CN110324177A - Service request processing method, system and medium under micro-service architecture - Google Patents

Service request processing method, system and medium under micro-service architecture Download PDF

Info

Publication number
CN110324177A
CN110324177A CN201910469325.7A CN201910469325A CN110324177A CN 110324177 A CN110324177 A CN 110324177A CN 201910469325 A CN201910469325 A CN 201910469325A CN 110324177 A CN110324177 A CN 110324177A
Authority
CN
China
Prior art keywords
service
micro services
list
eureka
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910469325.7A
Other languages
Chinese (zh)
Other versions
CN110324177B (en
Inventor
李小玲
周敬松
李小勇
吴庆波
谭郁松
朱浩
秦莹
杨沙洲
马俊
董攀
高珑
靳红军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN201910469325.7A priority Critical patent/CN110324177B/en
Publication of CN110324177A publication Critical patent/CN110324177A/en
Application granted granted Critical
Publication of CN110324177B publication Critical patent/CN110324177B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a service request processing method, a system and a medium under a micro-service architecture, and the method of the invention provides an improved thought aiming at the problems of low service request processing efficiency and the like caused by the full address information of the Eureka Client local cache service in the current Spring Cloud architecture: by defining the list of the service names which the Eureka Client depends on in the configuration file of the Eureka Client, when the Eureka Client sends a request to acquire the service addresses from the Eureka Server, the list of the dependent service names stated in the configuration file can be used as parameters to be transmitted to the Eureka Server, the Eureka Server matches according to the parameters of the transmitted list, and finally, only the service addresses which the Eureka Client depends on are returned. The invention can achieve the effects of reducing network overhead and memory use overhead, improving request processing efficiency and the like.

Description

Service request processing method, system and medium under a kind of micro services framework
Technical field
The present invention relates to micro services technologies, and in particular to service request processing method, system under a kind of micro services framework And medium.
Background technique
Micro services framework is the new technique that application and service is disposed in cloud computing environment.Service register center is A significant components in micro services framework, it mainly realizes the functions such as registration and the discovery of micro services, maintains micro services The key-value pair informations such as title and corresponding address port.Request call in the operation framework of micro services, between micro services Generally comprise two steps: first, address information (including IP and the port of called micro services are inquired by service register center Deng);Second, according to the address information of acquisition, transmitting and the clothes of message are realized by modes such as RESTful API or RPC calling The triggering for calling of being engaged in.Spring Cloud is one of the mainstream frame of current micro services technology, which adjusts to alleviate service With request to the access pressure of service register center (Eureka Server), service subscription person (Eureka Client) can the period The information for obtaining registered service from Eureka Server in a manner of increment of property, and it is buffered in Eureka Client sheet In ground caching, when service call, preferentially inquires relevant information on services in Eureka Client local cache.
For existing Spring Cloud framework, Fig. 1 gives a micro services request processing schematic, wherein Eureka Server is responsible for safeguarding that registered service list, source host (being considered as an Eureka Client) deploy Micro services A is service consumer (Service Consumer), destination host (being also considered as an Eureka Client) portion Having affixed one's name to by micro services B is service provider (Service Provider).Eureka Client is issued to Eureka Server Request to complete service registration, renewed treaty and the operation such as offline, the data that when request sends include Service name, machine IP, port numbers, Domain name etc..
As shown in Figure 1, source host obtains the service registration of the micro services B disposed in destination host to Eureka Server Information, and communicated by far call with service provider, to realize micro services A to the calling of micro services B.It is servicing In registration process, destination host calls the registration of the service of realization by register () interface, and when registration transmits InstanceInfo object information gives Eureka Server, contains micro services in instanceInfo object The information such as instanceId, micro services name (appName), machine IP address (ipAddr) and port numbers (port);Eureka The registered service list information that the local cache of Client Eureka Server is sended over has recorded in list each The instanceInfo object information of micro services.
Referring to fig. 2, specific request processing step is as follows:
1) call request of the source micro services (micro services A) of source host to the target micro services (micro services B) on destination host;
2) source host reads its local cache, in the registered service list information of its maintenance, passes through micro services B's Its corresponding ipAddr and port information of appName traversal queries, by calling getRegisteredApplications () Method is realized reads micro services instance data from its caching;If inquiring B pairs of micro services in the service list of local cache IpAddr the and port information answered, then jump to step 5);
3) source host issues service acquisition request, usually incremental re-quest to Eureka Server, is only full dose under abnormal conditions Request, such as caching are different for empty or consistency hash value, and Eureka Server is by relevant instanceInfo list information Return to source host;Eureka Server has opened the RESTful interface of two Get types for returning to address of service letter Breath, is full dose address interface/{ version }/apps and incremental address interface/{ version }/apps/delta respectively.Often The request that one Eureka Client full dose obtains information (or increment acquisition information) is responded by them;
4) after source host gets the registration service information of Eureka Server return, by writing memory mode for information on services It is written in source host caching;
5) source host is according to the information such as appName, ipAddr and port of the service B got, by RESTful API or RPC agreement carries out far call.
As indicated above, it is known that stored in the local cache of each Eureka Client in Spring Cloud framework All it is the full dose information of registered service, Internet resources and the transition of Eureka Client end memory resource is often brought to disappear The problem of consumption.
In conclusion there are the following problems for service request handling process in existing Spring Cloud framework: knowing What is stored in the local cache of each Eureka Client in Spring Cloud framework is the full dose letter of registered service The problem of ceasing, the transition of Internet resources and Eureka Client end memory resource often brought to consume.I.e. no matter Eureka Whether Client needs to call the service, is all stored in local cache, and this mode can bring Internet resources and Eureka Client end memory resource consumes excessively.When the scale of micro services quantity is bigger, especially in the feelings of multiple data centers Under condition, which will be amplified, and be had a significant impact for the response time of service request handling.
Summary of the invention
The technical problem to be solved in the present invention: it in view of the above problems in the prior art, provides under a kind of micro services framework Service request processing method, system and medium, can achieve using the present invention is reduced network overhead, memory using expense and mentioned Rise request treatment effeciency and other effects.
In order to solve the above-mentioned technical problem, the technical solution adopted by the present invention are as follows:
A kind of service request processing method under micro services framework, service register center Eureka Server customer in response end Eureka Client service acquisition request the step of include:
1) the service acquisition request and its service dependence list that client Eureka Client is sent are received, the service relies on List includes the target micro services information that the source micro services in service acquisition request can be called;
It 2) is that full dose request or incremental re-quest select to search service list to be whole services according to the type that service acquisition is requested Information on services in information or in the recent period change queue recentlyChangedQueue, will search service list and service relies on List is matched, and filters out the target that relies on the relevant micro services set of list as source micro services to service and can call in incognito Business returns to the client Eureka Client for issuing service acquisition request, the recent change queue RecentlyChangedQueue is on service register center Eureka Server for caching the micro services changed in the recent period Queue.
Preferably, the detailed step of step 2 includes:
2.1) judge client Eureka Client send service acquisition request used by interface be full dose address interface or Incremental address interface then jumps if it is full dose address interface and executes step 2.2);Otherwise it jumps and executes step 2.3);
2.2) select to search service list as whole information on services;It jumps and executes step 2.4);
2.3) select to search service list as the information on services in change queue recentlyChangedQueue in the recent period;It jumps and holds Row step 2.4);
2.4) lookup service list is relied on list with service to match, filters out micro services relevant to service dependence list The target micro services that gathering can call as source micro services return to the client Eureka for issuing service acquisition request Client。
Preferably, the detailed step of step 2.4) includes:
2.4.1 it) constructs and relies on the return list ReturnList of the relevant micro services set of list for storing and servicing;
2.4.2 service list) will be searched and be denoted as ServiceList, service is relied on into list and is denoted as DependList, constructs Hash Bucket HashSet and traverse service rely on list DependList and by each of these element DependList (i) and are added It is added to Hash bucket HashSet and carries out duplicate removal;Then service list ServiceList is searched by each of these element in traversal The micro services title appName of ServiceList (j) is added in Hash bucket HashSet, if there is having existed the element It clashes, ServiceList (j) is added to and is returned in list ReturnList;
2.4.3 the consistency hash value for returning to related micro services in list ReturnList) is obtained, list will be returned ReturnList and its corresponding consistency hash value return to the client Eureka Client for issuing service acquisition request.
Preferably, the source micro services of source host local include: to the target micro services call request step on destination host
S1) source host reads its local cache, and by the micro services title appName traversal queries of target micro services, its is corresponding IP address ipAddr and port port information, if with inquiring the corresponding IP of target micro services in the service list of local cache Location ipAddr and port port information, then jump to step S6);Otherwise, it jumps and performs the next step;
S2) service that source host reads source micro services into local preset configuration file relies on list;
S3) source host judges the type of service acquisition request, if caching is different for empty or consistency hash value, the service of judgement is obtained The type for taking request is that full dose is called, and otherwise determines the type of service acquisition request for increment calling;Source host is as client Different service interfaces of the type that Eureka Client is requested according to service acquisition to service register center Eureka Server Service acquisition request is issued, while the service of source micro services is relied on into list as parameter and passes to service register center Eureka Server;
S4) source host receives the target micro services that the source micro services of service register center Eureka Server return can be called, and leads to It crosses and writes memory mode the target micro services that source micro services can be called are deposited into the caching of source host;
S5) the target micro services that source host can be called according to source micro services obtain target micro services micro services title appName, IP address ipAddr and port port information;
S6) source micro services carry out far call target micro services by RESTful API or RPC agreement.
Preferably, step S4) detailed step include:
S4.1) source host receives the return list ReturnList and its correspondence of service register center Eureka Server return Consistency hash value, the list ReturnList that returns includes the target micro services information that can call of source micro services;It will return The set of service that list ReturnList is returned in local cache carries out increment merging;
S4.2 after) source host is in service list increment set of service being merged into caching, calculate the consistent of local cache Property hash value, compares the value and whether the service register center Eureka Server consistency hash value sent is consistent;If consistent Property hash value is identical, illustrates that the information at both ends is consistent;It jumps and executes step S5);If consistency hash value is different, illustrate two The information at end is different, then empties local cache, jumps and executes step S3) it is requested with the service acquisition for sending full dose calling.
Preferably, step S4.1) in will return list ReturnList in local cache set of service carry out increment conjunction And specifically refer to source host traversal and return to list ReturnList, compare and returns to each micro services in list ReturnList Status Type actionType adds this in incognito in the caching of oneself if Status Type actionType is ADDED Business, the micro services are just removed from the cache if it is DELETED.
The present invention also provides the service request handling system under a kind of micro services framework, including computer equipment, the calculating Machine equipment is programmed to perform the step of service request processing method under the aforementioned micro services framework of the present invention.
The present invention also provides the service request handling system under a kind of micro services framework, including computer equipment, the calculating The calculating of the service request processing method under the aforementioned micro services framework of the present invention is programmed to perform on the storage medium of machine equipment Machine program.
The present invention also provides a kind of computer readable storage medium, it is stored with and is programmed on the computer readable storage medium To execute the computer program of the service request processing method under the aforementioned micro services framework of the present invention.
The present invention also provides the service request handling systems under a kind of micro services framework, including service register center Eureka The journey of the service acquisition request of Server, service register center Eureka Server customer in response end Eureka Client Sequence module includes:
Request receive program module, for receive client Eureka Client transmission service acquisition request and its service according to Rely list, it includes the target micro services information that the source micro services in service acquisition request can be called that the service, which relies on list,;
Matcher module is requested, the type for requesting according to service acquisition is that full dose is requested or clothes are searched in incremental re-quest selection The information on services being engaged in the information on services or recent change queue recentlyChangedQueue that list is whole, will search Service list and service rely on list and are matched, filter out with the relevant micro services set of service dependence list as source in incognito The target micro services for being engaged in call return to the client Eureka Client for issuing service acquisition request, the recent change Queue recentlyChangedQueue be service register center Eureka Server on for cache in the recent period change it is micro- The queue of service.
The service list that the present invention is relied on by defining it in the configuration file of client Eureka Client, works as visitor Family end Eureka Client is sent when request obtains address of service from service register center Eureka Server in configuration file The dependence service list of statement can pass to service register center Eureka Server, service register center as parameter Eureka Server makees matching according to incoming list parameter and only returns to the service that client Eureka Client is relied on Address.Compared to the prior art, it has an advantage that
1) reduce network overhead: service register center Eureka Server only transmits its dependence to client Eureka Client The example information of service can greatly reduce the transmission of the example information of uncorrelated service, reduction pair when micro services quantity is very big The expense of Internet resources;
2) it reduces memory and uses expense: only storing its example for relying on service in the local cache of client Eureka Client Information, the example information without accessing full dose micro services can reduce client Eureka when micro services quantity is very big Use of the Client to memory source;
3) request treatment effeciency is promoted: due to only storing its reality for relying on service in client Eureka Client local cache Example information, reduces the storage to unnecessary information on services, when searching the address information of service by local cache, can reduce Time overhead promotes service request handling efficiency.
Detailed description of the invention
Fig. 1 is that existing micro services call schematic illustration.
Fig. 2 is existing micro services call flow schematic diagram.
Fig. 3 is that micro services call schematic illustration in the embodiment of the present invention.
Fig. 4 is the process signal of the service acquisition request of micro- customer in response end Eureka Client in the embodiment of the present invention Figure.
Fig. 5 is micro services call flow schematic diagram micro- in the embodiment of the present invention.
Specific embodiment
As shown in Figure 3 and Figure 4, in the service request processing method under the present embodiment micro services framework, service register center Eureka Server customer in response end Eureka Client service acquisition request the step of include:
1) the service acquisition request and its service dependence list that client Eureka Client is sent are received, the service relies on List includes the target micro services information that the source micro services in service acquisition request can be called;
It 2) is that full dose request or incremental re-quest select to search service list to be whole services according to the type that service acquisition is requested Information on services in information or in the recent period change queue recentlyChangedQueue, will search service list and service relies on List is matched, and filters out the target that relies on the relevant micro services set of list as source micro services to service and can call in incognito Business returns to the client Eureka Client for issuing service acquisition request, changes queue in the recent period RecentlyChangedQueue is on service register center Eureka Server for caching the micro services changed in the recent period Queue.
As shown in Figure 4 and Figure 5, the detailed step of step 2 includes: in the present embodiment
2.1) judge client Eureka Client send service acquisition request used by interface be full dose address interface or Incremental address interface then jumps if it is full dose address interface and executes step 2.2);Otherwise it jumps and executes step 2.3);
2.2) select to search service list as whole information on services;It jumps and executes step 2.4);
2.3) select to search service list as the information on services in change queue recentlyChangedQueue in the recent period;It jumps and holds Row step 2.4);
2.4) lookup service list is relied on list with service to match, filters out micro services relevant to service dependence list The target micro services that gathering can call as source micro services return to the client Eureka for issuing service acquisition request Client。
In the present embodiment, the detailed step of step 2.4) includes:
2.4.1 it) constructs and relies on the return list ReturnList of the relevant micro services set of list for storing and servicing;
2.4.2 service list) will be searched and be denoted as ServiceList, service is relied on into list and is denoted as DependList, constructs Hash Bucket HashSet and traverse service rely on list DependList and by each of these element DependList (i) and are added It is added to Hash bucket HashSet and carries out duplicate removal;Then service list ServiceList is searched by each of these element in traversal The micro services title appName of ServiceList (j) is added in Hash bucket HashSet, if there is having existed the element It clashes, ServiceList (j) is added to and is returned in list ReturnList;
2.4.3 the consistency hash value for returning to related micro services in list ReturnList) is obtained, list will be returned ReturnList and its corresponding consistency hash value return to the client Eureka Client for issuing service acquisition request.
As shown in Figure 4 and Figure 5, from the service under the angle of client Eureka Client, the present embodiment micro services framework The source micro services (micro services A) of source host local are to the target micro services (micro services B) on destination host in request processing method Call request step includes:
S1) source host reads its local cache, passes through its corresponding IP of the micro services title appName traversal queries of micro services B Address ipAddr and port port information, if inquiring the corresponding IP address of micro services B in the service list of local cache IpAddr and port port information, then jump to step S6);Otherwise, it jumps and performs the next step;Source host reads its local cache Micro services instance data can be read from its caching by calling getRegisteredApplications () method to realize;
S2) service that source host reads micro services A into local preset configuration file relies on list;
S3) source host judges the type of service acquisition request, if caching is different for empty or consistency hash value, the service of judgement is obtained The type for taking request is that full dose is called, and otherwise determines the type of service acquisition request for increment calling;Source host is as client Different service interfaces of the type that Eureka Client is requested according to service acquisition to service register center Eureka Server Service acquisition request is issued, while the service of micro services A is relied on into list as parameter and passes to service register center Eureka Server;
The RESTful interface that Eureka Server has opened two Get types is used to return to address of service information, is respectively:
Full dose address interface/{ version }/apps
Incremental address interface/{ version }/apps/delta
The request that each Eureka Client full dose obtains information (or increment acquisition information) is responded by them.
S4) source host receives the target that can call of micro services A of service register center Eureka Server return in incognito The target micro services that micro services A can be called, are deposited into the caching of source host by business by writing memory mode;
S5) the target micro services that source host can be called according to micro services A are with obtaining micro services title appName, IP of micro services B Location ipAddr and port port information;
S6) micro services A carries out far call micro services B by RESTful API or RPC agreement.
In the present embodiment, the information of micro services example is stored by instanceInfo class object, each micro services has 47 attributes are denoted as M1 (instanceId, appName...version), wherein instanceId be micro services example only One identifier, appName are the titles of micro services, and the same micro services can have multiple examples.In addition to this, InstanceInfo class object also includes IP address ipAddr, port port, Hostname hostName, Status Type The attribute informations such as actionType.
By taking login-service as an example, the instanceInfo object definition of login-service is as follows:
“instanceInfo”: {
“instanceId” : “login-service-h001:login-service:3000”
“appName” : 'login-service,
“ipAddr” : “11.1.98.15”,
“port”: “3000”,
“hostName” : “11.1.98.15”
“actionType”: “ADDED”
……
}
In examples detailed above, " instanceInfo " illustrates that this is the instanceInfo object of a service, " instanceId " It is the number of micro services example, in large-scale distributed system, it is contemplated that the load balancing and High Availabitity of system, a micro services Different running examples is had, is identified often through the attribute;" appName " indicates the title of micro services, " ipAddr " Indicate the IP address of micro services example, " port " indicates the port numbers of micro services example, and " hostName " is indicated where micro services The host name of container, " actionType " indicate the state of micro services, if ADDED representative is newly-increased micro services, DELETE generation Table micro services are offline.
Source host reading service into its configuration file relies on list, includes the Service name for relying on service in the list, with For login service login-service, which is defined as follows:
“login-service”: {
Depends:
“login-database”,
“select-database”,
“login- process”
}
Wherein, " login-service " indicates micro services name, and Depends indicates that " login-service " relies on service list, " login-database " indicates log database service, and " select-database " indicates inquiry database service, The flow processing service of " login-process " expression register.
In the present embodiment, step S4) detailed step include:
S4.1) source host receives the return list ReturnList and its correspondence of service register center Eureka Server return Consistency hash value, the list ReturnList that returns includes the target micro services information that can call of micro services A;It will return List ReturnList carries out increment merging in the set of service of local cache;
S4.2 after) source host is in service list increment set of service being merged into caching, calculate the consistent of local cache Property hash value, compares the value and whether the service register center Eureka Server consistency hash value sent is consistent;If consistent Property hash value is identical, illustrates that the information at both ends is consistent;It jumps and executes step S5);If consistency hash value is different, illustrate two The information at end is different, then empties local cache, jumps and executes step S3) it is requested with the service acquisition for sending full dose calling.
In the present embodiment, step S4.1) in will return to list ReturnList and increase in the set of service of local cache Amount, which merges, specifically refers to source host traversal return list ReturnList, compares and returns to each in list ReturnList in incognito The Status Type actionType of business adds this in the caching of oneself if Status Type actionType is ADDED Micro services are just removed from the cache the micro services if it is DELETED.
Requested if full dose, service register center Eureka Server by the instanceInfo information all serviced and Service list in SDL is compared, by calling return_service () method to obtain returning to list ReturnList, And Eureka Client is returned to by list ReturnList is returned.By taking login-service as an example, return_service The detailed process of () method is as follows:
The first step, the service that login-service is read in local profile relies on list, according to above-mentioned definition, it is known that It is login-database, select-database, login-process that service, which relies on the micro services for including in list,;
Second step, client Eureka Client is by calling AbstractJerseyEurekaHttpClient (String UrlPath, String [] regions, List list) method realize to service register center Eureka Server issue Service acquisition request, wherein List parameter is the SDL list obtained;
Third step, it is assumed that the registered Service Instance collection in service register center Eureka Server is combined into { login- database1、login-database2、visit-portal1、visit-portal2、visit-video1、select- Database1, login-process1, login-process2, write-database1, write-database2 }, and work as Preceding acquisition request is full dose request;Eureka Server compares the column of the service in List by return_service () at this time Table and registered Service Instance set, by taking login-database as an example, it is known that login-database1 and login- The Service name of database2 is login-database, therefore the two Service Instances column are added to the Service Instance of return In set;And so on, it is known that the Service Instance collection finally returned that be combined into login-database1, login-database2, select-database1,login-process1,login-process2 };
It is requested if full dose, if incremental re-quest, service register center Eureka Server will change queue in the recent period The InstanceInfo information of the Service Instance of recentlyChangedQueue storage and service rely in list, and pass through Return_service () method calculates change queue recentlyChangedQueue in the recent period and services the clothes relied in list Business list is compared;By calling return_service () method to obtain list, and client Eureka will be returned to Client。
In conclusion the service request processing method under the present embodiment micro services framework is to client Eureka Client The mechanism of the service object obtained from service register center Eureka Server improves optimization, first in client The service that it is defined in the configuration file of Eureka Client relies on list (Service Depend List, SDL), the list Define the target micro services information that the micro services can be called;Then, client Eureka Client is by reading configuration file The service of acquisition relies on list SDL;Client Eureka Client is after getting service dependence list SDL, into service registration When heart Eureka Server sends service acquisition request, service is relied on into list SDL and is also sent over.Service register center After the request for receiving client Eureka Client, the micro services list information that needs are returned (takes Eureka Server Pragmatic example information object set, service instanceInfo object set) and service dependence list SDL matched, filter out The set of service that relative service instanceInfo object set, the i.e. service can call, and should InstanceInfo aggregate information returns to client Eureka Client and is stored in its local cache.The program can solve Client Eureka Client obtains the problem of a large amount of unrelated addresss of service, and only storage relies on the address information of service with it, While reducing network data transmission amount, when reducing the space of client Eureka Client local cache and using and access Expense, promoted Spring Cloud micro services framework overall performance.In addition, service rely on list SDL be only stored in it is each A client is stored in service register center Eureka Server not as registration information, if being stored in service registration Heart Eureka Server responds the Dependency Specification that a micro services request needs to inquire it, the time for increasing additional is opened Pin.Compared to available frame, the service request processing method under the present embodiment micro services framework has done following improvement: first, in visitor In the configuration file of family end Eureka Client, the definition that service relies on list is increased;Second, client Eureka When Client sends service acquisition request, delivers the service read from configuration file and rely on list information;Third, service Registration center Eureka Server relies on list information and screen and return to relative example information object according to service to be believed Breath.Therefore, the service request processing method under the present embodiment micro services framework can be realized efficient micro services request processing, adopt It can achieve with the present embodiment method and reduce network overhead, memory uses expense and promotion request treatment effeciency and other effects.
In addition, the present embodiment also provides the service request handling system under a kind of micro services framework, including computer equipment, The computer equipment is programmed to perform the step of service request processing method under the aforementioned micro services framework of the present embodiment.The meter Calculating machine equipment can be service register center Eureka Server or client Eureka Client.In addition, the present embodiment The service request handling system under a kind of micro services framework, including computer equipment are also provided, the storage of the computer equipment is situated between The computer program of the service request processing method under the aforementioned micro services framework of the present embodiment is programmed to perform in matter.The calculating Machine equipment can be service register center Eureka Server or client Eureka Client.In addition, the present embodiment is also A kind of computer readable storage medium is provided, is stored on the computer readable storage medium before being programmed to perform the present embodiment State the computer program of the service request processing method under micro services framework.The computer readable storage medium can be service note Computer readable storage medium on volume center Eureka Server or client Eureka Client.In addition, this implementation Example also provides the service request handling system under a kind of micro services framework, including service register center Eureka Server, described Service register center Eureka Server customer in response end Eureka Client service acquisition request program module include:
Request receive program module, for receive client Eureka Client transmission service acquisition request and its service according to Rely list, it includes the target micro services information that the source micro services in service acquisition request can be called that the service, which relies on list,;
Matcher module is requested, the type for requesting according to service acquisition is that full dose is requested or clothes are searched in incremental re-quest selection The information on services being engaged in the information on services or recent change queue recentlyChangedQueue that list is whole, will search Service list and service rely on list and are matched, filter out with the relevant micro services set of service dependence list as source in incognito The target micro services for being engaged in call return to the client Eureka Client for issuing service acquisition request, change queue in the recent period RecentlyChangedQueue is on service register center Eureka Server for caching the micro services changed in the recent period Queue.
The above is only a preferred embodiment of the present invention, protection scope of the present invention is not limited merely to above-mentioned implementation Example, all technical solutions belonged under thinking of the present invention all belong to the scope of protection of the present invention.It should be pointed out that for the art Those of ordinary skill for, several improvements and modifications without departing from the principles of the present invention, these improvements and modifications It should be regarded as protection scope of the present invention.

