Intelligent access method and system for microservice environment

By adopting intelligent access methods in the microservice environment, using Kubernetes virtualized network and external server virtual network model to automatically eliminate abnormal external services, solving the problem that traditional platforms cannot monitor external services, and achieving uninterrupted response and high availability of service requests.

CN116032728BActive Publication Date: 2025-09-02BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211666872.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-23
Publication Date
2025-09-02
Estimated Expiration
2042-12-23

AI Technical Summary

Technical Problem

In a microservice environment, traditional Kubernetes platform cannot monitor external services health, resulting in the inability to know in time when external services are abnormal, resulting in continuous transmission of service requests to abnormal services, affecting overall high availability.

Method used

The intelligent access method is adopted to trigger the corresponding access policy by judging the access type, and the Kubernetes virtualization network model and the external server virtual network model are used to set up preset network segments and virtual IPs that do not conflict with each other, automatically eliminate abnormal external services, and build a scheduleable service list to achieve transparent and automatic failover.

Benefits of technology

It realizes timely monitoring and exception handling of external services, ensures uninterrupted response to service requests, improves overall high availability, and reduces operation and maintenance pressure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116032728B_ABST
    Figure CN116032728B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose an intelligent access method and system for a microservice environment; the method includes determining whether the access type is an internal service request or an external service request based on a service request; triggering a Kubernetes virtualized network model based on the access to the internal service request; triggering an external server virtual network model based on the access to the external service request; the external server virtual network model is provided with a preset network segment that does not conflict with the network segment of the Kubernetes virtualized network model, and the preset network segment is equipped with a number of virtual IPs; detecting the operating status of external services, automatically eliminating abnormal external services, and the remaining normal external services constitute a schedulable service list; if the virtual IP corresponding to the new service request is an abnormal external service, transmitting the new service request to the schedulable service list; the method can promptly obtain the abnormal status of internal and external services, realize transparent and automatic fault switching, and improve overall high availability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of microservice access technology, and in particular to an intelligent access method and system for a microservice environment. Background Art

[0002] As more and more companies accept microservice technology, Kubernetes has become the most popular microservice management platform. The microservice architecture provides great convenience for operation and maintenance personnel.

[0003] Enterprise application scenarios are often complex, with some applications deployed on microservice management platforms (hereinafter referred to as internal services) and others not, either on other platforms or without microservices (hereinafter referred to as external services). Internal services can be monitored and tested using microservice platforms, such as Kubernetes, but external Kubernetes cannot. If an external service fails, the internal service will be unaware of it and unable to access it normally. Summary of the Invention

[0004] In view of this, the embodiments of the present disclosure provide an intelligent access method and system for a microservice environment, which can promptly obtain abnormal status of internal and external services, eliminate unavailable internal and external services, realize transparent and automatic fault switching, effectively reduce the pressure of operation and maintenance, and at the same time, respond to all service requests, so that users will not feel that there is a problem with the service, thereby improving overall high availability.

[0005] In a first aspect, an embodiment of the present disclosure provides an intelligent access method for a microservice environment, which adopts the following technical solution: the method includes:

[0006] Determining an access type based on the service request, where the access type includes an internal service access request or an external service access request;

[0007] Triggering access policies based on the access type to access corresponding services;

[0008] The access policy includes a first access policy and a second access policy, wherein the first access policy triggers a Kubernetes virtualized network model based on the access internal service request; and the second access policy triggers an external server virtual network model based on the access external service request.

[0009] The external server virtual network model is provided with a preset network segment, and the preset network segment does not conflict with the network segment of the Kubernetes virtualized network model;

[0010] The preset network segment is configured with a plurality of virtual IPs, and the plurality of virtual IPs are matched with a plurality of external services;

[0011] Based on the detected operating status of the plurality of external services, abnormal external services are automatically eliminated, and the remaining normal external services constitute a list of schedulable services;

