CN109495559B - Service registration and calling method and system of micro-service client - Google Patents

Service registration and calling method and system of micro-service client Download PDF

Info

Publication number
CN109495559B
CN109495559B CN201811315388.9A CN201811315388A CN109495559B CN 109495559 B CN109495559 B CN 109495559B CN 201811315388 A CN201811315388 A CN 201811315388A CN 109495559 B CN109495559 B CN 109495559B
Authority
CN
China
Prior art keywords
service
client
calling
registration
environment
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.)
Active
Application number
CN201811315388.9A
Other languages
Chinese (zh)
Other versions
CN109495559A (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.)
Yonyou Network Technology Co Ltd
Original Assignee
Yonyou Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yonyou Network Technology Co Ltd filed Critical Yonyou Network Technology Co Ltd
Priority to CN201811315388.9A priority Critical patent/CN109495559B/en
Publication of CN109495559A publication Critical patent/CN109495559A/en
Application granted granted Critical
Publication of CN109495559B publication Critical patent/CN109495559B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • 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)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a service registration and calling method, a registration and calling system and a computer readable storage medium of a micro-service client. The micro-service client comprises a service providing client and a service calling client, and the registration and calling method comprises the following steps: registering a service providing client and a service calling client; acquiring a plurality of network address information of a service providing client; receiving a service calling request of a service calling client; and detecting the plurality of network address information, determining the nearest and idle target network address information, and calling the service according to the target network address information. By adopting the technical scheme of the invention, the service calling availability under various complex network conditions is improved.

Description