Claims (10)

1. the service request processing method under a kind of micro services framework, which is characterized in that service register center Eureka Server Customer in response end Eureka Client service acquisition request the step of include:
1) the service acquisition request and its service dependence list that client Eureka Client is sent are received, the service relies on List includes the target micro services information that the source micro services in service acquisition request can be called;
It 2) is that full dose request or incremental re-quest select to search service list to be whole services according to the type that service acquisition is requested Information on services in information or in the recent period change queue recentlyChangedQueue, will search service list and service relies on List is matched, and filters out the target that relies on the relevant micro services set of list as source micro services to service and can call in incognito Business returns to the client Eureka Client for issuing service acquisition request, the recent change queue RecentlyChangedQueue is on service register center Eureka Server for caching the micro services changed in the recent period Queue.
2. the service request processing method under micro services framework according to claim 1, which is characterized in that step 2 it is detailed Carefully step includes:
2.1) judge client Eureka Client send service acquisition request used by interface be full dose address interface or Incremental address interface then jumps if it is full dose address interface and executes step 2.2);Otherwise it jumps and executes step 2.3);
2.2) select to search service list as whole information on services;It jumps and executes step 2.4);
2.3) select to search service list as the information on services in change queue recentlyChangedQueue in the recent period;It jumps and holds Row step 2.4);
2.4) lookup service list is relied on list with service to match, filters out micro services relevant to service dependence list The target micro services that gathering can call as source micro services return to the client Eureka for issuing service acquisition request Client。
3. the service request processing method under micro services framework according to claim 2, which is characterized in that step 2.4) Detailed step includes:
2.4.1 it) constructs and relies on the return list ReturnList of the relevant micro services set of list for storing and servicing;
2.4.2 service list) will be searched and be denoted as ServiceList, service is relied on into list and is denoted as DependList, constructs Hash Bucket HashSet and traverse service rely on list DependList and by each of these element DependList (i) and are added It is added to Hash bucket HashSet and carries out duplicate removal;Then service list ServiceList is searched by each of these element in traversal The micro services title appName of ServiceList (j) is added in Hash bucket HashSet, if there is having existed the element It clashes, ServiceList (j) is added to and is returned in list ReturnList;
2.4.3 the consistency hash value for returning to related micro services in list ReturnList) is obtained, list will be returned ReturnList and its corresponding consistency hash value return to the client Eureka Client for issuing service acquisition request.
4. the service request processing method under a kind of micro services framework, which is characterized in that the source micro services of source host local are to mesh Mark host on target micro services call request step include:
S1) source host reads its local cache, and by the micro services title appName traversal queries of target micro services, its is corresponding IP address ipAddr and port port information, if with inquiring the corresponding IP of target micro services in the service list of local cache Location ipAddr and port port information, then jump to step S6);Otherwise, it jumps and performs the next step;
S2) service that source host reads source micro services into local preset configuration file relies on list;
S3) source host judges the type of service acquisition request, if caching is different for empty or consistency hash value, the service of judgement is obtained The type for taking request is that full dose is called, and otherwise determines the type of service acquisition request for increment calling;Source host is as client Different service interfaces of the type that Eureka Client is requested according to service acquisition to service register center Eureka Server Service acquisition request is issued, while the service of source micro services is relied on into list as parameter and passes to service register center Eureka Server;
S4) source host receives the target micro services that the source micro services of service register center Eureka Server return can be called, and leads to It crosses and writes memory mode the target micro services that source micro services can be called are deposited into the caching of source host;
S5) the target micro services that source host can be called according to source micro services obtain target micro services micro services title appName, IP address ipAddr and port port information;
S6) source micro services carry out far call target micro services by RESTful API or RPC agreement.
5. the service request processing method under micro services framework according to claim 4, which is characterized in that step S4) Detailed step includes:
S4.1) source host receives the return list ReturnList and its correspondence of service register center Eureka Server return Consistency hash value, the list ReturnList that returns includes the target micro services information that can call of source micro services;It will return The set of service that list ReturnList is returned in local cache carries out increment merging;
S4.2 after) source host is in service list increment set of service being merged into caching, calculate the consistent of local cache Property hash value, compares the value and whether the service register center Eureka Server consistency hash value sent is consistent;If consistent Property hash value is identical, illustrates that the information at both ends is consistent;It jumps and executes step S5);If consistency hash value is different, illustrate two The information at end is different, then empties local cache, jumps and executes step S3) it is requested with the service acquisition for sending full dose calling.
6. the service request processing method under micro services framework according to claim 5, which is characterized in that step S4.1) It is middle that return list ReturnList is specifically referred into source host traversal return in the set of service progress increment merging of local cache List ReturnList compares the Status Type actionType for returning to each micro services in list ReturnList, if Status Type actionType is that ADDED just adds this micro services in the caching of oneself, if it is DELETED just from caching In delete the micro services.
7. the service request handling system under a kind of micro services framework, including computer equipment, which is characterized in that the computer is set The step of standby service request processing method being programmed to perform under micro services framework described in any one of claim 1~6.
8. the service request handling system under a kind of micro services framework, including computer equipment, which is characterized in that the computer is set It is programmed to perform on standby storage medium at the service request under micro services framework described in any one of claim 1~6 The computer program of reason method.
9. a kind of computer readable storage medium, which is characterized in that be stored with and be programmed on the computer readable storage medium The computer program of service request processing method under micro services framework described in any one of perform claim requirement 1~6.
10. the service request handling system under a kind of micro services framework, which is characterized in that including service register center Eureka The journey of the service acquisition request of Server, service register center Eureka Server customer in response end Eureka Client Sequence module includes:
Request receive program module, for receive client Eureka Client transmission service acquisition request and its service according to Rely list, it includes the target micro services information that the source micro services in service acquisition request can be called that the service, which relies on list,;
Matcher module is requested, the type for requesting according to service acquisition is that full dose is requested or clothes are searched in incremental re-quest selection The information on services being engaged in the information on services or recent change queue recentlyChangedQueue that list is whole, will search Service list and service rely on list and are matched, filter out with the relevant micro services set of service dependence list as source in incognito The target micro services for being engaged in call return to the client Eureka Client for issuing service acquisition request, the recent change Queue recentlyChangedQueue be service register center Eureka Server on for cache in the recent period change it is micro- The queue of service.
CN201910469325.7A 2019-05-31 2019-05-31 Service request processing method, system and medium under micro-service architecture Active CN110324177B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910469325.7A CN110324177B (en) 2019-05-31 2019-05-31 Service request processing method, system and medium under micro-service architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910469325.7A CN110324177B (en) 2019-05-31 2019-05-31 Service request processing method, system and medium under micro-service architecture