[0012] If the virtual IP corresponding to the new service request is an abnormal external service, it is transmitted to the schedulable service list and accessed according to a preset connection algorithm.

[0013] Optionally, the Kubernetes virtualized network model and the external server virtual network model constitute a new Kubernetes cluster.

[0014] Optionally, triggering the Kubernetes virtualized network model includes: triggering the Kubernetes internal service network, switching to the virtualized pod network, and accessing the corresponding internal service based on the access internal service request.

[0015] Optionally, the external server virtual network model includes a receiving module, a parsing module, a virtual configuration module and an allocation module, and the receiving module is signal-connected to the parsing module;

[0016] The virtual configuration module is signal-connected to the analysis module;

[0017] The allocation module is signal-connected to the virtual configuration module;

[0018] The receiving module is configured to receive the service request;

[0019] The parsing module is configured to parse the service request;

[0020] The virtual configuration module is configured to obtain the corresponding virtual IP of the service request after parsing;

[0021] The allocation module is configured to transmit the service request to the corresponding external service through a preset forwarding path.

[0022] Optionally, the external server virtual network model includes several load balancers.

[0023] Optionally, the method for detecting the operating status of the plurality of external services includes:

[0024] Based on the set health detection plan and the preset detection cycle, the working status of several of the external services is detected.

[0025] Optionally, the preset detection period is 5 seconds.

[0026] Optionally, the anomaly includes a shutdown or a display error.

[0027] Optionally, the device for detecting the running status of the plurality of external services is Keepalived.

[0028] Optionally, the preset connection algorithm is any one of a round-robin algorithm, a weighted round-robin algorithm, or a least connection algorithm.

[0029] Optionally, the number of the virtual IPs is at least two.

[0030] Optionally, the intelligent access method further includes:

[0031] When the abnormal external service returns to normal, the abnormal external service is classified into the schedulable service list.

[0032] In a second aspect, the embodiments of the present disclosure further provide an intelligent access system for a microservice environment, which adopts the following technical solutions:

[0033] The smart access system includes:

[0034] a determination module configured to receive a service request and determine an access type, wherein the access type includes a request to access an internal service or a request to access an external service;

[0035] An analysis module is configured to trigger an access policy based on the access type and perform corresponding service access; the access policy includes a first access policy and a second access policy, the first access policy triggering a Kubernetes virtualized network model based on the access internal service request; the second access policy triggering an external server virtual network model based on the access external service request; the external server virtual network model is provided with a preset network segment, and the preset network segment does not conflict with the network segment of the Kubernetes virtualized network model; the preset network segment is configured with a plurality of virtual IPs, and the plurality of virtual IPs are matched with a plurality of external services;

[0036] a processing module configured to automatically remove abnormal external services based on the detected operating states of the plurality of external services, and to form a list of schedulable services with the remaining normal external services;

[0037] The correction module is configured to re-judge the new service request. If the virtual IP corresponding to the new service request is an abnormal external service, it is transmitted to the schedulable service list and accessed according to a preset connection algorithm.

[0038] In a third aspect, the present disclosure also provides an electronic device that employs the following technical solution:

[0039] The electronic device comprises:

[0040] at least one processor; and,

[0041] a memory communicatively connected to the at least one processor; wherein,

[0042] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the above-mentioned intelligent access methods for a microservice environment.

[0043] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute any of the above-mentioned intelligent access methods for a microservice environment.

[0044] The solution disclosed in this application can effectively solve the problem that traditional Kubernetes-based platforms do not perform health monitoring on external services. Traditional solutions only rely on set links for transmission. When the corresponding external service has an abnormality, it cannot be known, and it will continue to transmit to the abnormal external service according to the service request. Through the solution disclosed in this application, the abnormal status of the external service can be known in time, and the link can be changed in time to realize the full implementation of the service requests within the microservice. The normal external services in this solution serve as backup servers for each other, realizing uninterrupted response to service requests and providing overall service availability.

