CN109818997A - A kind of load-balancing method, system and storage medium - Google Patents
A kind of load-balancing method, system and storage medium Download PDFInfo
- Publication number
- CN109818997A CN109818997A CN201711165122.6A CN201711165122A CN109818997A CN 109818997 A CN109818997 A CN 109818997A CN 201711165122 A CN201711165122 A CN 201711165122A CN 109818997 A CN109818997 A CN 109818997A
- Authority
- CN
- China
- Prior art keywords
- server
- mentioned
- packet
- state
- load
- 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.)
- Pending
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Computer And Data Communications (AREA)
Abstract
The embodiment of the invention discloses a kind of load-balancing method, system and storage medium, above-mentioned load-balancing method includes: the network protocol IP packet for receiving client and sending;Obtain the corresponding target port of IP packet and message characteristic;If target port is identical with default load equalization port, according to message characteristic and predetermined server parameter, first object server is determined from server cluster;Wherein, first object server is any one server in server cluster;When first object server is service state, IP packet is sent to first object server.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of load-balancing methods, system and storage medium.
Background technique
Common SiteServer LBS is usually made of a set of load balancer and multiple real server, wherein load
Balanced device is by counting the load condition of each real server, according to scheduled load-balancing algorithm by distribution of services to multiple
Real server is handled.During carrying out distribution of services, load balancer needs to record between real server
Session, and fast-forwarding is realized by session.Due to load balancer according to historical session record carry out IP packet forwarding,
Therefore, it for the same session, needs to distribute IP packet to the same load balancer and handles.
Existing load-balancing technique, load balancer needs to store each session, therefore can largely occupy
The storage resource of load balancer;Simultaneously as the corresponding IP packet of same session can only be distributed to the same load balancer
It is handled, it is therefore desirable to which upper layer network equipment distributes flow according to the acceptable mode of load balancer, or needs
The scheduling that flow is carried out between load-balancing device, to reduce the flexibility of SiteServer LBS.
Summary of the invention
The embodiment of the present invention provides a kind of load-balancing method, system and storage medium, can greatly reduce load balancing
The waste of device storage resource, meanwhile, the flexibility of SiteServer LBS can be improved.
In order to achieve the above objectives, the technical solution of the embodiment of the present invention is achieved in that
The embodiment of the invention provides a kind of load-balancing methods, comprising:
Receive the network protocol IP packet that client is sent;
Obtain the corresponding target port of the IP packet and message characteristic;
If the target port is identical with default load equalization port, joined according to the message characteristic and predetermined server
Number determines first object server from server cluster;Wherein, the first object server is in the server cluster
Any one server;
When the first object server is service state, the IP packet is sent to the first object service
Device.
In the above scheme, before the network protocol IP packet for receiving client transmission, the method also includes:
Obtain the number of servers of the server cluster;
Processing is numbered to the server cluster, obtains the server no of the server cluster;Wherein, described
The corresponding server no of a server in server cluster;
By the number of servers and the server no, it is set as the predetermined server parameter.
In the above scheme, described according to the message characteristic and predetermined server parameter, it is determined from server cluster
First object server, comprising:
Digitized processing is carried out to the message characteristic, obtains the corresponding characteristic parameter of the message characteristic;
According to the characteristic parameter and the predetermined server parameter, the first object server is determined.
In the above scheme, described when the first object server is service state, the IP packet is sent to
Before the first object server, the method also includes:
When, there are when the first object server, determining the first object server in the pre-stored service device list
For the service state;
When the first object server is not present in the pre-stored service device list, the first object service is determined
Device is non-serving state.
In the above scheme, described when the first object server is not present in the pre-stored service device list, sentence
After the fixed first object server is non-serving state, the method also includes:
When the first object server is the non-serving state, second is determined from the pre-stored service device list
Destination server;Wherein, second destination server is any one server in the pre-stored service device list;
The IP packet is sent to second destination server.
In the above scheme, described when the first object server is the non-serving state, clothes are prestored from described
It is engaged in determining the second destination server in device list, comprising:
Determine the corresponding session of the IP packet and load balancing mark;
It obtains corresponding prestore of load balancing mark and forwards record;
It prestores in forwarding record when described there are when the session, second mesh is determined according to the forwarding record that prestores
Mark server;
When prestoring in forwarding record there is no the session, according to the IP packet and the pre-stored service device list,
Determine second destination server.
In the above scheme, it is described the IP packet is sent to second destination server after, the method is also
Include:
According to the corresponding session of the IP packet and second destination server, forwarding record is prestored described in foundation.
In the above scheme, described when the first object server is service state, the IP packet is sent to
Before the first object server, the method also includes:
State-detection is carried out to the server cluster, obtains the corresponding state-detection result of the server cluster;Its
In, the corresponding state-detection result of a server in the server cluster;
According to the state-detection as a result, establishing the pre-stored service device list.
The embodiment of the invention provides a kind of SiteServer LBS, the SiteServer LBS includes processor, is stored with
The memory of the processor-executable instruction, communication interface, and for connecting the processor, the memory and described
The bus of communication interface, when executed, the processor execute above-mentioned load-balancing method.
The embodiment of the invention provides a kind of computer readable storage mediums, are applied in SiteServer LBS, feature
It is, above-mentioned load-balancing method is realized when described program is executed by processor.
It can be seen that receiving client the embodiment of the invention provides a kind of load-balancing method, system and storage medium
The network protocol IP packet of transmission;Obtain the corresponding target port of IP packet and message characteristic;If target port and default load
Equalization port is identical, then according to message characteristic and predetermined server parameter, first object server is determined from server cluster;
Wherein, first object server is any one server in server cluster;When first object server is service state
When, IP packet is sent to first object server.That is, a kind of load-balancing method of proposition of the embodiment of the present invention,
System and storage medium can determine first object server according to message characteristic and predetermined server parameter, and in the first mesh
When mark server is service state, IP packet is directly forwarded to first object server, without the session according to storage
Record carries out the forwarding of IP packet, so as to greatly reduce the waste of load balancer storage resource, meanwhile, it can be improved negative
Carry the flexibility of equal balance system.
Detailed description of the invention
Fig. 1 is a kind of schematic diagram for SiteServer LBS that the embodiment of the present invention proposes;
Fig. 2 is a kind of implementation process schematic diagram one for load-balancing method that the embodiment of the present invention proposes;
Fig. 3 is a kind of implementation process schematic diagram two for load-balancing method that the embodiment of the present invention proposes;
Fig. 4 is a kind of implementation process schematic diagram three for load-balancing method that the embodiment of the present invention proposes;
Fig. 5 is a kind of implementation process schematic diagram four for load-balancing method that the embodiment of the present invention proposes;
Fig. 6 is a kind of implementation process schematic diagram five for load-balancing method that the embodiment of the present invention proposes;
Fig. 7 is a kind of implementation process schematic diagram six for load-balancing method that the embodiment of the present invention proposes;
Fig. 8 is a kind of implementation process schematic diagram seven for load-balancing method that the embodiment of the present invention proposes;
Fig. 9 is a kind of implementation process schematic diagram eight for load-balancing method that the embodiment of the present invention proposes;
Figure 10 is a kind of implementation process schematic diagram nine for load-balancing method that the embodiment of the present invention proposes;
Figure 11 is a kind of implementation process schematic diagram ten for load-balancing method that the embodiment of the present invention proposes;
Figure 12 is the composed structure schematic diagram one for the SiteServer LBS that the embodiment of the present invention proposes;
Figure 13 is the composed structure schematic diagram two for the SiteServer LBS that the embodiment of the present invention proposes;
Figure 14 is the composed structure schematic diagram three for the SiteServer LBS that the embodiment of the present invention proposes.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description.
Embodiment one
Fig. 1 is a kind of schematic diagram for SiteServer LBS that the embodiment of the present invention proposes, as shown in Figure 1, of the invention
In embodiment, above-mentioned SiteServer LBS may include client 01, load balancing module 02, state detection module 03 and clothes
Device module 04 of being engaged in is constituted.
Further, in an embodiment of the present invention, the above-mentioned client 01 in above-mentioned SiteServer LBS can be use
Family terminal, specifically, in an embodiment of the present invention, above-mentioned client 01 can be for initiating to request to server module 04
User terminal.
Further, in an embodiment of the present invention, above-mentioned load balancing module 02 in above-mentioned SiteServer LBS
Main function can be distribution, the execution of load balancing etc. of responsible flow.
Further, in an embodiment of the present invention, the above-mentioned state detection module 03 in above-mentioned SiteServer LBS can
To work for the health examination of charge server module 04.
Fig. 2 is a kind of implementation process schematic diagram one for load-balancing method that the embodiment of the present invention proposes, as shown in Fig. 2,
In an embodiment of the present invention, the method that SiteServer LBS carries out load balancing may comprise steps of:
Step 101 receives the network protocol IP packet that client is sent.
In an embodiment of the present invention, above-mentioned SiteServer LBS can first receive the IP packet sent by client.Its
In, above-mentioned IP packet is that above-mentioned SiteServer LBS is obtained by network equipment distribution.
Further, in an embodiment of the present invention, the load balancing module in above-mentioned SiteServer LBS is not necessarily in net
In network interface configure virtual ip address (address Virtual IP Address, VIP), VIP address configuration in business procedure,
The address VIP is invisible to external network.VIP+Port is configured in business module in every load balancing module, represents load
Balance module externally provides the service of VIP+Port, and all load balancing modules configure identical VIP+Port, and can match
Set multiple, expression can externally provide multiple services.
Step 102 obtains the corresponding target port of IP packet and message characteristic.
In an embodiment of the present invention, above-mentioned SiteServer LBS, can after receiving the IP packet sent by client
To obtain the corresponding target port of above-mentioned IP packet and message characteristic.
It should be noted that in an embodiment of the present invention, above-mentioned terminal can first obtain above-mentioned target port, that is, obtain
Then Target IP+the Port of above-mentioned IP packet can compare the target port of above-mentioned IP packet and pre-set port
It is right, to judge whether to carry out load balance process to above-mentioned IP packet.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS is by the target port of above-mentioned IP packet
It is compared with pre-set port, i.e., the VIP+ that will be configured in above-mentioned Target IP+Port and pre-set business procedure
After Port is compared, if above-mentioned IP+Port is consistent with above-mentioned VIP+Port, above-mentioned SiteServer LBS can
Subsequent load balance process is carried out to above-mentioned IP packet;Correspondingly, if above-mentioned IP+Port and above-mentioned VIP+Port are different
It causes, then above-mentioned SiteServer LBS can directly abandon above-mentioned IP packet.
It should be noted that in an embodiment of the present invention, by by the target port of above-mentioned IP packet and presetting
The method that is compared of port, above-mentioned SiteServer LBS can be normal in the case where not issuing the identical address VIP externally
Offer VIP service, while not will lead to the conflict of the address VIP.
Further, in an embodiment of the present invention, the above-mentioned message characteristic of above-mentioned IP packet may include source IP, source
The ginseng such as mouth, differentiated services code points (Differentiated Services Code Point, DSCP), proof of identification, agreement
Number.
If step 103, target port are identical with default load equalization port, joined according to message characteristic and predetermined server
Number determines first object server from server cluster;Wherein, first object server is any one in server cluster
A server.
In an embodiment of the present invention, above-mentioned SiteServer LBS is obtaining the corresponding above-mentioned target port of above-mentioned IP packet
After above-mentioned message characteristic, if above-mentioned target port is identical with above-mentioned default load equalization port, above-mentioned load is equal
Balance system can according to above-mentioned message characteristic and predetermined server parameter, determined from server cluster to above-mentioned IP packet into
The server of row processing, i.e., above-mentioned first object server.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS is by the target port of above-mentioned IP packet
After being compared with pre-set port, if above-mentioned target port is identical with above-mentioned default load equalization port,
It is considered that load balance process can be carried out to above-mentioned IP packet.
It should be noted that in an embodiment of the present invention, when above-mentioned SiteServer LBS determine to above-mentioned IP packet into
After row load balance process, can above-mentioned message characteristic according to acquisition and above-mentioned predetermined server parameter, calculate and obtain one
A server address obtains the address of above-mentioned first object server.
It should be noted that in an embodiment of the present invention, above-mentioned first object server is real server, above-mentioned the
One destination server can be any one server in above-mentioned server cluster.
Step 104, when first object server be service state when, IP packet is sent to first object server.
In an embodiment of the present invention, if above-mentioned target port is identical with above-mentioned default load equalization port, on
SiteServer LBS is stated according to above-mentioned message characteristic and predetermined server parameter, above-mentioned first is determined from server cluster
After destination server, if above-mentioned first object server is service state, above-mentioned SiteServer LBS can will be upper
It states IP packet and is sent to above-mentioned first object server.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS is determining above-mentioned first object server
Later, it is thus necessary to determine that whether above-mentioned first object server can be used, to judge whether for above-mentioned IP packet to be forwarded to above-mentioned
It is handled in one destination server.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS is according to above-mentioned first object server
With pre-stored server list, judge whether above-mentioned first object server is in after service state, if above-mentioned
One destination server is not service state, then above-mentioned IP packet is not then sent to above-mentioned first mesh by above-mentioned SiteServer LBS
Server is marked, but determines that the second destination server carries out the processing of above-mentioned IP packet in above-mentioned pre-stored service device list.
Fig. 3 is a kind of implementation process schematic diagram two for load-balancing method that the embodiment of the present invention proposes, as shown in figure 3,
In an embodiment of the present invention, before above-mentioned SiteServer LBS receives the network protocol IP packet that client is sent, i.e. step
Before 101, above-mentioned SiteServer LBS carry out load balancing method can with the following steps are included:
Step 105, the number of servers for obtaining server cluster.
In an embodiment of the present invention, above-mentioned SiteServer LBS receive that above-mentioned client sends be IP packet it
Before, it can first obtain the number of servers of above-mentioned server cluster.
It needs to be explanation, in an embodiment of the present invention, above-mentioned SiteServer LBS is carried out to above-mentioned IP packet
Before load balance process, first whole real server in system can be counted, obtain above-mentioned server cluster pair
The number of servers answered.
Processing is numbered to server cluster in step 106, obtains the server no of server cluster;Wherein, it services
The corresponding server no of a server in device cluster.
In an embodiment of the present invention, above-mentioned SiteServer LBS the number of servers for obtaining above-mentioned server cluster it
Afterwards, processing can be numbered to above-mentioned server cluster, to obtain the corresponding server no of above-mentioned server cluster.
It should be noted that in an embodiment of the present invention, above-mentioned SiteServer LBS is carried out in above-mentioned server cluster
After in numbering, each server has number corresponding thereto.For example, above-mentioned SiteServer LBS statistics obtains
The number of servers of server cluster is 8, then above-mentioned SiteServer LBS can compile above-mentioned server cluster
Number processing, obtain server cluster number be 0-7.
Step 107, by number of servers and server no, be set as predetermined server parameter.
In an embodiment of the present invention, processing is being numbered to above-mentioned server cluster in above-mentioned SiteServer LBS, obtains
After the corresponding server no of above-mentioned server cluster, can be by the corresponding number of servers of above-mentioned server cluster and upper
Server no is stated, above-mentioned predetermined server parameter is set as.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS after start-up, and carries out IP packet
Before load balancing, first it can be numbered according to the real server being managed for the needs being pre-configured and obtain true clothes
The number of servers of business device, so that above-mentioned predetermined server parameter further be arranged.
The embodiment of the invention provides a kind of load-balancing methods, receive the network protocol IP packet that client is sent;It obtains
Take the corresponding target port of IP packet and message characteristic;If target port is identical with default load equalization port, according to message
Feature and predetermined server parameter determine first object server from server cluster;Wherein, first object server is clothes
Any one server being engaged in device cluster;When first object server is service state, IP packet is sent to the first mesh
Mark server.That is, a kind of load-balancing method that the embodiment of the present invention proposes, it can be according to message characteristic and default clothes
Business device parameter determines first object server, and when first object server is service state, is directly forwarded to IP packet
First object server, the forwarding without carrying out IP packet according to the conversation recording of storage are negative so as to greatly reduce
The waste of balanced device storage resource is carried, meanwhile, the flexibility of SiteServer LBS can be improved;Also, implement simple side
Just, convenient for universal, the scope of application is wider.
Embodiment two
Fig. 4 is a kind of implementation process schematic diagram three for load-balancing method that the embodiment of the present invention proposes, as shown in figure 4,
Based on embodiment one, in an embodiment of the present invention, further, above-mentioned SiteServer LBS is according to message characteristic and default clothes
Business device parameter determines that the method for first object server may comprise steps of from server cluster:
Step 201 carries out digitized processing to message characteristic, obtains the corresponding characteristic parameter of message characteristic.
In an embodiment of the present invention, above-mentioned SiteServer LBS is obtaining the corresponding above-mentioned message characteristic of above-mentioned IP packet
Later, digitized processing can be carried out to above-mentioned message characteristic, it is hereby achieved that the characteristic parameter of above-mentioned message characteristic.
It should be noted that in an embodiment of the present invention, above-mentioned SiteServer LBS is receiving network equipment forwarding
Above-mentioned IP packet after, digitized processing can be carried out to the above-mentioned message characteristic that gets, to above-mentioned message characteristic into
Digitized processing after, above-mentioned SiteServer LBS can obtain a shaping number corresponding with above-mentioned message characteristic, i.e., on
State characteristic parameter.
Specifically, in an embodiment of the present invention, above-mentioned SiteServer LBS can be by above-mentioned message characteristic, such as source
The parameters such as IP, source port, DSCP, proof of identification, agreement are input in default computation model, and are calculated output and obtained above-mentioned spy
Levy parameter.
Specifically, in an embodiment of the present invention, above-mentioned SiteServer LBS is after receiving above-mentioned IP packet, can be with
The corresponding source address of above-mentioned message is subjected to binary system to metric conversion, thus obtain message source address it is low 16 ten into
Form processed.
Step 202, according to characteristic parameter and predetermined server parameter, determine first object server.
In an embodiment of the present invention, above-mentioned SiteServer LBS is carrying out digitized processing to above-mentioned message characteristic, obtains
After the characteristic parameter of above-mentioned message characteristic, can determine above-mentioned the according to features described above parameter and above-mentioned server parameter
One destination server.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS, can after obtaining features described above parameter
As the Hash factor, to carry out Hash calculation, can obtain to upper features described above parameter and above-mentioned predetermined server parameter
State the address for the above-mentioned first object server that IP packet is handled.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS can be first to the real server of registration
Processing is numbered and obtains above-mentioned predetermined server parameter, and after obtaining features described above parameter, according to features described above parameter
With above-mentioned predetermined server parameter, above-mentioned first object server is determined.Specifically, in an embodiment of the present invention, above-mentioned negative
Modulus value can be determined as above-mentioned predetermined server parameter by carrying equal balance system, carry out modulus processing to features described above parameter, thus
Identification number corresponding to above-mentioned first object server can be obtained, that is, determines above-mentioned first object server.
It should be noted that in an embodiment of the present invention, above-mentioned SiteServer LBS is to connect according to above-mentioned hash algorithm
It receives above-mentioned IP packet and selects received above-mentioned first object server, so that above-mentioned IP packet can be forwarded to above-mentioned the
One destination server.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS do not need to record above-mentioned IP packet with it is upper
State the corresponding relationship of first object server, the IP packet of subsequent same characteristic features parameter using strategy same as mentioned above into
Row distribution.Specifically, in an embodiment of the present invention, plan is distributed using identical load balancing due to above-mentioned SiteServer LBS
Slightly the IP packet received is forwarded, therefore the IP packet of same characteristic features parameter can be distributed to the same real service
Device, that is to say, that above-mentioned SiteServer LBS may insure that same characteristic parameter IP packet is distributed to same real server
It is handled.
It should be noted that in an embodiment of the present invention, no matter which load is IP packet be distributed to by the network equipment
Weighing apparatus is handled, above-mentioned SiteServer LBS can according to above-mentioned algorithm to forwarding IP packet real server address into
Row calculates, and may finally ensure that the IP packet of same characteristic features parameter can be assigned to same real server and be handled, from
And it may insure the correctness of business processing.It can be seen that the collection of load balancing module may be implemented in above-mentioned SiteServer LBS
The function of sessionless distribution also may be implemented in group's net.
The embodiment of the invention provides a kind of load-balancing methods, receive the network protocol IP packet that client is sent;It obtains
Take the corresponding target port of IP packet and message characteristic;If target port is identical with default load equalization port, according to message
Feature and predetermined server parameter determine first object server from server cluster;Wherein, first object server is clothes
Any one server being engaged in device cluster;When first object server is service state, IP packet is sent to the first mesh
Mark server.That is, a kind of load-balancing method that the embodiment of the present invention proposes, it can be according to message characteristic and default clothes
Business device parameter determines first object server, and when first object server is service state, is directly forwarded to IP packet
First object server, the forwarding without carrying out IP packet according to the conversation recording of storage are negative so as to greatly reduce
The waste of balanced device storage resource is carried, meanwhile, the flexibility of SiteServer LBS can be improved;Also, implement simple side
Just, convenient for universal, the scope of application is wider.
Embodiment three
Fig. 5 is a kind of implementation process schematic diagram four for load-balancing method that the embodiment of the present invention proposes, as shown in figure 5,
Based on embodiment one, in an embodiment of the present invention, further, when first object server is service state, IP is reported
Text is sent to before first object server, i.e., before step 104, above-mentioned SiteServer LBS carries out the method for load balancing also
It may comprise steps of:
Step 108, when there are when first object server, determining that first object server is clothes in pre-stored service device list
Business state.
In an embodiment of the present invention, if above-mentioned target port is identical with above-mentioned default load equalization port, on
SiteServer LBS is stated according to above-mentioned message characteristic and predetermined server parameter, above-mentioned first is determined from server cluster
After destination server, above-mentioned SiteServer LBS can be arranged according to above-mentioned first object server and pre-stored server
Table, judges whether above-mentioned first object server is in service state, specifically, in an embodiment of the present invention, if above-mentioned
There are above-mentioned first object servers in pre-stored service device list, then above-mentioned SiteServer LBS can be determined that above-mentioned first mesh
Marking server is available real server, i.e., above-mentioned first object server is service state.
Step 109, when in pre-stored service device list be not present first object server when, determine first object server be
Non-serving state.
In an embodiment of the present invention, if above-mentioned target port is identical with above-mentioned default load equalization port, on
SiteServer LBS is stated according to above-mentioned message characteristic and predetermined server parameter, above-mentioned first is determined from server cluster
After destination server, above-mentioned SiteServer LBS can be arranged according to above-mentioned first object server and pre-stored server
Table, judges whether above-mentioned first object server is in service state, specifically, in an embodiment of the present invention, if above-mentioned
Above-mentioned first object server is not present in pre-stored service device list, then above-mentioned SiteServer LBS can be determined that above-mentioned first
Destination server is unavailable real server, i.e., above-mentioned first object server is non-serving state.
The embodiment of the invention provides a kind of load-balancing methods, receive the network protocol IP packet that client is sent;It obtains
Take the corresponding target port of IP packet and message characteristic;If target port is identical with default load equalization port, according to message
Feature and predetermined server parameter determine first object server from server cluster;Wherein, first object server is clothes
Any one server being engaged in device cluster;When first object server is service state, IP packet is sent to the first mesh
Mark server.That is, a kind of load-balancing method that the embodiment of the present invention proposes, it can be according to message characteristic and default clothes
Business device parameter determines first object server, and when first object server is service state, is directly forwarded to IP packet
First object server, the forwarding without carrying out IP packet according to the conversation recording of storage are negative so as to greatly reduce
The waste of balanced device storage resource is carried, meanwhile, the flexibility of SiteServer LBS can be improved;Also, implement simple side
Just, convenient for universal, the scope of application is wider.
Example IV
Fig. 6 is a kind of implementation process schematic diagram five for load-balancing method that the embodiment of the present invention proposes, as shown in fig. 6,
Based on embodiment three, in an embodiment of the present invention, further, when there is no first object services in pre-stored service device list
When device, after determining first object server for non-serving state, i.e., after step 109, SiteServer LBS load
The method of weighing apparatus can with the following steps are included:
Step 1010, when first object server be non-serving state when, from pre-stored service device list determine the second mesh
Mark server;Wherein, the second destination server is any one server in the list of pre-stored service device.
In an embodiment of the present invention, above-mentioned SiteServer LBS is according to above-mentioned first object server and being stored in advance
Server list, judge whether above-mentioned first object server is in after service state, if above-mentioned first object service
Device is non-serving state, then above-mentioned SiteServer LBS can determine the second destination service from above-mentioned pre-stored service device list
Device.
It should be noted that in an embodiment of the present invention, above-mentioned second destination server can be above-mentioned pre-stored service
Any one server in device list.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS is determining above-mentioned first object server
After unavailable, need that above-mentioned second destination server is selected to carry out turning for above-mentioned IP packet in available real server
Hair.
IP packet is sent to the second destination server by step 1011.
In an embodiment of the present invention, if above-mentioned first object server is non-serving state, above-mentioned load is equal
For balance system after determining the second destination server in above-mentioned pre-stored service device list, above-mentioned SiteServer LBS can will be above-mentioned
IP packet is sent to above-mentioned second destination server.
It should be noted that in an embodiment of the present invention, above-mentioned SiteServer LBS is determining above-mentioned first object clothes
Be engaged in device be non-serving state after, that is, determine above-mentioned first object server can not carry out IP packet reception and processing business it
Afterwards, above-mentioned IP packet can be sent to the second destination server determined from above-mentioned pre-stored service device list, on carrying out
State the subsequent processing of IP packet.
The embodiment of the invention provides a kind of load-balancing methods, receive the network protocol IP packet that client is sent;It obtains
Take the corresponding target port of IP packet and message characteristic;If target port is identical with default load equalization port, according to message
Feature and predetermined server parameter determine first object server from server cluster;Wherein, first object server is clothes
Any one server being engaged in device cluster;When first object server is service state, IP packet is sent to the first mesh
Mark server.That is, a kind of load-balancing method that the embodiment of the present invention proposes, it can be according to message characteristic and default clothes
Business device parameter determines first object server, and when first object server is service state, is directly forwarded to IP packet
First object server, the forwarding without carrying out IP packet according to the conversation recording of storage are negative so as to greatly reduce
The waste of balanced device storage resource is carried, meanwhile, the flexibility of SiteServer LBS can be improved;Also, implement simple side
Just, convenient for universal, the scope of application is wider.
Embodiment five
Fig. 7 is a kind of implementation process schematic diagram six for load-balancing method that the embodiment of the present invention proposes, as shown in fig. 7,
It is in an embodiment of the present invention, further, above-mentioned when first object server is non-serving state based on example IV
SiteServer LBS from pre-stored service device list determine the second destination server method can with the following steps are included:
Step 301 determines the corresponding session of IP packet and load balancing mark.
In an embodiment of the present invention, above-mentioned SiteServer LBS can be equal to the corresponding session of above-mentioned IP packet and load
Weighing apparatus mark is determined, further to judge whether load balancer corresponding with above-mentioned load balancing mark is to obtain for the first time
State the corresponding session of IP packet.
It, can be with when above-mentioned SiteServer LBS forwards a session it should be noted that in an embodiment of the present invention
Transmission forwarding is carried out to above-mentioned session according to IP packet.
Further, in an embodiment of the present invention, the load balancing module in above-mentioned SiteServer LBS can be by extremely
A few load balancer is constituted, and specifically, at least one above-mentioned load balancer can at least one be negative configured with corresponding
Carry balanced mark.Wherein, a load balancer has a load balancing mark.
Further, in an embodiment of the present invention, on a load balancer in above-mentioned SiteServer LBS receives
IP packet is stated, therefore, above-mentioned SiteServer LBS can be identified by the corresponding load balancing of above-mentioned IP packet, from least one
A load balancer for receiving above-mentioned IP packet is determined in load balancer.
Step 302, acquisition load balancing mark are corresponding to prestore forwarding record.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS is to the corresponding session of above-mentioned IP packet
After being determined with load balancing mark, available above-mentioned load balancing mark is corresponding to prestore forwarding record.
It should be noted that in an embodiment of the present invention, above-mentioned prestore in forwarding record is stored with above-mentioned load
Equilibrium identifies the record of corresponding load balancer processing session, and specifically, above-mentioned load balancing mark is corresponding above-mentioned to be prestored
The corresponding relationship of session and real server is stored in forwarding record.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS can be identified according to above-mentioned load balancing
Corresponding above-mentioned prestore forwards record, determines that above-mentioned load balancing identifies whether corresponding load balancer is for the first time to above-mentioned IP
The corresponding session of message is forwarded processing.
Step 303, when prestoring in forwarding record there are when session, determine the second destination service according to prestoring forwarding and recording
Device.
In an embodiment of the present invention, above-mentioned SiteServer LBS turns in above-mentioned corresponding prestore of load balancing mark of acquisition
After hair record, if prestored in forwarding record there are above-mentioned session, above-mentioned SiteServer LBS can be according to above-mentioned pre-
It deposits forwarding record and determines above-mentioned second destination server.
It further, in an embodiment of the present invention, can if above-mentioned prestore in forwarding record there are above-mentioned session
When thinking above-mentioned first object server corresponding with above-mentioned session as non-serving state, the IP packet of above-mentioned session by
Load balancer corresponding with above-mentioned load balancing mark is processed, then above-mentioned SiteServer LBS can be directly according to upper
It states and prestores forwarding record, directly determine out above-mentioned second destination server, from above-mentioned pre-stored service device list to continue to upper
The above-mentioned IP packet for stating session is handled.
Specifically, in an embodiment of the present invention, above-mentioned if above-mentioned prestore in forwarding record there are above-mentioned session
SiteServer LBS can determine that above-mentioned load balancer forwards the record of above-mentioned session from above-mentioned prestore in forwarding record,
The real server for receiving above-mentioned session can be obtained.
Step 304, when prestoring in forwarding record there is no session, according to IP packet and pre-stored service device list, determine
Second destination server.
In an embodiment of the present invention, above-mentioned SiteServer LBS turns in above-mentioned corresponding prestore of load balancing mark of acquisition
After hair record, if prestored in forwarding record, there is no above-mentioned sessions, and above-mentioned SiteServer LBS can be according to above-mentioned
IP packet and above-mentioned pre-stored service device list, determine above-mentioned second destination server.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS can determine above-mentioned pre-stored service device column
The characteristic parameter of table, i.e., number of servers and server no in above-mentioned pre-stored service device list, then above-mentioned load balancing
System can carry out Hash meter using features described above parameter and the characteristic parameter of above-mentioned pre-stored service device list as the Hash factor
It calculates, the address of above-mentioned second destination server handled above-mentioned IP packet can be obtained.
The embodiment of the invention provides a kind of load-balancing methods, receive the network protocol IP packet that client is sent;It obtains
Take the corresponding target port of IP packet and message characteristic;If target port is identical with default load equalization port, according to message
Feature and predetermined server parameter determine first object server from server cluster;Wherein, first object server is clothes
Any one server being engaged in device cluster;When first object server is service state, IP packet is sent to the first mesh
Mark server.That is, a kind of load-balancing method that the embodiment of the present invention proposes, it can be according to message characteristic and default clothes
Business device parameter determines first object server, and when first object server is service state, is directly forwarded to IP packet
First object server, the forwarding without carrying out IP packet according to the conversation recording of storage are negative so as to greatly reduce
The waste of balanced device storage resource is carried, meanwhile, the flexibility of SiteServer LBS can be improved;Also, implement simple side
Just, convenient for universal, the scope of application is wider.
Embodiment six
Fig. 8 is a kind of implementation process schematic diagram seven for load-balancing method that the embodiment of the present invention proposes, as shown in figure 8,
Based on embodiment five, in an embodiment of the present invention, further, IP packet is sent to the second mesh by above-mentioned SiteServer LBS
After marking server, i.e., after step 1011, the method that above-mentioned SiteServer LBS carries out load balancing can also include following
Step:
Step 1012, according to the corresponding session of IP packet and the second destination server, foundation prestores forwarding record.
In an embodiment of the present invention, above-mentioned IP packet is being sent to above-mentioned second target clothes by above-mentioned SiteServer LBS
It is engaged in after device, can establish above-mentioned prestore according to the corresponding session of above-mentioned IP packet and above-mentioned second destination server and forward note
Record.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS above-mentioned IP packet is sent to it is above-mentioned
After second destination server, the corresponding relationship between the corresponding session of above-mentioned IP packet and above-mentioned second server is remembered
Address book stored, establish it is above-mentioned prestore forwarding record, so as to when above-mentioned session next time corresponding to above-mentioned IP packet is forwarded,
It can forward record that the identical IP packet of features described above parameter is forwarded to the same real server according to above-mentioned prestore.
The embodiment of the invention provides a kind of load-balancing methods, receive the network protocol IP packet that client is sent;It obtains
Take the corresponding target port of IP packet and message characteristic;If target port is identical with default load equalization port, according to message
Feature and predetermined server parameter determine first object server from server cluster;Wherein, first object server is clothes
Any one server being engaged in device cluster;When first object server is service state, IP packet is sent to the first mesh
Mark server.That is, a kind of load-balancing method that the embodiment of the present invention proposes, it can be according to message characteristic and default clothes
Business device parameter determines first object server, and when first object server is service state, is directly forwarded to IP packet
First object server, the forwarding without carrying out IP packet according to the conversation recording of storage are negative so as to greatly reduce
The waste of balanced device storage resource is carried, meanwhile, the flexibility of SiteServer LBS can be improved;Also, implement simple side
Just, convenient for universal, the scope of application is wider.
Embodiment seven
Fig. 9 is a kind of implementation process schematic diagram eight for load-balancing method that the embodiment of the present invention proposes, as shown in figure 9,
Based on embodiment one, in an embodiment of the present invention, further, when first object server is service state, load is equal
Before IP packet is sent to first object server by balance system, i.e., before step 104, above-mentioned SiteServer LBS is loaded
Balanced method can with the following steps are included:
Step 1013 carries out state-detection to server cluster, obtains the corresponding state-detection result of server cluster;Its
In, the corresponding state-detection result of a server in server cluster.
In an embodiment of the present invention, above-mentioned SiteServer LBS can carry out state-detection to above-mentioned server cluster,
Obtain the corresponding whole state-detection results of above-mentioned server cluster.
It should be noted that in an embodiment of the present invention, a server in above-mentioned server cluster is one corresponding
State-detection result.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS is by carrying out above-mentioned server cluster
State-detection, obtains the service state of each server, that is, determines whether each server can be used, so that it is determined that above-mentioned server
With the presence or absence of the server that not can be carried out IP packet reception and processing in cluster.
Step 1014, according to state-detection as a result, establishing pre-stored service device list.
In an embodiment of the present invention, above-mentioned SiteServer LBS is carrying out state-detection to above-mentioned server cluster, obtains
It, can be according to above-mentioned state-detection as a result, establishing above-mentioned prestore after obtaining the corresponding state-detection result of above-mentioned server cluster
Server list.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS is carrying out shape to above-mentioned server cluster
State detects, can be according to above-mentioned each after the state-detection result for obtaining each of above-mentioned server cluster server
The state-detection result of a server establishes above-mentioned pre-stored service device list, so as to select from above-mentioned pre-stored service device list
Select available real server.
In an embodiment of the present invention, further, when there are the inspections of the state of at least one server in server cluster
When survey result is service state, pre-stored service device list is established according at least one server.
It should be noted that in an embodiment of the present invention, above-mentioned SiteServer LBS is obtaining above-mentioned server cluster
Each of after the state-detection result of server, can be established according to testing result for the server of service state above-mentioned
Pre-stored service device list, that is to say, that the server in above-mentioned pre-stored service device list is available in above-mentioned server cluster
Server.
The embodiment of the invention provides a kind of load-balancing methods, receive the network protocol IP packet that client is sent;It obtains
Take the corresponding target port of IP packet and message characteristic;If target port is identical with default load equalization port, according to message
Feature and predetermined server parameter determine first object server from server cluster;Wherein, first object server is clothes
Any one server being engaged in device cluster;When first object server is service state, IP packet is sent to the first mesh
Mark server.That is, a kind of load-balancing method that the embodiment of the present invention proposes, it can be according to message characteristic and default clothes
Business device parameter determines first object server, and when first object server is service state, is directly forwarded to IP packet
First object server, the forwarding without carrying out IP packet according to the conversation recording of storage are negative so as to greatly reduce
The waste of balanced device storage resource is carried, meanwhile, the flexibility of SiteServer LBS can be improved;Also, implement simple side
Just, convenient for universal, the scope of application is wider.
Embodiment eight
Figure 10 is a kind of implementation process schematic diagram nine for load-balancing method that the embodiment of the present invention proposes, such as Figure 10 institute
Show, be based on embodiment seven, in an embodiment of the present invention, further, above-mentioned SiteServer LBS carries out server cluster
State-detection, the method for obtaining the corresponding state-detection result of server cluster may comprise steps of:
Step 401 is detected to server set pocket transmission according to prefixed time interval and is requested.
In an embodiment of the present invention, above-mentioned SiteServer LBS can be according to pre-set time interval to above-mentioned clothes
The each server being engaged in device cluster sends detection request.
It should be noted that in an embodiment of the present invention, above-mentioned SiteServer LBS can be according to above-mentioned preset time
It is spaced the detection request that each server into above-mentioned server cluster initiates health examination, it is each in above-mentioned server cluster
A server can make corresponding response after receiving above-mentioned detection request.
Step 402, the detection response for receiving server set pocket transmission;Wherein, a server pair in server cluster
Answer a detection response.
In an embodiment of the present invention, above-mentioned SiteServer LBS according to pre-set time interval to above-mentioned service
After each server in device cluster sends detection request, it can receive above-mentioned all detections of above-mentioned server set pocket transmission
Response.
It should be noted that in an embodiment of the present invention, above-mentioned detection response is inspection of the real server to receiving
The response that request carries out is surveyed, specifically, the corresponding detection response of a server in above-mentioned server cluster.
Further, in an embodiment of the present invention, each server in above-mentioned server cluster can receive it is above-mentioned
After detection request, respond immediately, at this point, if presence server nodes break down exits clothes in above-mentioned server cluster
Business will be unable to respond above-mentioned detection request.
Step 403, record detection respond the corresponding response time;Wherein, a detection responds a corresponding response time.
In an embodiment of the present invention, above-mentioned SiteServer LBS is in the above-mentioned whole for receiving above-mentioned server set pocket transmission
After detection response, it can recorde above-mentioned all detections response corresponding whole response times.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS is in the inspection for receiving each server transmission
While surveying response, above-mentioned all detections response corresponding whole response times can also be recorded.
It should be noted that in an embodiment of the present invention, for a server, above-mentioned SiteServer LBS can be incited somebody to action
It issues above-mentioned detection request and is determined as the server corresponding response time with the time interval for receiving between above-mentioned detection response.
Specifically, an a server corresponding response time.
It should be noted that in an embodiment of the present invention, if there are a servers not to have in above-mentioned server cluster
Have send correspond to detection request detection response, i.e., above-mentioned SiteServer LBS do not receive the server transmission in response to
The detection response of detection request, then it is considered that the server corresponding response time is infinity.
Step 404, according to response time determine state-detection result.
In an embodiment of the present invention, above-mentioned SiteServer LBS record above-mentioned detection respond the corresponding response time it
Afterwards, above-mentioned state-detection result can be determined according to the above-mentioned response time.
Specifically, in an embodiment of the present invention, above-mentioned SiteServer LBS can preset a preset time threshold
Then above-mentioned whole response times are compared with above-mentioned preset time threshold, so that it is determined that above-mentioned server set by value respectively
The corresponding above-mentioned whole state-detection results of group.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS by above-mentioned whole response times respectively with
After above-mentioned preset time threshold is compared, if there are a server corresponding response times in above-mentioned server cluster
Greater than above-mentioned preset time threshold, then it is considered that the server requests without response above-mentioned detection, and then above-mentioned load is equal
Balance system can think that the server node is in and exit service state.
Specifically, in an embodiment of the present invention, determine presence server node be in exit service state, then on
It states the health examination module in SiteServer LBS and issues advertised information to all load balancing modules immediately, Xiang Suoyou's is negative
It carries balance module and declares that the server has logged out service.
Further, in an embodiment of the present invention, when have server from exit service state revert to can service state,
Health examination module will declare the server recovered service state to all load balancing modules.So as to solve to load
The inconsistent problem of health examination result between balance module, it is ensured that each load balancing module in above-mentioned SiteServer LBS
The consistency of the service state of server obtained.
The embodiment of the invention provides a kind of load-balancing methods, receive the network protocol IP packet that client is sent;It obtains
Take the corresponding target port of IP packet and message characteristic;If target port is identical with default load equalization port, according to message
Feature and predetermined server parameter determine first object server from server cluster;Wherein, first object server is clothes
Any one server being engaged in device cluster;When first object server is service state, IP packet is sent to the first mesh
Mark server.That is, a kind of load-balancing method that the embodiment of the present invention proposes, it can be according to message characteristic and default clothes
Business device parameter determines first object server, and when first object server is service state, is directly forwarded to IP packet
First object server, the forwarding without carrying out IP packet according to the conversation recording of storage are negative so as to greatly reduce
The waste of balanced device storage resource is carried, meanwhile, the flexibility of SiteServer LBS can be improved;Also, implement simple side
Just, convenient for universal, the scope of application is wider.
Embodiment nine
Figure 11 is a kind of implementation process schematic diagram ten for load-balancing method that the embodiment of the present invention proposes, such as Figure 11 institute
Show, be based on embodiment eight, in an embodiment of the present invention, further, above-mentioned SiteServer LBS time according to response determines
The method of state-detection result may comprise steps of:
Step 404a, it will be compared respectively with preset time threshold the response time.
In an embodiment of the present invention, above-mentioned SiteServer LBS record above-mentioned detection respond the corresponding response time it
Afterwards, the above-mentioned response time can be compared with above-mentioned preset time threshold respectively.
Specifically, in an embodiment of the present invention, above-mentioned SiteServer LBS can preset a preset time threshold
The above-mentioned response time, is then compared with above-mentioned preset time threshold, so that it is determined that above-mentioned server cluster pair by value respectively
The above-mentioned state-detection result answered.
If step 404b, there are at least one response times in response time to be less than preset time threshold, it is determined that at least
At least one corresponding server of one response time.
In an embodiment of the present invention, above-mentioned SiteServer LBS by the above-mentioned response time respectively with above-mentioned preset time
After threshold value is compared, if there are at least one response times in the above-mentioned response time to be less than above-mentioned preset time threshold,
Then determine at least one corresponding server of at least one above-mentioned response time.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS is by above-mentioned whole response times and upper
It states after prefixed time interval is compared, to be less than or equal to if there are a response times in the above-mentioned whole response time
Above-mentioned preset time threshold, then above-mentioned SiteServer LBS can determine the response time corresponding server.
Step 404c, at least one corresponding state-detection result of at least one server is determined as service state.
In an embodiment of the present invention, if there are at least one response times less than above-mentioned in the above-mentioned whole response time
Preset time threshold, then above-mentioned SiteServer LBS is determining at least one corresponding server of at least one above-mentioned response time
Later, at least one corresponding state-detection result of at least one above-mentioned server can be determined as service state.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS is by above-mentioned whole response times and upper
It states after prefixed time interval is compared, to be less than or equal to if there are a response times in the above-mentioned whole response time
Above-mentioned preset time threshold, then above-mentioned SiteServer LBS can think that the server is service state.
Further, in an embodiment of the present invention, above-mentioned SiteServer LBS by above-mentioned whole response times respectively with
After above-mentioned preset time threshold is compared, if there are a server corresponding response times in above-mentioned server cluster
Greater than above-mentioned preset time threshold, then it is considered that the server requests without response above-mentioned detection, and then above-mentioned load is equal
Balance system can think that the server node is in and exit service state, i.e., the server is non-serving state.
According to foregoing description it is found that 404a-404c, above-mentioned SiteServer LBS will be distinguished the response time through the above steps
It is compared with preset time threshold;If there are at least one response times in the response time to be less than preset time threshold, really
Fixed at least one corresponding server of at least one response time;By at least one corresponding state-detection of at least one server
As a result it is determined as service state.That is, a kind of load-balancing method that the embodiment of the present invention proposes, it can be according to message spy
Predetermined server of seeking peace parameter determines first object server, and when first object server is service state, directly by IP
Message is forwarded to first object server, the forwarding without carrying out IP packet according to the conversation recording of storage, so as to
Greatly reduce the waste of load balancer storage resource, meanwhile, the flexibility of SiteServer LBS can be improved;Also, it realizes
Get up simple and convenient, convenient for universal, the scope of application is wider.
Embodiment ten
Under same inventive concept based on embodiment one to embodiment nine, Figure 12 is that the load that the embodiment of the present invention proposes is equal
The composed structure schematic diagram one of balance system, as shown in figure 12, the SiteServer LBS 1 that the embodiment of the present invention proposes include: load
Balance module 11.
Load balancing module 11, for receiving the network protocol IP packet of client transmission;And it obtains IP packet and corresponds to
Target port and message characteristic;And if target port is identical with default load equalization port, according to message characteristic and pre-
If server parameter, first object server is determined from server cluster;Wherein, first object server is server cluster
In any one server;And when first object server is service state, IP packet is sent to first object clothes
Business device.
Further, in an embodiment of the present invention, above-mentioned load balancing module 11 is also used to receive client transmission
Before network protocol IP packet, the number of servers of server cluster is obtained;And processing is numbered to server cluster, it obtains
Obtain the server no of server cluster;Wherein, the corresponding server no of a server in server cluster;And
By number of servers and server no, it is set as predetermined server parameter.
Further, in an embodiment of the present invention, above-mentioned load balancing module 11 is specifically used for carrying out message characteristic
Digitized processing obtains the corresponding characteristic parameter of message characteristic;And according to characteristic parameter and predetermined server parameter, determine
One destination server.
Further, in an embodiment of the present invention, above-mentioned load balancing module 11 takes also particularly useful for when first object
When business device is service state, before IP packet is sent to first object server, when there are first in pre-stored service device list
When destination server, determine that first object server is service state;And when there is no the first mesh in the list of pre-stored service device
When marking server, determine that first object server is non-serving state.
Further, in an embodiment of the present invention, above-mentioned load balancing module 11 is also used to when the pre-stored service device
When the first object server being not present in list, after determining the first object server for non-serving state, when the
When one destination server is non-serving state, the second destination server is determined from pre-stored service device list;Wherein, the second target
Server is any one server in the list of pre-stored service device;And IP packet is sent to the second destination server.
Further, in an embodiment of the present invention, above-mentioned load balancing module 11, also particularly useful for determining IP packet pair
The session answered and load balancing mark;And it obtains corresponding prestore of load balancing mark and forwards record;And works as and prestore forwarding
There are when session in record, determining second destination server is recorded according to forwarding is prestored;And it is not deposited when prestoring in forwarding record
In session, according to IP packet and pre-stored service device list, the second destination server is determined.
Further, in an embodiment of the present invention, above-mentioned load balancing module 11 is also used to for IP packet being sent to
After two destination servers, according to the corresponding session of IP packet and the second destination server, foundation prestores forwarding record.
Figure 13 is the composed structure schematic diagram two for the SiteServer LBS that the embodiment of the present invention proposes, as shown in figure 13, this
The SiteServer LBS 1 that inventive embodiments propose includes: state detection module 12.
State detection module 12, for when first object server is service state, IP packet to be sent to the first mesh
Before marking server, state-detection is carried out to server cluster, obtains the corresponding state-detection result of server cluster;Wherein,
The corresponding state-detection result of a server in server cluster;And clothes are prestored as a result, establishing according to state-detection
Business device list.
Further, in an embodiment of the present invention, above-mentioned state detection module 12 is specifically used for when in server cluster
There are the state-detection result of at least one server be service state when, pre-stored service device is established according at least one server
List.
Figure 14 is the composed structure schematic diagram three for the SiteServer LBS that the embodiment of the present invention proposes, in practical applications,
Under same inventive concept based on embodiment one to embodiment nine, as shown in figure 14, SiteServer LBS 1 may include processor
13, it is stored with memory 14, the communication interface 15 of 13 executable instruction of processor, and for connecting processor 13, memory 14
And the bus 16 of communication interface 15.
In an embodiment of the present invention, load balancing module 11 and state detection module 12 can be by being located at load balancing system
Processor 13 on system 1 realizes that above-mentioned processor 13 can be application-specific IC (Application Specific
Integrated Circuit, ASIC), digital signal processor (Digital Signal Processor, DSP), number letter
Number processing unit (Digital Signal Processing Device, DSPD), programmable logic device (ProgRAMmable
Logic Device, PLD), field programmable gate array (Field ProgRAMmable Gate Array, FPGA), CPU, control
At least one of device processed, microcontroller, microprocessor.It is to be appreciated that for different equipment, for realizing above-mentioned processing
The electronic device of device function can also be to be other, and the embodiment of the present invention is not especially limited.The SiteServer LBS 1 can also wrap
Memory 14 being included, which can connect with processor 13, wherein memory 14 is used to store executable program code,
The program code includes computer operation instruction, and memory 14 may include high speed RAM memory, it is also possible to further include non-volatile
Property memory, for example, at least two magnetic disk storages.
In an embodiment of the present invention, bus 16 is used for connection communication interface 15, processor 13, receiver 14, transmitter
Being in communication with each other between 15 and memory 14 and these devices.
In an embodiment of the present invention, memory 14, for storing instruction and data.
Processor 13, for receiving the network protocol IP packet of client transmission;And obtain the corresponding target of IP packet
Port and message characteristic;And if target port is identical with default load equalization port, according to message characteristic and preset service
Device parameter determines first object server from server cluster;Wherein, first object server is appointing in server cluster
It anticipates a server;And when first object server is service state, IP packet is sent to first object server.
In practical applications, above-mentioned memory 14 can be volatibility first memory (volatile memory), such as
Arbitrary access first memory (Random-Access Memory, RAM);Or non-volatile first memories (non-
Volatile memory), for example, read-only first memory (Read-Only Memory, ROM), quick flashing first memory
(flash memory), hard disk (Hard Disk Drive, HDD) or solid state hard disk (Solid-State Drive, SSD);Or
The combination of the first memory of person's mentioned kind, and instruction and data is provided to processor 13.
The embodiment of the invention provides a kind of SiteServer LBSs, receive the network protocol IP packet that client is sent;It obtains
Take the corresponding target port of IP packet and message characteristic;If target port is identical with default load equalization port, according to message
Feature and predetermined server parameter determine first object server from server cluster;Wherein, first object server is clothes
Any one server being engaged in device cluster;When first object server is service state, IP packet is sent to the first mesh
Mark server.That is, a kind of SiteServer LBS that the embodiment of the present invention proposes, it can be according to message characteristic and default clothes
Business device parameter determines first object server, and when first object server is service state, is directly forwarded to IP packet
First object server, the forwarding without carrying out IP packet according to the conversation recording of storage are negative so as to greatly reduce
The waste of balanced device storage resource is carried, meanwhile, the flexibility of SiteServer LBS can be improved;Also, implement simple side
Just, convenient for universal, the scope of application is wider.
In addition, each functional module in the present embodiment can integrate in one processing unit, it is also possible to each list
Member physically exists alone, and can also be integrated in one unit with two or more units.Above-mentioned integrated unit both can be with
Using formal implementation of hardware, can also be realized in the form of software function module.
If integrated unit realizes that being not intended as independent product is sold or made in the form of software function module
Used time can store in a computer readable storage medium, based on this understanding, the technical solution sheet of the present embodiment
The all or part of the part that contributes to existing technology or the technical solution can be with software product in other words in matter
Form embodies, which is stored in a storage medium, including some instructions are used so that a meter
It calculates machine equipment (can be personal computer, server or the network equipment etc.) or processor (processor) executes this implementation
The all or part of the steps of example method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (Read Only
Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. is various to deposit
Store up the medium of program code.
The embodiment of the present invention provides a kind of computer readable storage medium, is stored thereon with program, is applied to load balancing
The method such as embodiment one to embodiment nine is realized in system, when which is executed by processor.
Specifically, the corresponding program instruction of one of the present embodiment load-balancing method can be stored in CD,
Hard disk, on the storage mediums such as USB flash disk, when the program instruction corresponding with a kind of load-balancing method in storage medium is set by an electronics
It is standby to read or be performed, include the following steps:
Receive the network protocol IP packet that client is sent;
Obtain the corresponding target port of IP packet and message characteristic;
If target port is identical with default load equalization port, according to message characteristic and predetermined server parameter, from clothes
It is engaged in determining first object server in device cluster;Wherein, first object server is any one service in server cluster
Device;
When first object server is service state, IP packet is sent to first object server.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program
Product.Therefore, the shape of hardware embodiment, software implementation or embodiment combining software and hardware aspects can be used in the present invention
Formula.Moreover, the present invention, which can be used, can use storage in the computer that one or more wherein includes computer usable program code
The form for the computer program product implemented on medium (including but not limited to magnetic disk storage and optical memory etc.).
The present invention be referring to according to the method for the embodiment of the present invention, the realization of equipment (system) and computer program product
Flow diagram and/or block diagram describe.It should be understood that flow diagram and/or box can be realized by computer program instructions
The combination of each flow and/or block in figure and the process in implementation process schematic diagram and/or block diagram and/or box.
These computer program instructions be can provide to general purpose computer, special purpose computer, Embedded Processor or other programmable datas
The processor of processing equipment is to generate a machine, so that passing through computer or the processor of other programmable data processing devices
The instruction of execution generate for realizing in one box of implementation process schematic diagram one process or multiple processes and/or block diagrams or
The device for the function of being specified in multiple boxes.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
The manufacture of device is enabled, which realizes in implementation process schematic diagram one process or multiple processes and/or block diagrams one
The function of being specified in a box or multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction that is executed on other programmable devices provide for realizing in one process of implementation process schematic diagram or multiple processes and/or
The step of function of being specified in one or more blocks of the block diagram.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the scope of the present invention.
Claims (10)
1. a kind of load-balancing method, which is characterized in that the described method includes:
Receive the network protocol IP packet that client is sent;
Obtain the corresponding target port of the IP packet and message characteristic;
If the target port is identical with default load equalization port, according to the message characteristic and predetermined server parameter,
First object server is determined from server cluster;Wherein, the first object server is in the server cluster
Any one server;
When the first object server is service state, the IP packet is sent to the first object server.
2. the method according to claim 1, wherein it is described receive client send network protocol IP packet it
Before, the method also includes:
Obtain the number of servers of the server cluster;
Processing is numbered to the server cluster, obtains the server no of the server cluster;Wherein, the service
The corresponding server no of a server in device cluster;
By the number of servers and the server no, it is set as the predetermined server parameter.
3. the method according to claim 1, wherein described join according to the message characteristic and predetermined server
Number determines first object server from server cluster, comprising:
Digitized processing is carried out to the message characteristic, obtains the corresponding characteristic parameter of the message characteristic;
According to the characteristic parameter and the predetermined server parameter, the first object server is determined.
4. the method according to claim 1, wherein described when the first object server is service state
When, before the IP packet is sent to the first object server, the method also includes:
When there are when the first object server, determine the first object server for institute in the pre-stored service device list
State service state;
When the first object server is not present in the pre-stored service device list, determine that the first object server is
Non-serving state.
5. according to the method described in claim 4, it is characterized in that, described when there is no described in the pre-stored service device list
When first object server, after determining the first object server for non-serving state, the method also includes:
When the first object server is the non-serving state, the second target is determined from the pre-stored service device list
Server;Wherein, second destination server is any one server in the pre-stored service device list;
The IP packet is sent to second destination server.
6. according to the method described in claim 5, it is characterized in that, described when the first object server is the non-serving
When state, the second destination server is determined from the pre-stored service device list, comprising:
Determine the corresponding session of the IP packet and load balancing mark;
It obtains corresponding prestore of load balancing mark and forwards record;
It prestores in forwarding record when described there are when the session, determines that second target takes according to the forwarding record that prestores
Business device;
When prestoring in forwarding record there is no when the session, according to the IP packet and the pre-stored service device list, determine
Second destination server.
7. according to the method described in claim 6, it is characterized in that, described be sent to the second target clothes for the IP packet
It is engaged in after device, the method also includes:
According to the corresponding session of the IP packet and second destination server, forwarding record is prestored described in foundation.
8. the method according to claim 1, wherein described when the first object server is service state
When, before the IP packet is sent to the first object server, the method also includes:
State-detection is carried out to the server cluster, obtains the corresponding state-detection result of the server cluster;Wherein, institute
State the corresponding state-detection result of a server in server cluster;
According to the state-detection as a result, establishing the pre-stored service device list.
9. a kind of SiteServer LBS, which is characterized in that the SiteServer LBS includes processor, is stored with the processor
The memory of executable instruction, communication interface, and for connecting the processor, the memory and the communication interface
Bus, when executed, the processor execute the method according to claim 1.
10. a kind of computer readable storage medium, is stored thereon with program, it is applied in SiteServer LBS, which is characterized in that
The method according to claim 1 is realized when described program is executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711165122.6A CN109818997A (en) | 2017-11-21 | 2017-11-21 | A kind of load-balancing method, system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711165122.6A CN109818997A (en) | 2017-11-21 | 2017-11-21 | A kind of load-balancing method, system and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109818997A true CN109818997A (en) | 2019-05-28 |
Family
ID=66599668
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711165122.6A Pending CN109818997A (en) | 2017-11-21 | 2017-11-21 | A kind of load-balancing method, system and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109818997A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110417902A (en) * | 2019-08-01 | 2019-11-05 | 安徽听见科技有限公司 | Streaming network service load method, relevant device and readable storage medium storing program for executing |
CN111010425A (en) * | 2019-11-22 | 2020-04-14 | 北京奇艺世纪科技有限公司 | Server connection method, load balancing equipment and electronic equipment |
CN111193813A (en) * | 2019-10-24 | 2020-05-22 | 腾讯科技(深圳)有限公司 | Test request processing method and device for determining NAT type and computer equipment |
CN112636950A (en) * | 2020-12-02 | 2021-04-09 | 广东中兴新支点技术有限公司 | Hot standby method, system, device and storage medium of aggregation server |
CN112653740A (en) * | 2020-12-11 | 2021-04-13 | 北京金山云网络技术有限公司 | Load balancing method and device supporting QUIC connection migration and computer product |
CN112866395A (en) * | 2020-11-18 | 2021-05-28 | 统信软件技术有限公司 | Service request processing system and method and computing device |
CN114024968A (en) * | 2021-08-20 | 2022-02-08 | 绿盟科技集团股份有限公司 | Message sending method and device based on intermediate equipment and electronic equipment |
CN115022333A (en) * | 2022-06-22 | 2022-09-06 | 杭州迪普科技股份有限公司 | Message forwarding method and device of load balancing equipment and electronic equipment |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101009662A (en) * | 2007-01-31 | 2007-08-01 | 杭州华为三康技术有限公司 | Message processing method, system and device based on the load balance technology |
CN101304436A (en) * | 2008-07-07 | 2008-11-12 | 杭州华三通信技术有限公司 | Load balancing method, system and equipment for implementing application layer conversation persistency |
CN101783771A (en) * | 2010-03-24 | 2010-07-21 | 杭州华三通信技术有限公司 | Method and equipment for realizing load balance continuity |
CN102932270A (en) * | 2012-11-27 | 2013-02-13 | 无锡城市云计算中心有限公司 | Load balancing method and device supporting network security service |
US8533808B2 (en) * | 2006-02-02 | 2013-09-10 | Check Point Software Technologies Ltd. | Network security smart load balancing using a multiple processor device |
CN104301287A (en) * | 2013-07-16 | 2015-01-21 | 中兴通讯股份有限公司 | Method, network node, server and system of implementing many-to-many session |
CN104363472A (en) * | 2014-10-20 | 2015-02-18 | 中兴通讯股份有限公司 | HLS-based (http live streaming based) capacity control method, HLS-based capacity control service system and SLB (server load balancing) server |
CN105657025A (en) * | 2016-01-26 | 2016-06-08 | 南京贝伦思网络科技股份有限公司 | Homologous homoclinic algorithm for realizing passing UDP message through load balancing device based on UDP characteristic keyword matching and structure thereof |
CN105915650A (en) * | 2016-06-21 | 2016-08-31 | 腾讯科技(深圳)有限公司 | Load balancing method and device |
CN106790675A (en) * | 2017-01-23 | 2017-05-31 | 天地融科技股份有限公司 | Load-balancing method, equipment and system in a kind of cluster |
CN107317887A (en) * | 2017-08-23 | 2017-11-03 | 北京知道创宇信息技术有限公司 | A kind of load-balancing method, device and system |
CN107360251A (en) * | 2017-08-16 | 2017-11-17 | 中国工商银行股份有限公司 | Method, system and the load balancing apparatus that session is kept |
-
2017
- 2017-11-21 CN CN201711165122.6A patent/CN109818997A/en active Pending
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8533808B2 (en) * | 2006-02-02 | 2013-09-10 | Check Point Software Technologies Ltd. | Network security smart load balancing using a multiple processor device |
CN101009662A (en) * | 2007-01-31 | 2007-08-01 | 杭州华为三康技术有限公司 | Message processing method, system and device based on the load balance technology |
CN101304436A (en) * | 2008-07-07 | 2008-11-12 | 杭州华三通信技术有限公司 | Load balancing method, system and equipment for implementing application layer conversation persistency |
CN101783771A (en) * | 2010-03-24 | 2010-07-21 | 杭州华三通信技术有限公司 | Method and equipment for realizing load balance continuity |
CN102932270A (en) * | 2012-11-27 | 2013-02-13 | 无锡城市云计算中心有限公司 | Load balancing method and device supporting network security service |
CN104301287A (en) * | 2013-07-16 | 2015-01-21 | 中兴通讯股份有限公司 | Method, network node, server and system of implementing many-to-many session |
CN104363472A (en) * | 2014-10-20 | 2015-02-18 | 中兴通讯股份有限公司 | HLS-based (http live streaming based) capacity control method, HLS-based capacity control service system and SLB (server load balancing) server |
CN105657025A (en) * | 2016-01-26 | 2016-06-08 | 南京贝伦思网络科技股份有限公司 | Homologous homoclinic algorithm for realizing passing UDP message through load balancing device based on UDP characteristic keyword matching and structure thereof |
CN105915650A (en) * | 2016-06-21 | 2016-08-31 | 腾讯科技(深圳)有限公司 | Load balancing method and device |
CN106790675A (en) * | 2017-01-23 | 2017-05-31 | 天地融科技股份有限公司 | Load-balancing method, equipment and system in a kind of cluster |
CN107360251A (en) * | 2017-08-16 | 2017-11-17 | 中国工商银行股份有限公司 | Method, system and the load balancing apparatus that session is kept |
CN107317887A (en) * | 2017-08-23 | 2017-11-03 | 北京知道创宇信息技术有限公司 | A kind of load-balancing method, device and system |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110417902A (en) * | 2019-08-01 | 2019-11-05 | 安徽听见科技有限公司 | Streaming network service load method, relevant device and readable storage medium storing program for executing |
CN110417902B (en) * | 2019-08-01 | 2022-07-15 | 安徽听见科技有限公司 | Streaming network service load method, related device and readable storage medium |
CN111193813A (en) * | 2019-10-24 | 2020-05-22 | 腾讯科技(深圳)有限公司 | Test request processing method and device for determining NAT type and computer equipment |
CN111010425A (en) * | 2019-11-22 | 2020-04-14 | 北京奇艺世纪科技有限公司 | Server connection method, load balancing equipment and electronic equipment |
CN112866395A (en) * | 2020-11-18 | 2021-05-28 | 统信软件技术有限公司 | Service request processing system and method and computing device |
CN112866395B (en) * | 2020-11-18 | 2023-04-07 | 统信软件技术有限公司 | Service request processing system and method and computing device |
CN112636950A (en) * | 2020-12-02 | 2021-04-09 | 广东中兴新支点技术有限公司 | Hot standby method, system, device and storage medium of aggregation server |
CN112653740A (en) * | 2020-12-11 | 2021-04-13 | 北京金山云网络技术有限公司 | Load balancing method and device supporting QUIC connection migration and computer product |
CN114024968A (en) * | 2021-08-20 | 2022-02-08 | 绿盟科技集团股份有限公司 | Message sending method and device based on intermediate equipment and electronic equipment |
CN114024968B (en) * | 2021-08-20 | 2023-05-26 | 绿盟科技集团股份有限公司 | Message sending method and device based on intermediate equipment and electronic equipment |
CN115022333A (en) * | 2022-06-22 | 2022-09-06 | 杭州迪普科技股份有限公司 | Message forwarding method and device of load balancing equipment and electronic equipment |
CN115022333B (en) * | 2022-06-22 | 2023-10-24 | 杭州迪普科技股份有限公司 | Message forwarding method and device of load balancing equipment and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109818997A (en) | A kind of load-balancing method, system and storage medium | |
US10523748B2 (en) | Managing health status of network devices in a distributed global server load balancing system | |
CN105554065B (en) | Handle method, converting unit and the applying unit of message | |
CN103716251B (en) | For the load-balancing method and equipment of content distributing network | |
CN107086966B (en) | Network load balancing, control and network interaction method and device | |
CN105308929B (en) | Method and distributed load balancer system for distributed load balance | |
CN108075934B (en) | Network quality monitoring method, device and system | |
CN107592237B (en) | Resource monitoring method and system of hybrid cloud | |
CN106998370A (en) | Access control method, device and system | |
CN105471858B (en) | A kind of cloud platform Verification System and method based on Internet of Things awareness apparatus | |
WO2017031460A1 (en) | Device and method for establishing connection in load-balancing system | |
CN107360247B (en) | The method and the network equipment of processing business | |
CN109561054A (en) | A kind of data transmission method, controller and access device | |
JP2020510938A (en) | System and method for a compute node management protocol | |
US11640368B2 (en) | Acceleration system for facilitating processing of API calls | |
CN108989438A (en) | Implementation method, the device and system of data distribution network | |
CN109525684A (en) | Message forwarding method and device | |
CN104350711A (en) | Methods, systems, and computer readable media for routing diameter messages at diameter signaling router | |
CN106230992B (en) | A kind of load-balancing method and load balancing node | |
CN104038418A (en) | Routing method for hybrid topologic structure data center, path detection mechanism and message processing mechanism | |
CN109639796A (en) | A kind of implementation of load balancing, device, equipment and readable storage medium storing program for executing | |
CN113179295B (en) | Message processing method and device | |
US11070614B2 (en) | Load balancing method and related apparatus | |
JP5154313B2 (en) | SIP message distribution method and SIP message distribution apparatus | |
CN105763391B (en) | A kind of session data stream processing system, method and relevant device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190528 |