Movatterモバイル変換


[0]ホーム

URL:


CN106330785A - Method and device for selecting service node - Google Patents

Method and device for selecting service node
Download PDF

Info

Publication number
CN106330785A
CN106330785ACN201510337455.7ACN201510337455ACN106330785ACN 106330785 ACN106330785 ACN 106330785ACN 201510337455 ACN201510337455 ACN 201510337455ACN 106330785 ACN106330785 ACN 106330785A
Authority
CN
China
Prior art keywords
service node
service
message
mark
host
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.)
Granted
Application number
CN201510337455.7A
Other languages
Chinese (zh)
Other versions
CN106330785B (en
Inventor
陈平平
黄倩
钱笑宇
刘晶
吴志芳
孙其琛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Tencent Computer Systems Co Ltd
Original Assignee
Shenzhen Tencent Computer Systems Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Tencent Computer Systems Co LtdfiledCriticalShenzhen Tencent Computer Systems Co Ltd
Priority to CN201510337455.7ApriorityCriticalpatent/CN106330785B/en
Publication of CN106330785ApublicationCriticalpatent/CN106330785A/en
Application grantedgrantedCritical
Publication of CN106330785BpublicationCriticalpatent/CN106330785B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

The invention, which belongs to the technical field of communication, discloses a method and device for selecting a service node. The method comprises: a first switch receives a first service message carrying a first message type, a first source host identifier and a first destination host identifier; according to the first message type as well as a distribution strategy, a host identifier is selected from the first source host identifier and the first destination host identifier, wherein the host identifier is identical with a host identifier that is selected by a second switch when receiving a second service message and the second service identifier and the first service identifier belongs to a same session; and on the basis of the host identifier, a service node corresponding to the host identifier is selected from a service node set. In addition, the device consists of a receiving module, a first selection module, and a second selection module. The service nodes that are selected by the first service message and the second service message that are belong to the same session are identical; and successful transmission of the first service message and the second service message can be guaranteed.

Description

A kind of method and apparatus selecting service node
Technical field
The present invention relates to communication technical field, particularly to a kind of method and apparatus selecting service node.
Background technology
In existing network, between two network areas having different safety class requirement, generally dispose business jointPoint set, this service node set includes multiple service node, and service node is for two network areasBetween service message to carry out safety filtering, such as service node can be fire wall, for filter traffic reportDangerous content in literary composition;For another example, service node can be anti-virus equipment, in filter traffic messageVirus.
Such as, describe service node with an instantiation service message between two network areas is enteredThe process of row safety filtering, for the ease of describe, two network areas are called first network region andSecond network area, when the second main frame in the second network area of the first main frame in first network region is sent outWhen sending service request message, the first switch that the first main frame is corresponding to first network region sends this business pleaseSeeking message, the first switch selects a service node from business node set, the referred to as first service node,First switch sends this service request message to the first service node;First service node is by this service requestDangerous information filtering in message is fallen, the service request message after the second main frame sends this filtration;WhenTwo main frames are according to this service request message when the first main frame returns service response message, and the second main frame is to secondSecond switch corresponding to network area sends this service response message, and the second switch is from business node setMiddle selection one service node, the referred to as second service node, the second switch sends this industry to the second service nodeBusiness response message, the dangerous information filtering in this service response message is fallen by the second service node, to firstMain frame sends the service response message after this filtration, to realize the business friendship between the first main frame and the second main frameMutually.
Wherein, the first switch selects the process of the first service node to be: the first switch is to this businessIP (Internet Protocol, the agreement of interconnection between the network) (source, address of the first main frame that request message carriesThe IP address of main frame), the IP address (the IP address of destination host) of the second main frame, source TCP (TransmissionControl Protocol, transmission control protocol) port and purpose tcp port carry out Hash operation and obtain HashValue, the quantity of the service node included according to this cryptographic Hash and service node set selects the first service node;Equally, the second main frame selects the second service node according to above method.
During realizing the present invention, inventor finds that prior art at least there is problems in that
This service request message and this service response message belong to same session;The service message of same sessionNeed through identical service node, if service node receives the service request that this service node non-processesDuring corresponding service response, this service response is not processed;The cryptographic Hash obtained due to the first switchDifferent with the cryptographic Hash that the second switch obtains, thus the first service node and the second service node are different, because ofThis, just do not process this service response message when the second service node receives this service response message,Thus cause this service response message transmissions failure.
Summary of the invention
In order to solve problem of the prior art, the invention provides a kind of method and apparatus selecting service node.Technical scheme is as follows:
A kind of method selecting service node, described method includes:
First switch receives the first service message, described first service message carry the first type of message,One source host mark and the first destination host mark;
According to described first type of message and allocation strategy, from described first source host mark and described first meshHost identification in select host identification, described host identification and the second switch are receiving the second business reportThe host identification selected during literary composition is identical, and described second service message and described first service message belong to for a momentWords;
According to described host identification, from business node set, select the service node that described host identification is corresponding.
A kind of device selecting service node, described device includes:
Receiver module, for receive the first service message, described first service message carry the first type of message,First source host mark and the first destination host mark;
First selects module, for according to described first type of message and allocation strategy, from described first source masterMachine mark and described first destination host mark select host identification, described host identification and the second switchThe host identification selected when receiving the second service message is identical, described second service message and described firstService message belongs to same session;
Second selects module, for according to described host identification, selects described main frame from business node setThe service node that mark is corresponding.
In embodiments of the present invention, arranging allocation strategy in advance, switch is according to type of message and allocation strategySelect host identification, be all according to this owing to belonging to the first service message and second service message of same sessionPlant the host identification that allocation strategy selects, therefore, belong to the first service message and second business of same sessionMessage selects the host identification selected during service node identical, thus belongs to the first service message of same sessionIdentical with the service node that the second service message selects such that it is able to ensure the first service message and the second businessMessage Successful transmissions.
Accompanying drawing explanation
Fig. 1 is a kind of method flow diagram selecting service node that the embodiment of the present invention 1 provides;
Fig. 2-1 is a kind of system block diagram selecting service node that the embodiment of the present invention 2 provides;
Fig. 2-2 is a kind of method flow diagram selecting service node that the embodiment of the present invention 2 provides;
Fig. 3 is a kind of apparatus structure schematic diagram selecting service node that the embodiment of the present invention 3 provides;
Fig. 4 is the structural representation of a kind of switch that the embodiment of the present invention 4 provides.
Detailed description of the invention
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to the present inventionEmbodiment is described in further detail.
Embodiment 1
Embodiments provide a kind of method selecting service node, see Fig. 1, wherein, the method bagInclude:
Step 101: the first switch receives the first service message, the first service message carry the first type of message,First source host mark and the first destination host mark;
Step 102: according to the first type of message and allocation strategy, from the first source host mark and master of the first meshSelecting host identification in machine mark, this host identification and the second switch select when receiving the second service messageThe host identification selected is identical, and the second service message and the first service message belong to same session;
Step 103: according to this host identification, select the business that this host identification is corresponding from business node setNode.
In embodiments of the present invention, arranging allocation strategy in advance, switch is according to type of message and allocation strategySelect host identification, be all according to this owing to belonging to the first service message and second service message of same sessionPlant the host identification that allocation strategy selects, therefore, belong to the first service message and second business of same sessionMessage selects the host identification selected during service node identical, thus belongs to the first service message of same sessionIdentical with the service node that the second service message selects such that it is able to ensure the first service message and the second businessMessage Successful transmissions.
Embodiment 2
Embodiments providing a kind of method selecting service node, service node is for two networksService message between region carries out safety filtering;Describe with an instantiation in embodiments of the present inventionService node carries out the process of safety filtering to the service message between two network areas, for the ease of describing,Two network areas are called first network region and the second network area, see Fig. 2-1, when the first netWhen the second main frame in the second network area of the first main frame in network region sends service request message, firstThe first switch that main frame is corresponding to first network region sends this service request message, the first switch workingSelecting a service node in business node set, the first switch sends this service request message to this service node;Dangerous information filtering in this service request message is fallen by this service node, sends this filtration to the second main frameAfter service request message;When the second main frame returns service response according to this service request message to the first main frameDuring message, the second switch that the second main frame is corresponding to the second network area sends this service response message, theTwo switches select the first switch to be the business joint that this service request message selects from business node setPoint, the second switch sends this service response message to this service node, and this service node is by this service responseDangerous information filtering in message is fallen, and the service response message after the first main frame sends this filtration, with realityExisting service interaction between first main frame and the second main frame.
First service message can be service request message in embodiments of the present invention, and the first service message also may be usedThink service response message;When the first service message is service request message, the second service message is businessResponse message, now the first source host is designated the host identification of the first main frame, and the first destination host is designatedThe host identification of the second main frame;When the first service message is service response message, the second service message is industryBusiness request message, now the first source host is designated the host identification of the second main frame, the first destination host markIt it is the host identification of the first main frame.
Seeing Fig. 2-2, wherein, the method includes:
Step 201: the first main frame sends service request message to the first switch, and this service request message carriesRequest message type, the host identification of the first main frame and the host identification of the second main frame;
Wherein, service node can be fire wall or anti-virus equipment.The host identification of the first main frame is sourceThe host identification of main frame, the host identification of main frame for the purpose of the host identification of the second main frame.Host identification is permissibleFor the numbering of main frame, the GUID (Globally Unique Identifier, GUID) of main frame orIP (Internet Protocol, the agreement of interconnection between the network) address etc. of person's main frame.
Step 202: the first switch receives this service request message, and according to this request message type and firstAllocation strategy, selects host identification from the host identification of the first main frame and the host identification of the second main frame;
If the first allocation strategy is for selecting service node according to requested service host identification, then this step canThink: from the host identification of the first main frame and the host identification of the second main frame, select the main frame mark of the first main frameKnow.
If the first allocation strategy is for selecting service node according to response service host identification, then this step canThink: from the host identification of the first main frame and the host identification of the second main frame, select the main frame mark of the second main frameKnow.
It should be noted that before this step, controller generates the first allocation strategy and the second allocation strategy;Send the first allocation strategy to the first switch, send the second allocation strategy to the second switch;First exchangeMachine receives the first allocation strategy that controller sends, and the second switch receives the second distribution plan that controller sendsSlightly.
Wherein, the first allocation strategy and the second allocation strategy are contrary allocation strategies;When the first allocation strategyDuring for selecting service node according to requested service host identification, the second allocation strategy is for according to response serviceHost identification selects service node;When the first allocation strategy is for selecting business according to response service host identificationDuring node, the second allocation strategy is for selecting service node according to requested service host identification.
Step 203: the first switch, according to this host identification, selects this host identification from business node setCorresponding service node;
Wherein, this step can be passed through following steps (1) to (3) and realize, including:
(1): the first switch, according to this host identification, determines the end at the terminal place that this host identification is correspondingEnd set;
Before this step, controller is service node collection according to principle and first allocation strategy of load balancingEach service node distribution terminal in conjunction, for each service node, the end will distributed for this service nodeEnd one terminal set of composition, sets up the corresponding relation of the mark of terminal set and service node;Hand over to firstThe corresponding relation of the mark sending terminal set and service node of changing planes;First switch receives controller and sendsTerminal set and the corresponding relation of mark of service node, the mark of storage terminal set and service nodeCorresponding relation.
When the first allocation strategy is for selecting service node according to requested service host identification, then controller willHost assignment in first network region gives each service node.Such as, service node set includes 3Service node, respectively service node 1, service node 2 and service node 3;First network region includes6 main frames, respectively main frame 1, main frame 2 ... main frame 6;It is then that each service node distributes 2 main frames,The corresponding relation of the mark setting up terminal set and service node is to set up terminal set 1 and service node 1Corresponding relation, terminal set 2 and the corresponding relation of service node 2 and terminal set 3 and service node 3Corresponding relation.Wherein, terminal set 1 includes main frame 1 and main frame 2, and terminal set 2 includes main frame3 and main frame 4, terminal set 3 includes main frame 5 and main frame 6.
(2): according to this terminal set, obtain from the corresponding relation of terminal set and the mark of service nodeThe mark of the service node that this terminal set is corresponding;
The mark of service node can be numbering or the position etc. of service node.
Further, the first switch can also the mark of storage service node and master in embodiments of the present inventionThe corresponding relation of machine mark, then step (1) and (2) could alternatively be: according to this host identification, workingThe mark of the mark service node corresponding with obtaining this host identification in the corresponding relation of host identification of business nodeKnow.
Wherein, the mark of the first switch storage service node and the corresponding relation of host identification, implementProcess is:
When the first allocation strategy is for selecting service node according to response service host identification, then the first exchangeHost assignment in second network area is given each service node by machine;Such as, according to the second network areaHost assignment in second network area is given each service node, main frame in the second network area by IP addressIP address network segment is 10.1.0.0/16, is N number of district by the host IP address network segment cutting in the second network areaSection, for the scattered harmony of flow, N is far longer than the number of the service node that service node set includesAmount, such as, service node set includes 3 service nodes, and N is 4096, then the mark of service nodeAs shown in table 1 below with the corresponding relation of host identification:
Table 1
FlowIDsResponse service host identificationThe mark of service node
000110.1.0.0/28Service node 1
000210.1.0.16/28Service node 2
000310.1.0.32/28Service node 3
000410.1.0.48/28Service node 1
………………
409610.1.255.240/28Service node 3
(3): from business node set, select the service node that the mark of this service node is corresponding.
Service node set includes multiple service node, selects this service node from business node setThe service node that mark is corresponding, distributes to this service request message by the service node of selection.
Step 204: the first switch sends this service request message to this service node;
After first switch selects service node, send this service request message to this service node, perform stepRapid 205, this service node this service request message is carried out safety filtering.
Step 205: this service node receives this service request message, dangerous by this service request messageInformation filtering is fallen, the service request message after the second main frame sends this filtration;
If service node is fire wall, this service node is by the dangerous content in this service request messageFilter out;When service node is for report virus, this service node is by the virus filtration in this service request messageFall.
Step 206: the second main frame receives the service request message after this filtration, please according to the business after this filtrationAsk message to generate service response message, send this service response message to the second switch;
This service response message carries response message type, the host identification of the second main frame and the master of the first main frameMachine identifies.The host identification of the second main frame is the host identification of the second source host, the host identification of the first main frameIt it is the host identification of the second destination host.
Step 207: the second switch receives this service response message, and according to this response message type and secondAllocation strategy, selects host identification from the host identification of the second main frame and the host identification of the first main frame;
If the first allocation strategy in step 202 is for selecting service node according to requested service host identificationTime, then the second allocation strategy is for selecting service node according to response service host identification, then this step is permissibleFor: from the host identification of the second main frame and the host identification of the first main frame, select the main frame mark of the first main frameKnow.
If the first allocation strategy in step 202 is for selecting service node according to response service host identificationTime, then the second allocation strategy is for selecting service node according to requested service host identification, then this step is permissibleFor: from the host identification of the second main frame and the host identification of the first main frame, select the main frame mark of the second main frameKnow.
Step 208: the second switch, according to this host identification, selects this host identification from business node setCorresponding service node;
Wherein, this step can be passed through following steps (1) to (3) and realize, including:
(1): the first switch, according to this host identification, determines the end at the terminal place that this host identification is correspondingEnd set;
Before this step, controller is service node collection according to principle and second allocation strategy of load balancingEach service node distribution terminal in conjunction, for each service node, the end will distributed for this service nodeEnd one terminal set of composition, sets up the corresponding relation of the mark of terminal set and service node;Hand over to secondThe corresponding relation of the mark sending terminal set and service node of changing planes;Second switch receives controller and sendsTerminal set and the corresponding relation of mark of service node, the mark of storage terminal set and service nodeCorresponding relation.
When the first allocation strategy is for selecting service node according to requested service host identification, then the second distributionWhen strategy is for selecting service node according to response service host identification, then controller is by first network regionMain frame extension set distribute to each service node;Such as, service node set includes 3 service nodes,It is respectively service node 1, service node 2 and service node 3;First network region includes 6 main frames,It is respectively main frame 1, main frame 2 ... main frame 6;It is then that each service node distributes 2 main frames, sets up terminalThe corresponding relation of mark of set and service node be set up terminal set 1 and the corresponding relation of service node 1,Terminal set 2 and the corresponding relation of service node 2 and terminal set 3 and the corresponding relation of service node 3.Wherein, terminal set 1 includes main frame 1 and main frame 2, and terminal set 2 includes main frame 3 and main frame 4,Terminal set 3 includes main frame 5 and main frame 6.
(2): according to this terminal set, obtain from the corresponding relation of terminal set and the mark of service nodeThe mark of the service node that this terminal set is corresponding;
The mark of service node can be numbering or the position etc. of service node.
Further, the second switch can also the mark of storage service node and master in embodiments of the present inventionThe corresponding relation of machine mark, then step (1) and (2) could alternatively be: according to this host identification, workingThe mark of the mark service node corresponding with obtaining this host identification in the corresponding relation of host identification of business nodeKnow.
Wherein, the mark of the second switch storage service node and the corresponding relation of host identification, implementProcess is:
When the first allocation strategy is for selecting service node according to response service host identification, then the second distributionStrategy is for selecting service node according to requested service host identification, then the first switch is by the second network areaIn host assignment give each service node;Such as, according to the IP address of the second network area by the second networkHost assignment in region gives each service node, and in the second network area, the IP address network segment of main frame is10.1.0.0/16, it is N number of section by the host IP address network segment cutting in the second network area, for flowScattered harmony, N is far longer than the quantity of the service node that service node set includes, such as, industryBusiness node set includes 3 service nodes, and N is 4096, then the mark of service node and host identificationCorresponding relation is as shown in table 2 below:
Table 2
FlowIDsRequested service host identificationThe mark of service node
000110.1.0.0/28Service node 1
000210.1.0.16/28Service node 2
000310.1.0.32/28Service node 3
000410.1.0.48/28Service node 1
………………
409610.1.255.240/28Service node 3
Owing to the first allocation strategy and the second allocation strategy are corresponding, when the first allocation strategy is for according to askingWhen asking business host identification to select service node, the second allocation strategy is for selecting according to response service host identificationSelecting service node, therefore, the first switch is the main frame mark that service request message selects to select during service nodeThe host identification that knowledge selects when being this service response message selection service node with the second switch is identical.
(3): from business node set, select the service node that the mark of this service node is corresponding.
Service node set includes multiple service node, selects this service node from business node setThe service node that mark is corresponding, distributes to this service response message by the service node of selection.
Step 209: the second switch sends this service response message to this service node;
After second switch selects service node, send this service request message to this service node, perform stepRapid 210, this service node this service response message is carried out safety filtering.
Step 210: this service node receives this service response message, dangerous by this service response messageInformation filtering is fallen, the service response message after the first main frame sends this filtration.
If service node is fire wall, this service node is by the dangerous content in this service response messageFilter out;When service node is for report virus, this service node is by the virus filtration in this service response messageFall.
It should be noted that the first switch and the second switch can be same switch.
Further, along with the growth of service message necessary flow, when the load of service node is excessive, permissibleCarry out dilatation by the mode extending transversely increasing service node, promote service node and process the effect of service messageRate, specifically can pass through following steps (1) to (3) and realize, including:
(1): each service node in statistical service node set is in the preset duration nearest from current timeFlow needed for interior transmission service message;
Preset duration can be configured as required and change, in embodiments of the present invention to preset duration notMaking concrete restriction, such as, preset duration is 24 hours or 12 hours etc..
Such as, preset duration is 24 hours, then this step can be each industry in statistical service node setBusiness node transmits the flow needed for service message in 24 hours nearest from current time, as shown in table 3 below:
Table 3
Service node identifiesFlow
Service node 1100MB
Service node 2250MB
Service node 3160MB
(2): in the preset duration nearest from current time, transmit service message institute according to each service nodeThe flow needed, calculated flow rate is more than the ratio of the service node of preset flow;
In the preset duration nearest from current time, the stream needed for service message is transmitted according to each service nodeAmount, obtains the first quantity that flow exceedes the service node of preset flow;Calculate the first quantity and service nodeThe ratio of the second quantity of the service node that set includes is more than the service node of preset flow as flowRatio.
Preset flow can be configured according to the load condition of each service node and change, real in the present inventionExecute in example and preset flow is not especially limited.
(3): if this ratio is more than preset ratio, then in service node set, service node is increased.
After increasing service node in service node set, by each service node in service node setThe corresponding part terminal in terminal set is transferred in the terminal set that the service node of this increase is corresponding.
In embodiments of the present invention can each industry according to the principle of load balancing, from business node setFetching portion terminal in the terminal set that business node is corresponding, transfers to the industry of this increase by the part terminal of acquisitionIn the terminal set that business node is corresponding;Can also be according to each service node in nearest the presetting from current timeTransmit the flow needed for service message in duration, select minimum discharge, and the service node of minimum discharge;Part terminal in terminal set corresponding for the service node of minimum discharge is transferred to the service node pair of this increaseIn the terminal set answered.
Preset ratio can be configured as required and change, in embodiments of the present invention to preset ratio notMaking concrete restriction, such as preset ratio is 0.8 or 0.5 etc..
Such as, increasing by a service node in service node set is service node 4, then table 1 can be revised asShown in table 4:
Table 4
FlowIDsResponse service host identificationThe mark of service node
000110.1.0.0/28Service node 1
000210.1.0.16/28Service node 2
000310.1.0.32/28Service node 3
000410.1.0.48/28Service node 4
000510.1.0.80/28Service node 1
000610.1.0.96/28Service node 2
000710.1.0.112/28Service node 3
000810.1.0.128/28Service node 4
………………
Equally, table 2 can be revised as shown in table 5:
Table 5
FlowIDsRequested service host identificationThe mark of service node
000110.1.0.0/28Service node 1
000210.1.0.16/28Service node 2
000310.1.0.32/28Service node 3
000410.1.0.48/28Service node 4
000510.1.0.80/28Service node 1
000610.1.0.96/28Service node 2
000710.1.0.112/28Service node 3
000810.1.0.128/28Service node 4
………………
Wherein, originally service node set includes 3 service nodes, newly increases now a service node,The service node of this increase is transferred to by the part terminal in the terminal set that 3 service nodes of amendment are correspondingIn corresponding terminal set, and the terminal not shifted in terminal set corresponding to 3 service nodes is by appointingWhat impact, can also continue to transmit message in dilation process.
Further, owing to the flow needed for different main frame transmission service messages is different, the most each business savesFlow needed for some transmission service message is unbalanced, and it is possible to change over time and change,First switch or the second switch will monitor the stream of each service node in real time in embodiments of the present inventionAmount, according to the flow of each service node, carries out load balancing adjustment, specifically can pass through following steps (A)Realize to (C), including:
(A): each service node in statistical service node set is in the preset duration nearest from current timeFlow needed for interior transmission service message;
(B): in the preset duration nearest from current time, transmit service message institute according to each service nodeThe flow needed, selects maximum stream flow, minimum discharge, and the service node of maximum stream flow and minimum dischargeService node;
In the preset duration nearest from current time, the flow needed for service message is transmitted from each service nodeMiddle selection maximum stream flow and minimum discharge;The service node that maximum stream flow is corresponding is selected from business node setAs the service node of maximum stream flow, select service node corresponding to minimum discharge as the business of minimum dischargeNode.
(C): if maximum stream flow and the ratio of minimum discharge are more than default ratio, then by the industry of maximum stream flowIn business terminal set corresponding to node, part terminal transfers to the terminal set that the service node of minimum discharge is correspondingIn.
If maximum stream flow and the ratio of minimum discharge are more than default ratio, it is determined that the business joint of maximum stream flowThe load difference of the load of point and the service node of minimum discharge is relatively big, corresponding from the service node of maximum stream flowTerminal set in reduce part terminal;The part terminal reduced is increased the service node correspondence of minimum dischargeTerminal set in.
Default ratio can be configured as required and change, in embodiments of the present invention to default ratio notMaking concrete restriction, such as, default ratio can be 10 or 8 etc..
Such as, the load of service node 2 is much larger than service node 1 as can be seen from Table 3, then business savedDuring in the terminal set of point 2 correspondences, part terminal transfers to the terminal set of service node 1 correspondence, table 1 canTo be varied to table 6, table 2 can be varied to shown in table 7:
Table 6
FlowIDsResponse service host identificationThe mark of service node
000110.1.0.0/28Service node 1
000210.1.0.16/28Service node 1
000310.1.0.32/28Service node 3
000410.1.0.48/28Service node 1
………………
409610.1.255.240/28Service node 3
Table 7
FlowIDsRequested service host identificationThe mark of service node
000110.1.0.0/28Service node 1
000210.1.0.16/28Service node 1
000310.1.0.32/28Service node 3
000410.1.0.48/28Service node 1
………………
409610.1.255.240/28Service node 3
Further, whether the first switch or the second switch can also monitor each service node in real timeBreak down, when certain service node breaks down, by the flow switch of this service node to other businessOn node, can be with process specifically:
Obtain the service node broken down in service node set and the service node not broken down;To send outThe service node that terminal in the terminal set that the service node of raw fault is corresponding is transferred to not break down is correspondingTerminal set in.
Wherein it is possible to the terminal in terminal set corresponding for the service node broken down is evenly distributed to notIn the terminal set that the service node that breaks down is corresponding, it is also possible to the service node according to not breaking down existsThe flow needed for service message, the business never broken down is transmitted in the preset duration that current time is nearestNode selects the service node of minimum discharge, by terminal set corresponding for the service node that breaks downTerminal is transferred in terminal set corresponding to service node selected.
The method provided by the embodiment of the present invention, when service node breaks down, automatically by fault businessTerminal in the terminal set that node is corresponding transfers to the terminal set that the service node that do not breaks down is correspondingIn, it is achieved that transparent automatic fault is recovered, and improves the availability that system is overall.Meanwhile, service nodeFault the most only affects the terminal in the terminal set that this service node broken down is corresponding, does not breaks downTerminal in the terminal set that service node is corresponding is not affected.
Wherein, for each service node, detecting the step whether this service node break down can be:Send heartbeat message in real time to this service node;If receiving what this service node returned in Preset TimeResponse message, it is determined that this service node does not break down;If being not received by this in Preset TimeThe response message that service node returns, it is determined that this service node breaks down.
Can not be by it should be noted that service node to be carried out dilatation, load balancing and/or fault detectOne switch or the second switch perform, and can be performed by controller.
Further, in embodiments of the present invention, the first switch is that service request message selects service nodeAfterwards, the mark of this service node is inserted in this service request message;When the second main frame please according to this businessWhen asking message to generate service response message, from this service request message, obtain the mark of this service node, andThe mark of this service node being inserted in this service response message, the second switch receives this service responseDuring message, obtaining the mark of service node in this service response message, selecting from business node set shouldThe mark of service node, thus realize belonging to the service request message of same session and the selection of service response messageSame service node.
It should be noted that the second main frame can also be asked to the first main frame transmission business in embodiments of the present inventionSeek message;When the second switch receives the service request message that the second main frame sends, the second switch rootThe request message type carried according to the second allocation strategy and this service request message, from the main frame mark of the second main frameKnow and the host identification of the first main frame select host identification, according to this host identification, from business node setThe service node that this host identification of middle selection is corresponding;Equally, when the first switch receive the first main frame according toWhen this service request message sends service response message, the first switch is according to the first allocation strategy and this businessThe response message type that response message carries, from host identification and the host identification of the second main frame of the first main frameMiddle selection host identification, according to this host identification, selects this host identification corresponding from business node setService node.
In embodiments of the present invention, arranging allocation strategy in advance, switch is according to type of message and allocation strategySelect host identification, be all according to this owing to belonging to the first service message and second service message of same sessionPlant the host identification that allocation strategy selects, therefore, belong to the first service message and second business of same sessionMessage selects the host identification selected during service node identical, thus belongs to the first service message of same sessionIdentical with the service node that the second service message selects such that it is able to ensure the first service message and the second businessMessage Successful transmissions.
Embodiment 3
Embodiments providing a kind of device selecting service node, see Fig. 3, this device includes:
Receiver module 301, for receive the first service message, the first service message carry the first type of message,First source host mark and the first destination host mark;
First selects module 302, for according to the first type of message and allocation strategy, from the first source host markSelecting host identification with in the first destination host mark, this host identification and the second switch are receiving secondThe host identification selected during service message is identical, and the second service message and the first service message belong to same session;
Second selects module 303, for according to this host identification, selects this main frame mark from business node setKnow corresponding service node.
Further, if allocation strategy is for selecting service node according to requested service host identification, then theOne selects module 302, including:
First selects unit, for when the first type of message is request message type, from the first source host markKnow and the first destination host mark selects the first source host mark;
Second selects unit, for when the first type of message is response message type, from the first source host markKnow and the first destination host mark selects the first destination host mark;
If allocation strategy is for selecting service node according to response service host identification, then first select module302, including:
3rd selects unit, for when the first type of message is request message type, from the first source host markKnow and the first destination host mark selects the first destination host mark;
4th selects unit, for when the first type of message is response message type, from the first source host markKnow and the first destination host mark selects the first source host mark.
Further, second selects module 303, including:
Determine unit, for according to this host identification, determine the terminal at the terminal place that this host identification is correspondingSet;
Acquiring unit, for according to this terminal set, from the corresponding pass of the mark of terminal set and service nodeSystem obtains the mark of service node corresponding to this terminal set;
5th selects unit, for selecting the business of the mark correspondence of this service node from business node setNode.
Further, this device also includes:
Statistical module, each service node in statistical service node set is nearest from current timeThe flow needed for service message is transmitted in preset duration;
Computing module, for transmitting industry according to each service node in the preset duration nearest from current timeFlow needed for business message, calculated flow rate is more than the ratio of the service node of preset flow;
Increase module, if for this ratio more than preset ratio, then in service node set, increase businessNode.
Further, this device also includes:
3rd selects module, for passing in the preset duration nearest from current time according to each service nodeFlow needed for defeated service message, selects maximum stream flow, minimum discharge, and the service node of maximum stream flowService node with minimum discharge;
First shift module, if for maximum stream flow with the ratio of minimum discharge more than default ratio, then willIn the terminal set that the service node of maximum stream flow is corresponding, part terminal transfers to the service node pair of minimum dischargeIn the terminal set answered.
Further, this device also includes:
Acquisition module, for obtaining the service node that breaks down in service node set and not breaking downService node;
Second shift module, for by the terminal transfer in terminal set corresponding for the service node that break downIn the terminal set that the service node not broken down is corresponding.
In embodiments of the present invention, arranging allocation strategy in advance, switch is according to type of message and allocation strategySelect host identification, be all according to this owing to belonging to the first service message and second service message of same sessionPlant the host identification that allocation strategy selects, therefore, belong to the first service message and second business of same sessionMessage selects the host identification selected during service node identical, thus belongs to the first service message of same sessionIdentical with the service node that the second service message selects such that it is able to ensure the first service message and the second businessMessage Successful transmissions.
Embodiment 4
The device selecting service node can be switch, and this switch can be terminal, refer to Fig. 4, itsShowing the terminal structure schematic diagram with Touch sensitive surface involved by the embodiment of the present invention, this terminal is above-mentionedWhat example 3 provided selects the device of service node to provide running environment.Specifically:
Terminal 900 can include RF (Radio Frequency, radio frequency) circuit 110, include one orThe memorizer 120 of more than one computer-readable recording medium, input block 130, display unit 140, biographySensor 150, voicefrequency circuit 160, WiFi (wireless fidelity, Wireless Fidelity) module 170, include oneIndividual or more than one process the parts such as the processor 180 of core and power supply 190.Those skilled in the artIt is appreciated that the terminal structure shown in Fig. 4 is not intended that the restriction to terminal, can include than diagram moreMany or less parts, or combine some parts, or different parts are arranged.Wherein:
RF circuit 110 can be used for receiving and sending messages or in communication process, the reception of signal and transmission, especially,After the downlink information of base station is received, transfer to one or more than one processor 180 processes;It addition, willRelate to up data and be sent to base station.Generally, RF circuit 110 include but not limited to antenna, at least oneAmplifier, tuner, one or more agitator, subscriber identity module (SIM) card, transceiver, couplingClutch, LNA (Low Noise Amplifier, low-noise amplifier), duplexer etc..Additionally, RF circuit110 can also be communicated with network and other equipment by radio communication.Described radio communication can use arbitrary logicalBeacon is accurate or agreement, include but not limited to GSM (Global System of Mobile communication, entirelyBall mobile communcations system), GPRS (General Packet Radio Service, general packet radio service),CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband CodeDivision Multiple Access, WCDMA), LTE (Long Term Evolution, Long Term Evolution),Email, SMS (Short Messaging Service, Short Message Service) etc..
Memorizer 120 can be used for storing software program and module, and processor 180 is stored in by operationThe software program of reservoir 120 and module, thus perform the application of various function and data process.Memorizer120 can mainly include store program area and storage data field, wherein, storage program area can store operating system,Application program (such as sound-playing function, image player function etc.) etc. needed at least one function;DepositStorage data field can store the data (such as voice data, phone directory etc.) that the use according to terminal 900 is createdDeng.Additionally, memorizer 120 can include high-speed random access memory, it is also possible to include non-volatile depositingReservoir, for example, at least one disk memory, flush memory device or other volatile solid-state parts.Correspondingly, memorizer 120 can also include Memory Controller, to provide processor 180 and input blockThe access of 130 pairs of memorizeies 120.
Input block 130 can be used for receive input numeral or character information, and produce with user setup withAnd function controls relevant keyboard, mouse, action bars, optics or the input of trace ball signal.Specifically,Input block 130 can include Touch sensitive surface 131 and other input equipments 132.Touch sensitive surface 131, also referred to asFor touching display screen or Trackpad, can collect user thereon or neighbouring touch operation (such as user makesWith any applicable object such as finger, stylus or adnexa on Touch sensitive surface 131 or attached at Touch sensitive surface 131Near operation), and drive corresponding attachment means according to formula set in advance.Optionally, Touch sensitive surface 131Touch detecting apparatus and two parts of touch controller can be included.Wherein, touch detecting apparatus detects user'sTouch orientation, and detect the signal that touch operation brings, transmit a signal to touch controller;Touch controlDevice receives touch information from touch detecting apparatus, and is converted into contact coordinate, then gives processor 180,And order that processor 180 sends can be received and performed.Furthermore, it is possible to use resistance-type, condenser type,The polytype such as infrared ray and surface acoustic wave realizes Touch sensitive surface 131.Except Touch sensitive surface 131, input is singleUnit 130 can also include other input equipments 132.Specifically, other input equipments 132 can include but notIt is limited to physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, behaviourMake one or more in bar etc..
Display unit 140 can be used for showing the information inputted by user or the information being supplied to user and terminalThe various graphical user interface of 900, these graphical user interface can by figure, text, icon, video andIts combination in any is constituted.Display unit 140 can include display floater 141, optionally, can useLCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode,Organic Light Emitting Diode) etc. form configure display floater 141.Further, Touch sensitive surface 131 can coverDisplay floater 141, when Touch sensitive surface 131 detects thereon or after neighbouring touch operation, sends process toDevice 180 is to determine the type of touch event, with preprocessor 180 according to the type of touch event at display surfaceCorresponding visual output is provided on plate 141.Although in the diagram, Touch sensitive surface 131 and display floater 141It is to realize input and input function as two independent parts, but in some embodiments it is possible to willTouch sensitive surface 131 is integrated with display floater 141 and realizes input and output function.
Terminal 900 may also include at least one sensor 150, such as optical sensor, motion sensor and itsHis sensor.Specifically, optical sensor can include ambient light sensor and proximity transducer, wherein, environmentOptical sensor can regulate the brightness of display floater 141 according to the light and shade of ambient light, and proximity transducer can beWhen terminal 900 moves in one's ear, close display floater 141 and/or backlight.As the one of motion sensor,Gravity accelerometer can detect the size of (generally three axles) acceleration in all directions, can time staticDetect size and the direction of gravity, can be used for identifying application (such as horizontal/vertical screen switching, the phase of mobile phone attitudeClose game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.;As forGyroscope that terminal 900 can also configure, barometer, drimeter, thermometer, infrared ray sensor etc. otherSensor, does not repeats them here.
Voicefrequency circuit 160, speaker 161, microphone 162 can provide the audio frequency between user and terminal 900Interface.The signal of telecommunication after the voice data conversion that voicefrequency circuit 160 can will receive, is transferred to speaker 161,Acoustical signal output is converted to by speaker 161;On the other hand, the acoustical signal that microphone 162 will be collectedBe converted to the signal of telecommunication, voicefrequency circuit 160 after receiving, be converted to voice data, then by voice data outputAfter reason device 180 processes, through RF circuit 110 to be sent to such as another terminal, or voice data is exportedTo memorizer 120 to process further.Voicefrequency circuit 160 is also possible that earphone jack, outside providingIf earphone and the communication of terminal 900.
WiFi belongs to short range wireless transmission technology, and terminal 900 can help user by WiFi module 170Sending and receiving e-mail, browse webpage and access streaming video etc., it has provided the user wireless broadband interconnectionNet accesses.Although Fig. 4 shows WiFi module 170, but it is understood that, it is also not belonging to terminal900 must be configured into, can omit completely as required in not changing the scope of essence of invention.
Processor 180 is the control centre of terminal 900, utilizes various interface and the whole mobile phone of connectionVarious piece, by running or perform to be stored in the software program in memorizer 120 and/or module, and adjustsBy the data being stored in memorizer 120, perform the various functions of terminal 900 and process data, thus rightMobile phone carries out integral monitoring.Optionally, processor 180 can include one or more process core;Preferably,Processor 180 can integrated application processor and modem processor, wherein, application processor mainly processesOperating system, user interface and application program etc., modem processor mainly processes radio communication.PermissibleBeing understood by, above-mentioned modem processor can not also be integrated in processor 180.
Terminal 900 also includes the power supply 190 (such as battery) powered to all parts, it is preferred that power supply canWith logically contiguous with processor 180 by power-supply management system, thus realize management by power-supply management systemThe functions such as charging, electric discharge and power managed.Power supply 190 can also include one or more directlyStream or alternating current power supply, recharging system, power failure detection circuit, power supply changeover device or inverter, electricityThe random component such as source positioning indicator.
Although not shown, terminal 900 can also include photographic head, bluetooth module etc., does not repeats them here.The most in the present embodiment, the display unit of terminal 900 is touch-screen display, and terminal 900 also includesMemorizer, and one or more than one program, one of them or more than one program is stored in depositsIn reservoir, and it is configured to be performed to state one or more than one program by one or more than one processorComprise the instruction for carrying out following operation:
First switch receives the first service message, described first service message carry the first type of message,One source host mark and the first destination host mark;
According to described first type of message and allocation strategy, from described first source host mark and described first meshHost identification in select host identification, described host identification and the second switch are receiving the second business reportThe host identification selected during literary composition is identical, and described second service message and described first service message belong to for a momentWords;
According to described host identification, from business node set, select the service node that described host identification is corresponding.
Further, if described allocation strategy is for selecting service node according to requested service host identification,The most described according to described first type of message and allocation strategy, from described first source host mark and described firstDestination host mark selects host identification, including:
When described first type of message is request message type, from described first source host mark and described theOne destination host mark selects described first source host mark;When described first type of message is response messageDuring type, from described first source host mark and described first destination host mark, select described first purposeHost identification;
If described allocation strategy is for selecting service node, the most described basis according to response service host identificationDescribed first type of message and allocation strategy, from described first source host mark and described first destination host markKnowledge selects host identification, including:
When described first type of message is request message type, from described first source host mark and described theOne destination host mark selects described first destination host mark;When described first type of message is response reportDuring literary composition type, from described first source host mark and described first destination host mark, select described first sourceHost identification.
Further, described according to described host identification, from business node set, select described host identificationCorresponding service node, including:
According to described host identification, determine the terminal set at the terminal place that described host identification is corresponding;
According to described terminal set, obtain described from the corresponding relation of terminal set and the mark of service nodeThe mark of the service node that terminal set is corresponding;
The service node that the mark of described service node is corresponding is selected from business node set.
Further, described method also includes:
Add up each service node in described service node set in the preset duration nearest from current timeFlow needed for transmission service message;
Needed for transmitting service message according to described each service node in the preset duration nearest from current timeFlow, calculated flow rate is more than the ratio of service node of preset flow;
If described ratio is more than preset ratio, then in described service node set, increase service node.
Further, each service node in the set of described statistics described service node is from current timeAfter transmitting the flow needed for service message near preset duration, also include:
Needed for transmitting service message according to described each service node in the preset duration nearest from current timeFlow, select maximum stream flow, minimum discharge, and the service node of described maximum stream flow and described minimumThe service node of flow;
If described maximum stream flow and the ratio of described minimum discharge are more than default ratio, then by described max-flowIn the terminal set corresponding to service node of amount, to transfer to the service node of described minimum discharge corresponding for part terminalTerminal set in.
Further, described method also includes:
Obtain the service node broken down in described service node set and the service node not broken down;
Event is there is not described in terminal in terminal set corresponding for the described service node broken down being transferred toIn the terminal set corresponding to service node of barrier.
In embodiments of the present invention, arranging allocation strategy in advance, switch is according to type of message and allocation strategySelect host identification, be all according to this owing to belonging to the first service message and second service message of same sessionPlant the host identification that allocation strategy selects, therefore, belong to the first service message and second business of same sessionMessage selects the host identification selected during service node identical, thus belongs to the first service message of same sessionIdentical with the service node that the second service message selects such that it is able to ensure the first service message and the second businessMessage Successful transmissions.
It should be understood that the device of the selection service node of above-described embodiment offer is when selecting service node,Only it is illustrated with the division of above-mentioned each functional module, in actual application, can be as desired by upperState function distribution to be completed by different functional modules, the internal structure of device will be divided into different function mouldsBlock, to complete all or part of function described above.It addition, the selection business that above-described embodiment providesThe device of node belongs to same design with the embodiment of the method selecting service node, and it implements process and refers toEmbodiment of the method, repeats no more here.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can be passed throughHardware completes, it is also possible to instructing relevant hardware by program and complete, described program can be stored inIn a kind of computer-readable recording medium, storage medium mentioned above can be read only memory, disk orCD etc..
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all the present invention'sWithin spirit and principle, any modification, equivalent substitution and improvement etc. made, should be included in the present invention'sWithin protection domain.