[0045] The above description is only an overview of the technical solution of the present disclosure. In order to more clearly understand the technical means of the present disclosure, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present disclosure more obvious and easy to understand, the following specifically cites preferred embodiments and describes them in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0047] Figure 1 A logical flow chart of an intelligent access method for a microservice environment provided in an embodiment of the present disclosure.

[0048] Figure 2 This is a schematic diagram of the first embodiment provided in the present disclosure.

[0049] Figure 3 A schematic diagram of a second embodiment provided in the present disclosure.

[0050] Figure 4A block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0051] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0052] It should be clear that the following embodiments of the present disclosure are described through specific concrete examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other in the absence of conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.

[0053] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on this disclosure, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this device and / or practice this method.

[0054] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The illustrations only show components related to the present disclosure and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component can be changed at will, and the component layout type may also be more complicated.

[0055] Additionally, in the following description, specific details are provided to provide a thorough understanding of the examples. However, one skilled in the art will appreciate that the aspects described can be practiced without these specific details.

[0056] Reference Figure 1 The first aspect of the present application provides an intelligent access method for a microservice environment, the method comprising the following steps:

[0057] S100, determining an access type based on a received service request; specifically, the access type includes an internal service access request or an external service access request; the service request in this embodiment is a client request.

[0058] S200: Triggering an access policy based on the access type to access the corresponding service.

[0059] Specifically, the access policy includes a first access policy and a second access policy.

[0060] Among them, the first access policy is to trigger the Kubernetes virtualized network model based on the access internal service request. Specifically, it triggers the Kubernetes internal service network and switches to the virtualized pod network to access the corresponding internal service based on the access internal service request.

[0061] The second access policy triggers the external server virtual network model based on external service access requests. The external server virtual network model has a preset network segment, which does not conflict with the network segment of the Kubernetes virtualized network model, specifically the pod network card network segment and the internal service network segment in the Kubernetes virtualized network model.

[0062] The preset network segment is configured with a number of virtual IPs, and the number of virtual IPs is matched with a number of external services.

[0063] Furthermore, the external server virtual network model includes a receiving module, a parsing module, a virtual configuration module and an allocation module, wherein the receiving module is signal-connected to the parsing module; the virtual configuration module is signal-connected to the parsing module; and the allocation module is signal-connected to the virtual configuration module;

[0064] The receiving module is configured to receive service requests; the parsing module is configured to parse the service requests; the virtual configuration module is configured to obtain the corresponding virtual IP from the parsed service requests; and the distribution module is configured to transmit the service requests to the corresponding external services through a preset forwarding path.

[0065] Furthermore, the Kubernetes virtualized network model includes an acquisition module, a deployment module and an anomaly monitoring module. The acquisition module is signal-connected to the deployment module, and the anomaly monitoring module is signal-connected to the deployment module.

[0066] The acquisition module is configured to receive a service request; the dispatching module is configured to parse the service request and transmit the service request to the corresponding internal service according to a preset internal link to complete the internal request; the anomaly monitoring module is configured to perform anomaly monitoring of the internal service in real time.

[0067] S300: Based on the detected operating states of several external services, abnormal external services are automatically removed, and the remaining normal external services constitute a schedulable service list.

[0068] Specifically, the method for detecting the operating status of several external services includes: based on the set health detection plan and the preset detection cycle, performing health detection on the working status of several external services to obtain abnormal external services; through continuous detection of the preset detection cycle, the health status of the external services can be obtained in time to ensure the normal response of service requests.

[0069] In this embodiment, the preset detection period is preferably 5 seconds; abnormalities include downtime or display errors.

[0070] The health detection device detects the operating status of several external services.

[0071] S400: If the virtual IP corresponding to the new service request is an abnormal external service, it is transmitted to the schedulable service list and accessed according to a preset connection algorithm.

[0072] In this embodiment, the preset connection algorithm is preferably any one of a round-robin algorithm, a weighted round-robin algorithm, or a least connection algorithm.