Publications (2)

Publication Number Publication Date
CN110324177A true CN110324177A (en) 2019-10-11
CN110324177B CN110324177B (en) 2022-05-24

Family

ID=68119251

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910469325.7A Active CN110324177B (en) 2019-05-31 2019-05-31 Service request processing method, system and medium under micro-service architecture

Country Status (1)

Country Link
CN (1) CN110324177B (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110601994A (en) * 2019-10-14 2019-12-20 南京航空航天大学 Load balancing method for micro-service chain perception in cloud environment
CN111245916A (en) * 2020-01-07 2020-06-05 苏宁云计算有限公司 Service calling method, service arranging method and device based on micro-service gateway
CN111752641A (en) * 2020-06-29 2020-10-09 深圳壹账通智能科技有限公司 Method, device, equipment and storage medium for starting service between micro-service containers
CN111858101A (en) * 2020-07-28 2020-10-30 平安医疗健康管理股份有限公司 Cloud architecture system-oriented adaptation method, device, equipment and storage medium
CN111917838A (en) * 2020-07-14 2020-11-10 浙江大华技术股份有限公司 Processing method and device based on micro service, storage medium and electronic device
CN112019387A (en) * 2020-09-02 2020-12-01 上海卓钢链科技有限公司 Distributed service registration center construction method
CN112286503A (en) * 2020-10-28 2021-01-29 平安科技(深圳)有限公司 Multi-registration center micro-service unified management method, device, equipment and medium
CN112311786A (en) * 2020-10-28 2021-02-02 北京健康之家科技有限公司 Service request processing method and device, storage medium and computing equipment
CN112486625A (en) * 2020-10-22 2021-03-12 北京中软国际信息技术有限公司 Service fusion method based on service fusion middleware
CN112685403A (en) * 2019-10-18 2021-04-20 上海同是科技股份有限公司 High-availability framework system for hidden danger troubleshooting data storage and implementation method thereof
CN113051303A (en) * 2019-12-27 2021-06-29 北京国双科技有限公司 Business data processing method and device, electronic equipment and storage medium
CN113542344A (en) * 2020-04-16 2021-10-22 瞻博网络公司 Model-driven configuration management for microservices
CN113742100A (en) * 2021-08-27 2021-12-03 欧电云信息科技(江苏)有限公司 Service calling method, system, equipment and medium based on micro-service architecture
CN114401303A (en) * 2021-12-20 2022-04-26 苏州众言网络科技股份有限公司 Service registration and discovery method, system and device applied to micro-service
CN115118703A (en) * 2022-07-28 2022-09-27 中国工商银行股份有限公司 Service calling method and device and electronic equipment
CN117555708A (en) * 2024-01-11 2024-02-13 中国人民解放军国防科技大学 Windows microservice framework program calling method, system and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016099346A1 (en) * 2014-12-15 2016-06-23 Telefonaktiebolaget Lm Ericsson (Publ) Method and deployment module for managing a container to be deployed on a software platform
CN108427581A (en) * 2018-02-07 2018-08-21 平安普惠企业管理有限公司 System micro services method and terminal device
CN108446111A (en) * 2018-03-26 2018-08-24 国家电网公司客户服务中心 A kind of micro services construction method based on Spring cloud
CN108667925A (en) * 2018-05-04 2018-10-16 北京天元创新科技有限公司 A kind of method and system of WEB application seamless access distributed system
CN109587272A (en) * 2018-12-30 2019-04-05 深圳云天励飞技术有限公司 A kind of optimization method of micro services, device and electronic equipment
CN109814909A (en) * 2019-01-18 2019-05-28 南京绿新能源研究院有限公司 Method based on Spring cloud micro services framework cloud SCADA system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016099346A1 (en) * 2014-12-15 2016-06-23 Telefonaktiebolaget Lm Ericsson (Publ) Method and deployment module for managing a container to be deployed on a software platform
CN108427581A (en) * 2018-02-07 2018-08-21 平安普惠企业管理有限公司 System micro services method and terminal device
CN108446111A (en) * 2018-03-26 2018-08-24 国家电网公司客户服务中心 A kind of micro services construction method based on Spring cloud
CN108667925A (en) * 2018-05-04 2018-10-16 北京天元创新科技有限公司 A kind of method and system of WEB application seamless access distributed system
CN109587272A (en) * 2018-12-30 2019-04-05 深圳云天励飞技术有限公司 A kind of optimization method of micro services, device and electronic equipment
CN109814909A (en) * 2019-01-18 2019-05-28 南京绿新能源研究院有限公司 Method based on Spring cloud micro services framework cloud SCADA system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郑锦男等: "微服务框架下的交通信息化架构", 《信息技术》 *

Cited By (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110601994A (en) * 2019-10-14 2019-12-20 南京航空航天大学 Load balancing method for micro-service chain perception in cloud environment
CN110601994B (en) * 2019-10-14 2021-07-16 南京航空航天大学 Load balancing method for micro-service chain perception in cloud environment
CN112685403A (en) * 2019-10-18 2021-04-20 上海同是科技股份有限公司 High-availability framework system for hidden danger troubleshooting data storage and implementation method thereof
CN113051303A (en) * 2019-12-27 2021-06-29 北京国双科技有限公司 Business data processing method and device, electronic equipment and storage medium
CN111245916B (en) * 2020-01-07 2023-03-17 苏宁云计算有限公司 Service calling method, service arranging method and device based on micro-service gateway
CN111245916A (en) * 2020-01-07 2020-06-05 苏宁云计算有限公司 Service calling method, service arranging method and device based on micro-service gateway
CN113542344A (en) * 2020-04-16 2021-10-22 瞻博网络公司 Model-driven configuration management for microservices
CN111752641A (en) * 2020-06-29 2020-10-09 深圳壹账通智能科技有限公司 Method, device, equipment and storage medium for starting service between micro-service containers
CN111917838A (en) * 2020-07-14 2020-11-10 浙江大华技术股份有限公司 Processing method and device based on micro service, storage medium and electronic device
CN111917838B (en) * 2020-07-14 2023-08-29 浙江大华技术股份有限公司 Micro-service-based processing method and device, storage medium and electronic device
CN111858101A (en) * 2020-07-28 2020-10-30 平安医疗健康管理股份有限公司 Cloud architecture system-oriented adaptation method, device, equipment and storage medium
CN111858101B (en) * 2020-07-28 2023-05-26 深圳平安医疗健康科技服务有限公司 Cloud architecture system-oriented adaptation method, device, equipment and storage medium
CN112019387A (en) * 2020-09-02 2020-12-01 上海卓钢链科技有限公司 Distributed service registration center construction method
CN112486625A (en) * 2020-10-22 2021-03-12 北京中软国际信息技术有限公司 Service fusion method based on service fusion middleware
CN112486625B (en) * 2020-10-22 2023-06-23 北京中软国际信息技术有限公司 Service fusion method based on service fusion middleware
CN112286503A (en) * 2020-10-28 2021-01-29 平安科技(深圳)有限公司 Multi-registration center micro-service unified management method, device, equipment and medium
CN112311786B (en) * 2020-10-28 2023-06-13 北京水滴科技集团有限公司 Service request processing method and device, storage medium and computing equipment
CN112311786A (en) * 2020-10-28 2021-02-02 北京健康之家科技有限公司 Service request processing method and device, storage medium and computing equipment
CN112286503B (en) * 2020-10-28 2024-05-28 平安科技(深圳)有限公司 Method, device, equipment and medium for unified management of microservices of multiple registries
CN113742100A (en) * 2021-08-27 2021-12-03 欧电云信息科技(江苏)有限公司 Service calling method, system, equipment and medium based on micro-service architecture
CN113742100B (en) * 2021-08-27 2024-05-31 欧电云信息科技(江苏)有限公司 Service calling method, system, equipment and medium based on micro-service architecture
CN114401303A (en) * 2021-12-20 2022-04-26 苏州众言网络科技股份有限公司 Service registration and discovery method, system and device applied to micro-service
CN115118703A (en) * 2022-07-28 2022-09-27 中国工商银行股份有限公司 Service calling method and device and electronic equipment
CN115118703B (en) * 2022-07-28 2024-03-08 中国工商银行股份有限公司 Service calling method and device and electronic equipment
CN117555708A (en) * 2024-01-11 2024-02-13 中国人民解放军国防科技大学 Windows microservice framework program calling method, system and device
CN117555708B (en) * 2024-01-11 2024-03-26 中国人民解放军国防科技大学 Windows microservice framework program calling method, system and device

Also Published As

Publication number Publication date
CN110324177B (en) 2022-05-24

Similar Documents

Publication Publication Date Title
CN110324177A (en) Service request processing method, system and medium under micro-service architecture
US11775343B1 (en) Duty cycle estimation for job assignment
US11709600B2 (en) System and method for performing live partitioning in a data store
US11789925B2 (en) System and method for conditionally updating an item with attribute granularity
US10776395B2 (en) System and method for implementing a scalable data storage service
US11609697B2 (en) System and method for providing a committed throughput level in a data store
US8819027B1 (en) System and method for partitioning and indexing table data using a composite primary key
CN113949707B (en) OpenResty and K8S-based container cloud service discovery and load balancing method
US7756888B2 (en) Method and apparatus for providing heterogeneous resources for client systems
CN102447736B (en) Management and control method for user quota in multi-network storage system
US7827280B2 (en) System and method for domain name filtering through the domain name system
CN109670089A (en) Knowledge mapping system and its figure server
US11630695B1 (en) Dynamic reassignment in a search and indexing system
US20070198283A1 (en) Revenue management system and method
CN109783512A (en) Data processing method, device, computer equipment and storage medium
CN109299157A (en) A kind of data export method and device of distributed big single table
US11681707B1 (en) Analytics query response transmission
CN112738184B (en) Plug-in dynamic registration distributed micro-service gateway system
US20020161615A1 (en) Workflow system
EP3049940A1 (en) Data caching policy in multiple tenant enterprise resource planning system
US11385936B1 (en) Achieve search and ingest isolation via resource management in a search and indexing system
CN113726546A (en) Configuration method, device, system, computing equipment and storage medium
CN104714923B (en) A kind of method and apparatus for realizing collaborative share
CN109063140A (en) A kind of data query method, transfer server and computer readable storage medium
CN112148508A (en) Information processing method and related 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
GR01 Patent grant
GR01 Patent grant