Micro-service facility isolation method and apparatus, terminal device, and storage medium
By detecting the isolation tag type and fault reports of microservice facilities and adopting flexible isolation strategies, the problem of lack of service governance in existing registry centers in microservice systems is solved. This enables flexible isolation of microservice facilities and efficient troubleshooting, thereby improving the stability and utilization of microservice systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PING AN BANK CO LTD
- Filing Date
- 2022-06-21
- Publication Date
- 2026-04-17
AI Technical Summary
Existing open-source registry solutions lack service governance capabilities in microservice systems, making it difficult to meet the stringent IT system governance requirements of the financial industry. In particular, when microservice devices are running unstable, they cannot flexibly isolate microservices, leading to difficulties in troubleshooting business errors and problems.
This paper provides a method for isolating microservice facilities. By detecting the type of isolation marker, it adopts a partial or complete isolation strategy. Based on the marker type and fault report, it flexibly isolates microservice facilities, thereby improving the targeting and efficiency of isolation.
It enables flexible isolation of microservice facilities when microservice devices are running unstable, avoids business errors, improves the utilization rate of microservice facilities and the efficiency of problem diagnosis, and meets the IT system governance needs of the financial industry.
Smart Images

Figure CN115186256B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a microservice facility isolation method, apparatus, terminal device, and storage medium. Background Technology
[0002] The registry center is an indispensable and important system in the modern microservice architecture. It is responsible for centrally managing all microservice information, providing service registration and service discovery functions for microservices, and is the core of microservice system scheduling and a key point for system high availability.
[0003] There are currently several open-source registry solutions available. However, these solutions focus primarily on service registration and discovery, lacking support for service governance capabilities, which makes it difficult to meet the stringent IT system governance requirements of the financial industry.
[0004] For example, if a device running microservices becomes unstable during system operation, it's necessary to isolate the microservice device to prevent normal business traffic from entering and causing errors, while still allowing development and operations teams to troubleshoot the issue. This requires a flexible microservice isolation strategy from the registry center to ensure that all microservices on the same device are isolated. Summary of the Invention
[0005] This application provides a microservice facility isolation method, which can implement different types of isolation strategies for corresponding microservice facilities according to different tag types, thereby improving the flexibility and targeting of isolation.
[0006] In a first aspect, this application provides a microservice facility isolation method, the method comprising:
[0007] Detect whether isolation markers are included in multiple microservice facilities;
[0008] If a microservice facility including the isolation tag is detected, the isolation tag is analyzed to obtain the tag type of the isolation tag;
[0009] Based on the type of the isolation tag, the isolation includes the microservice facility with the isolation tag.
[0010] In some embodiments of this application, analyzing the isolation marker to obtain the marker type of the isolation marker includes:
[0011] Obtain the classification information from the isolation markers;
[0012] Based on the classification information, the tag type is obtained.
[0013] In some embodiments of this application, obtaining the tag type based on the classification information includes:
[0014] If the classification information includes temporary classification information, the label type is determined to be a partial isolation type;
[0015] If the classification information includes permanent classification information, the label type is determined to be a completely isolated type.
[0016] In some embodiments of this application, isolating microservice facilities including the isolation tag according to the tag type of the isolation tag includes:
[0017] If the isolation tag type is the partial isolation type, the microservice instances in the microservice facility before the time information is isolated according to the preset time information in the isolation tag, where the time information represents the creation time of the isolation tag;
[0018] If the isolation tag type is the full isolation type, then each microservice instance in the microservice facility is isolated.
[0019] In some embodiments of this application, before detecting whether an isolation marker is included among the multiple microservice facilities, the method further includes:
[0020] Check for any fault reports related to microservice facilities;
[0021] If the aforementioned fault report exists, identify the microservice facility that experienced the fault;
[0022] Add an isolation tag to the microservice facility that has failed.
[0023] In some embodiments of this application, the step of determining the faulty microservice facility if multiple microservice facility fault reports are received includes:
[0024] Analyze the fault report to determine the fault location;
[0025] Based on the fault address, the microservice facility that experienced the fault is identified.
[0026] In some embodiments of this application, adding an isolation marker to the faulty microservice facility includes:
[0027] The isolation level of the microservice facility that experienced the failure is determined based on the facility type to which it belongs.
[0028] Based on the isolation level, the microservice facility that has failed is marked.
[0029] Secondly, this application also provides a microservice facility isolation device, the device comprising:
[0030] The detection module is used to detect whether isolation markers are included in multiple microservice facilities;
[0031] An analysis module is used to analyze the isolation marker and obtain the marker type of the isolation marker if a microservice facility including the isolation marker is detected.
[0032] An isolation module is used to isolate microservice facilities that include the isolation tag according to the tag type of the isolation tag.
[0033] In some embodiments of this application, the analysis module is specifically used for:
[0034] Obtain the classification information from the isolation markers;
[0035] Based on the classification information, the tag type is obtained.
[0036] In some embodiments of this application, the analysis module is further used for:
[0037] If the classification information includes temporary classification information, the label type is determined to be a partial isolation type;
[0038] If the classification information includes permanent classification information, the label type is determined to be a completely isolated type.
[0039] In some embodiments of this application, the isolation module is specifically used for:
[0040] If the isolation marker is of the partial isolation type, the microservice instances in the microservice facility prior to the time information are isolated according to the preset time information in the isolation marker;
[0041] If the isolation tag type is the full isolation type, then each microservice instance in the microservice facility is isolated.
[0042] In some embodiments of this application, the microservice facility isolation device described in this application may further include an adding module, which is specifically used for:
[0043] Check for any fault reports related to microservice facilities;
[0044] If the aforementioned fault report exists, identify the microservice facility that experienced the fault;
[0045] Add an isolation tag to the microservice facility that has failed.
[0046] In some embodiments of this application, the added module is further used for:
[0047] Analyze the fault report to determine the fault location;
[0048] Based on the fault address, the microservice facility that experienced the fault is identified.
[0049] In some embodiments of this application, the added module is further used for:
[0050] The isolation level of the microservice facility that experienced the failure is determined based on the facility type to which it belongs.
[0051] Based on the isolation level, the microservice facility that has failed is marked.
[0052] Thirdly, this application also provides a terminal device, the terminal device including a processor, a memory, and a computer program stored in the memory and executable on the processor, the processor executing the computer program to implement the steps in any of the microservice facility isolation methods described above.
[0053] Fourthly, this application also provides a computer-readable storage medium storing a computer program that is executed by a processor to implement the steps in any of the microservice facility isolation methods described above.
[0054] The microservice facility isolation method provided in this application can identify the specific isolation type of a microservice facility based on the isolation markers on the microservice facility. In other words, it allows for flexible isolation methods for different isolation types, improving the targeting of isolation. Attached Figure Description
[0055] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0056] Figure 1 This is a schematic diagram of a microservice facility isolation system provided in the embodiments of this application;
[0057] Figure 2 This is a schematic flowchart of one embodiment of the microservice facility isolation method in this application.
[0058] Figure 3 This is a schematic diagram of a functional module of the microservice facility isolation device in the embodiments of this application;
[0059] Figure 4This is a schematic diagram of the structure of the terminal device in the embodiments of this application. Detailed Implementation
[0060] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0061] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0062] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0063] First, let's introduce some concepts that appear in this application:
[0064] Microservices: A software development technique—a variation of Service-Oriented Architecture (SOA)—that advocates dividing a single application into a set of small services that coordinate and cooperate with each other to provide end-value to the user. Each service runs in its own independent process, and services communicate with each other using lightweight communication mechanisms. Each service is built around a specific business function and can be independently deployed to production, pre-production, etc. Furthermore, a unified, centralized service management mechanism should be avoided as much as possible; for a specific service, the appropriate language and tools should be chosen to build it based on the context.
[0065] This application provides a microservice facility isolation method, apparatus, terminal device, and computer-readable storage medium, which are described in detail below.
[0066] Please see Figure 1 , Figure 1 This is a schematic diagram of a microservice facility isolation system provided in an embodiment of this application. The microservice facility isolation system may include a terminal device 100 and a microservice facility 200, which can transmit data to the terminal device 100. For example... Figure 1 The terminal device 100 can obtain whether an isolation marker exists in the microservice facility 200, thereby executing the microservice facility isolation method in this application.
[0067] In this embodiment of the application, the terminal device 100 may include, but is not limited to, desktop computers, portable computers, network servers, handheld computers (Personal Digital Assistants, PDAs), tablet computers, wireless terminal devices, embedded devices, etc.
[0068] In the embodiments of this application, the terminal device 100 and the microservice facility 200 can communicate through any communication method, including but not limited to mobile communication based on the 3rd Generation Partnership Project (3GPP), Long Term Evolution (LTE), and Worldwide Interoperability for Microwave Access (WiMAX), or computer network communication based on the TCP / IP Protocol Suite (TCP / IP) and User Datagram Protocol (UDP).
[0069] It should be noted that, Figure 1 The schematic diagram of the microservice facility isolation system shown is merely an example. The microservice facility isolation system and scenario described in this application embodiment are for the purpose of more clearly illustrating the technical solutions of this application embodiment and do not constitute a limitation on the technical solutions provided in this application embodiment. As those skilled in the art will know, with the evolution of microservice facility isolation systems and the emergence of new business scenarios, the technical solutions provided in this application embodiment are also applicable to similar technical problems.
[0070] like Figure 2 As shown, Figure 2 This is a flowchart illustrating one embodiment of the microservice facility isolation method in this application. The microservice facility isolation method may include the following steps 201-203:
[0071] 201. Check whether isolation markers are included in multiple microservice facilities.
[0072] First, based on the above conceptual introduction, we know the definition of microservices. In this step, the definition of microservice infrastructure is: infrastructure that can host and run microservices. For example: a virtual machine that hosts microservices; or a physical machine that hosts microservices; or a data center that can process microservice business, etc.
[0073] Secondly, the isolation marker can be a form of identification information, such as encoded information that carries information symbolizing isolation. When the corresponding isolation control device maintains network communication with the microservice facilities in the network, the isolation control device can detect in real time at a certain time frequency whether the encoded information for isolation has appeared in each microservice facility in the network. For example, the isolation control device can detect the microservice facilities in the network every minute to check whether there is an isolation marker including isolation encoded information. The microservice facilities in the network can send their own encoded information to the isolation control device for detection every minute through any feasible communication method.
[0074] 202. If a microservice facility with an isolation tag is detected, analyze the isolation tag to obtain the tag type of the isolation tag.
[0075] As can be seen from step 201 above, the isolation control device can detect whether a microservice facility in the network carries an isolation tag. If a microservice facility in the network carries an isolation tag, the isolation control device needs to isolate the corresponding microservice facility.
[0076] However, directly isolating microservices by using isolation control devices with isolation tags is a rather crude approach. For example, in real-world applications, microservices typically require isolation because they have experienced varying degrees of failure, including physical faults or program malfunctions. Therefore, isolation is necessary to prevent normal banking transactions from flowing into faulty microservices. During isolation, maintenance personnel can perform maintenance on microservices marked with isolation tags.
[0077] Because banks handle a massive volume of transactions, it's crucial to maximize the utilization of microservice infrastructure to ensure it effectively supports the bank's microservice operations. Therefore, directly isolating microservices without considering their specific needs can lead to the indiscriminate isolation of even minor faulty microservices, making it difficult for maintenance personnel to determine which microservices are experiencing minor or serious issues.
[0078] Therefore, to improve the flexibility and targeting of isolation, isolation control devices can analyze the specific type of isolation marker that appears. Based on different types of isolation markers, different isolation measures can be implemented. This allows maintenance personnel to prioritize repairing microservices with minor faults, enabling them to quickly return to operation and improving their utilization. For example, when an isolation marker is detected, the isolation control device can further analyze the encoded information within the marker, identifying the type of isolation, such as minor or severe isolation, to determine the appropriate isolation measures. If the isolation marker indicates minor isolation, the device can manage the microservice's execution under isolation and monitoring conditions, allowing maintenance personnel to prioritize maintenance of minorly isolated microservices. Conversely, if the isolation marker indicates severe isolation, the device can completely isolate the microservice, prohibiting it from executing any microservice operations.
[0079] At this point, the type of isolation marker can be identified by adding a suffix or prefix to the code in the isolation identifier when the isolation marker is created. For example, if the code for the isolation marker is ABCD, a type flag bit can be added to the end of ABCD. If the type flag bit is 0, it indicates a light isolation type, and the code would be ABCD0; or, if the type flag bit is 1, it indicates a severe isolation type, and the code would be ABCD1, and so on. In practice, there may be multiple classifications, which are not specifically limited here.
[0080] To better implement the embodiments of this application, in one embodiment, the isolation marker is analyzed to obtain the marker type of the isolation marker, including:
[0081] Obtain the classification information from the isolation markers; based on the classification information, obtain the marker type.
[0082] As shown in the above embodiments, the type flag bit encoded in the isolation tag can be analyzed to determine the tag type. Since the type flag bit is embedded in the encoding of the isolation tag, the program also needs to calculate the number of bits in the encoding during recognition. Although this bit-based recognition principle is relatively simple to implement and less prone to errors in bit-based recognition, it still offers a solution.
[0083] For this purpose, the present application also provides an implementation method for substitution. For example, when creating the isolation mark, additional classification information is added to the isolation mark instead of adding type flag bits to the coding information in the isolation mark. Parallel classification information can be added to the isolation mark, such as "0; ABCD" or "1; ABCD", so that the program does not need to identify the number of coding bits in the code. Of course, in this case, 0 in "0; ABCD" can even be replaced with "slight" in Chinese, and 1 in "1; ABCD" can be replaced with words such as "severe". When the program can recognize it, manual verification can also be added.
[0084] In order to better implement the embodiments of the present application, in one embodiment of the present application, according to the classification information, the mark type is obtained, including:
[0085] If the classification information includes temporary classification information, determine that the mark type is the partial isolation type; if the classification information includes permanent classification information, determine that the mark type is the complete isolation type.
[0086] According to the above embodiments, corresponding slight or severe classification information can be added when adding the mark. In order to make the classification types diverse, so that the isolation methods are diverse, temporary classification information and permanent classification information can also be added when adding the isolation mark, so that partial isolation or complete isolation is performed during isolation. The method for identifying temporary classification information or permanent classification information is the same as that in the above embodiments, and will not be elaborated here.
[0087] When the mark type includes temporary classification information, an isolation time can be set for the microservice facilities to be isolated, and the isolation can be automatically lifted after a period of isolation. Or, when the mark type is permanent classification information, the microservice facilities can be isolated all the time, and the isolation can only be lifted when an instruction to lift the isolation is issued by a higher authority. It should be noted that when the microservices in the microservice facilities are established, and when the isolation marks of the microservice facilities are added, the creation time of the microservices and the creation time of the marks are both established. Therefore, corresponding isolation operations can be performed according to different time information.
[0088] 203. Isolate the microservice facilities including the isolation mark according to the mark type of the isolation mark.
[0089] When the type of the isolation mark is obtained according to the above step 202, corresponding isolation means can be carried out. Taking the isolation mark types of partial isolation type and complete isolation type in the above embodiments as examples:
[0090] Meanwhile, as can be seen from the above embodiments, applying different isolation methods to different tag types helps improve the utilization rate of microservice facilities. Therefore, if the isolation tag type in the above embodiments includes partial isolation type or complete isolation type, there are two cases: if the tag type of the isolation tag is partial isolation type, microservice instances in the microservice facility before the time information is isolated according to the preset time information in the isolation tag; or, if the tag type of the isolation tag is complete isolation type, each microservice instance in the microservice facility is isolated.
[0091] Since both microservices and isolation tags have corresponding creation times added when they are created, in order to improve the utilization of microservice facilities, if the isolation tag type is partial isolation type, the isolation control device will only isolate microservices in the microservice facility after the isolation tag is created. Microservices after the isolation tag is created will not be isolated, only microservices before the isolation tag is created will be isolated.
[0092] For example, if the isolation label type is partial isolation and the creation time is 12:34:56 PM on January 2, 2022, then only microservices created before 12:34:56 PM on January 2, 2022, will be isolated; microservices created after that time will not be isolated. The reason is that if the current microservice infrastructure is partially isolated, it indicates that the current microservice infrastructure has a relatively minor failure rate. Furthermore, microservices are created based on specific infrastructure, so microservices created later have a high probability of overcoming the infrastructure's failure issues and therefore do not need isolation. However, if the isolation label type is full isolation, it indicates that the current microservice infrastructure has a severe failure rate. Therefore, it is assumed that the current microservice infrastructure can no longer support any microservices operating, and microservices on that infrastructure can be completely disabled, regardless of the time period.
[0093] Similarly, if the type of isolation marker is mild isolation or severe isolation, the temporary isolation method or permanent isolation method described in the above embodiments can be used, and the specific details will not be repeated here.
[0094] The microservice facility isolation method provided in this application can identify the specific isolation type of a microservice facility based on the isolation markers on the microservice facility. In other words, it allows for flexible isolation methods for different isolation types, improving the targeting of isolation.
[0095] To better implement the embodiments of this application, in one embodiment of this application, before detecting whether isolation markers are included in multiple microservice facilities, the method further includes:
[0096] Check for fault reports for microservice facilities; if fault reports exist, identify the microservice facility that is experiencing a fault; add an isolation tag to the microservice facility that is experiencing a fault.
[0097] Since the implementation of this application relies on the detection of isolation markers, corresponding markers need to be added so that the relevant isolation control devices can detect the isolation markers on the microservice facilities. Therefore, a marker-adding device can also be set up to detect whether the microservice facility is malfunctioning, including detecting whether there is a fault report sent by a corresponding detection device or whether the microservice facility has generated a fault report through self-detection. Based on the corresponding fault report, a marker is added to the corresponding microservice facility. For example, the fault report includes the specific fault severity of the microservice facility, and the marker-adding device can generate a corresponding isolation code based on the fault severity in the fault report, which is then added as an isolation marker to the microservice facility.
[0098] To better implement the embodiments of this application, in one embodiment of this application, if multiple microservice facility failure reports are received, determining the microservice facility that has failed includes:
[0099] Analyze the fault report to determine the fault address; based on the fault address, determine the microservice facility that experienced the fault.
[0100] As shown in the above embodiments, isolation tags can be added through fault reports. However, in reality, multiple microservice facilities may fail simultaneously, resulting in multiple fault reports. To avoid accidentally adding the isolation tag for microservice facility A to microservice facility B, it is necessary to determine the specific isolation tag corresponding to the faulty microservice facility. Therefore, when analyzing fault reports, the address of the faulty microservice facility can be obtained, and isolation tags can be added based on the address. For example, if the address of the faulty microservice facility is 12.34.56, then the microservice facility with address 12.34.56 can be isolated. The isolation method is the same as in the above embodiments and will not be repeated here.
[0101] To better implement the embodiments of this application, in one embodiment, an isolation marker is added to the microservice facility that has failed, including:
[0102] Determine the isolation level of the microservice facility that failed based on its facility type; then, mark the failed microservice facility according to its isolation level.
[0103] As can be seen from the embodiment in step 201, microservice facilities can include various types, such as virtual machines, physical machines, and data centers. However, as can be seen from the above embodiments, microservice facilities are the medium for hosting microservices, but the way microservices are hosted on different microservice facilities is also different. For example, virtual machines usually exist in a physical machine, and the physical machine may contain multiple virtual machines at the same time. Therefore, if one virtual machine fails, the other virtual machines in the physical machine do not fail, so isolation is not required.
[0104] Similarly, a data center may contain multiple physical machines, and the failure of one physical machine does not necessarily mean that the other physical machines in the data center have also failed. However, a failure of the data center itself would indicate that all physical machines in the data center have failed. Therefore, to isolate a microservice facility that is actually experiencing a failure, it is necessary to set appropriate isolation levels based on the specific circumstances to differentiate between the specific types of isolation facilities.
[0105] Therefore, when adding tags, the type of microservice facility experiencing the failure can be determined based on the corresponding failure information in the failure report, thereby adding isolation tags to characterize different isolation levels. For example, isolation level 1 corresponds to a virtual machine failure, isolation level 2 corresponds to a physical machine failure, and isolation level 3 corresponds to a data center failure. Therefore, when the isolation level in the isolation tag is 1, microservice isolation can be performed based on the tag type and the tag's creation time. For example, if the isolation tag type is partial isolation and the isolation level is 1, then microservices on the virtual machine before the tag's creation time are isolated; if the isolation tag type is partial isolation and the isolation level is 2, then microservices on the physical machine before the tag's creation time are isolated; if the isolation tag type is partial isolation and the isolation level is 3, then microservices in the data center before the tag's creation time are isolated. Similarly, the isolation method for the complete isolation tag is the same as in the above embodiment, and will not be repeated here.
[0106] In summary, the embodiments of this application generally cover three levels of scenarios, specifically including:
[0107] The first level is the node level, which marks instances of services running on virtual machines based on their IP addresses, indicating that the service instance running on the virtual machine specified by that IP is unavailable. This method is suitable for scenarios where a single virtual machine fails, and is used to isolate the services running on that virtual machine.
[0108] The second level is the physical machine level, which is based on the physical machine's IP address. It indicates that service instances running on all virtual machines on the physical machine specified by that IP are unavailable. This method is suitable for scenarios where a physical machine fails and it is necessary to isolate all service instances running on that physical machine.
[0109] The third level is the service level, which is marked based on the service name and data center, indicating that all instances of the service in a specific data center are unavailable. This method is suitable for scenarios where a service has a problem and it is necessary to isolate all service instances in a specified data center.
[0110] There is no mutual exclusion between the three levels. For a given service instance, the isolation flag of any level will cause the instance to be marked as unavailable.
[0111] The first type is a temporary isolation marker. This marker only applies to currently running service instances; service instances started after the marker is set are unaffected. If a currently running service instance restarts, it will also be unaffected by the temporary isolation marker. This type of temporary marker is suitable for troubleshooting temporary issues. Once the troubleshooting is complete, these isolation markers are no longer needed, and newly started service instances are not within the scope of the troubleshooting.
[0112] The second type is permanent isolation marking, which affects both running service instances and newly started service instances. This type of permanent marking is suitable for troubleshooting issues that require a long time, and can also be used to mark a large number of services in a data center to force traffic to switch to other data centers.
[0113] Both temporary and permanent tags can be deleted when they are no longer needed. After deletion, the tag disappears, and the service instance returns to its normal, untagged state.
[0114] When creating an isolation tag, a record is created in the registry containing the unavailability tier, validity period information, and the record creation time. An example is shown below:
[0115] The following record indicates that the virtual machine with IP address 10.3.4.5 has been marked as unavailable. It was created on January 2, 2022 at 12:34:56 PM and is valid only temporarily. It is invalid for service instances started after the creation time and is only valid for service instances started before the creation time.
[0116] The following record indicates that all service instances with the service name "user-service" in the Shanghai data center (SH) have been marked as unavailable. The creation time was 12:34:56 on February 2, 2022, and the validity period is permanent. It applies to service instances started before and after the creation time.
[0117] The following record indicates that all service instances with physical machine IP 172.16.1.6 have been marked as unavailable. The creation time was 22:34:56 on March 2, 2022. The validity period is temporary and it is invalid for service instances started after the creation time. It is only valid for service instances started before the creation time.
[0118] When these isolation markers are no longer needed, they can be deleted. After these records are deleted, all previously affected service instances return to normal.
[0119] When the registry detects a record with an isolation tag, it automatically marks eligible service instances as unavailable. "Eligible" means two things: first, the tier must meet certain criteria. Specifically: first, the virtual machine's IP address must equal the specified IP address; second, the service name and data center name must equal the specified service name and data center name; and third, the physical machine's IP address must equal the specified IP address. Second, the validity period must also meet certain criteria. Specifically, for temporary validity periods, the service's startup / registration time must be earlier than the rule's creation time; for permanent validity periods, the service's startup / registration time and the rule's creation time are not compared.
[0120] To better implement the microservice facility isolation method in the embodiments of this application, a microservice facility isolation device is also provided in the embodiments of this application, such as... Figure 3 As shown, the device 300 includes:
[0121] Detection module 301 is used to detect whether isolation markers are included in multiple microservice facilities;
[0122] Analysis module 302 is used to analyze the isolation markers and obtain the marker type of the isolation markers if a microservice facility including an isolation marker is detected.
[0123] Isolation module 303 is used to isolate microservice facilities that include isolation tags based on the tag type of the isolation tag.
[0124] The microservice facility isolation device provided in this application can detect the isolation mark on the microservice facility through the detection module 301, identify the specific isolation type of the microservice facility through the analysis module 302, and then make flexible isolation methods for different isolation types through the isolation module 303, thereby improving the targeting of isolation.
[0125] In some embodiments of this application, the analysis module 302 is specifically used for:
[0126] Obtain the classification information from the isolation markers;
[0127] Based on the classification information, the tag type is obtained.
[0128] In some embodiments of this application, the analysis module 302 is further configured to:
[0129] If the classification information includes temporary classification information, the label type is determined to be a partial isolation type;
[0130] If the classification information includes permanent classification information, the label type is determined to be the fully isolated type.
[0131] In some embodiments of this application, the isolation module 303 is specifically used for:
[0132] If the isolation tag is a partial isolation type, the microservice instances in the microservice facility that are isolated before the time information in the isolation tag are isolated according to the preset time information in the isolation tag. This time information represents the creation time of the isolation tag.
[0133] If the isolation tag is of the fully isolated type, each microservice instance in the microservice facility is isolated.
[0134] In some embodiments of this application, the microservice facility isolation device described in this application may further include an adding module, which is specifically used for:
[0135] Check for any fault reports related to microservice facilities;
[0136] If the aforementioned fault report exists, identify the microservice facility that experienced the fault;
[0137] Add an isolation tag to the microservice facility that has failed.
[0138] In some embodiments of this application, the added module is further used for:
[0139] Analyze the fault report to determine the fault location;
[0140] Based on the fault address, the microservice facility that experienced the fault is identified.
[0141] In some embodiments of this application, the added module is further used for:
[0142] The isolation level of the microservice facility that experienced the failure is determined based on the facility type to which it belongs.
[0143] Based on the isolation level, the microservice facility that has failed is marked.
[0144] This application also provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement the steps of any of the microservice facility isolation methods described in this application. This terminal device integrates any of the microservice facility isolation methods provided in this application, such as... Figure 4 As shown, it illustrates a structural schematic diagram of the terminal device involved in the embodiments of this application. Specifically:
[0145] The terminal device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that... Figure 4 The terminal device structure shown does not constitute a limitation on the terminal device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0146] The processor 401 is the control center of the terminal device. It connects various parts of the terminal device via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the memory 402, and by calling data stored in the memory 402, thereby providing overall monitoring of the terminal device. Optionally, the processor 401 may include one or more processing cores; the processor 401 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. Preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and application programs, and the modem processor mainly handles wireless communication. It is understood that the aforementioned modem processor may not be integrated into the processor 401.
[0147] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0148] The terminal device also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0149] The terminal device may also include an input unit 404, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0150] Although not shown, the terminal device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the terminal device loads the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 runs the applications stored in the memory 402 to realize various functions, such as:
[0151] Detect whether isolation markers are included in multiple microservice facilities;
[0152] If a microservice facility with an isolation tag is detected, analyze the isolation tag to obtain the tag type of the isolation tag;
[0153] Depending on the type of isolation tag, isolation includes microservice facilities with isolation tags.
[0154] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0155] Therefore, embodiments of this application provide a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a disk, or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any of the microservice facility isolation methods provided in embodiments of this application. For example, the computer program loaded by the processor can execute the following steps:
[0156] Detect whether isolation markers are included in multiple microservice facilities;
[0157] If a microservice facility with an isolation tag is detected, analyze the isolation tag to obtain the tag type of the isolation tag;
[0158] Depending on the type of isolation tag, isolation includes microservice facilities with isolation tags.
[0159] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.
[0160] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.
[0161] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0162] The above provides a detailed description of a microservice facility isolation method and apparatus provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for isolating microservice facilities, characterized in that, The method includes: Detect whether isolation markers are included in multiple microservice facilities; If a microservice facility including the isolation tag is detected, the isolation tag is analyzed to obtain the tag type and isolation level of the isolation tag; Based on the isolation tag type and the isolation level, the isolation includes microservice facilities with the isolation tag, including: If the isolation tag is of the partial isolation type, microservice instances in the microservice facility prior to the time information in the isolation tag are isolated according to the preset time information in the isolation tag, where the time information represents the creation time of the isolation tag; If the isolation tag is of the full isolation type, then each microservice instance in the microservice facility is isolated; Specifically, before detecting whether the multiple microservice facilities include an isolation tag, adding the isolation tag to the faulty microservice facility includes: determining the isolation level of the faulty microservice facility according to the facility type to which the faulty microservice facility belongs; and adding the isolation tag to the faulty microservice facility according to the isolation level.
2. The microservice facility isolation method according to claim 1, characterized in that, The analysis of the isolation markers to obtain the marker type of the isolation markers includes: Obtain the classification information from the isolation markers; Based on the classification information, the tag type is obtained.
3. The microservice facility isolation method according to claim 2, characterized in that, The step of obtaining the tag type based on the classification information includes: If the classification information includes temporary classification information, the label type is determined to be a partial isolation type; If the classification information includes permanent classification information, the label type is determined to be a completely isolated type.
4. The microservice facility isolation method according to claim 1, characterized in that, Before adding an isolation tag to the failed microservice facility, the method further includes: Check for any fault reports related to microservice facilities; If the aforementioned fault report exists, identify the microservice facility that experienced the fault.
5. The microservice facility isolation method according to claim 4, characterized in that, If multiple microservice facility failure reports are received, identify the microservice facility that failed, including: Analyze the fault report to determine the fault location; Based on the fault address, the microservice facility that experienced the fault is identified.
6. A microservice facility isolation device, characterized in that, The device includes: An add module is used to add isolation tags to microservice facilities that have failed, including: determining the isolation level of the microservice facility that has failed based on the facility type to which it belongs; and adding isolation tags to the microservice facility that has failed based on the isolation level. The detection module is used to detect whether isolation markers are included in multiple microservice facilities; An analysis module is used to analyze the isolation marker if a microservice facility including the isolation marker is detected, and to obtain the marker type and the isolation level of the isolation marker; An isolation module is used to isolate microservice facilities including the isolation tag according to the tag type and the isolation level of the isolation tag, including: if the tag type of the isolation tag is a partial isolation type, isolating microservice instances in the microservice facility before the time information preset in the isolation tag, wherein the time information represents the creation time of the isolation tag; if the tag type of the isolation tag is a full isolation type, isolating each microservice instance in the microservice facility.
7. A terminal device, characterized in that, The terminal device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the microservice facility isolation method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to implement the steps of the microservice facility isolation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Service fault processing method and device
CN110333963A
Monitoring method, monitoring device, computer equipment and medium
CN111831504A