[0073] Preferably, the number of virtual IPs is at least two. When the number of virtual IPs is two, the corresponding two external services serve as backup services for each other.

[0074] Furthermore, the service request in this application is a service request located inside the microservice, that is, the access to the external service in this application is the access of the service inside the microservice to the external service.

[0075] The present application discloses an intelligent access method for a microservice environment, further comprising the following steps: when an abnormal external service returns to normal, the abnormal external service is classified into a schedulable service list.

[0076] It should be noted that external services refer to external servers, and internal services refer to internal servers.

[0077] In this embodiment, the external server virtual network model is preferably a plurality of load balancers; and the health detection device is preferably Keepalived.

[0078] The Kubernetes virtualized network model and the external server virtual network model constitute a new Kubernetes cluster; the traditional Kubernetes cluster disclosed in the prior art, when it periodically updates the IPVS configuration, mistakenly kills the IPVS configuration that is not Kubernetes's own, that is, when Kubernetes uses IPVS as its own built-in load, it will periodically clean up all the system IPVS configurations. If there is an externally configured IPVS load balancing, it will also be cleaned up, and the health detection of external services cannot be achieved. The new Kubernetes cluster disclosed in this application does not require the development of additional code, and can retain the performance of traditional Kubernetes itself while achieving health detection and exception handling of external services, providing an intelligent access method and effectively improving the high availability of external services.

[0079] Reference Figure 2 , service requests come from Kubernetes internal services, using Kubernetes as a virtualized container platform to solve the scenario of internal access to external applications. Among them, internal refers to applications deployed in containers, and external applications refer to external services that are not managed by the container platform.

[0080] Specifically, the service request from within Kubernetes is connected to the external service through the configured external server virtual network model, that is, through the virtual external service 10.0.0.10 access service. In this embodiment, the external server virtual network model is preferably a load balancer SLB, and then the service request is parsed by the load balancer SLB to determine the virtual IP corresponding to the external service, and the service request is transmitted to the corresponding external service through the transmission link between the virtual IP and the external service.

[0081] In this embodiment, the device for detecting the operating status of several external services is Keepalived, that is, IPVS is configured as a configuration tool, that is, the health monitoring tool in this embodiment is Keepalived, which performs health detection on the two servers of external service A1 and external service A2. If an abnormality occurs in one of external service A1 and external service A2, such as external service A1 goes down, then the external service request of the internal service will not be sent to A1, but will be sent to A2 which is working normally, so as to achieve a normal response to the service request. This solution is simple to implement, efficient and convenient.

[0082] The solution disclosed in this application can effectively solve the problem that traditional Kubernetes-based platforms do not perform health monitoring on external services. Traditional solutions only rely on set links for transmission. When the corresponding external service has an abnormality, it cannot be known, and it will continue to transmit to the abnormal external service according to the service request. Through the solution disclosed in this application, the abnormal status of the external service can be known in time, and the link can be changed in time to achieve full implementation of client requests. The normal external services in this solution serve as backup servers for each other, achieving uninterrupted response to service requests and providing overall service availability.

[0083] Access to external services by services within the container is more transparent, without any changes or modifications to the Kubernetes platform. This allows for both internal and external service health checks.

[0084] Specifically, the IP of the load balancing SLB is a virtual IP that does not overlap with the service network segment. This IP is configured in a virtual network of the device. This solution preferably uses the Linux dump network card directly supported by the kernel. This network card does not require special settings and can effectively solve the conflict problem with the Kubenetes system in the existing technology. When one or all external services are down, it can be notified in time and adjusted in time.

[0085] Furthermore, load balancing uses IPVS, which is supported by the Linux kernel.

[0086] Reference Figure 3 In this embodiment, the service request is a service request sent by appA located inside the Kubenetes system. When it is determined that the service request is a request to access an internal service, the internal appC is accessed through the Kubernetes virtualized network model; when it is determined that the service request is a request to access an external service, taking appA accessing the external service dbserver as an example, the corresponding link matching is achieved through the external server virtual network model. Specifically, the link relationship between the virtual IP in the configured preset network segment and the external service is used to perform corresponding connection transmission of the external service.

