CN105357233A - Remote call method and device - Google Patents

Remote call method and device Download PDF

Info

Publication number
CN105357233A
CN105357233A CN201410406008.8A CN201410406008A CN105357233A CN 105357233 A CN105357233 A CN 105357233A CN 201410406008 A CN201410406008 A CN 201410406008A CN 105357233 A CN105357233 A CN 105357233A
Authority
CN
China
Prior art keywords
service
routing rule
information
target available
invocation request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410406008.8A
Other languages
Chinese (zh)
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201410406008.8A priority Critical patent/CN105357233A/en
Publication of CN105357233A publication Critical patent/CN105357233A/en
Pending legal-status Critical Current

Links

Abstract

An object of the application is to provide a remote call method and device. The method includes the following steps: acquiring or upgrading service address information of one or a plurality of available services; determining route access information of a target available service about a service call request according to the service call request and the service address information; calling the target available service according to the route access information. Compared with the prior art, the remote call method and device overcomes the technical defect that a third part device such as an intermediate server (eg. load balancing server ) is used to schedule the service call request to achieve load balancing; the route access information about the target service can be determined via a service request terminal to achieve load balancing without the third part device; the load balancing server for transit cannot be required, so that a single point of failure caused by the load balancing server can be avoided, network transit can be reduced, and the service response performance can be improved.

Description

A kind of remote invocation method and equipment
Technical field
The application relates to computer realm, particularly relates to a kind of far call technology.
Background technology
When application is moved towards the service process of the distributed system of across a network from centralized one-of-a-kind system, one of key issue how to determine and to call remote service.At present mainly through setting up the remote service call request that oolemma load-balanced server (as hardware F5 or software Linux virtual server LVS, reverse proxy HAProxy etc.) carrys out proxy call client pellucidly calling between client and service providing end, and determine that corresponding service providing end is to respond this request.
But, in such scheme, all request/response are all through load-balanced server, along with the increase of business, the pressure of load balancing can increase, this load-balanced server becomes fault single-point possibly, and this will cause a large amount of far call to complete, thus influential system service function realizes and user's experience.
Summary of the invention
The object of the application is to provide a kind of remote invocation method and equipment.
According to an aspect of the application, provide a kind of remote invocation method, comprising:
Obtain or upgrade the address of service information of one or more available service;
The route visit information of described service invocation request about target available service is determined according to service invocation request and described address of service information;
Described target available service is called according to described route visit information.
According to the another aspect of the application, additionally provide a kind of far call equipment, comprising:
First device, for obtaining or upgrade the address of service information of one or more available service;
Second device, for determining the route visit information of described service invocation request about target available service according to service invocation request and described address of service information;
3rd device, for calling described target available service according to described route visit information.
Compared with prior art, the application is by obtaining or upgrade the address of service information of one or more available service, determine the route visit information of described service invocation request about target available service according to service invocation request and address of service information, and then call this target available service according to this route visit information.The application overcomes and must carry out dispatch service call request via third party devices such as intermediate servers (as load-balanced server) thus realize the technology prejudice of load balancing, the application has abandoned third party device, but directly determines to realize load balancing about the route visit information of destination service by service request terminal; And, 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.
Further, the application can also realize more accurate far call load balancing, such as, the application can 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, for the delay that multimachine room is avoided across machine room by certain strategy.
Accompanying drawing explanation
By reading the detailed description done non-limiting example done with reference to the following drawings, the other features, objects and advantages of the application will become more obvious:
Fig. 1 illustrates the equipment schematic diagram of a kind of far call equipment according to the application aspect;
Fig. 2 illustrates the method flow diagram of a kind of remote invocation method according to another aspect of the application.
In accompanying drawing, same or analogous Reference numeral represents same or analogous parts.
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.

Claims (18)