Claims (12)

CN201510337455.7A2015-06-172015-06-17Method and device for selecting service nodeActiveCN106330785B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201510337455.7ACN106330785B (en)2015-06-172015-06-17Method and device for selecting service node

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201510337455.7ACN106330785B (en)2015-06-172015-06-17Method and device for selecting service node

Publications (2)

Publication NumberPublication Date
CN106330785Atrue CN106330785A (en)2017-01-11
CN106330785B CN106330785B (en)2020-08-11

Family

ID=57732958

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201510337455.7AActiveCN106330785B (en)2015-06-172015-06-17Method and device for selecting service node

Country Status (1)

CountryLink
CN (1)CN106330785B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN110798402A (en)*2019-10-302020-02-14腾讯科技(深圳)有限公司Service message processing method, device, equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20020097732A1 (en)*2001-01-192002-07-25Tom WorsterVirtual private network protocol
CN101350773A (en)*2008-06-202009-01-21中兴通讯股份有限公司Mobile packet network architecture as well as access method for equalizing load of a plurality of firewalls
CN101651680A (en)*2009-09-142010-02-17杭州华三通信技术有限公司Network safety allocating method and network safety device
CN101895472A (en)*2010-07-162010-11-24华为技术有限公司Traffic flow load sharing method and processing method and corresponding device and system
CN102131239A (en)*2010-10-272011-07-20华为技术有限公司 Service processing unit and method, service control gateway and load balancing method
CN103546497A (en)*2012-07-092014-01-29杭州华三通信技术有限公司Method and device for distributed firewall IPSec (internet protocol security) business load sharing
CN104065759A (en)*2013-03-222014-09-24杭州迪普科技有限公司Method for improving utilization efficiency of NAT address pool resource and device thereof
CN104426794A (en)*2013-08-232015-03-18华为技术有限公司A message forwarding method and device
CN104468063A (en)*2014-11-282015-03-25杭州华三通信技术有限公司Service message processing method and device
CN104469846A (en)*2013-09-182015-03-25华为技术有限公司 A message processing method and device
CN104469845A (en)*2013-09-182015-03-25华为技术有限公司 A message processing method, system and device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20020097732A1 (en)*2001-01-192002-07-25Tom WorsterVirtual private network protocol
CN101350773A (en)*2008-06-202009-01-21中兴通讯股份有限公司Mobile packet network architecture as well as access method for equalizing load of a plurality of firewalls
CN101651680A (en)*2009-09-142010-02-17杭州华三通信技术有限公司Network safety allocating method and network safety device
CN101895472A (en)*2010-07-162010-11-24华为技术有限公司Traffic flow load sharing method and processing method and corresponding device and system
CN102131239A (en)*2010-10-272011-07-20华为技术有限公司 Service processing unit and method, service control gateway and load balancing method
CN103546497A (en)*2012-07-092014-01-29杭州华三通信技术有限公司Method and device for distributed firewall IPSec (internet protocol security) business load sharing
CN104065759A (en)*2013-03-222014-09-24杭州迪普科技有限公司Method for improving utilization efficiency of NAT address pool resource and device thereof
CN104426794A (en)*2013-08-232015-03-18华为技术有限公司A message forwarding method and device
CN104469846A (en)*2013-09-182015-03-25华为技术有限公司 A message processing method and device
CN104469845A (en)*2013-09-182015-03-25华为技术有限公司 A message processing method, system and device
CN104468063A (en)*2014-11-282015-03-25杭州华三通信技术有限公司Service message processing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN110798402A (en)*2019-10-302020-02-14腾讯科技(深圳)有限公司Service message processing method, device, equipment and storage medium
CN110798402B (en)*2019-10-302023-04-07腾讯科技(深圳)有限公司Service message processing method, device, equipment and storage medium