[0087] Specifically, when the service request is to access an external service database, through a load balancer (i.e., DBservice Virtual server) in the Kubernetes virtualized network model, a call is made in the DBServer Pool to the virtual IP corresponding to DBServer 1 and DBServer 2 in the database service located in the external service to establish a connection with the corresponding external service and complete the transmission access.

[0088] When the service request is to access an external file database, through another load balancer in the Kubernetes virtualized network model (i.e., FileService Virtual server), a call is made in the FileServer Pool to the virtual IP corresponding to FileServer 1 and FileServer 2 in the file system service located in the external service to establish a connection with the corresponding external service and complete the transmission access.

[0089] At the same time, the health of external services is checked through the health detection device. Specifically, the working status and reachability of external services are checked every 5 seconds. If an unreachable external service is found, it will be removed from the schedulable services; if the kicked-out service returns to normal later, it can be added to the schedulable service list again.

[0090] Through the solution disclosed in this application, when problems occur in the external service part, it can be notified in time, and the unavailable external services can be eliminated in time to achieve transparent and automatic fault switching, effectively reducing the pressure of operation and maintenance. At the same time, all service requests can be responded to, so that users will not feel that there is a problem with the service, thereby improving overall high availability.

[0091] A second aspect of the present application discloses an intelligent access system for a microservice environment, the intelligent access system comprising:

[0092] A determination module configured to receive a service request and determine an access type, where the access type includes an internal service access request or an external service access request;

[0093] The analysis module is configured to trigger access policies based on access types and perform corresponding service access. The access policies include a first access policy and a second access policy. The first access policy triggers the Kubernetes virtualized network model based on access requests to internal services. The second access policy triggers the external server virtual network model based on access requests to external services. The external server virtual network model is provided with a preset network segment, and the preset network segment does not conflict with the network segment of the Kubernetes virtualized network model. The preset network segment is configured with a number of virtual IP addresses, and the number of virtual IP addresses is matched with a number of external services.

[0094] A processing module is configured to automatically remove abnormal external services based on the detected operating status of several external services, and the remaining normal external services constitute a schedulable service list;

[0095] The correction module is configured to re-judge the new service request. If the virtual IP corresponding to the new service request is an abnormal external service, it is transmitted to the schedulable service list and accessed according to the preset connection algorithm.

[0096] An electronic device according to an embodiment of the present disclosure includes a memory and a processor. The memory is used to store non-transitory computer-readable instructions. Specifically, the memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may, for example, include a read-only memory (ROM), a hard disk, a flash memory, etc.

[0097] The processor may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions. In one embodiment of the present disclosure, the processor is used to execute the computer-readable instructions stored in the memory, so that the electronic device performs all or part of the steps of the intelligent access method for a microservice environment in each embodiment of the present disclosure.

[0098] Those skilled in the art should understand that in order to solve the technical problem of how to obtain a good user experience, this embodiment may also include well-known structures such as a communication bus and an interface, and these well-known structures should also be included in the scope of protection of this disclosure.

[0099] like Figure 4 The present invention provides a schematic structural diagram of an electronic device according to an embodiment of the present invention, which is suitable for implementing the electronic device according to an embodiment of the present invention. Figure 4 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0100] like Figure 4 As shown, the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device into a random access memory (RAM). In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0101] Typically, the following devices can be connected to the I / O interface: input devices such as sensors or visual information acquisition devices; output devices such as display screens; storage devices such as tapes and hard disks; and communication devices. The communication device allows the electronic device to communicate with other devices (such as edge computing devices) wirelessly or by wire to exchange data. Figure 4The electronic device is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0102] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, all or part of the steps of the intelligent access method for a microservice environment of an embodiment of the present disclosure are performed.

