CN114944986A - Service isolation method and device and micro-service system - Google Patents

Service isolation method and device and micro-service system Download PDF

Info

Publication number
CN114944986A
CN114944986A CN202210769965.1A CN202210769965A CN114944986A CN 114944986 A CN114944986 A CN 114944986A CN 202210769965 A CN202210769965 A CN 202210769965A CN 114944986 A CN114944986 A CN 114944986A
Authority
CN
China
Prior art keywords
isolation
service
callable
information
list information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210769965.1A
Other languages
Chinese (zh)
Inventor
高凡冬
黄勐瞻韬
李春花
史鲁林
王文欢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Postal Savings Bank of China Ltd
Original Assignee
Postal Savings Bank of China 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 Postal Savings Bank of China Ltd filed Critical Postal Savings Bank of China Ltd
Priority to CN202210769965.1A priority Critical patent/CN114944986A/en
Publication of CN114944986A publication Critical patent/CN114944986A/en
Pending legal-status Critical Current

Links

Images

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
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • 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/0893Assignment of logical groups to network elements
    • 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/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/14Routing performance; Theoretical aspects

Abstract

The application provides a service isolation method, a device and a micro-service system, wherein the method comprises the following steps: acquiring service change information and isolation configuration information in real time, wherein the service change information is an IP address of a micro service registered in a previous subscription period, the subscription period is a time period for subscribing service change of a registration center, the isolation configuration information at least comprises an isolation IP, and the isolation IP is the IP address of the micro service to be isolated; generating current callable IP list information according to the service change information and the isolation configuration information, wherein the callable IP list information comprises IP addresses of a plurality of callable micro services; and sending the current callable IP list information to all the clients. The method solves the problem that the service isolation method in the prior art is difficult to realize dynamic configuration.

Description