Service registration and calling method and system of micro-service client
Technical Field
The invention relates to the technical field of computers, in particular to a service registration and calling method, a registration and calling system and a computer readable storage medium of a micro-service client.
Background
With the increase of business modules, the gradual increase of the number of teams and personnel, and the requirement of high-performance extensible architecture design, the project of ALL-IN-ONE cannot meet the actual development requirement, micro-service is a necessary trend, and the registration and discovery of services on which the micro-service depends, namely a service registration center, is indispensable.
In the related art, there are two main solutions for the service registration center: the first scheme is Dubbo/Dubbox, and a Dubbo/Dubbox product architecture diagram is shown in FIG. 1, wherein Dubbo provides a service registry (Register), a service Consumer (Consumer), a service Provider (Provider), and the like, the Dubbo registry pushes change information of the service Provider to the service Consumer, and the service Consumer makes remote call according to address information of the service Provider obtained from the registry; the service provider and service consumer will send statistical information to the Dubbo console (Monitor). The second scheme is NetflixEureka of SpringCloud, the product architecture diagram of Netflix Eureka is shown in FIG. 2, Netflix Eureka and Dubbo similarly provide functions of service registration, publishing, address update pushing and the like, and the difference from Dubbo is that a short connection heartbeat mode is adopted to replace a long connection.
Both of these solutions have their own drawbacks, (1) the product of Dubbo/Dubbox has: based on the Netty long connection, the requirement on the network is strict, various firewall and middleware products under the complex network condition are difficult to keep long connection, and the products are positioned in service registration and calling in a data center; any application can be connected without authority authentication; without tenant isolation, all services registered on the tenant isolation can be called in a reflection mode after the tenant isolation is connected with the dubbo, and the services can be maliciously registered to cause abnormity of normal service calling. (2) The NetflixEureka product of SpringCloud has the following defects: based on short connection, the network penetrability is strong, but only one IP/domain name can be registered during registration, so that no shortest path selection exists during cross-center calling and intranet calling, and most of results can be that the network is not communicated or a calling link is too long; any application can be connected without authority authentication; without tenant isolation, after the eureka is connected, addresses of all services can be acquired for calling, and the services can be maliciously registered to cause exception of normal service calling.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art or the related art.
To this end, an aspect of the present invention is to provide a method for registering and calling a service of a micro-service client.
Another aspect of the present invention is to provide a service registration and invocation system for a microservice client.
Yet another aspect of the present invention is directed to a computer-readable storage medium.
In view of this, according to an aspect of the present invention, a method for registering and calling a service of a micro-service client is provided, where the micro-service client includes a service providing client and a service calling client, and the method for registering and calling includes: registering a service providing client and a service calling client; acquiring a plurality of network address information of a service providing client; receiving a service calling request of a service calling client; and detecting the plurality of network address information, determining the nearest and idle target network address information, and calling the service according to the target network address information.
The method for registering and calling the service of the micro-service client is applied to a service registration center, the service providing client refers to application providing a certain function to the outside, and the service calling client refers to application calling the certain function of a service provider. The method comprises the following steps that a service providing client and a service calling client register in a service registration center, and multi-hop detection under complex network conditions is carried out after the registration is successful, and the method specifically comprises the following steps: the service providing client side collects a plurality of network address information of the service providing client side and sends the network address information to the service registration center, the service calling client side pulls the network address information from the service registration center, heartbeat health detection is carried out on the network address information according to the sequence from near to far, caching for a period of time and refreshing at regular time are carried out after the nearest and available optimal network address (target network address) is found, and the optimal network address is obtained from the caching for service calling when remote calling is initiated. By adopting the technical scheme of the invention, the service calling availability under various complex network conditions is improved.
The service registration and calling method of the microservice client according to the present invention may further have the following technical features:
in the above technical solution, preferably, registering the service providing client and the service invoking client specifically includes: acquiring registration authentication information of a service providing client and a service calling client, and authenticating the registration authentication information; and after the registration authentication information passes the authentication, providing registration accounts for the service providing client and the service calling client, and finishing the registration of the service providing client and the service calling client.
In the technical scheme, when the service is registered, the service providing client and/or the service calling client applies for an authentication Key and an authentication secret Key, the service registration can be carried out through an HMac signing algorithm (HMac is a hash operation message authentication code related to the Key), the service registration center checks the authentication Key and the signing result, the service is allowed to be registered after the check is passed, otherwise, the service providing client and/or the service calling client is refused to register to the service registration center, malicious registration is prevented, and normal service is prevented from being influenced.
In any of the above technical solutions, preferably, the method further includes: sending heartbeat detection signals to a service providing client and/or a service calling client according to a preset period; and when receiving feedback information of the service providing client and/or the service calling client to the heartbeat detection signal, marking the service providing client and/or the service calling client to be in an online state.
According to the technical scheme, a heartbeat detection signal is sent to the service providing client and/or the service calling client according to a preset period, and a new on-line or off-line service providing client and/or service calling client is obtained so as to update incremental data of the service providing client and/or the service calling client at regular time.
In any of the above technical solutions, preferably, the method further includes: and allocating account identification for each service providing client and/or the tenant account of the service calling client.
In the technical scheme, tenant isolation is performed on the application, specifically, account identifiers are allocated to tenant accounts of each service providing client and/or each service calling client, so that isolation is performed according to the account identifiers to prevent confusion of application programming interfaces with the same name. The tenant refers to a large user, for example, a company a applies for a tenant account in a service registry, and then the company a is a tenant, and a tenant can deploy one or more service providing clients and/or service invoking clients. The tenant is isolated by the fact that the account identification allocated to the company A is a first identification and the account identification allocated to the company B is a second identification.
In any of the above technical solutions, preferably, the method further includes: setting an environment identifier for the application environment of each tenant account; the application environment comprises one or the combination of the following: development environment, test environment, gray level environment, production environment, daily environment, joint debugging environment.
In the technical scheme, different environments of the application are isolated, specifically, an environment identifier is set for the application environment of each tenant account, so that the isolation is performed according to the environment identifier to prevent calling conflicts among different environments, wherein the application environments include a development environment, a test environment, a gray level environment, a production environment, a daily environment and a joint debugging environment. For example, the development environment calls the test environment to cause data influence on the test environment, so that different environment identifiers are set for each application environment to be isolated.
According to another aspect of the present invention, a service registration and invocation system for a micro-service client is provided, where the micro-service client includes a service providing client and a service invocation client, and the registration and invocation system includes: a memory for storing a computer program; a processor for executing a computer program to: registering a service providing client and a service calling client; acquiring a plurality of network address information of a service providing client; receiving a service calling request of a service calling client; and detecting the plurality of network address information, determining the nearest and idle target network address information, and calling the service according to the target network address information.
The service registration and calling system of the micro-service client is applied to a service registration center, the service providing client refers to application providing a certain function to the outside, and the service calling client refers to application calling a certain function of a service provider. The method comprises the following steps that a service providing client and a service calling client register in a service registration center, and multi-hop detection under complex network conditions is carried out after the registration is successful, and the method specifically comprises the following steps: the service providing client side collects a plurality of network address information of the service providing client side and sends the network address information to the service registration center, the service calling client side pulls the network address information from the service registration center, heartbeat health detection is carried out on the network address information according to the sequence from near to far, caching for a period of time and refreshing at regular time are carried out after the nearest and available optimal network address (target network address) is found, and the optimal network address is obtained from the caching for service calling when remote calling is initiated. By adopting the technical scheme of the invention, the service calling availability under various complex network conditions is improved.
The service registration and invocation system of the microservice client according to the present invention may further have the following technical features:
in the foregoing technical solution, preferably, the processor is specifically configured to execute a computer program to: acquiring registration authentication information of a service providing client and a service calling client, and authenticating the registration authentication information; and after the registration authentication information passes the authentication, providing registration accounts for the service providing client and the service calling client, and finishing the registration of the service providing client and the service calling client.
In the technical scheme, when the service is registered, the service providing client and/or the service calling client applies for the authentication Key and the authentication secret Key, the service registration can be carried out through an HMac signing algorithm, the service registration center checks the authentication Key and the signing result, the service is allowed to be registered after the check is passed, otherwise, the service providing client and/or the service calling client is refused to be registered in the service registration center, so that malicious registration is prevented, and normal service is prevented from being influenced.
In any of the above technical solutions, preferably, the processor is further configured to execute the computer program to: sending heartbeat detection signals to a service providing client and/or a service calling client according to a preset period; and when receiving feedback information of the service providing client and/or the service calling client to the heartbeat detection signal, marking the service providing client and/or the service calling client to be in an online state.
According to the technical scheme, a heartbeat detection signal is sent to the service providing client and/or the service calling client according to a preset period, and a new on-line or off-line service providing client and/or service calling client is obtained so as to update incremental data of the service providing client and/or the service calling client at regular time.
In any of the above technical solutions, preferably, the processor is further configured to execute the computer program to: and allocating account identification for each service providing client and/or the tenant account of the service calling client.
In the technical scheme, tenant isolation is performed on the application, specifically, account identifiers are allocated to tenant accounts of each service providing client and/or each service calling client, so that isolation is performed according to the account identifiers to prevent confusion of application programming interfaces with the same name. The tenant refers to a large user, for example, a company a applies for a tenant account in a service registry, and then the company a is a tenant, and a tenant can deploy one or more service providing clients and/or service invoking clients. The tenant is isolated by the fact that the account identification allocated to the company A is a first identification and the account identification allocated to the company B is a second identification.
In any of the above technical solutions, preferably, the processor is further configured to execute the computer program to: setting an environment identifier for the application environment of each tenant account; the application environment comprises one or the combination of the following: development environment, test environment, gray level environment, production environment, daily environment, joint debugging environment.
In the technical scheme, different environments of the application are isolated, specifically, an environment identifier is set for the application environment of each tenant account, so that the isolation is performed according to the environment identifier to prevent calling conflicts among different environments, wherein the application environments include a development environment, a test environment, a gray level environment, a production environment, a daily environment and a joint debugging environment. For example, the development environment calls the test environment to cause data influence on the test environment, so that different environment identifiers are set for each application environment to be isolated.
According to a further aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for registering and calling the service of the microservice client according to any of the above-mentioned technical solutions.
In the computer-readable storage medium provided by the present invention, when being executed by a processor, the computer program implements the steps of the service registration and invocation method of the micro-service client according to any one of the above technical solutions, so that the computer-readable storage medium includes all the beneficial effects of the service registration and invocation method of the micro-service client according to any one of the above technical solutions.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 shows a schematic diagram of the Dubbo/Dubbox product architecture in the related art;
FIG. 2 shows a schematic diagram of the Netflix Eureka product architecture in the related art;
FIG. 3 is a flow diagram illustrating a method for service registration and invocation of a microservice client in accordance with an embodiment of the present invention;
FIG. 4 is a flow diagram illustrating a method for service registration and invocation of a microservice client in accordance with another embodiment of the present invention;
FIG. 5 is a flow diagram illustrating a method for service registration and invocation of a microservice client in accordance with yet another embodiment of the present invention;
FIG. 6 is a flow diagram illustrating a method for service registration and invocation of a microservice client in accordance with yet another embodiment of the present invention;
FIG. 7 is a schematic diagram illustrating a secure availability service registration and discovery scheme according to an embodiment of the present invention;
FIG. 8 is a service invocation diagram illustrating a secure availability service registration and discovery scheme in accordance with an embodiment of the present invention;
FIG. 9 shows a schematic block diagram of a service registration and invocation system for a microservice client of one embodiment of the present invention.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a more particular description of the invention will be rendered by reference to the appended drawings. It should be noted that the embodiments of the present invention and features of the embodiments may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, however, the present invention may be practiced in other ways than those specifically described herein, and therefore the scope of the present invention is not limited to the specific embodiments disclosed below.
An embodiment of a first aspect of the present invention provides a method for registering and calling a service of a micro service client, where the micro service client includes a service providing client and a service calling client, and fig. 3 illustrates a flowchart of the method for registering and calling the service of the micro service client according to an embodiment of the present invention. Wherein, the method comprises the following steps:
step 302, registering a service providing client and a service calling client;
step 304, acquiring a plurality of network address information of the service providing client;
step 306, receiving a service calling request of a service calling client;
and 308, detecting a plurality of network address information, determining the nearest and idle target network address information, and calling the service according to the target network address information.
The method for registering and calling the service of the micro-service client is applied to a service registration center, the service providing client refers to application providing a certain function to the outside, and the service calling client refers to application calling the certain function of a service provider. The method comprises the following steps that a service providing client and a service calling client register in a service registration center, and multi-hop detection under complex network conditions is carried out after the registration is successful, and the method specifically comprises the following steps: the service providing client side collects a plurality of network address information of the service providing client side and sends the network address information to the service registration center, the service calling client side pulls the network address information from the service registration center, heartbeat health detection is carried out on the network address information according to the sequence from near to far, caching for a period of time and refreshing at regular time are carried out after the nearest and available optimal network address (target network address) is found, and the optimal network address is obtained from the caching for service calling when remote calling is initiated. By adopting the technical scheme of the invention, the service calling availability under various complex network conditions is improved.
Preferably, step 302, registering the service providing client and the service invoking client includes: acquiring registration authentication information of a service providing client and a service calling client, and authenticating the registration authentication information; and after the registration authentication information passes the authentication, providing registration accounts for the service providing client and the service calling client, and finishing the registration of the service providing client and the service calling client.
In the embodiment, when the service is registered, the service providing client and/or the service calling client applies for the authentication Key and the authentication Key, the service registration can be performed through the HMac signing algorithm, the service registration center checks the authentication Key and the signing result, the service registration is allowed after the check is passed, otherwise, the service providing client and/or the service calling client is refused to register to the service registration center, so that malicious registration is prevented, and normal service is prevented from being influenced.
Fig. 4 is a flowchart illustrating a service registration and invocation method of a micro service client according to another embodiment of the present invention. Wherein, the method comprises the following steps:
step 402, registering a service providing client and a service calling client;
step 404, obtaining a plurality of network address information of the service providing client;
step 406, receiving a service calling request of the service calling client;
step 408, detecting a plurality of network address information, determining the nearest and idle target network address information, and calling service according to the target network address information;
step 410, sending heartbeat detection signals to a service providing client and/or a service calling client according to a preset period; and when receiving feedback information of the service providing client and/or the service calling client to the heartbeat detection signal, marking the service providing client and/or the service calling client to be in an online state.
In the embodiment, a heartbeat detection signal is sent to the service providing client and/or the service calling client according to a preset period, and a new on-line or off-line service providing client and/or service calling client is obtained, so that incremental data of the service providing client and/or the service calling client is updated at regular time.
Preferably, step 402, registering the service providing client and the service invoking client includes: acquiring registration authentication information of a service providing client and a service calling client, and authenticating the registration authentication information; and after the registration authentication information passes the authentication, providing registration accounts for the service providing client and the service calling client, and finishing the registration of the service providing client and the service calling client.
Fig. 5 is a flowchart illustrating a service registration and invocation method of a micro service client according to yet another embodiment of the present invention. Wherein, the method comprises the following steps:
step 502, registering a service providing client and a service calling client;
step 504, obtaining a plurality of network address information of the service providing client;
step 506, receiving a service calling request of a service calling client;
step 508, detect multiple network address information, confirm the nearest and vacant target network address information, call the service according to the target network address information;
step 510, sending heartbeat detection signals to a service providing client and/or a service calling client according to a preset period; when feedback information of the service providing client and/or the service calling client to the heartbeat detection signal is received, marking the service providing client and/or the service calling client to be in an online state;
and step 512, allocating account identifications for the tenant accounts of each service providing client and/or service calling client.
In this embodiment, tenant isolation is performed on the application, specifically, an account identifier is allocated to a tenant account of each service providing client and/or each service calling client, so that isolation is performed according to the account identifier to prevent confusion of application programming interfaces of the same name. The tenant refers to a large user, for example, a company a applies for a tenant account in a service registry, and then the company a is a tenant, and a tenant can deploy one or more service providing clients and/or service invoking clients. The tenant is isolated by the fact that the account identification allocated to the company A is a first identification and the account identification allocated to the company B is a second identification.
Preferably, step 502, registering the service providing client and the service invoking client includes: acquiring registration authentication information of a service providing client and a service calling client, and authenticating the registration authentication information; and after the registration authentication information passes the authentication, providing registration accounts for the service providing client and the service calling client, and finishing the registration of the service providing client and the service calling client.
Fig. 6 is a flowchart illustrating a service registration and invocation method of a micro service client according to another embodiment of the present invention. Wherein, the method comprises the following steps:
step 602, registering a service providing client and a service calling client;
step 604, obtaining a plurality of network address information of the service providing client;
step 606, receiving a service calling request of a service calling client;
step 608, detecting multiple network address information, determining the nearest and idle target network address information, and calling service according to the target network address information;
step 610, sending heartbeat detection signals to a service providing client and/or a service calling client according to a preset period; when feedback information of the service providing client and/or the service calling client to the heartbeat detection signal is received, marking the service providing client and/or the service calling client to be in an online state;
step 612, allocating account identifiers for tenant accounts of each service providing client and/or service calling client;
step 614, setting an environment identifier for the application environment of each tenant account; the application environment comprises one or the combination of the following: development environment, test environment, gray level environment, production environment, daily environment, joint debugging environment.
In this embodiment, different environments of the application are isolated, specifically, an environment identifier is set for the application environment of each tenant account, so that the isolation is performed according to the environment identifier to prevent call conflicts between different environments, where the application environments include a development environment, a test environment, a grayscale environment, a production environment, a daily environment, and a joint debugging environment. For example, the development environment calls the test environment to cause data influence on the test environment, so that different environment identifiers are set for each application environment to be isolated.
Preferably, step 602, registering the service providing client and the service invoking client includes: acquiring registration authentication information of a service providing client and a service calling client, and authenticating the registration authentication information; and after the registration authentication information passes the authentication, providing registration accounts for the service providing client and the service calling client, and finishing the registration of the service providing client and the service calling client.
The embodiment of the invention provides a service registration and discovery scheme with strong safety availability, which not only can ensure the safety of service registration and perfect a tenant isolation system, but also can improve the availability under various complex network conditions. The scheme relates to an assembly comprising: (1) the service provider: an application that refers to a REST API that provides some function to the outside; (2) service caller: refers to an application that calls a service provider API; (3) a tenant: an account that refers to the owner of the application; (4) the authentication center: verifying the authenticity of the tenant through the authentication Key and the authentication Key of the tenant; (5) the service registration center: the service provider and the service caller register service with the service provider when starting, and pull the network address of the service provider in the service registration center when the service caller calls.
The principle of the scheme is as follows: as shown in fig. 7, the service caller and the service provider (i.e., the microservice client in fig. 7) register with the service registry in an Http manner at the time of startup, and maintain an online state at regular intervals by heartbeat. When the service is called, the remote calling is carried out through the pulled address of the service provider, and the incremental data is updated regularly (namely, a new online or offline service provider and/or service provider is obtained). Specifically, the method comprises the following steps:
(1) the security improvement of the embodiment of the invention comprises the following steps: and checking during service registration to prevent malicious registration and avoid influence on normal service. When the service is registered, the micro-service client configures an authentication Key and an authentication secret Key applied from an authentication center, service registration is carried out through an HMac signing algorithm, the service registration center checks the authentication Key and the signing result, registration service is allowed after the check is passed, a service registration list is shown in a table 1, and otherwise, the micro-service client is refused to register in the service registration center.
TABLE 1
Figure BDA0001856125380000111
(2) The usability improvement under the condition of enhancing the complex network of the embodiment of the invention comprises the following steps: as shown in fig. 8, taking deployment in a marathon environment as an example, a microserver operates in a docker at the innermost of a nested network environment, and the docker operates in a host. The service provider will collect: 1) IP and port of the docker; 2) IP and port of host; 3) IP and port of marathonlB; 4) and applying the corresponding domain name and port, and reporting the network address information to a service registration center. When a service caller pulls a registration service, the four network addresses are all pulled from a service registration center, heartbeat health check is carried out according to the sequence from near to far, a period of cache is carried out and timing refreshing is carried out after the nearest and available optimal network address is found, the optimal network address is obtained from the cache to be called when RPC (Remote Procedure Call) is initiated, wherein the optimal meaning is that the calling is carried out according to the shortest and unobstructed network path.
(3) The tenant isolation improvement of the embodiment of the invention comprises the following steps: and tenant isolation is performed on the application, so that confusion of application programming interfaces with the same name is prevented. Such as: a and B are different tenants, face recognition service is issued, application programming interfaces are the same name, different application programming interfaces can be identified through the tenants, and a service caller can also call the face recognition service under the designated tenant by clear identification before service calling.
(4) The isolation improvement of different environments of the application of the embodiment of the invention comprises the following steps: call conflicts between different contexts are prevented. For example, the development environment calls the online environment to affect data on the online environment, so that different environments are isolated.
In an embodiment of the second aspect of the present invention, a service registration and invocation system of a micro service client is provided, where the micro service client includes a service providing client and a service invocation client, and fig. 9 shows a schematic block diagram of a service registration and invocation system 90 of a micro service client according to an embodiment of the present invention. The registration and call system 90 includes:
a memory 902 for storing a computer program;
a processor 904 for executing a computer program to:
registering a service providing client and a service calling client; acquiring a plurality of network address information of a service providing client; receiving a service calling request of a service calling client; and detecting the plurality of network address information, determining the nearest and idle target network address information, and calling the service according to the target network address information.
The service registration and call system 90 of the micro-service client provided by the invention is applied to a service registration center, the service providing client refers to an application providing a certain function to the outside, and the service call client refers to an application calling a certain function of a service provider. The method comprises the following steps that a service providing client and a service calling client register in a service registration center, and multi-hop detection under complex network conditions is carried out after the registration is successful, and the method specifically comprises the following steps: the service providing client side collects a plurality of network address information of the service providing client side and sends the network address information to the service registration center, the service calling client side pulls the network address information from the service registration center, heartbeat health detection is carried out on the network address information according to the sequence from near to far, caching for a period of time and refreshing at regular time are carried out after the nearest and available optimal network address (target network address) is found, and the optimal network address is obtained from the caching for service calling when remote calling is initiated. By adopting the technical scheme of the invention, the service calling availability under various complex network conditions is improved.
Preferably, the processor 904 is specifically configured to execute a computer program to: acquiring registration authentication information of a service providing client and a service calling client, and authenticating the registration authentication information; and after the registration authentication information passes the authentication, providing registration accounts for the service providing client and the service calling client, and finishing the registration of the service providing client and the service calling client.
In the embodiment, when the service is registered, the service providing client and/or the service calling client applies for the authentication Key and the authentication Key, the service registration can be performed through the HMac signing algorithm, the service registration center checks the authentication Key and the signing result, the service registration is allowed after the check is passed, otherwise, the service providing client and/or the service calling client is refused to register to the service registration center, so that malicious registration is prevented, and normal service is prevented from being influenced.
Preferably, the processor 904 is further configured to execute a computer program to: sending heartbeat detection signals to a service providing client and/or a service calling client according to a preset period; and when receiving feedback information of the service providing client and/or the service calling client to the heartbeat detection signal, marking the service providing client and/or the service calling client to be in an online state.
In the embodiment, a heartbeat detection signal is sent to the service providing client and/or the service calling client according to a preset period, and a new on-line or off-line service providing client and/or service calling client is obtained, so that incremental data of the service providing client and/or the service calling client is updated at regular time.
Preferably, the processor 904 is further configured to execute a computer program to: and allocating account identification for each service providing client and/or the tenant account of the service calling client.
In this embodiment, tenant isolation is performed on the application, specifically, an account identifier is allocated to a tenant account of each service providing client and/or each service calling client, so that isolation is performed according to the account identifier to prevent confusion of application programming interfaces of the same name. The tenant refers to a large user, for example, a company a applies for a tenant account in a service registry, and then the company a is a tenant, and a tenant can deploy one or more service providing clients and/or service invoking clients. The tenant is isolated by the fact that the account identification allocated to the company A is a first identification and the account identification allocated to the company B is a second identification.
Preferably, the processor 904 is further configured to execute a computer program to: setting an environment identifier for the application environment of each tenant account; the application environment comprises one or the combination of the following: development environment, test environment, gray level environment, production environment, daily environment, joint debugging environment.
In this embodiment, different environments of the application are isolated, specifically, an environment identifier is set for the application environment of each tenant account, so that the isolation is performed according to the environment identifier to prevent call conflicts between different environments, where the application environments include a development environment, a test environment, a grayscale environment, a production environment, a daily environment, and a joint debugging environment. For example, the development environment calls the test environment to cause data influence on the test environment, so that different environment identifiers are set for each application environment to be isolated.
In an embodiment of the third aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program, when being executed by a processor, implements the steps of the service registration and calling method of the micro-service client according to any one of the above embodiments.
The computer-readable storage medium provided by the present invention, when being executed by a processor, implements the steps of the service registration and invocation method of the micro service client according to any of the above embodiments, so that the computer-readable storage medium includes all the benefits of the service registration and invocation method of the micro service client according to any of the above embodiments.
In the description herein, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance unless explicitly stated or limited otherwise; the terms "connected," "mounted," "secured," and the like are to be construed broadly and include, for example, fixed connections, removable connections, or integral connections; may be directly connected or indirectly connected through an intermediate. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the description herein, the description of the terms "one embodiment," "some embodiments," "specific embodiments," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A method for registering and calling the service of a micro-service client is applied to a service registration center, and is characterized in that the micro-service client comprises a service providing client and a service calling client, and the method for registering and calling comprises the following steps:
registering the service providing client and the service calling client;
acquiring a plurality of network address information of the service providing client;
receiving a service calling request of the service calling client;
detecting a plurality of network address information, determining the nearest and idle target network address information, and calling service according to the target network address information;
the detecting the plurality of network address information specifically includes:
and the service calling client pulls the network address information from the service registration center and carries out heartbeat health detection on the network address information according to the sequence from near to far.
2. The method for registering and calling the service of the microservice client according to claim 1, wherein registering the service providing client and the service calling client specifically comprises:
acquiring registration authentication information of the service providing client and the service calling client, and authenticating the registration authentication information;
and after the registration authentication information passes the authentication, providing registration accounts for the service providing client and the service calling client, and finishing the registration of the service providing client and the service calling client.
3. The method for registering and calling the service of the micro-service client according to claim 1, further comprising:
sending a heartbeat detection signal to the service providing client and/or the service calling client according to a preset period;
and when receiving feedback information of the service providing client and/or the service calling client to the heartbeat detection signal, marking the service providing client and/or the service calling client to be in an online state.
4. The method for registering and calling the service of the micro-service client according to any one of claims 1 to 3, further comprising:
and allocating account identification for each service providing client and/or the tenant account of the service calling client.
5. The method for registering and calling the service of the micro-service client according to claim 4, further comprising:
setting an environment identifier for the application environment of each tenant account;
the application environment comprises one or the combination of the following: development environment, test environment, gray level environment, production environment, daily environment, joint debugging environment.
6. A service registration and call system of a micro-service client is applied to a service registration center, and is characterized in that the micro-service client comprises a service providing client and a service call client, and the registration and call system comprises:
a memory for storing a computer program;
a processor for executing the computer program to:
registering the service providing client and the service calling client;
acquiring a plurality of network address information of the service providing client;
receiving a service calling request of the service calling client;
detecting a plurality of network address information, determining the nearest and idle target network address information, and calling service according to the target network address information;
the detecting the plurality of network address information specifically includes:
and the service calling client pulls the network address information from the service registration center and carries out heartbeat health detection on the network address information according to the sequence from near to far.
7. The system of claim 6, wherein the processor is specifically configured to execute the computer program to:
acquiring registration authentication information of the service providing client and the service calling client, and authenticating the registration authentication information;
and after the registration authentication information passes the authentication, providing registration accounts for the service providing client and the service calling client, and finishing the registration of the service providing client and the service calling client.
8. The micro-service client service registration and invocation system according to claim 6, wherein said processor is further configured to execute said computer program to:
sending a heartbeat detection signal to the service providing client and/or the service calling client according to a preset period;
and when receiving feedback information of the service providing client and/or the service calling client to the heartbeat detection signal, marking the service providing client and/or the service calling client to be in an online state.
9. The micro-service client service registration and invocation system according to any of claims 6-8, wherein said processor is further configured to execute said computer program to:
and allocating account identification for each service providing client and/or the tenant account of the service calling client.
10. The micro-service client service registration and invocation system according to claim 9, wherein said processor is further configured to execute said computer program to:
setting an environment identifier for the application environment of each tenant account;
the application environment comprises one or the combination of the following: development environment, test environment, gray level environment, production environment, daily environment, joint debugging environment.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for service registration and invocation of a microservice client according to any of the claims 1 to 5.
CN201811315388.9A 2018-11-06 2018-11-06 Service registration and calling method and system of micro-service client Active CN109495559B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811315388.9A CN109495559B (en) 2018-11-06 2018-11-06 Service registration and calling method and system of micro-service client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811315388.9A CN109495559B (en) 2018-11-06 2018-11-06 Service registration and calling method and system of micro-service client