Also Published As

Publication numberPublication date
CN106330785B (en)2020-08-11

Similar Documents

PublicationPublication DateTitle
CN105119806B (en)message updating method and device
CN104142862B (en)The overload protection method of server and device
CN103458305B (en)Video broadcasting method, device, terminal unit server
CN103294515B (en)A kind of methods, devices and systems for obtaining application program
CN106686070A (en)Database data migration method, device, terminal and system
CN107634962B (en) Network bandwidth management method and related products
CN104142868B (en)Establish the method and device of connection
CN103716331B (en)Method, terminal, server and system for numerical value transfer
CN103475914B (en)Video playing method, video playing device, terminal equipment and server
CN105120065A (en)Message processing method and device
CN106162316A (en)The data processing method of a kind of video flowing, device and system
CN103593247B (en)Method and device for data transmission
CN103338145B (en)Method, device and system for controlling voice data transmission
CN104820665A (en)Method, terminal and server for exhibiting recommendation information
CN104717341A (en)Message prompting method and terminal
CN104618873A (en)Method and device for sharing access point information
CN113825163B (en) Reconstruction method, terminal device and storage medium when communication is abnormal
CN105227890A (en)Video call method and device
CN104639354A (en)Router management method and device
CN106453030B (en) A method and device for acquiring social relationship chains
CN105245432A (en)Unread message counting method, unread message counting device and terminal
CN104468483B (en) Data transmission method and system, control device and node device
CN104468060A (en)Method and device for media access control uplink data assembly
CN103561155B (en)Send the method for note, device and terminal
CN105022621A (en)Method and device for collecting session message and terminal

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp