CN108234666A - A kind of micro services calling system, method and computer storage media - Google Patents
A kind of micro services calling system, method and computer storage media Download PDFInfo
- Publication number
- CN108234666A CN108234666A CN201810041787.4A CN201810041787A CN108234666A CN 108234666 A CN108234666 A CN 108234666A CN 201810041787 A CN201810041787 A CN 201810041787A CN 108234666 A CN108234666 A CN 108234666A
- Authority
- CN
- China
- Prior art keywords
- service
- address
- micro services
- service provider
- consumer
- 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/63—Routing a service request depending on the request content or context
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The present invention proposes a kind of micro services calling system, method and computer storage media, including address administration center, service consumer, service provider, wherein, the corresponding micro services of the service provider include multiple Service Instances:Described address administrative center registers with the address of service for the Service Instance that the micro services include;The service consumer is cached with the address list formed from the address of service that described address administrative center obtains;When initiating service request, the service consumer is used to select the address of service of a Service Instance according to preset algorithm, sends the service provider belonging to the service request to the micro services;The service provider responds the service request and returns to call result according to the situation of the Service Instance of the selection.Address of service is managed collectively by the present invention, supports the deployment of isomerous environment, not only reduces the pressure in terms of O&M and the probability of error, while increase the flexibility of deployment.
Description
Technical field
The present invention relates to field of cloud computer technology, more particularly to a kind of micro services calling system, method and computer storage
Medium.
Background technology
With the growth of progress and the service of cloud computing technology, micro services framework more and more receives the pass of people
Note.Micro services architecture mode provides huge help for agility deployment and the application implementation of complicated enterprise, and micro services are
An application is built with the mode of one group of small service, service independent operating passes through light weight in different processes between service
Communication mechanism interact, and service can independently be disposed by automatically dispose mode.Just because of in micro services framework, clothes
It is independent from each other between business, so different services can be developed or the demand according to business using different language
Use different types of database.
In the process of development, in order to which whole system is more clear and is decoupled, internal system realizes module level even work(
The service of energy level, that is to say, that service the granularity smaller of realization.This brings stronger for the realization of application and service certainly
Flexibility, the service offering period also substantially reduces.But it is each function that such fine granularity, which splits the problem of servicing, bringing,
Realization need the increase of the quantity of service that accesses at double, the address of service managed is needed to also increase as, service call error
Probability also greatly increase.
Invention content
For the defects in the prior art, the present invention proposes a kind of micro services calling system, method and computer storage
Address of service is managed collectively by medium, supports the deployment of isomerous environment, not only reduces the several of pressure in terms of O&M and error
Rate, while increase the flexibility of deployment.
According to embodiment of the present invention, a kind of micro services calling system is provided, including address administration center, service
Consumer, service provider, wherein, the corresponding micro services of the service provider include multiple Service Instances:
Described address administrative center registers with the address of service for the Service Instance that the micro services include;
The service consumer is cached with the address column formed from the address of service that described address administrative center obtains
Table;
When initiating service request, the service consumer is with being used to select the service of a Service Instance according to preset algorithm
Location sends the service provider belonging to the service request to the micro services;
The service provider responds the service request and returns to call result according to the situation of the Service Instance of the selection.
In above-mentioned micro services calling system, upon start up, the service provider is additionally operable to the micro services to contain
The information on services of address of service is registered to described address administrative center.
In above-mentioned micro services calling system, the service provider is every preset time to described address administrative center
Update request is submitted, described address administrative center asks to update the service of the corresponding micro services of the service provider according to the update
Information.
In above-mentioned micro services calling system, upon start up, the service consumer is obtained from described address administrative center
The address of service of the micro services is taken to be buffered in local memory after forming the address list.
In above-mentioned micro services calling system, when the corresponding Service Instance of the micro services cannot normally be called,
Described address administrative center generates an exception information and pushes the exception information to the service consumer;
The service consumer updates the described address list in its local memory according to the exception information.
In above-mentioned micro services calling system, the preset algorithm includes:
According to the weights size of the corresponding Service Instance of the micro services, the corresponding clothes of Service Instance for selecting weights optimal
Business address.
In above-mentioned micro services calling system, when the Service Instance state of the selection is normal, the service provider
It responds the service request and obtains the corresponding address of service of Service Instance of the selection and return to the service consumer;
When the Service Instance abnormal state of the selection, the service provider responds the service request and returns to mistake containing calling
That loses is prompted to the service consumer, and the service consumer is additionally operable to select the micro services corresponding another according to the preset algorithm
One Service Instance.
Another embodiment of the present invention provides a kind of micro services call method, disappears applied to address administration center, service
Fei Fang, service provider, wherein, the corresponding micro services of the service provider include multiple Service Instances, the micro services tune
Included with method:
Initiate service request;
The corresponding address of service of one Service Instance is selected according to preset algorithm, sends the service request to the Service Instance institute
The service provider of category;
Receive the call result that the service provider responds the service request and returns.
In above-mentioned micro services call method, upon start up, information on services of the micro services containing address of service is noted
Volume arrives described address administrative center.
The present invention also provides a kind of computer storage media, computer program is stored in the computer storage media, institute
Computer program is stated for performing below scheme:
A. service request is initiated;
B. the corresponding address of service of a Service Instance is selected according to preset algorithm, sends the service request to the Service Instance
Affiliated service provider;
C. the call result that the described service provider responds the service request and returns is received.
Micro services calling system of the present invention, method and computer storage media provide at following technique effect:Service ground
Location is managed collectively, and reduces the pressure in terms of O&M and the probability of error;The deployment of isomerous environment is supported, due to service consumer
It can calculate best access address according to service weight, because all servers is not required to be required for the same configuration, increase
The flexibility of deployment is added;Service is stateless, and service consumer requires no knowledge about the micro services that service provider is provided and corresponds to
Service Instance true address, it is thus only necessary to know the title of service provider, pass through address administration center obtain service ground
Location list makes system more intelligence reliable.
Description of the drawings
It in order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached
Figure is briefly described, it should be understood that the following drawings illustrates only certain embodiments of the present invention, therefore is not construed as pair
The restriction of range, for those of ordinary skill in the art, without creative efforts, can also be according to this
A little attached drawings obtain other relevant attached drawings.
Fig. 1 is a kind of structure diagram for micro services calling system that the embodiment of the present invention proposes.
Fig. 2 is a kind of flow diagram for micro services call method that first embodiment of the invention proposes.
Fig. 3 is a kind of flow diagram for micro services call method that second embodiment of the invention proposes.
Main element symbol description:
10- micro services calling systems;11- service providers;12- address administrations center;13- service consumers.
Specific embodiment
Hereinafter, the various embodiments of the disclosure will be described more fully.The disclosure can have various embodiments, and
It can adjust and change wherein.It should be understood, however, that:There is no the various embodiments of the disclosure are limited to spy disclosed herein
Determine the intention of embodiment, but the disclosure should be interpreted as in the spirit and scope for covering the various embodiments for falling into the disclosure
All adjustment, equivalent and/or alternative.
Hereinafter, disclosed in the term " comprising " that can be used in the various embodiments of the disclosure or " may include " instruction
Function, operation or the presence of element, and do not limit the increase of one or more functions, operation or element.In addition, such as exist
Used in the various embodiments of the disclosure, term " comprising ", " having " and its cognate are meant only to represent special characteristic, number
Word, step, operation, the combination of element, component or aforementioned item, and be understood not to exclude first one or more other
Feature, number, step, operation, element, component or aforementioned item combination presence or increase one or more features, number,
Step, operation, element, component or aforementioned item combination possibility.
In the various embodiments of the disclosure, "or" or " at least one of A or/and B " are stated including what is listed file names with
Any combinations of word or all combinations.For example, statement " A or B " or " at least one of A or/and B " may include A, may include
B may include A and B both.
The statement (" first ", " second " etc.) used in the various embodiments of the disclosure can be modified in various implementations
Various constituent element in example, but respective sets can not be limited into element.For example, presented above be not intended to limit the suitable of the element
Sequence and/or importance.The purpose presented above for being only used for differentiating an element and other elements.For example, the first user fills
It puts and indicates different user device with second user device, although the two is all user apparatus.For example, not departing from each of the disclosure
In the case of the range of kind embodiment, first element is referred to alternatively as second element, and similarly, second element is also referred to as first
Element.
It should be noted that:It, can be by the first composition member if a constituent element ' attach ' to another constituent element by description
Part is directly connected to the second constituent element, and " connection " third can be formed between the first constituent element and the second constituent element
Element.On the contrary, when by a constituent element " being directly connected to " to another constituent element, it will be appreciated that be in the first constituent element
And second third constituent element is not present between constituent element.
The term " user " used in the various embodiments of the disclosure, which may indicate that, to be used the people of electronic device or uses electricity
The device (for example, artificial intelligence electronic device) of sub-device.
The term used in the various embodiments of the disclosure is used only for the purpose of describing specific embodiments and not anticipates
In the various embodiments of the limitation disclosure.As used herein, singulative is intended to also include plural form, unless context is clear
Chu it is indicated otherwise.Unless otherwise defined, otherwise all terms (including technical terms and scientific terms) used herein have
There is the meaning identical with the various normally understood meanings of embodiment one skilled in the art of the disclosure.The term
(term such as limited in the dictionary generally used) is to be interpreted as having and situational meaning in the related technical field
Identical meaning and the meaning that Utopian meaning or too formal will be interpreted as having, unless in the various of the disclosure
It is clearly defined in embodiment.
Embodiment 1
Fig. 1 is a kind of structure diagram for micro services calling system that the embodiment of the present invention proposes.The micro services call system
System 10 includes service provider 11, address administration center 12 and service consumer 13, wherein, the service provider 11 is corresponding
Micro services include multiple Service Instances.
Service provider 11 responds service request and returns to call result according to the situation of the micro services.
When service provider 11 receives the service request of the transmission of service consumer 13, asked according to service consumer 13
The corresponding Service Instance of micro services state, return to the call result of the service request.
For example, micro services calling system is said with a service consumer and a provider in the present embodiment
It is bright, in other embodiments of the invention, can also there are multiple service consumers and multiple service providers.Service provider
" KFC " provides micro services and corresponds to " A areas KFC ", " B areas KFC ", " C areas KFC ", " D areas KFC ", " E areas
5 Service Instances of KFC ", service consumption direction service provider " KFC " provide micro services corresponding Service Instance " A
The service request of area's KFC " transmission " I will buy hamburger ", service provider is according to the shape of the Service Instance " A areas KFC "
State returns to call result to service consumer.
Upon start up, the service provider 11 is additionally operable to information on services of the micro services containing address of service to be registered to
Described address administrative center 12.
Service provider 11 submits the information on services of oneself when starting to address administration center 12, wherein, it is described
Information on services includes:Service provider title, the micro services title provided, that service provider provides micro services is corresponding several
Service Instance, the IP address of Service Instance, the corresponding weight of Service Instance IP address, port etc..
The service provider 11 submits update request, described address every preset time to described address administrative center 12
Administrative center 12 asks to update the information on services of the corresponding micro services of the service provider according to the update.
For example, in the present embodiment, service provider updates the service of oneself every 30s to the timing of address administration center to be believed
Breath, exception information of recalls information, Service Instance including Service Instance etc..Address administration center is according to fresh information timing
The information on services of the corresponding micro services of the service provider is updated, obtains Service Instance last state in time, reduces and calls error
Probability.
In addition, in other embodiments of the invention, the service of the corresponding micro services of the service provider can also be worked as
When information changes, the service provider submits update request, described address administrative center to described address administrative center
The information on services of the update micro services is asked according to the update, service provider sends update request, avoids system congestion on demand
And improve the real-time effectiveness of information.
Address administration center 12 registers with the corresponding address of service of the micro services.
Address administration center registration 12 has the service for including address of service that the service provider 11 provides micro services
Information simultaneously stores.
In the present embodiment, the service provider 11 submits update please every preset time to described address administrative center 12
It asks, update request includes recalls information, exception information of Service Instance of Service Instance etc., described address administrative center
12 ask to update the information on services of the corresponding micro services of the service provider according to the update.
When the corresponding Service Instance of micro services cannot normally be called, one abnormal letter of the generation of described address administrative center 12
It ceases and pushes the exception information to the service consumer 13;The service consumer 13 is updated according to the exception information in its local
Described address list in depositing.
For example, when Service Instance " A areas KFC " is abnormal, when causing Service Instance that cannot normally be called, address
Administrative center sends exception information and the exception information is pushed to service consumer to messaging bus, then by messaging bus, described
Service consumer updates the described address list in its local memory according to the exception information.
Service consumer 13 is cached with the address column formed from the address of service that described address administrative center obtains
Table;When initiating service request, the service consumer is used to select the corresponding address of service of a micro services according to preset algorithm,
Send the service provider belonging to the service request to the micro services.
Upon start up, the service consumer 13 obtains all micro services and the micro services from described address administrative center 12
The address of service of corresponding Service Instance is buffered in after forming address list in local memory;When service consumer 13 is initiated to service
Before request, first according to preset algorithm with selecting in the corresponding all Service Instances of the micro services service of optimal service example
Location sends service request to the address of service.
It is provided for example, service consumer obtains service provider " KFC " from address administration center " Baidu map "
Micro services correspond to " A areas KFC ", " B areas KFC ", " C areas KFC ", " D areas KFC ", " E areas KFC " 5 services
The address of service of example forms address list and is buffered in local memory;Service consumption direction service provider " KFC " is sent out
Before the service request for playing " I will buy hamburger ", the corresponding all Service Instances of the micro services are selected according to preset algorithm first
The address of service of middle optimal service example, it is assumed that selected optimal service example be " A areas KFC ", to " A areas KFC " this
The address of service of a Service Instance sends service request.
When the corresponding Service Instance of the micro services cannot normally be called, described address administrative center generation one is abnormal
Information and the exception information is pushed to the service consumer;The service consumer updates its local memory according to the exception information
In described address list.
For example, address administration center sends the exception information of Service Instance " A areas KFC " to messaging bus, then by message
The exception information is pushed to service consumer by bus;Service consumer updates service provider " Ken De according to the exception information
Base " provides the state of the corresponding Service Instance of micro services " A areas KFC ".
The preset algorithm includes:According to the weights size of the corresponding Service Instance of the micro services, select weights optimal
The corresponding address of service of micro services.
In the present embodiment, service consumer is that a Service Instance distributes weight according to the corresponding address of service of Service Instance,
In the other embodiment of the present invention, different weights can also be distributed for Service Instance according to other factors.For example, service consumption
Side, which obtains service provider " KFC " from address administration center " Baidu map " and provides micro services and correspond to, " agrees moral in A areas
Base ", " B areas KFC ", " C areas KFC ", " D areas KFC ", " E areas KFC " 5 Service Instances address of service, first
It is 5 Service Instances " A areas KFC ", " B areas KFC ", " C areas KFC ", " D according to the size of address of service respective distances
The weights that area's KFC ", " E areas KFC " are distributed are respectively " 1 ", " 7 ", " 5 ", " 4 " and " 3 ", are selected according to the weights size
The address of service of the corresponding Service Instance of weights " 1 " " A areas KFC " is optimum location or the corresponding clothes of selection weights " 7 "
The address of service of pragmatic example " B areas KFC " is optimum location.Wherein, weights are set for service consumer according to different factors,
The weights that each service provider provides the corresponding all Service Instances of micro services can be different.
When the micro services state of the selection is normal, the service provider responds the service request and obtains the micro- of the selection
It services corresponding address of service and returns to the service consumer;When the micro services abnormal state of the selection, the service provides
Side responds the service request and returns to the service consumer that is prompted to containing malloc failure malloc, and the service consumer is additionally operable to basis should
Preset algorithm selects the corresponding another Service Instance of the micro services to initiate request.
For example, if Service Instance " A areas KFC " is normal condition, you can with normally called state, service carries
Supplier returns to the address of service of the corresponding Service Instance of the micro services " A areas KFC " to service consumer;If service
Example " A areas KFC " be abnormality, i.e., the Service Instance on different server, place server power-off, system crash
Or in busy (be called state), service provider responds service request return and is prompted to this containing malloc failure malloc
Service consumer, service consumer receive the prompting and select the corresponding another Service Instance " B of the micro services according to preset algorithm
Area's KFC " initiates request, i.e., if sending service request failure to Service Instance " A areas KFC ", then utilizes pre- imputation
Method provides the corresponding several Service Instances of residue of micro services " B areas KFC " in service provider " KFC ", " agrees moral in C areas
Request is initiated in selection optimal service address in base ", " D areas KFC ", " E areas KFC ".If service consumer sends service
The request frequency of failure reaches preset value, then returns to malloc failure malloc message.
Embodiment 2
Fig. 2 is a kind of flow diagram for micro services call method that first embodiment of the invention proposes.The micro services tune
It is applied to address administration center, service consumer, service provider with method, wherein, the service provider is corresponding in incognito
Business includes multiple Service Instances.
In step S110, when initiating service request, the address of service of a micro services is selected according to preset algorithm, sends the clothes
The service provider belonging to the micro services is arrived in business request.
Upon start up, information on services of the micro services containing address of service is registered to described address by the service provider
Administrative center, the address of service that the service consumer obtains the micro services from described address administrative center form the address column
It is buffered in local memory after table.Wherein, the information on services includes:Service provider title, the micro services title provided, clothes
It is corresponding that business provider provides the corresponding several Service Instances of micro services, the IP address of Service Instance, Service Instance IP address
Weight, port etc..
According to the address list, the address of service for selecting an optimal service example using preset algorithm is sent service consumer
Service request, wherein, which is the weights size according to the corresponding Service Instance of the micro services, selects weights optimal
The corresponding Service Instance address of micro services.In the present embodiment, service consumer is according to the corresponding address of service of Service Instance
A Service Instance distributes weight, can also be different for Service Instance distribution according to other factors in the other embodiment of the present invention
Weight.Wherein, weights are set for service consumer according to different factors, and it is corresponding that each service provider provides micro services
The weights of all Service Instances can be different.
In step S120, the call result that the service provider responds service request return is received.
When the micro services state of the selection is normal, the service provider responds the service request and obtains the micro- of the selection
It services corresponding address of service and returns to the service consumer, service consumer sends service request to the address of service, returns
The micro services call result;When the micro services abnormal state of the selection, for example, Service Instance on a different server, clothes
The problems such as power-off of business device or system crash, causes the Service Instance that cannot normally be called, and the service provider responds the clothes
Business request is returned is prompted to the service consumer containing malloc failure malloc.
The service consumer is additionally operable to the corresponding another Service Instance of the micro services be selected to initiate according to the preset algorithm
Request.
Current service is unavailable, and service consumer selects another optimal service using preset algorithm in remaining Service Instance
Request is initiated in address, and when the frequency of failure is asked to reach predetermined value, malloc failure malloc message is sent to service consumer.
When the corresponding Service Instance of the micro services cannot normally be called, described address administrative center generation one is abnormal
Information and the exception information is pushed to the service consumer;The service consumer updates its local memory according to the exception information
In described address list.
Address administration is centrally generated an exception information and pushes the exception information to messaging bus, then should by messaging bus
Exception information is pushed to service consumer;Service consumer updates service provider according to the exception information and provides micro services pair
The state for the Service Instance answered.
In the present embodiment, the service provider submits update request every preset time to described address administrative center,
Described address administrative center asks to update the information on services of the corresponding micro services of the service provider according to the update.
In other embodiments of the invention, the information on services that can also work as the corresponding micro services of the service provider becomes
During change, the service provider submits update request to described address administrative center, and described address administrative center is according to the update
Request updates the information on services of the micro services.
Embodiment 3
Fig. 3 is a kind of flow diagram for micro services call method that second embodiment of the invention proposes.The micro services tune
It is applied to address administration center, service consumer, service provider with method, wherein, the service provider is corresponding in incognito
Business includes multiple Service Instances.
Step S210, address administration center register with the corresponding address of service of the micro services.
Upon start up, the service provider is additionally operable to information on services of the micro services containing address of service to be registered to institute
State address administration center.Wherein, information on services includes service provider title, the micro services title provided, service provider institute
The corresponding several Service Instances of micro services, the IP address of Service Instance, the corresponding weight of Service Instance IP address, port are provided
Deng.
Step S220 submits update request every preset time to address administration center.
The service provider submits update request, described address management every preset time to described address administrative center
It is asked to update the information on services of the corresponding micro services of the service provider according to the update in center.
For example, service provider sends the state update of micro services corresponding with service example every 30s to address administration center
Information, address administration center update the information on services of corresponding micro services according to the fresh information.
Step S230, service consumer are cached with the ground formed from the address of service that described address administrative center obtains
Location list.
Upon start up, the service consumer is formed from the address of service of the described address administrative center acquisition micro services
It is buffered in local memory after the address list.
When initiating service request, the address of service of a micro services is selected according to preset algorithm by step S240.
Service consumer selects the service of an optimal service example according to preset algorithm first before service request is initiated
Address sends service request, wherein, which is the weights size according to the corresponding Service Instance of the micro services, is selected
The corresponding Service Instance address of the optimal micro services of weights.Service consumer according to the corresponding address of service of Service Instance or other
Factor is that a Service Instance distributes weight, wherein, weights are set for service consumer according to different factors, each service provider
The weights of the corresponding all Service Instances of provided micro services can be different.
Step S250 sends the service provider belonging to the service request to the micro services.
Whether step S260, the corresponding Service Instance of micro services are normal.
Judge whether the corresponding Service Instance state of micro services is normal, if can normally be called, advances to step S270,
The address of service of the Service Instance is returned to service consumer;If Service Instance abnormal state, i.e. Service Instance are in different clothes
On business device, server power-off or the problems such as system crash cause the Service Instance that cannot normally be called, advance to step
S280 is returned and is prompted to the service consumer containing malloc failure malloc.
Step S270, service provider respond the address of service that the service request obtains the micro services of the selection.
The service provider, which responds the service request and obtains the corresponding address of service of micro services of the selection, returns to this
Service consumer, the service consumption direction address of service send service request and receive the response results of service provider.
Step S280 returns to the prompting containing malloc failure malloc.
When the micro services abnormal state of the selection, the service provider responds the service request and returns containing malloc failure malloc
Be prompted to the service consumer.
Step S290, service consumer update address list simultaneously select another Service Instance address to initiate request.
When the corresponding Service Instance of the micro services cannot normally be called, described address administrative center generation one is abnormal
Information and the exception information is pushed to messaging bus;The exception information is sent to service consumer, the service by messaging bus
Consumer updates the described address list in its local memory according to the exception information.
Service consumer selected in all Service Instances of residue corresponding to the micro services using preset algorithm it is another most
Excellent address of service sends service request.When the request frequency of failure reaches preset value, return malloc failure malloc information to service consumer.
In addition, when the information on services of the corresponding micro services of the service provider changes, the service provider
Update request is submitted to described address administrative center, described address administrative center asks to update the clothes of the micro services according to the update
Business information.Avoid service provider submits invalid update to ask to address administration center, i.e., service provider provides micro-
When any variation does not occur for the information on services of service, the number that fresh information is sent to address administration center is reduced, is being serviced
When the information on services that provider provides micro services frequently changes, increase time that fresh information is sent to address administration center
Number, service provider send update request on demand, avoid system congestion and improve the real-time effectiveness of information.
Embodiment 4
A kind of computer storage media is present embodiments provided, computer journey is stored in the computer storage media
Sequence;The computer program is used to perform below scheme:
A. service request is initiated;
B. the corresponding address of service of a Service Instance is selected according to preset algorithm, sends the service request to the micro services institute
The service provider of category;
C. the call result that the described service provider responds the service request and returns is received.
In the particular embodiment, upon start up, information on services of the micro services containing address of service is registered to described
Address administration center.
With this, the present invention proposes a kind of micro services calling system, method and computer storage media, and address of service is united
One management reduces the pressure in terms of O&M and the probability of error;Secondly it supports the deployment of isomerous environment, increases the spirit of deployment
Activity;Service is stateless, and service consumer requires no knowledge about the corresponding Service Instance of micro services that service provider is provided
True address, it is thus only necessary to know the title of service provider, can by address administration center obtain service address list, make be
System more intelligence is reliable.
In several embodiments provided herein, it should be understood that disclosed system and method can also pass through
Other modes are realized.System embodiment described above is only schematical, for example, flow chart and structure in attached drawing
Figure shows the system frame in the cards of the system of multiple embodiments according to the present invention, method and computer program product
Structure, function and operation.In this regard, each box in flow chart or block diagram can represent a module, program segment or code
A part, the part of the module, program segment or code include one or more be used to implement as defined in logic function
Executable instruction.It should also be noted that in the realization method as replacement, the function that is marked in box can also be to be different from
The sequence marked in attached drawing occurs.For example, two continuous boxes can essentially perform substantially in parallel, they are sometimes
It can perform in the opposite order, this is depended on the functions involved.It is also noted that in structure chart and/or flow chart
The combination of each box and the box in structure chart and/or flow chart can use the special of function as defined in performing or action
Hardware based system realize or can be realized with the combination of specialized hardware and computer instruction.
In addition, each function module or unit in each embodiment of the present invention can integrate and to form an independence
Part or modules individualism, can also two or more modules be integrated to form an independent part.
If the function is realized in the form of software function module and is independent product sale or in use, can be with
It is stored in a computer read/write memory medium.Based on such understanding, technical scheme of the present invention is substantially in other words
The part contribute to the prior art or the part of the technical solution can be embodied in the form of software product, the meter
Calculation machine software product is stored in a storage medium, is used including some instructions so that a computer equipment (can be intelligence
Can mobile phone, personal computer, server or network equipment etc.) perform each embodiment the method for the present invention whole or
Part steps.And aforementioned storage medium includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory),
Random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can to store program code
Medium.
The above description is merely a specific embodiment, but protection scope of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can readily occur in change or replacement, should all contain
Lid is within protection scope of the present invention.
Claims (10)
1. a kind of micro services calling system, which is characterized in that including address administration center, service consumer, service provider,
In, the corresponding micro services of the service provider include multiple Service Instances:
Described address administrative center registers with the address of service for the Service Instance that the micro services include;
The service consumer is cached with the address list formed from the address of service that described address administrative center obtains;
When initiating service request, the service consumer is used to select the address of service of a Service Instance according to preset algorithm,
Send the service provider belonging to the service request to the micro services;
The service provider responds the service request and returns to call result according to the situation of the Service Instance of the selection.
2. micro services calling system as described in claim 1, which is characterized in that
Upon start up, the service provider is additionally operable to information on services of the micro services containing address of service to be registered to described
Location administrative center.
3. micro services calling system as claimed in claim 2, which is characterized in that the service provider every preset time to
Update request is submitted by described address administrative center, and described address administrative center asks to update the service provider pair according to the update
The information on services for the micro services answered.
4. micro services calling system as described in claim 1, which is characterized in that
Upon start up, the service consumer forms the ground from the address of service of the described address administrative center acquisition micro services
It is buffered in local memory after the list of location.
5. micro services calling system as described in claim 1, which is characterized in that
When the corresponding Service Instance of the micro services cannot normally be called, described address administrative center generates an exception information
And the exception information is pushed to the service consumer;
The service consumer updates the described address list in its local memory according to the exception information.
6. micro services calling system as described in claim 1, which is characterized in that the preset algorithm includes:
According to the weights size of the corresponding Service Instance of the micro services, the corresponding service ground of Service Instance for selecting weights optimal
Location.
7. micro services calling system as described in claim 1, which is characterized in that
When the Service Instance state of the selection is normal, the service provider responds the service that the service request obtains the selection
The corresponding address of service of example returns to the service consumer;
When the Service Instance abnormal state of the selection, the service provider responds the service request and returns containing malloc failure malloc
The service consumer is prompted to, the service consumer is additionally operable to select the corresponding another clothes of the micro services according to the preset algorithm
Pragmatic example.
8. a kind of micro services call method, which is characterized in that applied to address administration center, service consumer, service provider,
Wherein, the corresponding micro services of the service provider include multiple Service Instances, and the micro services call method includes:
Initiate service request;
The corresponding address of service of one Service Instance is selected according to preset algorithm, is sent belonging to the service request to the Service Instance
Service provider;
Receive the call result that the service provider responds the service request and returns.
9. micro services call method as claimed in claim 8, which is characterized in that further include:
Upon start up, information on services of the micro services containing address of service is registered to described address administrative center.
10. a kind of computer storage media, which is characterized in that computer program is stored in the computer storage media, it is described
Computer program is used to perform below scheme:
A. service request is initiated;
B. the corresponding address of service of a Service Instance is selected according to preset algorithm, sent belonging to the service request to the Service Instance
Service provider;
C. the call result that the described service provider responds the service request and returns is received.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810041787.4A CN108234666A (en) | 2018-01-16 | 2018-01-16 | A kind of micro services calling system, method and computer storage media |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810041787.4A CN108234666A (en) | 2018-01-16 | 2018-01-16 | A kind of micro services calling system, method and computer storage media |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108234666A true CN108234666A (en) | 2018-06-29 |
Family
ID=62642020
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810041787.4A Pending CN108234666A (en) | 2018-01-16 | 2018-01-16 | A kind of micro services calling system, method and computer storage media |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108234666A (en) |
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109104491A (en) * | 2018-08-30 | 2018-12-28 | 郑州云海信息技术有限公司 | A kind of micro services call method, device, server and storage medium |
CN109298958A (en) * | 2018-10-26 | 2019-02-01 | 恒生电子股份有限公司 | The call method and related system of service |
CN109582472A (en) * | 2018-10-19 | 2019-04-05 | 华为技术有限公司 | A kind of micro services processing method and equipment |
CN109714319A (en) * | 2018-12-06 | 2019-05-03 | 深圳市中农网有限公司 | Management system, method, apparatus, computer equipment and the storage medium of micro services |
CN110062043A (en) * | 2019-04-16 | 2019-07-26 | 杭州朗和科技有限公司 | Service administering method, service controlling device, storage medium and electronic equipment |
CN110233886A (en) * | 2019-05-30 | 2019-09-13 | 华南理工大学 | A kind of High Availabitity service governing system and implementation method towards magnanimity micro services |
CN110430079A (en) * | 2019-08-05 | 2019-11-08 | 腾讯科技(深圳)有限公司 | Bus or train route cooperative system |
CN110602193A (en) * | 2019-08-29 | 2019-12-20 | 微梦创科网络科技(中国)有限公司 | Service discovery method and system |
CN110659184A (en) * | 2019-09-23 | 2020-01-07 | 北京百度网讯科技有限公司 | Health state checking method, device and system |
CN110740151A (en) * | 2018-07-20 | 2020-01-31 | 中移信息技术有限公司 | micro-service adjusting method, device, server and computer storage medium |
CN110825772A (en) * | 2019-10-28 | 2020-02-21 | 爱钱进(北京)信息科技有限公司 | Method and device for synchronizing memory data of multiple service instances and storage medium |
CN111200651A (en) * | 2019-12-31 | 2020-05-26 | 优刻得科技股份有限公司 | Method, system, device and medium for timed calling of microservice |
CN112202605A (en) * | 2020-09-27 | 2021-01-08 | 中国建设银行股份有限公司 | Service configuration method, device, equipment and storage medium |
WO2021013023A1 (en) * | 2019-07-19 | 2021-01-28 | 深圳前海微众银行股份有限公司 | Microservice inter-communication method, computer apparatus, and storage medium |
CN112532670A (en) * | 2019-09-19 | 2021-03-19 | 阿里巴巴集团控股有限公司 | Data processing method and device |
CN112925628A (en) * | 2021-03-29 | 2021-06-08 | 建信金融科技有限责任公司 | Service management method and device |
CN113259431A (en) * | 2021-05-11 | 2021-08-13 | 中国工商银行股份有限公司 | Service calling method, service calling device, electronic device and storage medium |
CN113301175A (en) * | 2020-07-14 | 2021-08-24 | 阿里巴巴集团控股有限公司 | Service calling method, data storage method, device, equipment and storage medium |
CN113391820A (en) * | 2021-06-16 | 2021-09-14 | 浙江百应科技有限公司 | High-performance micro-service registration calling system and method |
CN114553967A (en) * | 2022-01-14 | 2022-05-27 | 青岛海尔科技有限公司 | Calling method and related device between micro services |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105141452A (en) * | 2015-08-07 | 2015-12-09 | 北京思特奇信息技术股份有限公司 | High-performance service system and method based on CXF |
US20160134530A1 (en) * | 2014-01-02 | 2016-05-12 | Futurewei Technologies, Inc. | Method and apparatus for scalable content routing and mobility in named data networks |
CN105959138A (en) * | 2016-04-29 | 2016-09-21 | 深圳前海大数点科技有限公司 | Micro-service dynamic disposition system and method based on cloud calculation |
CN106506605A (en) * | 2016-10-14 | 2017-03-15 | 华南理工大学 | A kind of SaaS application construction methods based on micro services framework |
CN107438107A (en) * | 2017-09-05 | 2017-12-05 | 深圳乐信软件技术有限公司 | The call method and device of background service in a kind of micro services framework |
-
2018
- 2018-01-16 CN CN201810041787.4A patent/CN108234666A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160134530A1 (en) * | 2014-01-02 | 2016-05-12 | Futurewei Technologies, Inc. | Method and apparatus for scalable content routing and mobility in named data networks |
CN105141452A (en) * | 2015-08-07 | 2015-12-09 | 北京思特奇信息技术股份有限公司 | High-performance service system and method based on CXF |
CN105959138A (en) * | 2016-04-29 | 2016-09-21 | 深圳前海大数点科技有限公司 | Micro-service dynamic disposition system and method based on cloud calculation |
CN106506605A (en) * | 2016-10-14 | 2017-03-15 | 华南理工大学 | A kind of SaaS application construction methods based on micro services framework |
CN107438107A (en) * | 2017-09-05 | 2017-12-05 | 深圳乐信软件技术有限公司 | The call method and device of background service in a kind of micro services framework |
Cited By (25)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110740151A (en) * | 2018-07-20 | 2020-01-31 | 中移信息技术有限公司 | micro-service adjusting method, device, server and computer storage medium |
CN109104491A (en) * | 2018-08-30 | 2018-12-28 | 郑州云海信息技术有限公司 | A kind of micro services call method, device, server and storage medium |
CN109582472A (en) * | 2018-10-19 | 2019-04-05 | 华为技术有限公司 | A kind of micro services processing method and equipment |
CN109298958A (en) * | 2018-10-26 | 2019-02-01 | 恒生电子股份有限公司 | The call method and related system of service |
CN109714319A (en) * | 2018-12-06 | 2019-05-03 | 深圳市中农网有限公司 | Management system, method, apparatus, computer equipment and the storage medium of micro services |
CN110062043A (en) * | 2019-04-16 | 2019-07-26 | 杭州朗和科技有限公司 | Service administering method, service controlling device, storage medium and electronic equipment |
CN110062043B (en) * | 2019-04-16 | 2021-10-29 | 杭州朗和科技有限公司 | Service management method, service management device, storage medium, and electronic device |
CN110233886A (en) * | 2019-05-30 | 2019-09-13 | 华南理工大学 | A kind of High Availabitity service governing system and implementation method towards magnanimity micro services |
WO2021013023A1 (en) * | 2019-07-19 | 2021-01-28 | 深圳前海微众银行股份有限公司 | Microservice inter-communication method, computer apparatus, and storage medium |
CN110430079A (en) * | 2019-08-05 | 2019-11-08 | 腾讯科技(深圳)有限公司 | Bus or train route cooperative system |
CN110602193A (en) * | 2019-08-29 | 2019-12-20 | 微梦创科网络科技(中国)有限公司 | Service discovery method and system |
CN112532670A (en) * | 2019-09-19 | 2021-03-19 | 阿里巴巴集团控股有限公司 | Data processing method and device |
CN112532670B (en) * | 2019-09-19 | 2022-07-05 | 阿里巴巴集团控股有限公司 | Data processing method and device |
CN110659184A (en) * | 2019-09-23 | 2020-01-07 | 北京百度网讯科技有限公司 | Health state checking method, device and system |
CN110659184B (en) * | 2019-09-23 | 2023-04-18 | 北京百度网讯科技有限公司 | Health state checking method, device and system |
CN110825772A (en) * | 2019-10-28 | 2020-02-21 | 爱钱进(北京)信息科技有限公司 | Method and device for synchronizing memory data of multiple service instances and storage medium |
CN111200651A (en) * | 2019-12-31 | 2020-05-26 | 优刻得科技股份有限公司 | Method, system, device and medium for timed calling of microservice |
CN113301175A (en) * | 2020-07-14 | 2021-08-24 | 阿里巴巴集团控股有限公司 | Service calling method, data storage method, device, equipment and storage medium |
CN113301175B (en) * | 2020-07-14 | 2022-04-12 | 阿里巴巴集团控股有限公司 | Service calling method, data storage method, device, equipment and storage medium |
CN112202605A (en) * | 2020-09-27 | 2021-01-08 | 中国建设银行股份有限公司 | Service configuration method, device, equipment and storage medium |
CN112925628A (en) * | 2021-03-29 | 2021-06-08 | 建信金融科技有限责任公司 | Service management method and device |
CN113259431A (en) * | 2021-05-11 | 2021-08-13 | 中国工商银行股份有限公司 | Service calling method, service calling device, electronic device and storage medium |
CN113259431B (en) * | 2021-05-11 | 2022-11-11 | 中国工商银行股份有限公司 | Service calling method, service calling device, electronic device and storage medium |
CN113391820A (en) * | 2021-06-16 | 2021-09-14 | 浙江百应科技有限公司 | High-performance micro-service registration calling system and method |
CN114553967A (en) * | 2022-01-14 | 2022-05-27 | 青岛海尔科技有限公司 | Calling method and related device between micro services |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108234666A (en) | A kind of micro services calling system, method and computer storage media | |
CN108282368A (en) | A kind of micro services management system, method and computer storage media | |
CN109412853B (en) | Distributed service registration storage method, system, device and storage medium | |
CN103841134B (en) | Based on API transmission, the method for receive information, apparatus and system | |
CN101931619B (en) | Pluggable contact resolution | |
CN109993542A (en) | A kind of method, apparatus, server and storage medium for assigning work order | |
CN114756347B (en) | Cluster-based server resource scheduling method and device, cloud platform and medium | |
KR101376815B1 (en) | Global provisioning of millions of users with deployment units | |
CN106130972B (en) | resource access control method and device | |
CN109818809A (en) | Interactive voice response system and its data processing method and phone customer service system | |
CN110677492A (en) | Access request processing method and device, electronic equipment and storage medium | |
CN109981757A (en) | A kind of API gateway load-balancing algorithm towards small-scale micro services framework | |
CN103516759A (en) | Cloud system resource management method, cloud call center seat management method and cloud system | |
CN107172214A (en) | A kind of service node with load balancing finds method and device | |
CN112764920A (en) | Edge application deployment method, device, equipment and storage medium | |
CN107635251A (en) | Fiduciary network traffics concocting method | |
CN111431818B (en) | Cross-domain request flow distribution method and device, storage medium and computer equipment | |
CN106815053A (en) | A kind of data-updating method, device, data call end and data update system | |
CN106484714B (en) | A kind of storage method and equipment of behavior record | |
CN109412940B (en) | Router management method and router management system | |
CN110830492A (en) | Method and system for mutually scheduling edge applications based on CoreDNS registration service | |
CN108196962B (en) | Method and device for realizing calling of interfaces of different versions | |
CN111163237B (en) | Call service flow control method and related device | |
CN110347502A (en) | Load equilibration scheduling method, device and the electronic equipment of cloud host server | |
CN109274641A (en) | Connection method and device, calculating equipment and storage medium between client and service node |
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: 20180629 |
|
RJ01 | Rejection of invention patent application after publication |