Publications (2)

Publication Number Publication Date
CN109495559A CN109495559A (en) 2019-03-19
CN109495559B true CN109495559B (en) 2022-02-22

Family

ID=65694050

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811315388.9A Active CN109495559B (en) 2018-11-06 2018-11-06 Service registration and calling method and system of micro-service client

Country Status (1)

Country Link
CN (1) CN109495559B (en)

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110532170B (en) * 2019-07-18 2023-08-08 北京文渊佳科技有限公司 Method and device for building test environment, electronic equipment and medium
CN110391940B (en) * 2019-07-26 2022-09-27 广州虎牙科技有限公司 Service address response method, device, system, equipment and storage medium
CN110505219B (en) * 2019-08-12 2021-10-26 南京莱斯信息技术股份有限公司 Dubbo-based micro-service registration control management system and method
CN110708356B (en) * 2019-09-06 2024-01-05 国云科技股份有限公司 Method and system for managing third party application by registry
CN110620727B (en) * 2019-09-09 2022-02-22 平安科技(深圳)有限公司 Gateway automatic routing method and related equipment in multi-environment
CN110519395A (en) * 2019-09-16 2019-11-29 北京思维造物信息科技股份有限公司 Service request processing method, device, computer equipment and storage medium
CN112261072B (en) * 2019-10-10 2024-04-09 北京京东尚科信息技术有限公司 Service calling method, device, equipment and storage medium
CN110798513B (en) * 2019-10-16 2021-01-05 北京邮电大学 Internet of things equipment interconnection system and method
CN111341445B (en) * 2020-02-05 2024-04-16 网宿科技股份有限公司 Health detection method and health detection system for micro-service call chain
CN111478955B (en) * 2020-03-31 2023-04-18 招商局金融科技有限公司 Microservice registration method, system, apparatus and computer readable storage medium
CN113542319A (en) * 2020-04-15 2021-10-22 华为技术有限公司 Service providing entity change notification method, device and system used in Dubbo framework
CN111858001B (en) * 2020-07-15 2021-02-26 武汉众邦银行股份有限公司 Workflow processing method based on micro-service architecture system
CN113821351B (en) * 2020-11-05 2024-07-16 北京京东乾石科技有限公司 Remote procedure call method and device, readable storage medium and electronic equipment
CN112612625A (en) * 2020-12-26 2021-04-06 中国农业银行股份有限公司 Service calling method and device
CN112882924B (en) * 2021-01-21 2022-02-08 平安银行股份有限公司 Test environment building method, device, equipment and medium based on registration center
CN112882749B (en) * 2021-03-15 2024-07-09 京东方科技集团股份有限公司 Method and device for controlling online and offline of application instance and storage medium
CN113160024A (en) * 2021-04-30 2021-07-23 中国银行股份有限公司 Business management system and method based on micro-service architecture
CN114710494B (en) * 2022-04-22 2024-06-25 中国工商银行股份有限公司 Application management method, device and storage medium
CN115174592A (en) * 2022-06-28 2022-10-11 北京软通智慧科技有限公司 Enterprise-level data request forwarding system and method
CN115103028B (en) * 2022-07-22 2022-11-15 深圳竹云科技股份有限公司 SaaS application request processing method and device and computer equipment
CN115834378B (en) * 2022-10-31 2024-06-18 中电金信软件有限公司 Data processing method and configuration system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106559488A (en) * 2016-11-24 2017-04-05 天津市普迅电力信息技术有限公司 A kind of method of the electrical network geographical information space service for setting up tenant's driving
CN107612955A (en) * 2016-07-12 2018-01-19 深圳市远行科技股份有限公司 Micro services provide method, apparatus and system
CN107766149A (en) * 2017-09-22 2018-03-06 北京市天元网络技术股份有限公司 A kind of method and device of the ZooKeeper cluster configurations based on DUBBO
CN108306917A (en) * 2017-01-13 2018-07-20 中国移动通信集团江西有限公司 The register method and device of data processing method and device, micro services module
CN108337260A (en) * 2016-05-11 2018-07-27 甲骨文国际公司 Multi-tenant identity and data security management cloud service

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10013275B2 (en) * 2016-11-17 2018-07-03 Red Hat, Inc. Executing code referenced from a microservice registry

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108337260A (en) * 2016-05-11 2018-07-27 甲骨文国际公司 Multi-tenant identity and data security management cloud service
CN107612955A (en) * 2016-07-12 2018-01-19 深圳市远行科技股份有限公司 Micro services provide method, apparatus and system
CN106559488A (en) * 2016-11-24 2017-04-05 天津市普迅电力信息技术有限公司 A kind of method of the electrical network geographical information space service for setting up tenant's driving
CN108306917A (en) * 2017-01-13 2018-07-20 中国移动通信集团江西有限公司 The register method and device of data processing method and device, micro services module
CN107766149A (en) * 2017-09-22 2018-03-06 北京市天元网络技术股份有限公司 A kind of method and device of the ZooKeeper cluster configurations based on DUBBO

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
周洪岩.基于Dubbo 微服务技术的应用与实现.《信息与电脑》.2018, *
基于Dubbo 微服务技术的应用与实现;周洪岩;《信息与电脑》;20181031;正文第1-3页 *
微服务框架的设计与实现;张晶 等;《计算机系统应用》;20170630;全文 *