Service isolation method and device and micro-service system
Technical Field
The present application relates to the field of service isolation technologies, and in particular, to a service isolation method, apparatus, computer-readable storage medium, processor, and micro-service system.
Background
Most of the service isolation methods in the industry currently have the following disadvantages: flexible and dynamic configuration is not possible; code intrusion is required; service switching procedures are user-perceivable, and the like.
In most of the existing isolation schemes, the isolation strategy cannot be flexibly configured, and if the isolation strategy is required to be dynamically configured, the service code needs to be modified in a targeted manner. Based on the point, the invention provides a novel service isolation method without intrusion based on the regular matching routing rule, so that the system can flexibly configure an isolation strategy according to the regular expression, and users have no perception in the process of flow switching.
The existing general isolation strategy scheme is
1) registry-RPC framework system. Under the micro-service architecture, each micro-service registers with the registration center, establishes a push-pull mechanism with the registration center, and regularly acquires the latest service node information from the registration center. And the micro-service selects one of the service provider node information from the service node information through the RPC frame according to the load balancing algorithm to call the service, so that the load balancing algorithm of the RPC frame is modified to realize service isolation.
2) And isolating the service cluster through network isolation. The network data packet to be sent to the external network by the application program is intercepted in the kernel of the operating system through client software on the host, the network data packet is judged according to the access rule, the network data packet judged to be a legal network data packet is converted into a private protocol data packet, and then the private protocol data packet is sent out through a network card drive.
The registry-RPC framework system realizes the function of service isolation by modifying the load balancing call algorithm of the RPC. The disadvantages of this approach are: isolation information cannot be dynamically configured, and a call algorithm of an RPC frame needs to be modified during each isolation, so that code intrusion is caused; and all services need to be restarted, severely impacting user experience.
The disadvantages of isolation by network are: network adjustment is more complex and it is too difficult to implement dynamic configuration of isolation information.
The above information disclosed in this background section is only for enhancement of understanding of the background of the technology described herein and, therefore, certain information may be included in the background that does not form the prior art that is already known in this country to a person of ordinary skill in the art.
Disclosure of Invention
The present application mainly aims to provide a service isolation method, a service isolation device, a computer-readable storage medium, a processor, and a micro-service system, so as to solve the problem that the service isolation method in the prior art is difficult to implement dynamic configuration.
According to an aspect of an embodiment of the present invention, there is provided a service isolation method, including: acquiring service change information and isolation configuration information in real time, wherein the service change information is an IP address of a micro service registered in a previous subscription period, the subscription period is a time period for subscribing service change of a registration center, the isolation configuration information at least comprises an isolation IP, and the isolation IP is the IP address of the micro service to be isolated; generating current callable IP list information according to the service change information and the isolation configuration information, wherein the callable IP list information comprises IP addresses of a plurality of callable micro services; and sending the current invokable IP list information to all the clients.
Optionally, generating current callable IP list information according to the service change information and the isolation configuration information, including: adding the IP address of the micro service corresponding to the service change information to the callable IP list information of the last subscription period to obtain the callable IP list information after the service change; and deleting the isolation IP corresponding to the isolation configuration information from the callable IP list information after the service is changed to obtain the current callable IP list information.
Optionally, the isolation configuration information further includes an isolation ID and an isolation micro-service name, in a group of the isolation configuration information, one isolation ID corresponds to multiple isolation IPs, the isolation micro-service name corresponds to the isolation IPs one to one, and in the callable IP list information after the service change, the isolation IP corresponding to the isolation configuration information is deleted to obtain the current callable IP list information, where the method includes: matching the isolation ID according to a regular matching routing rule to obtain the non-matching isolation ID; and deleting the isolation IP corresponding to the unmatched isolation ID in the callable IP list information after the service is changed to obtain the current callable IP list information.
Optionally, obtaining the isolation configuration information in real time includes: and acquiring the isolation configuration information configured by a management side page or receiving the isolation configuration information pushed by a third-party system, wherein the management side page is a page for configuring the isolation configuration information.
Optionally, sending the current callable IP list information to all the clients includes: performing MD5 summary processing on the current callable IP list information to obtain a current MD5 value; sending the current callable IP list information to the client if the current MD5 value is different from the MD5 value of the last subscription period.
Optionally, sending the current callable IP list information to all the clients includes: pushing the current callable IP list information to all clients through udp token.
According to another aspect of the embodiments of the present invention, there is also provided a service isolation apparatus, including: the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring service change information and isolation configuration information in real time, the service change information is an IP address of a micro service registered in a previous subscription period, the subscription period is a time period for subscribing service change of a registration center, the isolation configuration information at least comprises an isolation IP, and the isolation IP is the IP address of the micro service to be isolated; a generating unit, configured to generate current callable IP list information according to the service change information and the isolation configuration information, where the callable IP list information includes IP addresses of the callable micro services; and the sending unit is used for sending the current callable IP list information to all the clients.
According to still another aspect of embodiments of the present invention, there is also provided a computer-readable storage medium including a stored program, wherein the program executes any one of the methods.
According to another aspect of the embodiments of the present invention, there is also provided a processor, configured to run a program, where the program executes to perform any one of the methods.
According to another aspect of the embodiments of the present invention, there is also provided a microservice system, including: the system comprises an isolation platform, a registry and a client, wherein the isolation platform is used for executing any one of the methods.
In the embodiment of the present invention, in the service isolation method, service change information and isolation configuration information are obtained in real time, where the service change information is an IP address of a micro service registered in a previous subscription period, the subscription period is a time period of service change of a subscription registration center, the isolation configuration information at least includes an isolation IP, and the isolation IP is an IP address of the micro service to be isolated; generating current callable IP list information according to the service change information and the isolation configuration information, wherein the callable IP list information comprises IP addresses of a plurality of callable micro services; and sending the current invokable IP list information to all the clients. The method updates the callable IP list information by acquiring the service change information and the isolation configuration information in real time, synchronizes the callable IP list information to all clients, calls the micro-service according to the callable IP list to realize service isolation, directly configures and generates the isolation configuration information to realize a dynamic configuration isolation strategy, and solves the problem that the dynamic configuration is difficult to realize by the service isolation method in the prior art.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, are included to provide a further understanding of the application, and the description of the exemplary embodiments and illustrations of the application are intended to explain the application and are not intended to limit the application. In the drawings:
FIG. 1 shows a flow diagram of a service isolation method according to an embodiment of the application;
FIG. 2 shows a schematic view of a service isolation device according to a specific embodiment of the present application;
FIG. 3 shows a schematic diagram of a canonical isolation configuration according to a specific embodiment of the application;
fig. 4 shows a schematic view of a service isolation device according to an embodiment of the present application.
Detailed Description
It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the disclosure. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments according to the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
It will be understood that when an element such as a layer, film, region, or substrate is referred to as being "on" another element, it can be directly on the other element or intervening elements may also be present. Also, in the specification and claims, when an element is described as being "connected" to another element, the element may be "directly connected" to the other element or "connected" to the other element through a third element.
For convenience of description, some terms or expressions referred to in the embodiments of the present application are explained below:
service isolation: in the same cluster, in order to avoid mutual influence among services, the system is divided into a plurality of service modules according to a certain principle, and the modules are relatively independent and do not have strong dependence. When a fault occurs, the problem and the influence can be isolated in a certain module without spreading risks, affecting other modules and affecting the overall system service;
isolation ID: the system isolates the unique identification of the service instance;
isolation configuration: the isolation information configured at the isolation platform management end comprises an isolation ID, an isolation micro-service name and an isolation IP;
code intrusion: in order to implement a certain non-service function, a developer needs to add an additional non-service logic in a service code, so as to implement the function;
and (3) load balancing algorithm: when the downstream service is called, one service node is selected from the service node information according to a certain algorithm (such as polling, random and the like) to be called. This algorithm is called a load balancing algorithm;
the IP list may be invoked: and the isolation platform integrates the micro service information of the registration center and the isolation configuration information configured by the management end and provides the integrated information for the client to carry out remote calling on the IP list.
As mentioned in the background, in order to solve the above problems, it is difficult for the service isolation method in the prior art to implement dynamic configuration, and in an exemplary embodiment of the present application, a service isolation method, apparatus, computer-readable storage medium, processor, and micro-service system are provided.
According to an embodiment of the present application, a service isolation method is provided.
Fig. 1 is a flow chart of a service isolation method according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step S101, acquiring service change information and isolation configuration information in real time, wherein the service change information is an IP address of a micro service registered in a previous subscription period, the subscription period is a time period for subscribing service change of a registration center, the isolation configuration information at least comprises an isolation IP, and the isolation IP is the IP address of the micro service to be isolated;
step S102, generating current callable IP list information according to the service change information and the isolation configuration information, wherein the callable IP list information comprises IP addresses of a plurality of callable micro services;
step S103, sending the current callable IP list information to all clients.
In the service isolation method, service change information and isolation configuration information are obtained in real time, wherein the service change information is an IP address of a micro service registered in a previous subscription period, the subscription period is a time period for subscribing service change of a registration center, the isolation configuration information at least comprises an isolation IP, and the isolation IP is the IP address of the micro service to be isolated; generating current callable IP list information according to the service change information and the isolation configuration information, wherein the callable IP list information comprises IP addresses of a plurality of callable micro services; and sending the current invokable IP list information to all the clients. The method updates the callable IP list information by acquiring the service change information and the isolation configuration information in real time, synchronizes the callable IP list information to all clients, calls the micro-service according to the callable IP list to realize service isolation, directly configures and generates the isolation configuration information to realize a dynamic configuration isolation strategy, and solves the problem that the dynamic configuration is difficult to realize by the service isolation method in the prior art.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than here.
In an embodiment of the present application, generating current callable IP list information according to the service change information and the isolation configuration information includes: adding the IP address of the micro service corresponding to the service change information to the callable IP list information of the last subscription period to obtain the callable IP list information after the service change; deleting the isolated IP corresponding to the isolation configuration information from the invokable IP list information after the service is changed to obtain the current invokable IP list information. Specifically, as shown in fig. 2, after the micro service is started, the micro service is registered with a registration center cluster, the registration center cluster generates service change information, the IP address of the newly registered micro service corresponding to the service change information is added to the callable IP list information of the previous subscription period, so that the callable IP list information after the service change can be obtained, then the isolated IP corresponding to the isolation configuration information in the callable IP list information is deleted, so that the current callable IP list information can be obtained, and the service isolation is realized by updating the callable IP list in real time.
In an embodiment of the present application, the isolation configuration information further includes an isolation ID and an isolation micro-service name, one isolation ID in a group of the isolation configuration information corresponds to a plurality of isolation IPs, the isolation micro-service name corresponds to the isolation IP in a one-to-one manner, and the obtaining the current callable IP list information by deleting the isolation IP corresponding to the isolation configuration information from the callable IP list information after the service change includes: matching the isolation ID according to a regular matching routing rule to obtain the non-matching isolation ID; deleting the quarantine IP corresponding to the unmatched quarantine ID from the callable IP list information after the service change to obtain the current callable IP list information. Specifically, in the scheme of implementing service isolation by using a routing rule of regular matching, a plurality of isolation IDs are set, one isolation ID corresponds to a plurality of isolation IPs, the isolation IDs are matched according to the routing rule of regular matching, the isolation IP corresponding to the isolation ID that is successfully matched can be accessed, the isolation IP corresponding to the isolation ID that is unsuccessfully matched cannot be accessed, the isolation ID that is successfully matched can be flexibly selected by setting the routing rule of regular matching, and compared with a common isolation scheme, the isolation configuration is more flexible and the application scenarios are wider.
More specifically, as shown in FIG. 3, in addition to the configuration of the isolation IDs tentant-A-001 and tentant-B-002, the configuration of the isolation ID "^ tentant [ \ S ]/", is additionally performed. The system judges whether the isolation ID is a configured regular matching routing rule or not according to the regular starting identifier ^ and the regular ending identifier $. At this time, if there is an identifier with the isolation ID of tentat as the prefix for access, because tentat-a-001 and tentat-B-002 are not matched, and thus an identifier with the isolation ID of "^ tentat \ S ]/$" is directly matched, only 192.168.0.10 is the ip of serviceA, and 192.168.0.11 is the ip of serviceB.
In an embodiment of the present application, obtaining isolation configuration information in real time includes: and acquiring the isolation configuration information configured by a management end page or receiving the isolation configuration information pushed by a third-party system, wherein the management end page is a page for configuring the isolation configuration information. Specifically, as shown in fig. 2, an administrator may configure the isolation configuration information through a management side page of the isolation platform itself, or a third-party system changes/pushes the isolation configuration information to the management side of the isolation platform through an interface, so that the isolation configuration function is integrated at the management side of the isolation platform, which is convenient for the administrator to perform isolation configuration management.
In an embodiment of the present application, sending the current callable IP list information to all the clients includes: performing MD5 digest processing on the current IP list information to obtain a current MD5 value; and sending the current callable IP list information to the client when the current MD5 value is different from the MD5 value of the previous subscription period. Specifically, the client regularly pulls the latest callable IP list from the service isolation platform management end through the isolation platform SDK packet, so that the data transmission quantity is large, the efficiency is low, the callable IP list information of each version can be subjected to MD5 digest processing, if the MD5 value of the callable IP list information acquired by the client last time is consistent with that of the management end, the callable IP list information does not need to be updated, the current callable IP list information does not need to be sent to the client, and otherwise, the current callable IP list information needs to be sent for updating.
In an embodiment of the present application, sending the current callable IP list information to all the clients includes: pushing the current above-mentioned callable IP list information to all clients through udp token. Specifically, the udp token can enable one server to communicate with a plurality of clients, and the isolation management platform can send the callable IP list information to all clients through the udp token.
The embodiment of the present application further provides a service isolation apparatus, and it should be noted that the service isolation apparatus in the embodiment of the present application may be used to execute the method for service isolation provided in the embodiment of the present application. The service isolation device provided by the embodiment of the present application is described below.
Fig. 4 is a schematic diagram of a service isolation device according to an embodiment of the application. As shown in fig. 4, the apparatus includes:
an obtaining unit 10, configured to obtain service change information and isolation configuration information in real time, where the service change information is an IP address of a micro service registered in a previous subscription period, the subscription period is a time period of service change of a subscription registration center, the isolation configuration information at least includes an isolation IP, and the isolation IP is an IP address of the micro service to be isolated;
a generating unit 20, configured to generate current callable IP list information according to the service change information and the isolation configuration information, where the callable IP list information includes IP addresses of the plurality of callable microservices;
a sending unit 30, configured to send the current callable IP list information to all clients.
In the service isolation device, an acquisition unit acquires service change information and isolation configuration information in real time, wherein the service change information is an IP address of a micro service registered in a previous subscription period, the subscription period is a time period for subscribing service change of a registration center, the isolation configuration information at least comprises an isolation IP, and the isolation IP is the IP address of the micro service to be isolated; a generation unit that generates current callable IP list information including IP addresses of the plurality of callable microservices, based on the service change information and the quarantine configuration information; the sending unit sends the current callable IP list information to all the clients. The device updates the callable IP list information by acquiring the service change information and the isolation configuration information in real time, synchronizes the callable IP list information to all clients, calls the micro-service according to the callable IP list to realize service isolation, can directly configure and generate the isolation configuration information to realize a dynamic configuration isolation strategy, and solves the problem that the dynamic configuration is difficult to realize by a service isolation method in the prior art.
In an embodiment of the application, the generating unit includes an adding module and a deleting module, where the adding module is configured to add an IP address of the micro service corresponding to the service change information to the callable IP list information of the previous subscription period, so as to obtain the callable IP list information after the service change; the deleting module is configured to delete the isolated IP corresponding to the isolation configuration information from the callable IP list information after the service change, so as to obtain current callable IP list information. Specifically, as shown in fig. 2, after the micro service is started, the micro service is registered with a registration center cluster, the registration center cluster generates service change information, the IP address of the newly registered micro service corresponding to the service change information is added to the callable IP list information of the previous subscription period, so that the callable IP list information after the service change can be obtained, then the isolated IP corresponding to the isolation configuration information in the callable IP list information is deleted, so that the current callable IP list information can be obtained, and the service isolation is realized by updating the callable IP list in real time.
In an embodiment of the present application, the isolation configuration information further includes an isolation ID and an isolation micro-service name, in a group of the isolation configuration information, one isolation ID corresponds to a plurality of isolation IPs, the isolation micro-service name corresponds to the isolation IPs in a one-to-one manner, and in the callable IP list information after the service change, the deletion module includes a matching sub-module and a deletion sub-module, where the matching sub-module is configured to match the isolation ID according to a routing rule of a regular match, and obtain the isolation ID without a match; the deleting submodule is configured to delete the isolated IP corresponding to the unmatched isolated ID from the callable IP list information after the service change, and obtain current callable IP list information. Specifically, in the scheme of implementing service isolation by using a routing rule of regular matching, a plurality of isolation IDs are set, one isolation ID corresponds to a plurality of isolation IPs, the isolation IDs are matched according to the routing rule of regular matching, the isolation IP corresponding to the isolation ID that is successfully matched can be accessed, the isolation IP corresponding to the isolation ID that is unsuccessfully matched cannot be accessed, the isolation ID that is successfully matched can be flexibly selected by setting the routing rule of regular matching, and compared with a common isolation scheme, the isolation configuration is more flexible and the application scenarios are wider.
More specifically, as shown in FIG. 3, in addition to the configuration of the isolation IDs tentant-A-001 and tentant-B-002, the configuration of the isolation ID "^ tentant [ \ S ]/", is additionally performed. The system judges whether the isolation ID is a configured regular matching routing rule or not according to the regular starting identifier ^ and the regular ending identifier $. At this time, if there is an identifier with the isolation ID of tentat as the prefix for access, because tentat-a-001 and tentat-B-002 are not matched, and thus an identifier with the isolation ID of "^ tentat \ S ]/$" is directly matched, only 192.168.0.10 is the ip of serviceA, and 192.168.0.11 is the ip of serviceB.
In an embodiment of the application, the obtaining unit is further configured to obtain the isolation configuration information configured on a management side page or receive the isolation configuration information pushed by a third-party system, where the management side page is a page configured with the isolation configuration information. Specifically, as shown in fig. 2, an administrator may configure the isolation configuration information through a management side page of the isolation platform itself, or a third-party system changes/pushes the isolation configuration information to the management side of the isolation platform through an interface, so that the isolation configuration function is integrated at the management side of the isolation platform, which is convenient for the administrator to perform isolation configuration management.
In an embodiment of the present application, the sending unit includes a processing module and a sending module, where the processing module is configured to perform MD5 digest processing on the current callable IP list information to obtain a current MD5 value; the sending module is configured to send the current callable IP list information to the client when the current MD5 value is different from the MD5 value of the previous subscription period. Specifically, because the client regularly pulls the latest callable IP list from the service isolation platform management end through the isolation platform SDK packet, the data transmission amount is large, the efficiency is low, the callable IP list information of each version is subjected to MD5 digest processing, and if the MD5 value of the callable IP list information obtained by the client last time is consistent with that of the management end, the callable IP list information does not need to be updated, that is, the current callable IP list information does not need to be sent to the client, otherwise, the callable IP list information needs to be sent for updating.
In an embodiment of the application, the sending unit is further configured to push the current callable IP list information to all clients through udp token. Specifically, the udp token can enable one server to communicate with a plurality of clients, and the isolation management platform can send the callable IP list information to all clients through the udp token.
According to an embodiment of the present application, there is provided a microservice system including: the system comprises an isolation platform, a registry and a client, wherein the isolation platform is used for executing any one of the methods.
The micro-service system comprises an isolation platform, a registration center and a client, wherein the isolation platform acquires service change information and isolation configuration information in real time, the service change information is an IP address of a micro-service registered in a previous subscription period, the subscription period is a time period for subscribing the service change of the registration center, the isolation configuration information at least comprises an isolation IP, and the isolation IP is the IP address of the micro-service to be isolated; the isolation platform generates current callable IP list information according to the service change information and the isolation configuration information, wherein the callable IP list information comprises IP addresses of a plurality of callable micro services; and the isolation platform sends the current called IP list information to all the clients. The system updates the callable IP list information by acquiring the service change information and the isolation configuration information in real time, synchronizes the callable IP list information to all clients, calls the micro-service according to the callable IP list to realize service isolation, directly configures and generates the isolation configuration information to realize a dynamic configuration isolation strategy, and solves the problem that the dynamic configuration is difficult to realize by a service isolation method in the prior art.
More specifically, the scheme for implementing service isolation by the microservice system includes the following 4 processes, that is, system flow, isolation configuration, change push, and remote call, where the system flow includes the following steps: s1-1, after the micro service is started, registering the micro service to a registration center cluster; s1-2, when the service isolation platform management end is started, all micro services are loaded and subscribed to the registration center, and the registration center can push change information when the micro services are changed; s1-3, the service isolation platform management end obtains the configured isolation configuration information from the database, and integrates the configured isolation configuration information with the micro-service online information currently obtained from the registration center to obtain the callable IP list currently provided for the client; s1-4, the client end regularly pulls the latest callable IP list from the service isolation platform management end through the isolation platform SDK packet. In order to ensure the network communication efficiency, the called IP list information of each version is subjected to MD5 abstract processing, and if the MD5 value of the called IP list information obtained by the client last time is consistent with that of the management end, the called IP list information does not need to be updated; s1-5, the service isolation platform management end loads and subscribes the newly registered service from the registration center cluster at regular time, and the newly registered service is ensured to be controlled by the isolation platform. The isolation configuration comprises the following steps: s2-1, the isolation platform itself or the third party system changes/pushes the isolation configuration information to the isolation platform management end through the interface; s2-2, the isolation platform management end saves the isolation configuration information; after the isolation configuration information is changed in S2-3, the isolation platform management side pushes the latest isolation configuration information to all client services through udp token. The change pushing comprises the following steps: s3-1, the registry cluster pushes the micro service change information to the isolation platform management end through udp token; s3-2, after the information is changed, the isolation platform management end pushes the latest isolation configuration information to all client side services through udp sync. In the remote call flow, the client service selects the matched service to call through the callable IP list pulled from the isolation platform.
The service isolation device comprises a processor and a memory, the acquisition unit, the generation unit, the transmission unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the problem that dynamic configuration is difficult to realize by a service isolation method in the prior art is solved by adjusting kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a computer-readable storage medium on which a program is stored, which when executed by a processor implements the above-described method.
The embodiment of the invention provides a processor, which is used for running a program, wherein the method is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein when the processor executes the program, at least the following steps are realized:
step S101, acquiring service change information and isolation configuration information in real time, wherein the service change information is an IP address of a micro service registered in a previous subscription period, the subscription period is a time period for subscribing service change of a registration center, the isolation configuration information at least comprises an isolation IP, and the isolation IP is the IP address of the micro service to be isolated;
step S102, generating current callable IP list information according to the service change information and the isolation configuration information, wherein the callable IP list information comprises IP addresses of a plurality of callable micro services;
step S103, sending the current callable IP list information to all clients.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program of initializing at least the following method steps when executed on a data processing device:
step S101, acquiring service change information and isolation configuration information in real time, wherein the service change information is an IP address of a micro service registered in a previous subscription period, the subscription period is a time period for subscribing service change of a registration center, the isolation configuration information at least comprises an isolation IP, and the isolation IP is the IP address of the micro service to be isolated;
step S102, generating current callable IP list information according to the service change information and the isolation configuration information, wherein the callable IP list information comprises IP addresses of a plurality of callable micro services;
step S103, sending the current callable IP list information to all clients.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a computer-readable storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned computer-readable storage media comprise: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
From the above description, it can be seen that the above-described embodiments of the present application achieve the following technical effects:
1) the service isolation method comprises the steps of obtaining service change information and isolation configuration information in real time, wherein the service change information is an IP address of a micro service registered in a previous subscription period, the subscription period is a time period of service change of a subscription registration center, the isolation configuration information at least comprises an isolation IP, and the isolation IP is the IP address of the micro service to be isolated; generating current callable IP list information according to the service change information and the isolation configuration information, wherein the callable IP list information comprises IP addresses of a plurality of callable micro services; and sending the current invokable IP list information to all the clients. The method updates the callable IP list information by acquiring the service change information and the isolation configuration information in real time, synchronizes the callable IP list information to all clients, calls the micro-service according to the callable IP list to realize service isolation, directly configures and generates the isolation configuration information to realize a dynamic configuration isolation strategy, and solves the problem that the dynamic configuration is difficult to realize by the service isolation method in the prior art.
2) In the service isolation device, an acquisition unit acquires service change information and isolation configuration information in real time, wherein the service change information is an IP address of a micro service registered in a previous subscription period, the subscription period is a time period for subscribing service change of a registration center, the isolation configuration information at least comprises an isolation IP, and the isolation IP is the IP address of the micro service to be isolated; a generation unit that generates current callable IP list information including IP addresses of the plurality of callable microservices, based on the service change information and the quarantine configuration information; the sending unit sends the current callable IP list information to all the clients. The device updates the callable IP list information by acquiring the service change information and the isolation configuration information in real time, synchronizes the callable IP list information to all clients, calls the micro-service according to the callable IP list to realize service isolation, directly configures and generates the isolation configuration information to realize a dynamic configuration isolation strategy, and solves the problem that the dynamic configuration is difficult to realize by a service isolation method in the prior art.
3) The micro-service system comprises an isolation platform, a registration center and a client, wherein the isolation platform acquires service change information and isolation configuration information in real time, the service change information is an IP address of a micro-service registered in a previous subscription period, the subscription period is a time period for subscribing the service change of the registration center, the isolation configuration information at least comprises an isolation IP, and the isolation IP is the IP address of the micro-service to be isolated; the isolation platform generates current callable IP list information according to the service change information and the isolation configuration information, wherein the callable IP list information comprises IP addresses of a plurality of callable micro services; and the isolation platform sends the current called IP list information to all the clients. The system updates the callable IP list information by acquiring the service change information and the isolation configuration information in real time, synchronizes the callable IP list information to all clients, calls the micro-service according to the callable IP list to realize service isolation, directly configures and generates the isolation configuration information to realize a dynamic configuration isolation strategy, and solves the problem that the dynamic configuration is difficult to realize by a service isolation method in the prior art.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made to the present application by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A method of service isolation, comprising:
acquiring service change information and isolation configuration information in real time, wherein the service change information is an IP address of a micro service registered in a previous subscription period, the subscription period is a time period for subscribing service change of a registration center, the isolation configuration information at least comprises an isolation IP, and the isolation IP is the IP address of the micro service to be isolated;
generating current callable IP list information according to the service change information and the isolation configuration information, wherein the callable IP list information comprises IP addresses of a plurality of callable micro services;
and sending the current callable IP list information to all the clients.
2. The method of claim 1, wherein generating current callable IP list information based on the service change information and the quarantine configuration information comprises:
adding the IP address of the micro service corresponding to the service change information to the callable IP list information of the last subscription period to obtain the callable IP list information after the service change;
and deleting the isolation IP corresponding to the isolation configuration information in the callable IP list information after the service is changed to obtain the current callable IP list information.
3. The method of claim 2, wherein the isolation configuration information further includes an isolation ID and an isolation micro-service name, one isolation ID in a group of the isolation configuration information corresponds to a plurality of isolation IPs, the isolation micro-service name corresponds to the isolation IPs in a one-to-one correspondence, and the deleting the isolation IP corresponding to the isolation configuration information from the callable IP list information after the service change to obtain the current callable IP list information includes:
matching the isolation ID according to a regular matching routing rule to obtain the non-matching isolation ID;
and deleting the isolation IP corresponding to the unmatched isolation ID in the callable IP list information after the service is changed to obtain the current callable IP list information.
4. The method of claim 1, wherein obtaining the isolated configuration information in real-time comprises:
and acquiring the isolation configuration information configured by a management side page or receiving the isolation configuration information pushed by a third-party system, wherein the management side page is a page for configuring the isolation configuration information.
5. The method according to any one of claims 1 to 4, wherein sending the current callable IP list information to all clients comprises:
performing MD5 digest processing on the current callable IP list information to obtain a current MD5 value;
sending the current callable IP list information to the client if the current MD5 value is different from the MD5 value of the last subscription period.
6. The method according to any one of claims 1 to 4, wherein sending the current callable IP list information to all clients comprises:
pushing the current callable IP list information to all clients through udp token.
7. A service isolation apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring service change information and isolation configuration information in real time, the service change information is an IP address of a micro service registered in a previous subscription period, the subscription period is a time period for subscribing service change of a registration center, the isolation configuration information at least comprises an isolation IP, and the isolation IP is the IP address of the micro service to be isolated;
a generating unit, configured to generate current callable IP list information according to the service change information and the isolation configuration information, where the callable IP list information includes IP addresses of the callable micro services;
and the sending unit is used for sending the current callable IP list information to all the clients.
8. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein the program performs the method of any one of claims 1 to 6.
9. A processor, characterized in that the processor is configured to run a program, wherein the program when running performs the method of any of claims 1 to 6.
10. A microservice system, comprising: an isolation platform, a registry and a client, wherein the isolation platform is configured to perform the method of any one of claims 1 to 6.
CN202210769965.1A 2022-07-01 2022-07-01 Service isolation method and device and micro-service system Pending CN114944986A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210769965.1A CN114944986A (en) 2022-07-01 2022-07-01 Service isolation method and device and micro-service system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210769965.1A CN114944986A (en) 2022-07-01 2022-07-01 Service isolation method and device and micro-service system