[0103] For detailed description of this embodiment, please refer to the corresponding description in the aforementioned embodiments, which will not be repeated here.

[0104] According to an embodiment of the present disclosure, a computer-readable storage medium stores non-transitory computer-readable instructions. When the non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the aforementioned intelligent access method for a microservice environment of each embodiment of the present disclosure are executed.

[0105] The above-mentioned computer-readable storage media include, but are not limited to, optical storage media (e.g., CD-ROMs and DVDs), magneto-optical storage media (e.g., MOs), magnetic storage media (e.g., magnetic tapes or mobile hard disks), media with built-in rewritable non-volatile memory (e.g., memory cards), and media with built-in ROM (e.g., ROM cartridges).

[0106] For detailed description of this embodiment, please refer to the corresponding description in the aforementioned embodiments, which will not be repeated here.

[0107] The basic principles of the present disclosure have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, and effects mentioned in this disclosure are merely illustrative and not restrictive, and should not be construed as necessarily possessed by each embodiment of the present disclosure. Furthermore, the specific details disclosed above are provided for illustrative purposes and to facilitate understanding, rather than as limitations. These details do not limit the present disclosure to necessarily being implemented using these specific details.

[0108] In the present disclosure, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. The block diagrams of the devices, devices, equipment, and systems involved in the present disclosure are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, devices, equipment, and systems can be connected, arranged, or configured in any manner. Words such as "including," "comprising," "having," and the like are open-ended words, meaning "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or" and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.

[0109] Additionally, as used herein, "or" used in a list of items beginning with "at least one" indicates a separate list, so that, for example, a list of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not mean that the example described is preferred or better than other examples.

[0110] It should also be noted that in the system and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.

[0111] Various changes, substitutions, and modifications may be made to the technology described herein without departing from the teachings defined by the appended claims. Moreover, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of things, means, methods, and actions described above. Currently existing or later developed processes, machines, manufactures, compositions of things, means, methods, or actions that perform substantially the same function or achieve substantially the same results as the corresponding aspects described herein may be utilized. Accordingly, the appended claims include within their scope such processes, machines, manufactures, compositions of things, means, methods, or actions.

[0112] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0113] The above description has been provided for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.

Claims

1. An intelligent access method for a microservice environment, characterized in that: The method includes: Determine the access type based on the service request, where the access type includes an internal service request or an external service request; the service request is a service request sent by a service within the Kubenetes system; An access policy is triggered based on the access type to access the corresponding service; the access policy includes a first access policy and a second access policy, the first access policy is to trigger the Kubernetes virtualized network model based on the access internal service request; the second access policy is to trigger the external server virtual network model based on the access external service request; the external server virtual network model is provided with a preset network segment, and the preset network segment does not conflict with the network segment of the Kubernetes virtualized network model; the preset network segment is configured with a number of virtual IPs, and the plurality of virtual IPs are matched with a plurality of external services; If the service request is determined to be a request to access an internal service, the Kubernetes virtualized network model is used to access the internal service. If the service request is determined to be a request to access an external service, the external server virtual network model is used to achieve corresponding link matching. Based on the detected operating status of the plurality of external services, abnormal external services are automatically eliminated, and the remaining normal external services constitute a list of schedulable services; If the virtual IP corresponding to the new service request is an abnormal external service, it is transmitted to the schedulable service list and accessed according to the preset connection algorithm; The external server virtual network model includes a receiving module, a parsing module, a virtual configuration module and an allocation module, wherein the receiving module is connected to the parsing module by signal; the virtual configuration module is connected to the parsing module by signal; the allocation module is connected to the virtual configuration module by signal; the receiving module is configured to receive the service request; the parsing module is configured to parse the service request; the virtual configuration module is configured to obtain the corresponding virtual IP address of the parsed service request; and the allocation module is configured to transmit the service request to the corresponding external service through a preset forwarding path; The Kubernetes virtualized network model and the external server virtual network model constitute a new Kubernetes cluster. The new Kubernetes cluster does not require the development of additional code, can retain the performance of traditional Kubernetes itself, and can also implement health detection and exception handling of external services.