1. a remote invocation method, comprising:
Obtain the address of service information of one or more available service;
The route visit information of described service invocation request about target available service is determined according to service invocation request and described address of service information;
Described target available service is called according to described route visit information.
2. method according to claim 1, wherein, describedly determine that described service invocation request comprises about the route visit information of target available service according to service invocation request and described address of service information:
According to service invocation request and described address of service information determination target available service, 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.
3. method according to claim 1 and 2, wherein, describedly determine that target available service comprises:
According to service invocation request and described address of service information, and combine corresponding routing rule, determine described target available service.
4. method according to claim 3, wherein, 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.
5. method according to claim 3, wherein, describedly determine that target available service comprises:
According to service invocation request and described address of service information, and combine corresponding routing rule and the weight information of described routing rule, determine described target available service.
6. method according to claim 3, wherein, the routing rule of described correspondence comprises multinomial routing rule;
Wherein, describedly determine that target available service comprises:
According to service invocation request and described address of service information, and combine corresponding routing rule and the granular information of described routing rule, determine described target available service.
7. method according to claim 3, wherein, the method also comprises:
Obtain or upgrade the routing rule of described correspondence, for determining corresponding target available service.
8. method according to any one of claim 1 to 7, wherein, describedly determine that described service invocation request comprises about the route visit information of target available service according to service invocation request and described address of service information:
According to service invocation request and institute's address of service information, and combine corresponding routing rule, determine the route visit information of described service invocation request about target available service.
9. method according to any one of claim 1 to 8, wherein, described available service comprises internal state initialization and completes and data and the successful registration service of dependence service detection.
10. a far call equipment, comprising:
First device, for obtaining the address of service information of one or more available service;
Second device, for determining the route visit information of described service invocation request about target available service according to service invocation request and described address of service information;
3rd device, for calling described target available service according to described route visit information.
11. equipment according to claim 10, wherein, described second device is used for:
According to service invocation request and described address of service information determination target available service, 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.
12. equipment according to claim 10 or 11, wherein, describedly determine that target available service comprises:
According to service invocation request and described address of service information, and combine corresponding routing rule, determine described target available service.
13. equipment according to claim 12, wherein, 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.
14. equipment according to claim 12, wherein, describedly determine that target available service comprises:
According to service invocation request and described address of service information, and combine corresponding routing rule and the weight information of described routing rule, determine described target available service.
15. equipment according to claim 12, wherein, the routing rule of described correspondence comprises multinomial routing rule;
Wherein, describedly determine that target available service comprises:
According to service invocation request and described address of service information, and combine corresponding routing rule and the granular information of described routing rule, determine described target available service.
16. equipment according to claim 12, wherein, this equipment also comprises:
4th device, for obtaining or upgrade the routing rule of described correspondence, for determining corresponding target available service.
17. according to claim 10 to the equipment according to any one of 16, and wherein, described second device is used for:
According to service invocation request and described address of service information, and combine corresponding routing rule, determine the route visit information of described service invocation request about target available service.
18. according to claim 10 to the equipment according to any one of 17, and wherein, described available service comprises internal state initialization and completes and data and the successful registration service of dependence service detection.
CN201410406008.8A 2014-08-18 2014-08-18 Remote call method and device Pending CN105357233A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410406008.8A CN105357233A (en) 2014-08-18 2014-08-18 Remote call method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410406008.8A CN105357233A (en) 2014-08-18 2014-08-18 Remote call method and device

Publications (1)

Publication Number Publication Date
CN105357233A true CN105357233A (en) 2016-02-24

Family

ID=55333095

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410406008.8A Pending CN105357233A (en) 2014-08-18 2014-08-18 Remote call method and device

Country Status (1)

