CN109542641A - Service calling method, apparatus and system - Google Patents
Service calling method, apparatus and system Download PDFInfo
- Publication number
- CN109542641A CN109542641A CN201811353235.3A CN201811353235A CN109542641A CN 109542641 A CN109542641 A CN 109542641A CN 201811353235 A CN201811353235 A CN 201811353235A CN 109542641 A CN109542641 A CN 109542641A
- Authority
- CN
- China
- Prior art keywords
- service
- address list
- service provider
- address
- destination
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
Abstract
The present invention provides a kind of service calling method, apparatus and system, this method, comprising: the service identifiers according to corresponding to destination service determine fragment address list corresponding with the destination service;Service provider corresponding to each address in the fragment address list is used to provide the described destination service, and every corresponding fragment address list of a kind of service identifiers;A destination service provider is selected from the fragment address list based on load-balancing algorithm;Service invocation request is sent to the destination service provider.So as to shorten the calling link of service request, the calling efficiency of service request is promoted.
Description
Technical field
The present invention relates to network technique field more particularly to a kind of service calling methods, apparatus and system.
Background technique
With the development of internet technology, the scale of website application is also constantly expanding.In order to meet growing clothes
Business demand, engineers propose the schemes such as Distributed Services framework, flowing computing architecture.
Dubbo is a distributed service framework, applies far call agreement (Remote Procedure Call
Protocol, RPC) realize remote service calling and service management.The core of Dubbo includes the function of three aspects: 1)
It provides abstract to a variety of non-block type input and output (Non-blocking Input Output, NIO) frames based on long connection
Encapsulation, including a variety of threading models, serializing, and the information exchange system of " request-response " mode;2) it provides and is based on interface
The transparent remote invocation of procedure of method, including multi protocol supporting and soft load balancing, failure is fault-tolerant, and address routing is dynamically matched
Equal clusters are set to support;3) it is based on registration center's directory service, makes the lookup service provider of service consumer dynamic, makes address
It is transparent, so that service provider is smoothly increased or decreased machine.
But apply Dubbo when using the e-commerce system of same set of service code, since Dubbo can only be into
Row unified plan, therefore the framework of e-commerce system can be made more complicated, the service request that service consumer is initiated needs
Service provider can be just found by very long calling link, calls inefficiency.When the operation system of service provider occurs
When abnormal, the feedback of operation system where the e-commerce system of unified plan can wait always the service provider, to lead
Overstocking for service request is caused, or even the case where e-commerce system delay machine occurs.
Summary of the invention
The present invention provides a kind of service calling method, apparatus and system, to shorten the calling link of service request, promotes clothes
The calling efficiency of business request.
In a first aspect, the embodiment of the present invention provides a kind of service calling method, comprising:
The service identifiers according to corresponding to destination service determine fragment address list corresponding with the destination service;Institute
It states service provider corresponding to each address in fragment address list and is used to provide the described destination service, and every a kind of service
Identify a corresponding fragment address list;
A destination service provider is selected from the fragment address list based on load-balancing algorithm;
Service invocation request is sent to the destination service provider.
Optionally, in the service identifiers according to corresponding to destination service, with determining fragment corresponding with the destination service
Before the list of location, further includes:
Receive the address list that registration center sends;Wherein, registered service is stored in the address list to provide
Address corresponding to side;Address in the address list is that the service identifiers sent according to service provider in registration carry out
Classification storage.
Optionally, before receiving the address list that registration center sends, further includes:
Service subscription request is sent to registration center, includes corresponding to the destination service in the service subscription request
Service identifiers.
Optionally, further includes:
Receive the updated address list that registration center sends.
Optionally, after sending service invocation request to the destination service provider, further includes:
Receive the response signal of the destination service provider feedback;
If within a preset time period, not receiving the response signal of the destination service provider feedback, then from described
A service provider is reselected in fragment address list as new destination service provider;
Service invocation request is sent to the new destination service provider.
Second aspect, the embodiment of the present invention provide a kind of service calling method, comprising:
Receive the service invocation request that service consumer is sent;
If agreeing to the service invocation request, within a preset time period, the response of Xiang Suoshu service consumer feedback
Signal.
Optionally, before receiving the service invocation request that service consumer is sent, further includes:
Send service registration request to registration center, include service identifiers in the service registration request, and with institute
State the address of the corresponding service provider of service identifiers.
The third aspect, the embodiment of the present invention provide a kind of service calling method, comprising:
Receive the service subscription request that service consumer is sent;
Address list is sent to the service consumer, wherein is stored with registered service in the address list and is mentioned
Address corresponding to supplier;Address in the address list be according to service provider in registration the service identifiers that send into
Row classification storage;Every corresponding fragment address list of one kind service identifiers.
Optionally, further includes:
The service registration request that service provider is sent is received, includes service identifiers in the service registration request, with
And the address of service provider corresponding with the service identifiers.
Optionally, further includes:
The updated address list sent to service consumer.
Fourth aspect, the embodiment of the present invention provide a kind of service call device, comprising:
Determining module determines corresponding with the destination service point for the service identifiers according to corresponding to destination service
Piece address list;Service provider corresponding to each address in the fragment address list is used to provide the described target clothes
Business, and every corresponding fragment address list of a kind of service identifiers;
Selecting module, for selecting a destination service to provide from the fragment address list based on load-balancing algorithm
Side;
Sending module, for sending service invocation request to the destination service provider.
Optionally, further includes:
Receiving module, in the service identifiers according to corresponding to destination service, determination to be corresponding with the destination service
Before fragment address list, the address list that registration center sends is received;Wherein, it is stored in the address list registered
Address corresponding to service provider;Address in the address list is the service sent according to service provider in registration
Mark carries out classification storage.
Optionally, the sending module is also used to before receiving the address list that registration center sends, to registration center
Service subscription request is sent, includes service identifiers corresponding to the destination service in the service subscription request.
Optionally, the receiving module, is also used to:
Receive the updated address list that registration center sends.
Optionally, the selecting module is also used to after sending service invocation request to the destination service provider,
Receive the response signal of the destination service provider feedback;
If within a preset time period, not receiving the response signal of the destination service provider feedback, then from described
A service provider is reselected in fragment address list as new destination service provider;
Service invocation request is sent to the new destination service provider.
5th aspect, the embodiment of the present invention provide a kind of service call device, comprising:
Receiving module, for receiving the service invocation request of service consumer transmission;
Feedback module is used for when agreeing to the service invocation request, within a preset time period, Xiang Suoshu service consumption
The response signal just fed back.
Optionally, further includes:
Sending module, for sending and taking to registration center before receiving the service invocation request that service consumer is sent
It is engaged in registration request, includes service identifiers in the service registration request, and service corresponding with service identifiers offer
The address of side.
6th aspect, the embodiment of the present invention provide a kind of service call device, comprising:
Receiving module, for receiving the service subscription request of service consumer transmission;
Sending module, for sending address list to the service consumer, wherein be stored in the address list
Address corresponding to the service provider of registration;Address in the address list is according to service provider transmission in registration
Service identifiers carry out classification storage;Every corresponding fragment address list of one kind service identifiers.
Optionally, the receiving module is also used to receive the service registration request of service provider transmission, the service note
It include service identifiers in volume request, and the address of service provider corresponding with the service identifiers.
Optionally, the sending module, is also used to:
The updated address list sent to service consumer.
7th aspect, the embodiment of the present invention provide a kind of service calling system, comprising:
Memory, for storing program;
Processor, for executing the described program of memory storage, when described program is performed, the processor
For executing the method as described in any one of first aspect, second aspect, the third aspect.
Eighth aspect, the embodiment of the present invention provide a kind of computer readable storage medium, comprising: computer program, when it
When running on computers, so that computer executes any method in first aspect and second aspect, the third aspect.
Service calling method provided by the invention, apparatus and system, by the service identifiers according to corresponding to destination service,
Determine fragment address list corresponding with the destination service;Service corresponding to each address in the fragment address list
Provider is used to provide the described destination service, and every corresponding fragment address list of a kind of service identifiers;Based on load balancing
Algorithm selects a destination service provider from the fragment address list;Service is sent to the destination service provider to adjust
With request.So as to shorten the calling link of service request, the calling efficiency of service request is promoted.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair
Bright some embodiments for those of ordinary skill in the art without any creative labor, can be with
It obtains other drawings based on these drawings.
Fig. 1 is the structural schematic diagram of existing distributed structure/architecture;
Fig. 2 is the flow chart for the service calling method that the embodiment of the present invention one provides;
Fig. 3 is the flow chart of service calling method provided by Embodiment 2 of the present invention;
Fig. 4 is the flow chart for the service calling method that the embodiment of the present invention three provides;
Fig. 5 is the structural schematic diagram for the service call device that the embodiment of the present invention four provides;
Fig. 6 is the structural schematic diagram for the service call device that the embodiment of the present invention five provides;
Fig. 7 is the structural schematic diagram for the service call device that the embodiment of the present invention six provides;
Fig. 8 is the structural schematic diagram for the service calling system that the embodiment of the present invention seven provides.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Description and claims of this specification and term " first ", " second ", " third ", " in above-mentioned attached drawing
The (if present)s such as four " are to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should manage
The data that solution uses in this way are interchangeable under appropriate circumstances, so that the embodiment of the present invention described herein for example can be to remove
Sequence other than those of illustrating or describe herein is implemented.In addition, term " includes " and " having " and theirs is any
Deformation, it is intended that cover it is non-exclusive include, for example, containing the process, method of a series of steps or units, system, production
Product or equipment those of are not necessarily limited to be clearly listed step or unit, but may include be not clearly listed or for this
A little process, methods, the other step or units of product or equipment inherently.
Technical solution of the present invention is described in detail with specifically embodiment below.These specific implementations below
Example can be combined with each other, and the same or similar concept or process may be repeated no more in some embodiments.
Hereinafter, the part term in the application is explained, in order to those skilled in the art understand that:
1) Dubbo is a distributed service framework, applies far call agreement (Remote Procedure Call
Protocol, RPC) realize remote service calling and service management.5 node roles are contained in Dubbo framework: exposure service
Service provider (Provider), call the note of the service consumer (Consumer) of remote service, service register and discovery
Volume center (Registry), statistical fractals calling subharmonic allocating time monitoring center (Monitor), service operation container
(Container)。
Fig. 1 is the structural schematic diagram of existing distributed structure/architecture, as shown in Figure 1, the distributed structure/architecture includes: that service provides
Side 1, service consumer 2, registration center 3, monitoring center 4, service operation container 5, wherein service operation container 5 is for being responsible for
Starting, load, operation service provider 1;Service provider 1 on startup, the service oneself provided is registered to registration center 3;
Service consumer 2 on startup, to registration center 3 subscribe to oneself needed for service;Service consumer 2 is from service provider 1
In address list, a provider is selected to be called based on soft load-balancing algorithm, if malloc failure malloc, then another would be selected to mention
Supplier is called.Service consumer 2 and service provider add up call number and allocating time in memory, and according to pre-
It fixes time to be spaced and sends a statistical data to monitoring center 4.But above-mentioned distributed structure/architecture is applied and is using same set of industry
When the operation system of business code, since distributed structure/architecture can only carry out unified plan, so that the frame of e-commerce system can be made
Structure is more complicated, and the service request that service consumer is initiated needs just find service provider by very long calling link,
Call inefficiency.When the operation system of service provider occurs abnormal, the e-commerce system of unified plan can be waited always
To the feedback of operation system where the service provider, so as to cause overstocking for service request, or even there is e-commerce system
The case where delay machine.
Service calling method provided by the invention, it is intended to solve the technical problem as above of the prior art.
How to be solved with technical solution of the specifically embodiment to technical solution of the present invention and the application below above-mentioned
Technical problem is described in detail.These specific embodiments can be combined with each other below, for the same or similar concept
Or process may repeat no more in certain embodiments.Below in conjunction with attached drawing, the embodiment of the present invention is described.
Fig. 2 is the flow chart for the service calling method that the embodiment of the present invention one provides, as shown in Fig. 2, in the present embodiment
Method may include:
S101, the service identifiers according to corresponding to destination service determine fragment address column corresponding with the destination service
Table.
Optionally, in the service identifiers according to corresponding to destination service, with determining fragment corresponding with the destination service
Before the list of location, service consumption direction registration center sends service subscription request, includes described in the service subscription request
Service identifiers corresponding to destination service.
In the present embodiment, service provider corresponding to each address in the fragment address list is used to provide the described
Destination service, and every corresponding fragment address list of a kind of service identifiers.Registration center is receiving service consumption method hair
After the service subscription request sent, Xiang Suoshu service consumer sends address list;Wherein, it is stored in the address list
Address corresponding to the service provider of registration;Address in the address list is according to service provider transmission in registration
Service identifiers carry out classification storage.
Optionally, service consumer can also receive the updated address list that registration center sends in either phase.
Specifically, it is assumed that address list does not change, and simultaneously non-first time then takes service consumer to registration center's transmission service request
Business consumer can also find corresponding fragment address column according to service identifiers directly in previously received address list
Table.
S102, a destination service provider is selected from the fragment address list based on load-balancing algorithm.
In the present embodiment, the service provider in fragment address list can provide destination service to service consumer,
In order to balance the loading condition of each service provider servers, selected from the fragment address list using load-balancing algorithm
A service provider is selected to provide destination service.
Specifically, load-balancing algorithm may include: polling method, randomized, source address Hash method, weighted polling method, add
Weigh randomized, minimum even number method etc..Polling method refers to: request being alternately assigned on back-end server in order, it is
Each server for treating to weighing apparatus rear end, without concern for the actual connection number of server and current system load.Randomized
Refer to: by the random algorithm of system, a server therein is randomly selected according to the list size value of back-end server
It accesses.Source address Hash method refers to: according to the IP address for obtaining client, a number being calculated by hash function
Value, carries out modulo operation with size of the numerical value to server list, obtained result is that customer side will access server
Serial number.Using source address Hash method carry out load balancing, the client of same IP address, when back-end server list is constant,
It can be mapped to same back-end server every time and access.Weighted polling method refers to: different back-end servers may
The configuration of machine and the load of current system be not identical, therefore their anti-pressure ability is not also identical, therefore, can be to configuration
The machine high, load is low configures higher weight, its processing is allowed more to ask;And with setting low, loading high machine, give its distribution
Lower weight reduces its system load, and weighted polling can will request sequential processes, and according to weight distribution to rear end.Add
Power randomized refers to: according to the configuration of rear end machine, the load of system distributes different weights;Unlike randomized, it
Be according to weight random request back-end server, and it is non-sequential.Even number method refers to minimum: by the least clothes of overstocked connection number
Device be engaged in handle current request, improves the utilization efficiency of back-end services as much as possible, will be responsible for reasonably being diverted to each
Server.
S103, Xiang Suoshu destination service provider send service invocation request.
In the present embodiment, after the address of service provider has been determined, Xiang Suoshu destination service provider sends service
Call request.
Optionally, after sending service invocation request to the destination service provider, further includes:
Receive the response signal of the destination service provider feedback;
If within a preset time period, not receiving the response signal of the destination service provider feedback, then from described
A service provider is reselected in fragment address list as new destination service provider;
Service invocation request is sent to the new destination service provider.
In the present embodiment, the response signal of destination service provider transmission whether is received in the preset period by monitoring
To determine whether service call succeeds.If within a preset time period, being not received by the response of destination service provider transmission
Signal, it is determined that service call failure;At this time, it may be necessary to select a service provider to make in the fragment address list again
For new destination service provider;Service invocation request is sent to the new destination service provider.In specific application,
By the above method, the success rate of service call can be greatly promoted.
The present embodiment determines corresponding with the destination service point by the service identifiers according to corresponding to destination service
Piece address list;Service provider corresponding to each address in the fragment address list is used to provide the described target clothes
Business, and every corresponding fragment address list of a kind of service identifiers;Based on load-balancing algorithm from the fragment address list
Select a destination service provider;Service invocation request is sent to the destination service provider.So as to shorten clothes
The calling link of business request, promotes the calling efficiency of service request.
Fig. 3 is the flow chart of service calling method provided by Embodiment 2 of the present invention, as shown in figure 3, in the present embodiment
Method may include:
S201, the service invocation request that service consumer is sent is received.
In the present embodiment, service provider (method is it is found that corresponding herein is destination service provider as shown in connection with fig. 2)
Receive the service invocation request that service consumer is sent.
Optionally, before receiving the service invocation request that service consumer is sent, service provider is sent out to registration center
Service registration request is sent, includes service identifiers in the service registration request, and service corresponding with the service identifiers
The address of provider.
In the present embodiment, since service provider is in registration service, just include in the service registration request of transmission
Service identifiers, therefore registration center can carry out Classification Management to service provider according to the service identifiers, it will thus provide same class
The address of the service provider of service is stored in a fragment address list.
If S202, agreeing to the service invocation request, within a preset time period, Xiang Suoshu service consumer feedback
Response signal.
In the present embodiment, if service provider has received the service invocation request of service consumer, preset period
It is interior, the response signal of Xiang Suoshu service consumer feedback;Shown response signal is for notifying the success of service consumer service call.
The present embodiment, the service invocation request that service provider is sent by receiving service consumer;If agreeing to the clothes
Business call request, then within a preset time period, the response signal of Xiang Suoshu service consumer feedback.So as to accuse in time
Know whether service consumer service call succeeds, avoids service consumer from being in long-term wait state, improve service call
Efficiency.
Fig. 4 is the flow chart for the service calling method that the embodiment of the present invention three provides, as shown in figure 4, in the present embodiment
Method may include:
S301, the service subscription request that service consumer is sent is received.
Optionally, registration center also receives the service registration request of service provider transmission, in the service registration request
It include service identifiers, and the address of service provider corresponding with the service identifiers.
In the present embodiment, registration center receives the service subscription request that service consumer is sent, in the service subscription request
It include that service consumer needs service identifiers corresponding to the service called.
S302, Xiang Suoshu service consumer send address list.
Optionally, registration middle line can also be in any stage, to the updated address list of service consumer transmission.
In the present embodiment, address corresponding to registered service provider is stored in the address list;Describedly
Address in the list of location is that the service identifiers sent according to service provider in registration carry out classification storage;Every a kind of service
Identify a corresponding fragment address list.
The present embodiment, registration center can receive the service subscription request of service consumer, and send to service consumer
Address list, wherein address corresponding to registered service provider is stored in the address list;The address list
In address be that in registration, the service identifiers that send carry out classification storage according to service provider;Every one kind service identifiers pair
Answer a fragment address list.So as to shorten the calling link of service request, the calling efficiency of service request is promoted.
Fig. 5 is the structural schematic diagram for the service call device that the embodiment of the present invention four provides, as shown in figure 5, the present embodiment
In device may include:
Determining module 10, for the service identifiers according to corresponding to destination service, determination is corresponding with the destination service
Fragment address list;Service provider corresponding to each address in the fragment address list is used to provide the described target clothes
Business, and every corresponding fragment address list of a kind of service identifiers;
Selecting module 20, for selecting a destination service to mention from the fragment address list based on load-balancing algorithm
Supplier;
Sending module 30, for sending service invocation request to the destination service provider.
Optionally, further includes:
Receiving module 40, in the service identifiers according to corresponding to destination service, determination to be corresponding with the destination service
Fragment address list before, receive registration center send address list;Wherein, it is stored in the address list registered
Service provider corresponding to address;Address in the address list is the clothes sent according to service provider in registration
Business mark carries out classification storage.
Optionally, the sending module 30 is also used to before receiving the address list that registration center sends, into registration
The heart sends service subscription request, includes service identifiers corresponding to the destination service in the service subscription request.
Optionally, the receiving module 40, is also used to:
Receive the updated address list that registration center sends.
Optionally, the selecting module 20, be also used to the destination service provider send service invocation request it
Afterwards, the response signal of the destination service provider feedback is received;
If within a preset time period, not receiving the response signal of the destination service provider feedback, then from described
A service provider is reselected in fragment address list as new destination service provider;
Service invocation request is sent to the new destination service provider.
The present embodiment can execute the technical solution in above-mentioned method shown in Fig. 2, realize process and technical effect with
The above method is similar, and details are not described herein again.
Fig. 6 is the structural schematic diagram for the service call device that the embodiment of the present invention five provides, as shown in fig. 6, the present embodiment
In device may include:
Receiving module 50, for receiving the service invocation request of service consumer transmission;
Feedback module 60, within a preset time period, disappearing to the service when agreeing to the service invocation request
The response signal of Fei Fang feedback.
Optionally, further includes:
Sending module 70, for being sent to registration center before receiving the service invocation request that service consumer is sent
Service registration request includes service identifiers in the service registration request, and service corresponding with the service identifiers mentions
The address of supplier.
The present embodiment can execute the technical solution in above-mentioned method shown in Fig. 3, realize process and technical effect with
The above method is similar, and details are not described herein again.
Fig. 7 is the structural schematic diagram for the service call device that the embodiment of the present invention six provides, as shown in fig. 7, the present embodiment
In device may include:
Receiving module 80, for receiving the service subscription request of service consumer transmission;
Sending module 90, for sending address list to the service consumer, wherein be stored in the address list
Address corresponding to registered service provider;Address in the address list be according to service provider registration when hair
The service identifiers sent carry out classification storage;Every corresponding fragment address list of one kind service identifiers.
Optionally, the receiving module 80 is also used to receive the service registration request of service provider transmission, the service
It include service identifiers in registration request, and the address of service provider corresponding with the service identifiers.
Optionally, the sending module 90, is also used to:
The updated address list sent to service consumer.
The present embodiment can execute the technical solution in above-mentioned method shown in Fig. 4, realize process and technical effect with
The above method is similar, and details are not described herein again.
Fig. 8 is the structural schematic diagram for the service calling system that the embodiment of the present invention seven provides, as shown in figure 8, the present embodiment
In service calling system 100 include: processor 110 and memory 120;
Memory 120 (such as realizes application program, the function mould of above-mentioned service calling method for storing computer program
Block etc.), computer instruction etc., above-mentioned computer program, computer instruction etc. can be stored with partitioned storage in one or more
In device 120.And above-mentioned computer program, computer instruction, data etc. can be called with device 110 processed.
Processor 110, the computer program stored for executing the memory 120, to realize above-described embodiment
Each step in the method being related to.It specifically may refer to the associated description in previous methods embodiment.Wherein, memory 120,
Processor 110 can be of coupled connections by bus 130.
The present embodiment can execute the technical solution in above-mentioned Fig. 2~method shown in Fig. 4, realize process and technology effect
Fruit is similar with the above method, and details are not described herein again.
In addition, the embodiment of the present application also provides a kind of computer readable storage medium, deposited in computer readable storage medium
Computer executed instructions are contained, when at least one processor of user equipment executes the computer executed instructions, user equipment
Execute above-mentioned various possible methods.
Wherein, computer-readable medium includes computer storage media and communication media, and wherein communication media includes being convenient for
From a place to any medium of another place transmission computer program.Storage medium can be general or specialized computer
Any usable medium that can be accessed.A kind of illustrative storage medium is coupled to processor, to enable a processor to from this
Read information, and information can be written to the storage medium.Certainly, storage medium is also possible to the composition portion of processor
Point.Pocessor and storage media can be located in ASIC.In addition, the ASIC can be located in user equipment.Certainly, processor and
Storage medium can also be used as discrete assembly and be present in communication equipment.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead to
The relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer readable storage medium.The journey
When being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned include: ROM, RAM, magnetic disk or
The various media that can store program code such as person's CD.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to
So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into
Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme.
Claims (21)
1. a kind of service calling method characterized by comprising
The service identifiers according to corresponding to destination service determine fragment address list corresponding with the destination service;Described point
Service provider corresponding to each address in piece address list is used to provide the described destination service, and every a kind of service identifiers
A corresponding fragment address list;
A destination service provider is selected from the fragment address list based on load-balancing algorithm;
Service invocation request is sent to the destination service provider.
2. the method according to claim 1, wherein being determined in the service identifiers according to corresponding to destination service
Before fragment address list corresponding with the destination service, further includes:
Receive the address list that registration center sends;Wherein, registered service provider institute is stored in the address list
Corresponding address;Address in the address list is that the service identifiers sent according to service provider in registration are classified
Storage.
3. according to the method described in claim 2, it is characterized in that, being gone back before receiving the address list that registration center sends
Include:
Service subscription request is sent to registration center, includes clothes corresponding to the destination service in the service subscription request
Business mark.
4. the method according to claim 1, wherein further include:
Receive the updated address list that registration center sends.
5. the method according to claim 1, wherein being asked sending service call to the destination service provider
After asking, further includes:
Receive the response signal of the destination service provider feedback;
If within a preset time period, not receiving the response signal of the destination service provider feedback, then from the fragment
A service provider is reselected in address list as new destination service provider;
Service invocation request is sent to the new destination service provider.
6. a kind of service calling method characterized by comprising
Receive the service invocation request that service consumer is sent;
If agreeing to the service invocation request, within a preset time period, the response signal of Xiang Suoshu service consumer feedback.
7. according to the method described in claim 6, it is characterized in that, receive service consumer send service invocation request it
Before, further includes:
Send service registration request to registration center, include service identifiers in the service registration request, and with the clothes
Business identifies the address of corresponding service provider.
8. a kind of service calling method characterized by comprising
Receive the service subscription request that service consumer is sent;
Address list is sent to the service consumer, wherein registered service provider is stored in the address list
Corresponding address;Address in the address list is that the service identifiers sent according to service provider in registration are divided
Class storage;Every corresponding fragment address list of one kind service identifiers.
9. according to the method described in claim 8, it is characterized by further comprising:
The service registration request that service provider is sent is received, includes service identifiers, Yi Jiyu in the service registration request
The address of the corresponding service provider of the service identifiers.
10. according to the method described in claim 8, it is characterized by further comprising:
The updated address list sent to service consumer.
11. a kind of service call device characterized by comprising
Determining module, for the service identifiers according to corresponding to destination service, with determining fragment corresponding with the destination service
Location list;Service provider corresponding to each address in the fragment address list is used to provide the described destination service, and
Every corresponding fragment address list of one kind service identifiers;
Selecting module, for selecting a destination service provider from the fragment address list based on load-balancing algorithm;
Sending module, for sending service invocation request to the destination service provider.
12. device according to claim 11, which is characterized in that further include:
Receiving module, for determining fragment corresponding with the destination service in the service identifiers according to corresponding to destination service
Before address list, the address list that registration center sends is received;Wherein, registered service is stored in the address list
Address corresponding to provider;Address in the address list is the service identifiers sent according to service provider in registration
Carry out classification storage.
13. device according to claim 12, which is characterized in that the sending module is also used to receiving registration center
Before the address list of transmission, service subscription request is sent to registration center, includes the mesh in the service subscription request
The corresponding service identifiers of mark service.
14. device according to claim 11, which is characterized in that the receiving module is also used to:
Receive the updated address list that registration center sends.
15. device according to claim 11, which is characterized in that the selecting module is also used to take to the target
It is engaged in after provider's transmission service invocation request, receives the response signal of the destination service provider feedback;
If within a preset time period, not receiving the response signal of the destination service provider feedback, then from the fragment
A service provider is reselected in address list as new destination service provider;
Service invocation request is sent to the new destination service provider.
16. a kind of service call device characterized by comprising
Receiving module, for receiving the service invocation request of service consumer transmission;
Feedback module, for when agreeing to the service invocation request, within a preset time period, Xiang Suoshu service consumer to be anti-
The response signal of feedback.
17. device according to claim 16, which is characterized in that further include:
Sending module, for sending service note to registration center before receiving the service invocation request that service consumer is sent
Volume is requested, and includes service identifiers in the service registration request, and service provider corresponding with the service identifiers
Address.
18. a kind of service call device characterized by comprising
Receiving module, for receiving the service subscription request of service consumer transmission;
Sending module, for sending address list to the service consumer, wherein be stored in the address list registered
Service provider corresponding to address;Address in the address list is the clothes sent according to service provider in registration
Business mark carries out classification storage;Every corresponding fragment address list of one kind service identifiers.
19. device according to claim 18, which is characterized in that the receiving module is also used to receive service provider
The service registration request of transmission includes service identifiers in the service registration request, and corresponding with the service identifiers
The address of service provider.
20. device according to claim 18, which is characterized in that the sending module is also used to:
The updated address list sent to service consumer.
21. a kind of service calling system characterized by comprising
Memory, for storing program;
Processor, for executing the described program of the memory storage, when described program is performed, the processor is used for
Execute such as method of any of claims 1-10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811353235.3A CN109542641A (en) | 2018-11-14 | 2018-11-14 | Service calling method, apparatus and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811353235.3A CN109542641A (en) | 2018-11-14 | 2018-11-14 | Service calling method, apparatus and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109542641A true CN109542641A (en) | 2019-03-29 |
Family
ID=65847379
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811353235.3A Pending CN109542641A (en) | 2018-11-14 | 2018-11-14 | Service calling method, apparatus and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109542641A (en) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110427428A (en) * | 2019-08-06 | 2019-11-08 | 中国工商银行股份有限公司 | Distributed Services call method and system |
CN111124532A (en) * | 2019-11-29 | 2020-05-08 | 北京浪潮数据技术有限公司 | Service loading method and device, electronic equipment and storage medium |
CN111984309A (en) * | 2020-08-31 | 2020-11-24 | 北京达佳互联信息技术有限公司 | Service calling method, device, server and storage medium |
CN112468580A (en) * | 2020-11-25 | 2021-03-09 | 政采云有限公司 | Method, device, equipment and storage medium for calling business service |
CN112491717A (en) * | 2019-09-12 | 2021-03-12 | 华为技术有限公司 | Service routing method and device |
CN112698970A (en) * | 2020-12-31 | 2021-04-23 | 北京千方科技股份有限公司 | Service calling method and device for micro-service architecture and computer storage medium |
CN112788124A (en) * | 2020-12-31 | 2021-05-11 | 中科星通(廊坊)信息技术有限公司 | Distributed registration service method and device for remote sensing image |
CN113014673A (en) * | 2021-04-08 | 2021-06-22 | 广州趣丸网络科技有限公司 | Service call optimization method and device |
CN113765870A (en) * | 2020-09-01 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Remote service calling method, device and system |
CN113765805A (en) * | 2021-08-31 | 2021-12-07 | 上海完美时空软件有限公司 | Call-based communication method, device, storage medium and equipment |
CN114697339A (en) * | 2022-04-08 | 2022-07-01 | 中国银行股份有限公司 | Load balancing method and device under centralized architecture |
CN114726787A (en) * | 2022-04-11 | 2022-07-08 | 阿里巴巴(中国)有限公司 | Routing method and system applied to RPC framework |
CN115002185A (en) * | 2022-05-09 | 2022-09-02 | 北京城市网邻信息技术有限公司 | Data processing method and device, electronic equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8407672B2 (en) * | 2003-08-07 | 2013-03-26 | International Business Machines Corporation | Systems and methods for synchronizing software execution across data processing systems and platforms |
CN104461747A (en) * | 2014-12-31 | 2015-03-25 | 合一网络技术(北京)有限公司 | Distributed type task scheduling system |
CN104615489A (en) * | 2015-01-22 | 2015-05-13 | 江苏大烨智能电气股份有限公司 | Multi-node data interaction achieving method |
CN105635331A (en) * | 2014-11-18 | 2016-06-01 | 阿里巴巴集团控股有限公司 | Service addressing method and apparatus in distributed environment |
CN105847057A (en) * | 2016-03-29 | 2016-08-10 | 乐视控股(北京)有限公司 | Fault processing method and fault processing device |
CN106572137A (en) * | 2015-10-12 | 2017-04-19 | 阿里巴巴集团控股有限公司 | Distributed service resource management method and apparatus |
CN106941508A (en) * | 2016-01-05 | 2017-07-11 | 阿里巴巴集团控股有限公司 | Service calling method, device and system |
-
2018
- 2018-11-14 CN CN201811353235.3A patent/CN109542641A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8407672B2 (en) * | 2003-08-07 | 2013-03-26 | International Business Machines Corporation | Systems and methods for synchronizing software execution across data processing systems and platforms |
CN105635331A (en) * | 2014-11-18 | 2016-06-01 | 阿里巴巴集团控股有限公司 | Service addressing method and apparatus in distributed environment |
CN104461747A (en) * | 2014-12-31 | 2015-03-25 | 合一网络技术(北京)有限公司 | Distributed type task scheduling system |
CN104615489A (en) * | 2015-01-22 | 2015-05-13 | 江苏大烨智能电气股份有限公司 | Multi-node data interaction achieving method |
CN106572137A (en) * | 2015-10-12 | 2017-04-19 | 阿里巴巴集团控股有限公司 | Distributed service resource management method and apparatus |
CN106941508A (en) * | 2016-01-05 | 2017-07-11 | 阿里巴巴集团控股有限公司 | Service calling method, device and system |
CN105847057A (en) * | 2016-03-29 | 2016-08-10 | 乐视控股(北京)有限公司 | Fault processing method and fault processing device |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110427428A (en) * | 2019-08-06 | 2019-11-08 | 中国工商银行股份有限公司 | Distributed Services call method and system |
CN112491717A (en) * | 2019-09-12 | 2021-03-12 | 华为技术有限公司 | Service routing method and device |
WO2021047515A1 (en) * | 2019-09-12 | 2021-03-18 | 华为技术有限公司 | Service routing method and apparatus |
CN111124532A (en) * | 2019-11-29 | 2020-05-08 | 北京浪潮数据技术有限公司 | Service loading method and device, electronic equipment and storage medium |
CN111984309A (en) * | 2020-08-31 | 2020-11-24 | 北京达佳互联信息技术有限公司 | Service calling method, device, server and storage medium |
CN113765870A (en) * | 2020-09-01 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Remote service calling method, device and system |
CN113765870B (en) * | 2020-09-01 | 2023-09-05 | 北京沃东天骏信息技术有限公司 | Remote service calling method, device and system |
CN112468580A (en) * | 2020-11-25 | 2021-03-09 | 政采云有限公司 | Method, device, equipment and storage medium for calling business service |
CN112788124B (en) * | 2020-12-31 | 2023-06-09 | 中科星通(廊坊)信息技术有限公司 | Remote sensing image distributed registration service method and device |
CN112698970A (en) * | 2020-12-31 | 2021-04-23 | 北京千方科技股份有限公司 | Service calling method and device for micro-service architecture and computer storage medium |
CN112788124A (en) * | 2020-12-31 | 2021-05-11 | 中科星通(廊坊)信息技术有限公司 | Distributed registration service method and device for remote sensing image |
CN113014673A (en) * | 2021-04-08 | 2021-06-22 | 广州趣丸网络科技有限公司 | Service call optimization method and device |
CN113765805A (en) * | 2021-08-31 | 2021-12-07 | 上海完美时空软件有限公司 | Call-based communication method, device, storage medium and equipment |
CN113765805B (en) * | 2021-08-31 | 2023-10-20 | 上海完美时空软件有限公司 | Calling-based communication method, device, storage medium and equipment |
CN114697339A (en) * | 2022-04-08 | 2022-07-01 | 中国银行股份有限公司 | Load balancing method and device under centralized architecture |
CN114726787A (en) * | 2022-04-11 | 2022-07-08 | 阿里巴巴(中国)有限公司 | Routing method and system applied to RPC framework |
CN114726787B (en) * | 2022-04-11 | 2023-08-25 | 阿里巴巴(中国)有限公司 | Routing method and system applied to RPC framework |
CN115002185A (en) * | 2022-05-09 | 2022-09-02 | 北京城市网邻信息技术有限公司 | Data processing method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109542641A (en) | Service calling method, apparatus and system | |
CN109218355B (en) | Load balancing engine, client, distributed computing system and load balancing method | |
US8364163B2 (en) | Method, system and apparatus for connecting a plurality of client machines to a plurality of servers | |
CN110191164A (en) | Distributed Services access system and method | |
Wuhib et al. | Gossip-based resource management for cloud environments | |
CN102164116B (en) | Method, system and corresponding device for balancing load | |
US20210410057A1 (en) | Service Discovery Extension in a 5G Mobile Communication Network | |
US8935377B2 (en) | Dynamic registration of listener resources for cloud services | |
CN107105013B (en) | File processing method, server, terminal and system | |
CN108933829A (en) | A kind of load-balancing method and device | |
CN107426323A (en) | One kind is based on distributed resource service and Visualized Monitoring System and method | |
CN110740162A (en) | Communication link establishing method, device, electronic equipment and medium | |
US8606908B2 (en) | Wake-up server | |
CN112953982B (en) | Service processing method, service configuration method and related device | |
CN111694663A (en) | Load balancing method, device and system for server cluster | |
US20110131288A1 (en) | Load-Balancing In Replication Engine of Directory Server | |
CN106230992A (en) | A kind of load-balancing method and load balancing node | |
CN112367221A (en) | Distributed registry recommendation method under industrial Internet of things | |
CN111522664A (en) | Service resource management and control method and device based on distributed service | |
CN111796935A (en) | Consumption instance distribution method and system for calling log information | |
CN112422609A (en) | Programming device and service request connection method | |
CN114024968B (en) | Message sending method and device based on intermediate equipment and electronic equipment | |
WO2015069378A1 (en) | Hierarchical distribution of control information in a massively scalable network server | |
US7647401B1 (en) | System and method for managing resources of a network load balancer via use of a presence server | |
CN113179295B (en) | Message processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190329 |
|
RJ01 | Rejection of invention patent application after publication |