Embodiment
Below in conjunction with accompanying drawing, the application is described in further detail.
In the application one typically configuration, the equipment of terminal, service network and trusted party include one or more processor (CPU), input/output interface, network interface and internal memory.
Internal memory may comprise the volatile memory in computer-readable medium, and the forms such as random access memory (RAM) and/or Nonvolatile memory, as read-only memory (ROM) or flash memory (flashRAM).Internal memory is the example of computer-readable medium.
Computer-readable medium comprises permanent and impermanency, removable and non-removable media can be stored to realize information by any method or technology.Information can be computer-readable instruction, data structure, the module of program or other data.The example of the storage medium of computer comprises, but be not limited to phase transition internal memory (PRAM), static RAM (SRAM), dynamic random access memory (DRAM), the random access memory (RAM) of other types, read-only memory (ROM), Electrically Erasable Read Only Memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tape, magnetic disk stores or other magnetic storage apparatus or any other non-transmitting medium, can be used for storing the information can accessed by computing equipment.According to defining herein, computer-readable medium does not comprise non-temporary computer readable media (transitorymedia), as data-signal and the carrier wave of modulation.
Fig. 1 illustrates the equipment schematic diagram of a kind of far call equipment according to the application aspect.Far call equipment 1 comprises first device 101, second device 102 and the 3rd device 103.
Wherein, first device 101 obtains the address of service information of one or more available service.Particularly, first device 101 is regular or answer event triggering ground, from the registrar corresponding to far call framework or address server, obtain the address of service information of one or more available service, or only obtain the address of service information of the one or more available service after wherein upgrading.Such as, this first device 101, regularly from the registrar corresponding to far call framework, downloads the address of service information of registration service.
Those skilled in the art will be understood that; the mode of above-mentioned acquisition or renewal address of service information is only citing; the mode of other acquisitions that are existing or that may occur from now on or renewal address of service information is as being applicable to the application; also should be included within the application's protection range, and be contained in this at this with way of reference.
Second device 102 determines the route visit information of described service invocation request about target available service according to service invocation request and described address of service information.Particularly, the second device 102 determines that the mode of route visit information includes but not limited to:
1) the second device 102 address of service information of one or more available service of first obtaining according to this service invocation request and first device 101 or upgrading, determine target available service, wherein, this target available service and this service invocation request match; Subsequently, the second device 102 is again according to the address of service information of this target available service, and route determines the route visit information of this service invocation request about this target available service.
2) the second device 102 address of service information of one or more available service of first obtaining according to this service invocation request and first device 101 or upgrading, determines several candidate's route visit informations; Subsequently, this second device 102 again according to service invocation request, or further combined with routing rule, filters out target available service from these several candidate's route visit informations, and then, using the candidate's route visit information corresponding to this target available service as this route visit information.
Those skilled in the art will be understood that; above-mentionedly determine that the mode of route visit information is only citing; the mode of other determination route visit informations that are existing or that may occur from now on, as being applicable to the application, also should being included within the application's protection range, and being contained in this at this with way of reference.
3rd device 103 calls described target available service according to described route visit information.Particularly, the 3rd device 103 according to the determined route visit information of the second device 102, this target available service of direct far call; Or this service invocation request, according to this route visit information, is sent to this target available service by the 3rd device 103, and by this this service invocation request of target available service process.
At this, if this service invocation request comprises service call parameter, then the 3rd device 103 can call this target available service according to being somebody's turn to do (s) service call parameter.
Those skilled in the art will be understood that; the mode of above-mentioned invocation target available service is only citing; the mode of other invocation target available service that are existing or that may occur from now on, as being applicable to the application, also should being included within the application's protection range, and being contained in this at this with way of reference.
At this, far call includes but not limited to based on such as HSF, RPC or RMI etc.At this, this remote invocation method works in the client calling remote service.
HSF (High-SpeedServiceFramework, high-speed service framework), be intended to for service application provides a distributed service framework, HSF from Distributed Application aspect and unified issue/method of calling aspect for everybody provides support, thus distributed application can be developed easily and provide or use common functional modules, and the various details technology in field of distributed type need not be considered, realization of such as telecommunication, performance loss, the transparence called, synchronous/asynchronous method of calling etc. problem.
RPC (RemoteProcedureCallProtocol, remote procedure call protocol), be a kind of by network from request service remote computer program, and do not need the agreement understanding underlying network technology.
RMI (RemoteMethodInvocation, RMI) is in Java programming language, a kind of application programming interface for realizing remote procedure call.It makes the program that client computer is run can call object on remote server.RMI characteristic enables Java programming personnel's distributed operation in a network environment.The aim of RMI is the use simplifying remote interface object as far as possible.
Preferably, be constant work between each device of far call equipment 1.Particularly, first device 101 obtains or upgrades the address of service information of one or more available service; Second device 102 determines the route visit information of described service invocation request about target available service according to the address of service information of service invocation request and described one or more available service; 3rd device 103 calls described target available service according to described route visit information.At this, it will be understood by those skilled in the art that each device that " continuing " refer to far call equipment 1 respectively according to setting or the mode of operation requirement of adjustment in real time, obtain or upgrade address of service information, determine route visit information and invocation target available service.
At this, far call equipment 1 is by obtaining or upgrade the address of service information of one or more available service, address of service information according to service invocation request and this one or more available service determines the route visit information of described service invocation request about target available service, and then calls this target available service according to this route visit information.Far call equipment 1 is by determining that the route visit information of target available service directly calls this target available service, do not need the load-balanced server of pile warp transfer, not only avoid the Single Point of Faliure that load-balanced server causes, decrease network transfer, improve service response performance.
Preferably, described second device 102 is according to the address of service information determination target available service of service invocation request and described one or more available service, and wherein, described target available service and described service invocation request match; The route visit information of described service invocation request about described target available service is determined according to the address of service information router of described target available service.
Such as, the second device 102 according to service invocation request, and first device 101 the address of service information of one or more available service that obtains or upgrade, determine to match with this service invocation request target available service; Subsequently; this second device 102 is according to the address of service information of this target available service; route determines the route visit information of this service invocation request about this target available service; as according to service call client the route information table protected; the down hop of the address of service going to this target available service is determined in inquiry, namely corresponding route visit information.
At this, service invocation request generally includes the relevant information for mating target available service, and such as, service invocation request is the service of request call log query.
Preferably, comprise according to the address of service information determination target available service of service invocation request and described one or more available service:
According to the address of service information of service invocation request and described one or more available service, and combine corresponding routing rule, determine described target available service.
Particularly, second device 102 according to service invocation request, and first device 101 the address of service information of one or more available service that obtains or upgrade, determine several candidate's available service, wherein, this candidate's available service and this service invocation request match; Subsequently, this second device 102 combines corresponding routing rule, from these several and candidate's available service of matching of this service invocation request filter out target available service.
Preferably, when still there is multiple candidate's available service after routing rule screening, the second device 102 Stochastic choice candidate's available service, as target available service.
Subsequently, the address of service information of the target available service that this second device 102 is determined according to this, route determines the route visit information of this service invocation request about this target available service.
More preferably, described routing rule comprises following at least any one:
Based on the routing rule of service interface;
Based on the routing rule of method of servicing;
Based on the routing rule of the parameter value of service;
Based on the routing rule corresponding to the affiliated machine room of service.
Particularly, routing rule comprises the routing rule based on service interface.At this, the routing rule based on service interface is service call according to interface route to several fixing machines or several groups of machines.Such as, user wants to do interface level route test to service A, and the address list of A service is: 192.168.1.2,192.168.1.3.When controlling all service access A service, be all routed to 192.168.1.3, only need to register following content to file configuration center:
IP address wherein support regular expression (*,?), such as can be configured to 192.168.1.*.At this, if only want to mate some IP, need to add ": * " after this IP during configuration, ": the * " part as above in example in " 192.168.1.3:* " is necessary.If natively there is asterisk wildcard " * " at the end of IP address, as 192.168.1.*, then without the need to adding again ": * ".
Routing rule also comprises the routing rule based on method of servicing.At this, the routing rule based on method of servicing is that the method for servicing that will call according to service invocation request screens candidate's available service, is routed to fixing several or several groups of machines.The same with the above-mentioned routing rule based on service interface, as user needs read and write abruption, existing 2 machines provide the read and write method of same service, and user thinks that 1 machine is used as the service of reading, 1 machine is used as the service of writing, and only needs to register following content to file configuration center:
Routing rule also comprises the routing rule of the parameter value based on service.At this, the routing rule based on the parameter value of service is the actual value that service call imports into according to parameter, is routed to several fixing machines or several groups of machines.User wants to do parameter rank route test to service A, and the address list of A service is: 192.168.1.2,192.168.1.3.Control all service access A when serving, if (such as, import integer into when parameter and be greater than 10 to a few machines, be less than 10 to another several machines) when certain parameter is greater than certain rule in method, be routed on different group machine.Only need to register following content to file registration center:
Routing rule also comprises based on the routing rule corresponding to the affiliated machine room of service.Preferably, when the available proportion threshold value of satisfied service, the preferential routing rule of local machine room is enabled.Because the cost across machine room is general larger, therefore, can preferentially enable local machine room.But because some services is unbalanced in the deployment of machine room, even do not dispose at some machine room, therefore, can not call with without exception full forbidding across machine room, calling across machine room is needs under certain conditions at all.The judgement carrying out weighing can be coordinated by local machine room is regular flexibly.At this, serve available proportion threshold value and be used for judging whether preferentially to enable local machine room, its value can be system intialization, also can adjust according to actual conditions.The available proportion threshold value of this service specifies in this routing rule certain service, whether enables the strategy that local machine room preferentially calls, and when enabling strategy, the threshold values that strategy really can come into force.It is defined as follows:
<flowControl>
<localPreferredSwitch>on</localPreferredSwitch>
<threshold>0.2</threshold>
</flowControl>
Above Rule Expression, enable to configured service the strategy that local machine room preferentially calls, taking effect rules threshold values is 0.2.
Rules properties:
localPreferredSwitch:on|off
Threshold:float value
Exclusions: if expect that this rule only comes into force to a part of machine, can use this attribute configuration to need the IP got rid of, as: 172.24.*, will represent that this rule can not be applied to the IP of all 172.24 beginnings.
The computational methods of the available proportion threshold value of this service are: serve available ratio=local machine room available machines used quantity/all service-delivery machine quantity.
When serving available ratio and being more than or equal to the available proportion threshold value of this service, enable local machine room preference strategy.When serving available ratio and being less than the available proportion threshold value of this service, local machine room preference strategy is closed, and service still adopts the mode of random call.
Those skilled in the art will be understood that above-mentioned routing rule is only citing, and other routing rules that are existing or that may occur from now on, as being applicable to the application, also should being included within the application's protection range, and being contained in this at this with way of reference.
Preferably, according to the address of service information of service invocation request and described one or more available service, and combine corresponding routing rule, determine that described target available service comprises:
According to the address of service information of service invocation request and described one or more available service, and combine corresponding routing rule and the weight information of described routing rule, determine described target available service.
Particularly, combine corresponding routing rule at the second device 102, when determining target available service, also can consider the weight information of routing rule.Such as, the second device 102 according to service invocation request, and first device 101 the address of service information of one or more available service that obtains or upgrade, and combine corresponding routing rule and the weight information of this routing rule, determine this target available service.
At this, owing to increasing weight in routing rule.User sometimes wishes that the inside increases weight again in routing rule, as long as at this moment at the routing rule of correspondence, as increased weighted value in the routing rule based on service interface, the routing rule based on method of servicing or the IP address list based on the routing rule of the parameter value of service.Such as, in based on the routing rule of service interface, increase weight information, ratio is 1:3.Then should be as follows based on the routing rule reference of service interface:
Preferably, the routing rule of described correspondence comprises multinomial routing rule; Wherein, according to the address of service information of service invocation request and described one or more available service, and combine corresponding routing rule, determine that described target available service comprises:
According to the address of service information of service invocation request and described one or more available service, and combine corresponding routing rule and the granular information of described routing rule, determine described target available service.
Particularly, combine corresponding routing rule at the second device 102, when determining target available service, if this routing rule comprises multinomial routing rule, then this second device 102 also needs the granular information in conjunction with this multinomial routing rule, determines this target available service.Such as, the second device 102 according to service invocation request, and first device 101 the address of service information of one or more available service that obtains or upgrade, and combine corresponding routing rule and the granular information of this routing rule, determine this target available service.
Such as, suppose that routing rule comprises multinomial routing rule, as comprised the routing rule based on service interface, the routing rule based on method of servicing, the routing rule of parameter value based on service, then this second device 102 is according to the granular information of this multinomial routing rule, target available service is screened, as according to granular information order from small to large, target available service is screened, as, priority based on the routing rule of the parameter value of service is the highest, next is the routing rule based on method of servicing, is finally the routing rule based on service interface.
At this, after caller obtains all list of available addresses, one of them is selected to be directly the most general the simplest strategy by random device.But this kind of simple strategy cannot meet complicated demand, under some actual scene, need according to interface, method and parameter from can address list filter and select specific address list and call; Also weight selection can be carried out based on route to some machine; In addition for some high concurrent websites, have multiple machine room in the whole nation, the service call across machine room is common, needs certain strategy to avoid the delay across machine room for multimachine room.
Therefore, far call equipment 1 according to the address of service information of service invocation request and one or more available service, and combines corresponding routing rule, determines target available service; Or further, far call equipment 1, again in conjunction with the weight information of this routing rule, determines target available service; Or further, far call equipment 1, again in conjunction with the granular information of routing rule, determines target available service.
Preferably, this far call equipment 1 also comprises the 4th device (not shown).4th device obtains or upgrades the routing rule of described correspondence, for determining corresponding target available service.Particularly, the 4th device regularly or event of answering trigger ground, such as, from the file configuration corresponding to far call framework, download and administer by service the routing rule that platform generates, to realize acquisition to routing rule or renewal; When follow-up receive service invocation request again time, just can have more obtain or routing rule after upgrading, determine corresponding target available service.At this, determine that the mode of target available service is identical with previous embodiment or substantially identical, therefore repeat no more, and be contained in this with way of reference.
At this, at operation system initial phase, service framework, as HSF, the service route information that registered client's caller is relevant, once have new routing rule to issue or content variation, service framework will resolve up-to-date rule at once, exists side by side to carve and operationally comes into force.
Those skilled in the art will be understood that; the mode of above-mentioned acquisition or renewal routing rule is only citing; the mode of other acquisitions that are existing or that may occur from now on or renewal routing rule is as being applicable to the application; also should be included within the application's protection range, and be contained in this at this with way of reference.
Preferably, described second device 102 according to the address of service information of service invocation request and described one or more available service, and combines corresponding routing rule, determines the route visit information of described service invocation request about target available service.
Such as, the second device 102 according to service invocation request, and first device 101 the address of service information of one or more available service that obtains or upgrade, determine several candidate's available service, wherein, this candidate's available service and this service invocation request match; Subsequently, this second device 102 combines corresponding routing rule again, from these several and candidate's available service of matching of this service invocation request filter out target available service; And then the address of service information of the target available service that this second device 102 is determined according to this, route determines the route visit information of this service invocation request about this target available service.
Preferably, described available service comprises internal state initialization and completes and data and rely on service detection successful registration service.Particularly, this available service is registration service, and the internal state initialization of this registration service completes, and data and the service that relies on of this registration service have detected successfully.First device 101 is regular or answer event triggering ground, from the registrar corresponding to far call framework or address server, obtains or upgrade the address of service information of one or more available service.Such as, this first device 101, regularly from the registrar corresponding to far call framework, downloads the address of service information of registration service.
Fig. 2 illustrates the method flow diagram of a kind of remote invocation method according to another aspect of the application.
In step s 201, far call equipment 1 obtains the address of service information of one or more available service.Particularly, in step s 201, far call equipment 1 is regular or answer event triggering ground, from the registrar corresponding to far call framework or address server, obtain the address of service information of one or more available service, or only obtain the address of service information of the one or more available service after wherein upgrading.Such as, in step s 201, far call equipment 1, regularly from the registrar corresponding to far call framework, downloads the address of service information of registration service.
Those skilled in the art will be understood that; the mode of above-mentioned acquisition or renewal address of service information is only citing; the mode of other acquisitions that are existing or that may occur from now on or renewal address of service information is as being applicable to the application; also should be included within the application's protection range, and be contained in this at this with way of reference.
In step S202, far call equipment 1 determines the route visit information of described service invocation request about target available service according to service invocation request and described address of service information.Particularly, in step S202, far call equipment 1 determines that the mode of route visit information includes but not limited to:
1) in step S202, far call equipment 1 is first according to this service invocation request and the address of service information of one or more available service that obtains in step s 201 or upgrade, determine target available service, wherein, this target available service and this service invocation request match; Subsequently, in step S202, far call equipment 1 is again according to the address of service information of this target available service, and route determines the route visit information of this service invocation request about this target available service.
2) in step S202, first far call equipment 1 according to this service invocation request and the address of service information of one or more available service that obtains in step s 201 or upgrade, determine several candidate's route visit informations; Subsequently, in step S202, far call equipment 1 is again according to service invocation request, or further combined with routing rule, target available service is filtered out from these several candidate's route visit informations, and then, using the candidate's route visit information corresponding to this target available service as this route visit information.
Those skilled in the art will be understood that; above-mentionedly determine that the mode of route visit information is only citing; the mode of other determination route visit informations that are existing or that may occur from now on, as being applicable to the application, also should being included within the application's protection range, and being contained in this at this with way of reference.
In step S203, far call equipment 1 calls described target available service according to described route visit information.Particularly, in step S203, far call equipment 1 according to route visit information determined in step S202, this target available service of direct far call; Or in step S203, this service invocation request, according to this route visit information, is sent to this target available service by far call equipment 1, and by this this service invocation request of target available service process.
At this, if this service invocation request comprises service call parameter, then in step S203, far call equipment 1 can call this target available service according to being somebody's turn to do (s) service call parameter.
Those skilled in the art will be understood that; the mode of above-mentioned invocation target available service is only citing; the mode of other invocation target available service that are existing or that may occur from now on, as being applicable to the application, also should being included within the application's protection range, and being contained in this at this with way of reference.
At this, far call includes but not limited to based on such as HSF, RPC or RMI etc.At this, this remote invocation method works in the client calling remote service.
HSF (High-SpeedServiceFramework, high-speed service framework), be intended to for service application provides a distributed service framework, HSF from Distributed Application aspect and unified issue/method of calling aspect for everybody provides support, thus distributed application can be developed easily and provide or use common functional modules, and the various details technology in field of distributed type need not be considered, realization of such as telecommunication, performance loss, the transparence called, synchronous/asynchronous method of calling etc. problem.
RPC (RemoteProcedureCallProtocol, remote procedure call protocol), be a kind of by network from request service remote computer program, and do not need the agreement understanding underlying network technology.
RMI (RemoteMethodInvocation, RMI) is in Java programming language, a kind of application programming interface for realizing remote procedure call.It makes the program that client computer is run can call object on remote server.RMI characteristic enables Java programming personnel's distributed operation in a network environment.The aim of RMI is the use simplifying remote interface object as far as possible.
Preferably, be constant work between each step of far call equipment 1.Particularly, in step s 201, far call equipment 1 obtains or upgrades the address of service information of one or more available service; In step S202, far call equipment 1 determines the route visit information of described service invocation request about target available service according to the address of service information of service invocation request and described one or more available service; In step S203, far call equipment 1 calls described target available service according to described route visit information.At this, it will be understood by those skilled in the art that each step that " continuing " refer to far call equipment 1 respectively according to setting or the mode of operation requirement of adjustment in real time, obtain or upgrade address of service information, determine route visit information and invocation target available service.
At this, far call equipment 1 is by obtaining or upgrade the address of service information of one or more available service, address of service information according to service invocation request and this one or more available service determines the route visit information of described service invocation request about target available service, and then calls this target available service according to this route visit information.Far call equipment 1 is by determining that the route visit information of target available service directly calls this target available service, do not need the load-balanced server of pile warp transfer, not only avoid the Single Point of Faliure that load-balanced server causes, decrease network transfer, improve service response performance.
Preferably, in step S202, far call equipment 1 is according to the address of service information determination target available service of service invocation request and described one or more available service, and wherein, described target available service and described service invocation request match; The route visit information of described service invocation request about described target available service is determined according to the address of service information router of described target available service.
Such as, in step S202, far call equipment 1 according to service invocation request, and in step s 201 the address of service information of one or more available service that obtains or upgrade, determine to match with this service invocation request target available service; Subsequently; in step S202; far call equipment 1 is according to the address of service information of this target available service; route determines the route visit information of this service invocation request about this target available service; as according to service call client the route information table protected; the down hop of the address of service going to this target available service is determined in inquiry, namely corresponding route visit information.
At this, service invocation request generally includes the relevant information for mating target available service, and such as, service invocation request is the service of request call log query.
Preferably, comprise according to the address of service information determination target available service of service invocation request and described one or more available service:
According to the address of service information of service invocation request and described one or more available service, and combine corresponding routing rule, determine described target available service.
Particularly, in step S202, far call equipment 1 is according to service invocation request, and in step s 201 the address of service information of one or more available service that obtains or upgrade, determine several candidate's available service, wherein, this candidate's available service and this service invocation request match; Subsequently, in step S202, far call equipment 1 combines corresponding routing rule, from these several and candidate's available service of matching of this service invocation request filter out target available service.
Preferably, when still there is multiple candidate's available service after routing rule screening, in step S202, far call equipment 1 Stochastic choice candidate's available service, as target available service.
Subsequently, in step S202, the address of service information of the target available service that far call equipment 1 is determined according to this, route determines the route visit information of this service invocation request about this target available service.
More preferably, described routing rule comprises following at least any one:
Based on the routing rule of service interface;
Based on the routing rule of method of servicing;
Based on the routing rule of the parameter value of service;
Based on the routing rule corresponding to the affiliated machine room of service.
Particularly, routing rule comprises the routing rule based on service interface.At this, the routing rule based on service interface is service call according to interface route to several fixing machines or several groups of machines.Such as, user wants to do interface level route test to service A, and the address list of A service is: 192.168.1.2,192.168.1.3.When controlling all service access A service, be all routed to 192.168.1.3, only need to register following content to file configuration center:
IP address wherein support regular expression (*,?), such as can be configured to 192.168.1.*.At this, if only want to mate some IP, need to add ": * " after this IP during configuration, ": the * " part as above in example in " 192.168.1.3:* " is necessary.If natively there is asterisk wildcard " * " at the end of IP address, as 192.168.1.*, then without the need to adding again ": * ".
Routing rule also comprises the routing rule based on method of servicing.At this, the routing rule based on method of servicing is that the method for servicing that will call according to service invocation request screens candidate's available service, is routed to fixing several or several groups of machines.The same with the above-mentioned routing rule based on service interface, as user needs read and write abruption, existing 2 machines provide the read and write method of same service, and user thinks that 1 machine is used as the service of reading, 1 machine is used as the service of writing, and only needs to register following content to file configuration center:
Routing rule also comprises the routing rule of the parameter value based on service.At this, the routing rule based on the parameter value of service is the actual value that service call imports into according to parameter, is routed to several fixing machines or several groups of machines.User wants to do parameter rank route test to service A, and the address list of A service is: 192.168.1.2,192.168.1.3.Control all service access A when serving, if (such as, import integer into when parameter and be greater than 10 to a few machines, be less than 10 to another several machines) when certain parameter is greater than certain rule in method, be routed on different group machine.Only need to register following content to file registration center:
Routing rule also comprises based on the routing rule corresponding to the affiliated machine room of service.Preferably, when the available proportion threshold value of satisfied service, the preferential routing rule of local machine room is enabled.Because the cost across machine room is general larger, therefore, can preferentially enable local machine room.But because some services is unbalanced in the deployment of machine room, even do not dispose at some machine room, therefore, can not call with without exception full forbidding across machine room, calling across machine room is needs under certain conditions at all.The judgement carrying out weighing can be coordinated by local machine room is regular flexibly.At this, serve available proportion threshold value and be used for judging whether preferentially to enable local machine room, its value can be system intialization, also can adjust according to actual conditions.The available proportion threshold value of this service specifies in this routing rule certain service, whether enables the strategy that local machine room preferentially calls, and when enabling strategy, the threshold values that strategy really can come into force.It is defined as follows:
<flowControl>
<localPreferredSwitch>on</localPreferredSwitch>
<threshold>0.2</threshold>
</flowControl>
Above Rule Expression, enable to configured service the strategy that local machine room preferentially calls, taking effect rules threshold values is 0.2.
Rules properties:
localPreferredSwitch:on|off
Threshold:float value
Exclusions: if expect that this rule only comes into force to a part of machine, can use this attribute configuration to need the IP got rid of, as: 172.24.*, will represent that this rule can not be applied to the IP of all 172.24 beginnings.
The computational methods of the available proportion threshold value of this service are: serve available ratio=local machine room available machines used quantity/all service-delivery machine quantity.
When serving available ratio and being more than or equal to the available proportion threshold value of this service, enable local machine room preference strategy.When serving available ratio and being less than the available proportion threshold value of this service, local machine room preference strategy is closed, and service still adopts the mode of random call.
Those skilled in the art will be understood that above-mentioned routing rule is only citing, and other routing rules that are existing or that may occur from now on, as being applicable to the application, also should being included within the application's protection range, and being contained in this at this with way of reference.
Preferably, according to the address of service information of service invocation request and described one or more available service, and combine corresponding routing rule, determine that described target available service comprises:
According to the address of service information of service invocation request and described one or more available service, and combine corresponding routing rule and the weight information of described routing rule, determine described target available service.
Particularly, in step S202, far call equipment 1 combines corresponding routing rule, when determining target available service, also can consider the weight information of routing rule.Such as, in step S202, far call equipment 1 according to service invocation request, and in step s 201 the address of service information of one or more available service that obtains or upgrade, and combine corresponding routing rule and the weight information of this routing rule, determine this target available service.
At this, owing to increasing weight in routing rule.User sometimes wishes that the inside increases weight again in routing rule, as long as at this moment at the routing rule of correspondence, as increased weighted value in the routing rule based on service interface, the routing rule based on method of servicing or the IP address list based on the routing rule of the parameter value of service.Such as, in based on the routing rule of service interface, increase weight information, ratio is 1:3.Then should be as follows based on the routing rule reference of service interface:
Preferably, the routing rule of described correspondence comprises multinomial routing rule; Wherein, according to the address of service information of service invocation request and described one or more available service, and combine corresponding routing rule, determine that described target available service comprises:
According to the address of service information of service invocation request and described one or more available service, and combine corresponding routing rule and the granular information of described routing rule, determine described target available service.
Particularly, in step S202, far call equipment 1 combines corresponding routing rule, when determining target available service, if this routing rule comprises multinomial routing rule, then in step S202, far call equipment 1 also needs the granular information in conjunction with this multinomial routing rule, determines this target available service.Such as, in step S202, far call equipment 1 according to service invocation request, and in step s 201 the address of service information of one or more available service that obtains or upgrade, and combine corresponding routing rule and the granular information of this routing rule, determine this target available service.
Such as, suppose that routing rule comprises multinomial routing rule, as comprised the routing rule based on service interface, based on the routing rule of method of servicing, based on the routing rule of the parameter value of service, then in step S202, far call equipment 1 is according to the granular information of this multinomial routing rule, target available service is screened, as according to granular information order from small to large, target available service is screened, as, priority based on the routing rule of the parameter value of service is the highest, next is the routing rule based on method of servicing, it is finally the routing rule based on service interface.
At this, after caller obtains all list of available addresses, one of them is selected to be directly the most general the simplest strategy by random device.But this kind of simple strategy cannot meet complicated demand, under some actual scene, need according to interface, method and parameter from can address list filter and select specific address list and call; Also weight selection can be carried out based on route to some machine; In addition for some high concurrent websites, have multiple machine room in the whole nation, the service call across machine room is common, needs certain strategy to avoid the delay across machine room for multimachine room.
Therefore, far call equipment 1 according to the address of service information of service invocation request and one or more available service, and combines corresponding routing rule, determines target available service; Or further, far call equipment 1, again in conjunction with the weight information of this routing rule, determines target available service; Or further, far call equipment 1, again in conjunction with the granular information of routing rule, determines target available service.
Preferably, the method also comprises step S204 (not shown).In step S204, far call equipment 1 obtains or upgrades the routing rule of described correspondence, for determining corresponding target available service.Particularly, in step S204, far call equipment 1 regularly or event of answering trigger ground, such as, from the file configuration corresponding to far call framework, download and administer by service the routing rule that platform generates, to realize acquisition to routing rule or renewal; When follow-up receive service invocation request again time, just can have more obtain or routing rule after upgrading, determine corresponding target available service.At this, determine that the mode of target available service is identical with previous embodiment or substantially identical, therefore repeat no more, and be contained in this with way of reference.
At this, at operation system initial phase, service framework, as HSF, the service route information that registered client's caller is relevant, once have new routing rule to issue or content variation, service framework will resolve up-to-date rule at once, exists side by side to carve and operationally comes into force.
Those skilled in the art will be understood that; the mode of above-mentioned acquisition or renewal routing rule is only citing; the mode of other acquisitions that are existing or that may occur from now on or renewal routing rule is as being applicable to the application; also should be included within the application's protection range, and be contained in this at this with way of reference.
Preferably, in step S202, far call equipment 1 according to the address of service information of service invocation request and described one or more available service, and combines corresponding routing rule, determines the route visit information of described service invocation request about target available service.
Such as, in step S202, far call equipment 1 is according to service invocation request, and in step s 201 the address of service information of one or more available service that obtains or upgrade, determine several candidate's available service, wherein, this candidate's available service and this service invocation request match; Subsequently, in step S202, far call equipment 1 combines corresponding routing rule again, from these several and candidate's available service of matching of this service invocation request filter out target available service; And then in step S202, the address of service information of the target available service that far call equipment 1 is determined according to this, route determines the route visit information of this service invocation request about this target available service.
Preferably, described available service comprises internal state initialization and completes and data and rely on service detection successful registration service.Particularly, this available service is registration service, and the internal state initialization of this registration service completes, and data and the service that relies on of this registration service have detected successfully.In step s 201, far call equipment 1 is regular or answer event triggering ground, from the registrar corresponding to far call framework or address server, obtains or upgrade the address of service information of one or more available service.Such as, in step s 201, far call equipment 1, regularly from the registrar corresponding to far call framework, downloads the address of service information of registration service.
It should be noted that the application can be implemented in the assembly of software and/or software restraint, such as, application-specific integrated circuit (ASIC) (ASIC), general object computer or any other similar hardware device can be adopted to realize.In one embodiment, the software program of the application can perform to realize step mentioned above or function by processor.Similarly, the software program of the application can be stored in computer readable recording medium storing program for performing (comprising relevant data structure), such as, and RAM memory, magnetic or CD-ROM driver or floppy disc and similar devices.In addition, some steps of the application or function can adopt hardware to realize, such as, as coordinating with processor thus performing the circuit of each step or function.
In addition, a application's part can be applied to computer program, such as computer program instructions, when it is performed by computer, by the operation of this computer, can call or provide the method according to the application and/or technical scheme.And call the program command of the method for the application, may be stored in fixing or moveable recording medium, and/or be transmitted by the data flow in broadcast or other signal bearing medias, and/or be stored in the working storage of the computer equipment run according to described program command.At this, an embodiment according to the application comprises a device, this device comprises the memory for storing computer program instructions and the processor for execution of program instructions, wherein, when this computer program instructions is performed by this processor, trigger this plant running based on the method for aforementioned multiple embodiments according to the application and/or technical scheme.
To those skilled in the art, obvious the application is not limited to the details of above-mentioned one exemplary embodiment, and when not deviating from spirit or the essential characteristic of the application, can realize the application in other specific forms.Therefore, no matter from which point, all should embodiment be regarded as exemplary, and be nonrestrictive, the scope of the application is limited by claims instead of above-mentioned explanation, and all changes be therefore intended in the implication of the equivalency by dropping on claim and scope are included in the application.Any Reference numeral in claim should be considered as the claim involved by limiting.In addition, obviously " comprising " one word do not get rid of other unit or step, odd number does not get rid of plural number.Multiple unit of stating in device claim or device also can be realized by software or hardware by a unit or device.First, second word such as grade is used for representing title, and does not represent any specific order.