Country Link
CN (1) CN105357233A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107196954A (en) * 2017-06-15 2017-09-22 网宿科技股份有限公司 A kind of service access method, apparatus and system
CN108810166A (en) * 2018-07-11 2018-11-13 深圳市小牛在线互联网信息咨询有限公司 Route management method, system, computer equipment and computer readable storage medium
CN109327503A (en) * 2018-08-27 2019-02-12 珠海格力电器股份有限公司 Information management system and method, service router
CN109791482A (en) * 2016-07-22 2019-05-21 思科技术公司 Scalable service is found in micro services environment
CN109951528A (en) * 2019-02-21 2019-06-28 中国工商银行股份有限公司 Support method for processing business, the apparatus and system of more deployment modes
CN110557357A (en) * 2018-05-31 2019-12-10 华为技术有限公司 remote procedure call protocol self-adaption method, related device and server
CN112698970A (en) * 2020-12-31 2021-04-23 北京千方科技股份有限公司 Service calling method and device for micro-service architecture and computer storage medium
CN113055421A (en) * 2019-12-27 2021-06-29 南京亚信软件有限公司 Service grid management method and system
CN113765870A (en) * 2020-09-01 2021-12-07 北京沃东天骏信息技术有限公司 Remote service calling method, device and system
CN114726787A (en) * 2022-04-11 2022-07-08 阿里巴巴(中国)有限公司 Routing method and system applied to RPC framework
US11412053B2 (en) 2016-07-22 2022-08-09 Cisco Technology, Inc. Scaling service discovery in a micro-service environment
CN116112560A (en) * 2023-04-10 2023-05-12 广东电网有限责任公司佛山供电局 Data uplink and proxy method and system based on Reactive mechanism

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109791482B (en) * 2016-07-22 2022-06-21 思科技术公司 Method and apparatus for scaling service discovery in a microservice environment
US11838376B2 (en) 2016-07-22 2023-12-05 Cisco Technology, Inc. Scaling service discovery in a micro-service environment
US11558478B2 (en) 2016-07-22 2023-01-17 Cisco Technology, Inc. Scaling service discovery in a micro-service environment
CN109791482A (en) * 2016-07-22 2019-05-21 思科技术公司 Scalable service is found in micro services environment
US11412053B2 (en) 2016-07-22 2022-08-09 Cisco Technology, Inc. Scaling service discovery in a micro-service environment
CN107196954A (en) * 2017-06-15 2017-09-22 网宿科技股份有限公司 A kind of service access method, apparatus and system
CN110557357A (en) * 2018-05-31 2019-12-10 华为技术有限公司 remote procedure call protocol self-adaption method, related device and server
CN110557357B (en) * 2018-05-31 2022-07-29 华为技术有限公司 Remote procedure call protocol self-adaption method, related device and server
CN108810166A (en) * 2018-07-11 2018-11-13 深圳市小牛在线互联网信息咨询有限公司 Route management method, system, computer equipment and computer readable storage medium
CN109327503A (en) * 2018-08-27 2019-02-12 珠海格力电器股份有限公司 Information management system and method, service router
CN109951528A (en) * 2019-02-21 2019-06-28 中国工商银行股份有限公司 Support method for processing business, the apparatus and system of more deployment modes
CN113055421B (en) * 2019-12-27 2022-06-21 南京亚信软件有限公司 Service grid management method and system
CN113055421A (en) * 2019-12-27 2021-06-29 南京亚信软件有限公司 Service grid management method and system
CN113765870B (en) * 2020-09-01 2023-09-05 北京沃东天骏信息技术有限公司 Remote service calling method, device and system
CN113765870A (en) * 2020-09-01 2021-12-07 北京沃东天骏信息技术有限公司 Remote service calling method, device and system
CN112698970A (en) * 2020-12-31 2021-04-23 北京千方科技股份有限公司 Service calling method and device for micro-service architecture and computer storage medium
CN114726787B (en) * 2022-04-11 2023-08-25 阿里巴巴(中国)有限公司 Routing method and system applied to RPC framework
CN114726787A (en) * 2022-04-11 2022-07-08 阿里巴巴(中国)有限公司 Routing method and system applied to RPC framework
CN116112560B (en) * 2023-04-10 2023-06-30 广东电网有限责任公司佛山供电局 Data uplink and proxy method and system based on Reactive mechanism
CN116112560A (en) * 2023-04-10 2023-05-12 广东电网有限责任公司佛山供电局 Data uplink and proxy method and system based on Reactive mechanism

Similar Documents

Publication Publication Date Title
CN105357233A (en) Remote call method and device
CN108028853B (en) System, method, and medium for customizable event-triggered computation at edge locations
US11586673B2 (en) Data writing and reading method and apparatus, and cloud storage system
US10360199B2 (en) Partitioning and rebalancing data storage
US20190386956A1 (en) Dynamically opening ports for trusted application processes hosted in containers
US20120173486A1 (en) System and method for dynamically selecting storage locations of replicas in cloud storage system
US20160179840A1 (en) Cloud bursting a database
CN104216724A (en) Method and system for updating network application program interface
US11489814B1 (en) Customized domain name resolution for virtual private clouds
CN105045762A (en) Management method and apparatus for configuration file
CN107888717A (en) A kind of domain name determines method, apparatus and electronic equipment
CA3058061A1 (en) Permission processing method, device, application side device and storage media
CN111556135A (en) Request scheduling method, system and device and electronic equipment
CN113676511A (en) Cloud storage method, system, equipment and storage medium
CN113315848A (en) Access control method, device and equipment
US11803621B1 (en) Permissions searching by scenario
US11303606B1 (en) Hashing name resolution requests according to an identified routing policy
CN114885024B (en) Routing method, device, equipment and medium of application instance
CN115174158B (en) Cloud product configuration checking method based on multi-cloud management platform
CN106202397A (en) A kind of method of data synchronization and device
CN114500221B (en) Cloud system, public cloud management and control method, public cloud management and control equipment and storage medium
CN115914404A (en) Cluster flow management method and device, computer equipment and storage medium
CN107453950A (en) A kind of information processing method and monitoring system
CN114513535A (en) Data transmission system, method, device and equipment
CN113366813A (en) Network peer discovery system and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160224

RJ01 Rejection of invention patent application after publication