2. The intelligent access method for a microservice environment according to claim 1, characterized in that: The triggering of the Kubernetes virtualized network model includes: triggering the Kubernetes internal service network, switching to the virtualized pod network, and accessing the corresponding internal service based on the access internal service request.

3. The intelligent access method for a microservice environment according to claim 1, characterized in that: The external server virtual network model includes several load balancers.

4. The intelligent access method for a microservice environment according to claim 1, characterized in that: The method for detecting the operating status of the plurality of external services includes: Based on the set health detection plan and the preset detection cycle, the working status of several of the external services is detected.

5. The intelligent access method for a microservice environment according to claim 4, characterized in that: The preset detection period is 5 seconds.

6. The intelligent access method for a microservice environment according to claim 1, characterized in that: The anomalies include downtime or display errors.

7. The intelligent access method for a microservice environment according to claim 1, characterized in that: The device for detecting the running status of the plurality of external services is Keepalived.

8. The intelligent access method for a microservice environment according to claim 1, characterized in that: The preset connection algorithm is any one of a round-robin algorithm, a weighted round-robin algorithm, or a least connection algorithm.

9. The intelligent access method for a microservice environment according to claim 1, characterized in that: The number of the virtual IPs is at least two.

10. The intelligent access method for a microservice environment according to claim 1, characterized in that: The smart access method also includes: When the abnormal external service returns to normal, the abnormal external service is classified into the schedulable service list.

11. An intelligent access system for a microservice environment, characterized in that: The smart access system includes: A determination module is configured to receive a service request and determine an access type, where the access type includes an internal service access request or an external service access request; the service request is a service request sent by a service within the Kubenetes system; An analysis module is configured to trigger an access policy based on the access type to access the corresponding service; the access policy includes a first access policy and a second access policy, the first access policy is to trigger the Kubernetes virtualization network model based on the access internal service request; the second access policy is to trigger the external server virtual network model based on the access external service request; the external server virtual network model is provided with a preset network segment, and the preset network segment does not conflict with the network segment of the Kubernetes virtualization network model; the preset network segment is configured with a number of virtual IPs, and the plurality of virtual IPs are matched with a plurality of external services; wherein, when it is determined that the service request is a request to access an internal service, the internal service is accessed through the Kubernetes virtualization network model; when it is determined that the service request is a request to access an external service, the corresponding matching of the link is achieved through the external server virtual network model; a processing module configured to automatically remove abnormal external services based on the detected operating states of the plurality of external services, and to form a list of schedulable services with the remaining normal external services; a correction module configured to re-judge a new service request and, if the virtual IP corresponding to the new service request is an abnormal external service, transmit the new service request to the schedulable service list and access the service according to a preset connection algorithm; The external server virtual network model includes a receiving module, a parsing module, a virtual configuration module and an allocation module, wherein the receiving module is connected to the parsing module by signal; the virtual configuration module is connected to the parsing module by signal; the allocation module is connected to the virtual configuration module by signal; the receiving module is configured to receive the service request; the parsing module is configured to parse the service request; the virtual configuration module is configured to obtain the corresponding virtual IP address of the parsed service request; and the allocation module is configured to transmit the service request to the corresponding external service through a preset forwarding path; The Kubernetes virtualized network model and the external server virtual network model constitute a new Kubernetes cluster. The new Kubernetes cluster does not require the development of additional code, can retain the performance of traditional Kubernetes itself, and can also implement health detection and exception handling of external services.

12. An electronic device, characterized in that: The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the intelligent access method for a microservice environment described in any one of claims 1-10.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, which are used to enable a computer to execute the intelligent access method for a microservice environment described in any one of claims 1-10.

Citation Information

Patent Citations

  • Method and device for dispatching web servers

    CN104320492A

  • Service data processing method and device, node structure and electronic equipment

    CN112243045A