Publications (1)

Publication Number Publication Date
CN114944986A true CN114944986A (en) 2022-08-26

Family

ID=82911567

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210769965.1A Pending CN114944986A (en) 2022-07-01 2022-07-01 Service isolation method and device and micro-service system

Country Status (1)

Country Link
CN (1) CN114944986A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160142369A1 (en) * 2014-11-18 2016-05-19 Alibaba Group Holding Limited Service addressing in distributed environment
CN108282368A (en) * 2018-01-24 2018-07-13 云宏信息科技股份有限公司 A kind of micro services management system, method and computer storage media
CN112000448A (en) * 2020-07-17 2020-11-27 北京计算机技术及应用研究所 Micro-service architecture-based application management method
CN112019369A (en) * 2019-05-31 2020-12-01 烽火通信科技股份有限公司 Dynamic configuration management method and system under micro-service framework
CN113496004A (en) * 2020-04-02 2021-10-12 华为技术有限公司 Message sending method and device
CN113596110A (en) * 2021-07-08 2021-11-02 交通银行股份有限公司太平洋信用卡中心 Heterogeneous cloud-oriented cloud native micro-service platform
CN114500481A (en) * 2021-12-29 2022-05-13 苏州众言网络科技股份有限公司 Service request processing method, system and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160142369A1 (en) * 2014-11-18 2016-05-19 Alibaba Group Holding Limited Service addressing in distributed environment
CN108282368A (en) * 2018-01-24 2018-07-13 云宏信息科技股份有限公司 A kind of micro services management system, method and computer storage media
CN112019369A (en) * 2019-05-31 2020-12-01 烽火通信科技股份有限公司 Dynamic configuration management method and system under micro-service framework
CN113496004A (en) * 2020-04-02 2021-10-12 华为技术有限公司 Message sending method and device
CN112000448A (en) * 2020-07-17 2020-11-27 北京计算机技术及应用研究所 Micro-service architecture-based application management method
CN113596110A (en) * 2021-07-08 2021-11-02 交通银行股份有限公司太平洋信用卡中心 Heterogeneous cloud-oriented cloud native micro-service platform
CN114500481A (en) * 2021-12-29 2022-05-13 苏州众言网络科技股份有限公司 Service request processing method, system and device