Also Published As

Publication number Publication date
CN109495559A (en) 2019-03-19

Similar Documents

Publication Publication Date Title
CN109495559B (en) Service registration and calling method and system of micro-service client
US8463885B2 (en) Systems and methods for generating management agent installations
US8302196B2 (en) Combining assessment models and client targeting to identify network security vulnerabilities
US8914787B2 (en) Registering software management component types in a managed network
EP1934780B1 (en) Creating secure interactive connections with remote resources
US10826889B2 (en) Techniques for onboarding devices based on multifactor authentication
US20110283138A1 (en) Change Tracking and Management in Distributed Applications
CN108769124B (en) Application deployment method, device, server and storage medium of PaaS platform
KR20150069027A (en) Hardware management interface
US11201792B2 (en) Management system and control method
US20150234722A1 (en) Secure Fallback Network Device
US10659331B2 (en) Network system, device management method, network device, control method thereof, and non-transitory computer-readable medium
CN113630266A (en) Method and device for instantiating edge application server
EP3133798A1 (en) Management device, control device, and managment method
CN107707939B (en) Video access method, access balance server, central server and system
KR101606438B1 (en) Managing a home network
US10594842B2 (en) Method for real-time synchronization between a device and host servers
CN113014640A (en) Request processing method and device, electronic equipment and storage medium
CN111831402B (en) Method, apparatus and computer program product for managing software functions
JP5736346B2 (en) Virtualization device, virtualization control method, virtualization device control program
CN108429732A (en) A kind of method and system obtaining resource
CN101131641B (en) User interface manager and method for reacting to a change in system status
GB2617014A (en) Authenticity assessment of a requestor based on a communication request
US8788623B2 (en) System, method, and computer program product for receiving security content utilizing a serial over LAN connection
CN115174180B (en) Authentication method, authentication device, server and storage medium

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