Similar Documents

Publication Publication Date Title
CN110768836B (en) Network slice management method and device
WO2019007345A1 (en) Method, apparatus, and system for selecting network slice, and storage medium
CN102970362B (en) The method of a kind of high in the clouds data sharing and device
US9781255B1 (en) Authentication of phone call origination
KR100953855B1 (en) Methods and apparatus for simultaneously hosting multiple service providers on a network
US20090040947A1 (en) Push and Clone Configuration Management for Mobile Devices
KR101352647B1 (en) Pluggable contact resolution
CN112804722A (en) Method for realizing micro-service gateway dynamic routing
CN111935738B (en) Method and system for multi-operator core network docking MEC
CN111611091A (en) Service calling method, device and medium for business object
US20130078984A1 (en) Method and device for creating management object instance in management tree of terminal device
CN101326493A (en) Method and device for distributing load of multiprocessor server
CN111782259B (en) Reverse proxy-based microservice treatment method
CN112732456A (en) Micro-service calling method and device, electronic equipment and storage medium
CN108989420A (en) The method and system of registration service, the method and system for calling service
WO2022052875A1 (en) Terminal cross-region communication method, network element device, and storage medium
CN114944986A (en) Service isolation method and device and micro-service system
RU2447613C2 (en) Method for service processing, communication system and associated device
CN112839372A (en) Network access method and device for user and computer readable storage medium
CN106936643B (en) Equipment linkage method and terminal equipment
CN113824789B (en) Configuration method, device, equipment and storage medium of access descriptor
CN114338383B (en) Simplified configuration method and system for video equipment
CN112910796B (en) Traffic management method, apparatus, device, storage medium, and program product
WO2009006770A1 (en) Method of p2p node management
CN114615321A (en) Traffic processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination