CN116614552B - Microservice access methods, devices, electronic devices and storage media - Google Patents

Microservice access methods, devices, electronic devices and storage media

Info

Publication number
CN116614552B
CN116614552B CN202310563104.2A CN202310563104A CN116614552B CN 116614552 B CN116614552 B CN 116614552B CN 202310563104 A CN202310563104 A CN 202310563104A CN 116614552 B CN116614552 B CN 116614552B
Authority
CN
China
Prior art keywords
microservice
access
micro
gateway
registration information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310563104.2A
Other languages
Chinese (zh)
Other versions
CN116614552A (en
Inventor
霍钊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Si Tech Information Technology Co Ltd
Original Assignee
Beijing Si Tech Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Si Tech Information Technology Co Ltd filed Critical Beijing Si Tech Information Technology Co Ltd
Priority to CN202310563104.2A priority Critical patent/CN116614552B/en
Publication of CN116614552A publication Critical patent/CN116614552A/en
Application granted granted Critical
Publication of CN116614552B publication Critical patent/CN116614552B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/142Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/2895Intermediate processing functionally located close to the data provider application, e.g. reverse proxies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/54Presence management, e.g. monitoring or registration for receipt of user log-on information, or the connection status of the users
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种微服务访问方法、装置、电子设备及存储介质。该方法包括:通过分流管理网关,获取微服务访问请求;通过分流管理网关,根据微服务访问请求和分流管理网关中的分流微服务注册信息,将微服务访问请求发送至分流微服务注册信息对应的微服务访问网关;通过微服务访问网关,根据微服务访问请求,访问对应的容器集群中的微服务;微服务部署于容器集群中;微服务访问网关用于为容器集群中的各微服务提供访问接口;分流管理网关部署于容器集群之外,用于对多个微服务访问网关进行访问。本发明实施例的技术方案提高了微服务访问的速度和准确度。

This invention discloses a microservice access method, apparatus, electronic device, and storage medium. The method includes: obtaining a microservice access request through a traffic management gateway; sending the microservice access request to the microservice access gateway corresponding to the traffic management gateway based on the microservice access request and traffic-split microservice registration information in the traffic management gateway; accessing the corresponding microservice in a container cluster through the microservice access gateway according to the microservice access request; the microservice is deployed in the container cluster; the microservice access gateway provides access interfaces for each microservice in the container cluster; the traffic management gateway is deployed outside the container cluster and is used to access multiple microservice access gateways. The technical solution of this invention improves the speed and accuracy of microservice access.

Description

Micro-service access method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of information technologies, and in particular, to a method and apparatus for accessing micro services, an electronic device, and a storage medium.
Background
With the development of internet technology, the development speed of micro services is faster, the number of micro services is more and more, and the access to the micro services is more and more frequent.
The micro-services are typically deployed in a container cluster, with access to each micro-service in the container cluster through a micro-service access gateway.
However, as the size of the container clusters increases, a way of deploying micro services by multiple container clusters appears, and it is difficult to quickly and accurately access micro services.
Disclosure of Invention
The invention provides a micro-service access method, a micro-service access device, electronic equipment and a storage medium, which improve the speed and accuracy of micro-service access.
According to an aspect of the present invention, there is provided a micro service access method, including:
obtaining a micro-service access request through a shunt management gateway;
Sending the micro-service access request to the micro-service access gateway corresponding to the split micro-service registration information according to the micro-service access request and the split micro-service registration information in the split management gateway through the split management gateway;
The micro-service access gateway is used for providing access interfaces for all the micro-services in the container clusters, and the shunt management gateway is deployed outside the container clusters and used for accessing a plurality of micro-service access gateways.
According to another aspect of the present invention, there is provided a micro service access apparatus including a offload management gateway and a micro service access gateway;
the distribution management gateway is used for acquiring the micro-service access request;
The distribution management gateway is used for sending the micro-service access request to the micro-service access gateway corresponding to the distribution micro-service registration information according to the micro-service access request and the distribution micro-service registration information in the distribution management gateway;
The micro-service access gateway is used for accessing the micro-services in the corresponding container cluster according to the micro-service access request, the micro-services are deployed in the container cluster, the micro-service access gateway is used for providing access interfaces for all the micro-services in the container cluster, and the shunt management gateway is deployed outside the container cluster and used for carrying out access management on the plurality of micro-service access gateways.
According to another aspect of the present invention, there is provided an electronic apparatus including:
At least one processor, and
A memory communicatively coupled to the at least one processor, wherein,
The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the micro service access method of any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the micro service access method according to any of the embodiments of the present invention when executed.
According to the technical scheme, the micro-service access request is acquired through the distribution management gateway, the micro-service access request is sent to the micro-service access gateway corresponding to the distribution micro-service registration information through the distribution management gateway according to the micro-service access request and the distribution micro-service registration information in the distribution management gateway, the micro-service in the corresponding container cluster is accessed through the micro-service access gateway according to the micro-service access request, the micro-service is deployed in the container cluster, the micro-service access gateway is used for providing access interfaces for all the micro-services in the container cluster, the distribution management gateway is deployed outside the container cluster and used for accessing the plurality of micro-service access gateways, the problem that the micro-service access is difficult to be rapidly and accurately performed in a mode of deploying the micro-service by the multi-container cluster is solved, and the speed and the accuracy of the micro-service access are improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for micro service access according to a first embodiment of the present invention;
FIG. 2 is a flow chart of a method for micro-service access according to a second embodiment of the present invention;
FIG. 3 is a schematic diagram of a micro service access method provided according to a second embodiment of the present invention;
fig. 4 is a schematic diagram of the operation of a cluster shunt controller according to the second embodiment of the present invention;
FIG. 5 is a schematic diagram of the operation of a micro-service probe according to a second embodiment of the present invention;
FIG. 6 is a flow chart of a method of micro service access provided in accordance with an embodiment of the present invention;
FIG. 7 is a flow chart of a method for updating split microservice registration information provided in accordance with an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a micro service access device according to a third embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device implementing a micro service access method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a micro service access method according to an embodiment of the present invention. The embodiment of the invention is applicable to the situation of accessing the micro-service, the method can be executed by a micro-service access device which can be realized in the form of hardware and/or software, and the micro-service access device can be configured in an electronic device carrying the micro-service access function.
Referring to the micro service access method shown in fig. 1, the method includes:
S110, obtaining a micro-service access request through a shunt management gateway.
The distribution management gateway is used for distributing the micro-service access requests. The micro-service access request is used to access micro-services in the container cluster. The number of container clusters may be plural.
Specifically, the micro-service access request sent by the user on the front-end page can be obtained through the shunt management gateway.
S120, sending the micro-service access request to the micro-service access gateway corresponding to the split micro-service registration information according to the micro-service access request and the split micro-service registration information in the split management gateway through the split management gateway.
The offload microservice registration information may provide information basis for microservice access requests. The offload microservice registration information may include correspondence of each microservice to a microservice access gateway. The offload microservice registration information may be stored in a cache corresponding to the offload management gateway. The micro service access gateway is used for registering, publishing and accessing micro services.
Specifically, the corresponding micro service access gateway can be queried through the diversion management gateway according to the micro service to be accessed in the micro service access request, and the diversion micro service registration information in the cache corresponding to the diversion management gateway, and the micro service access request is sent to the micro service access gateway corresponding to the diversion micro service registration information.
S130, accessing the corresponding micro services in the container cluster according to the micro service access request through the micro service access gateway, wherein the micro services are deployed in the container cluster, the micro service access gateway is used for providing access interfaces for all the micro services in the container cluster, and the split management gateway is deployed outside the container cluster and used for accessing a plurality of micro service access gateways.
Micro services may implement services that apply a certain function. Each micro-service runs independently. Each micro-service can be updated, deployed and extended independently to meet the functional requirements of the application. Applications are typically developed based on a front-end and back-end split architecture. The application may contain at least one micro-service. The microservices are deployed inside the container. The containers are built according to container clusters. The micro service access gateway is used to access micro services inside the container. Inside the container, the container can be accessed directly through the virtual address, and outside the container, the container internal address and port can be mapped into the address and port of the physical machine outside the container, and any micro service inside the container can be accessed through the micro service access gateway.
Specifically, the micro service in the container cluster corresponding to the micro service access gateway can be accessed through the micro service access gateway according to the micro service to be accessed by the micro service access request.
In the prior art, when the size of a container cluster increases or the physical address of the container cluster changes, multiple sets of container clusters need to be created. At this time, since the micro services contained in the application are deployed into a plurality of containers, virtual address allocation within different containers is different and invisible from each other, and there may be a case where the micro service route cannot be determined. It is understood that the micro services cannot be accessed by accessing a single micro service access gateway. Meanwhile, when the application is developed, the corresponding relation between the micro service and the micro service access gateway needs to be concerned, and difficulty is brought to the development of the application. For example, an application carrying 5000 thousands of users has about 2000 access to microservice registration information, about 100 host physical machines involved in a container cluster, and about 3 container clusters. In the application scenario, the original application is published and migrated among different container clusters, and when the application development is performed, the micro-service access gateway and the corresponding micro-service access path to be called are required to be modified according to the specific deployment of the micro-service, and each modification can involve the carding and adjustment of the inter-calling service in 2000 micro-services.
According to the technical scheme, the micro-service access request is acquired through the distribution management gateway, the micro-service access request is sent to the micro-service access gateway corresponding to the distribution micro-service registration information according to the micro-service access request and the distribution micro-service registration information in the distribution management gateway through the distribution management gateway, the micro-service in the corresponding container cluster is accessed according to the micro-service access request through the micro-service access gateway, the micro-service access gateway is used for providing access interfaces for all the micro-services in the container cluster, the distribution management gateway is deployed outside the container cluster and used for accessing the plurality of micro-service access gateways, distribution of the micro-service access request is realized through the distribution micro-service registration information in the distribution management gateway, the problem that application access is affected by deployment of the micro-service of a plurality of containers is solved, the speed and accuracy of micro-service access are improved, meanwhile, the perception of front-end users is reduced, the problem of focusing on deployment of the micro-service in the application development process is solved, and the application expansibility is enhanced.
In an optional embodiment of the invention, after accessing the micro services in the corresponding container clusters according to the micro service access request through the micro service access gateway, the method further comprises the steps of acquiring micro service access abnormal events fed back by the micro service access gateway through the split management gateway and recording the number of the micro service access abnormal events, and acquiring access micro service registration information of each container cluster through each micro service access gateway when the number of the micro service access abnormal events is greater than or equal to a preset access abnormal event number threshold through the split management gateway, and updating split micro service registration information in the split management gateway.
A micro-service access exception event may be an event that fails to access the corresponding micro-service. Illustratively, the micro-service access exception event may be 404 an error. The preset access anomaly event number threshold may be a maximum value of the preset number of micro-service access anomaly events. The preset access anomaly number threshold may be set and adjusted based on the experience of the technician. The access micro service registration information may be registration information of the micro service in a corresponding micro service access gateway. The offload microservice registration information may include access microservice registration information uploaded by each microservice access gateway. When the micro service is changed or the physical address of the container where the micro service is located is changed, the access micro service registration information in the corresponding micro service access gateway can be updated. The access micro-service registration information is the same as the information type contained in the distribution micro-service registration information, and it can be understood that the access micro-service registration information and the distribution micro-service registration information both contain micro-service access paths and corresponding micro-service access gateways. However, the distributed micro-service registration information contains access micro-service registration information uploaded by all the micro-service access gateways, and the access micro-service registration information only contains micro-service registration information of a single micro-service access gateway. The distributed micro-service registration information is more comprehensive, and the timeliness of accessing the micro-service registration information is higher.
Specifically, the micro-service access abnormal events fed back by the micro-service access gateway can be obtained through the shunt management gateway, and the number of the micro-service access abnormal events is recorded. And when the number of the micro-service access abnormal events is greater than or equal to a preset access abnormal event number threshold value, the access micro-service registration information of each container cluster is acquired through each micro-service access gateway through the shunting management gateway. The split microservice registration information in the split stream management gateway can be compared with the access microservice registration information of each container cluster, and the split stream microservice registration information with difference in comparison result is updated according to the access microservice registration information of each container cluster.
According to the method, after the micro services in the corresponding container clusters are accessed according to the micro service access request through the micro service access gateway, micro service access abnormal events fed back by the micro service access gateway are acquired through the split management gateway, the number of the micro service access abnormal events is recorded, when the number of the micro service access abnormal events is larger than or equal to a preset access abnormal event number threshold value through the split management gateway, access micro service registration information of each container cluster is acquired through each micro service access gateway, split micro service registration information in the split management gateway is updated, the availability of system resources is considered through setting the preset access abnormal event number threshold value, and timeliness of split micro service registration information is improved through updating split micro service registration information in the split management gateway, so that the efficiency and accuracy of subsequent micro service access are further improved.
In an optional embodiment of the invention, the method further comprises periodically accessing each micro service access gateway through the split management gateway to obtain access micro service registration information of each container cluster, and updating the split micro service registration information in the split management gateway.
The period of access to each micro service access gateway may be set and adjusted empirically by the skilled person. Illustratively, the period of access to each micro-service access gateway may be daily, weekly, monthly, quarterly, yearly, or the like. The period of accessing each micro service access gateway can be set as a period with lower micro service access frequency, for example, 2 to 4 am, so that the update of the shunt micro service registration information is avoided, and the normal micro service access process is influenced.
According to the method and the system, the access micro-service access gateways are periodically accessed through the distribution management gateway, the access micro-service registration information of each container cluster is obtained, the distribution micro-service registration information in the distribution management gateway is updated, timeliness of the distribution micro-service registration information is improved, and efficiency and accuracy of subsequent micro-service access are further improved.
In an alternative embodiment of the invention, the micro services in the corresponding container clusters are accessed according to the micro service access request through the micro service access gateway, and the method comprises the steps of analyzing the micro service access request through the micro service access gateway to obtain a micro service access path, and accessing the micro services in the corresponding container clusters according to the micro service access path through the micro service access gateway.
Specifically, the micro service access request can be analyzed through the micro service access gateway to obtain a micro service access path. The micro services in the corresponding container clusters may be accessed through the micro service access gateway according to the micro service access path.
According to the method, the micro-service access gateway is used for analyzing the micro-service access request to obtain a micro-service access path, the micro-service in the corresponding container cluster is accessed according to the micro-service access path through the micro-service access gateway, and the corresponding micro-service in the container cluster is accessed through the micro-service access gateway.
In an optional embodiment of the invention, sending the micro-service access request to the micro-service access gateway corresponding to the split micro-service registration information comprises the steps of obtaining the number of micro-service access requests received by each micro-service access gateway in each container cluster through a split management gateway, enabling one container cluster to correspond to at least two micro-service access gateways, selecting the micro-service access gateway with smaller number of the received micro-service access requests from each micro-service access gateway corresponding to the split micro-service registration information through the split management gateway according to the number of the micro-service access requests received by each micro-service access gateway, determining the micro-service access gateway as a target micro-service access gateway, and sending the micro-service access request to the target micro-service access gateway so as to enable the number of the micro-service access requests processed by each micro-service access gateway in the same container cluster to achieve load balance.
One container cluster may correspond to at least two micro service access gateways, and it may be understood that the container cluster where the micro service is located is configured with a plurality of micro service access gateways, and any one micro service access gateway corresponding to the same container cluster may access the corresponding micro service. Any one micro service access gateway corresponding to the same container cluster is functionally equivalent.
Specifically, the number of micro service access requests received by each micro service access gateway in each container cluster can be obtained through the split management gateway. The number of micro service access requests received by each micro service access gateway may be compared by the offload management gateway. And selecting the micro service access gateway with fewer received micro service access requests from all the micro service access gateways corresponding to the split micro service registration information, and determining the micro service access gateway as the target micro service access gateway. The micro-service access request can be sent to a target micro-service access gateway, and the corresponding micro-service is accessed according to the micro-service access request through the target micro-service access gateway.
According to the method, the number of micro service access requests received by each micro service access gateway in each container cluster is obtained through the split management gateway, one container cluster corresponds to at least two micro service access gateways, the micro service access gateway with the smaller number of the received micro service access requests is selected from the micro service access gateways corresponding to the split micro service registration information through the split management gateway according to the number of the micro service access requests received by each micro service access gateway, the micro service access gateway is determined to be the target micro service access gateway, and the micro service access requests are sent to the target micro service access gateway, so that the number of the micro service access requests processed by each micro service access gateway in the same container cluster reaches load balance, the load capacity of each micro service access gateway in the same container cluster is ensured, and the processing efficiency of the micro service access gateway to the micro service access requests is further improved.
Example two
Fig. 2 is a flowchart of a micro service access method according to a second embodiment of the present invention. The embodiment of the invention is based on the embodiment, the micro service access gateway corresponding to the split micro service registration information is embodied as the split management gateway which is used for analyzing the micro service access request to obtain a micro service access path, the split management gateway is used for inquiring the split micro service registration information in the split management gateway according to the micro service access path to obtain an inquiry result, and the split management gateway is used for splitting the micro service access request to the micro service access gateway corresponding to the inquiry result when the inquiry result is not null, so that the micro service access request is quickly split, and the access efficiency and the access accuracy of the micro service are further improved. In the embodiments of the present invention, the descriptions of other embodiments may be referred to in the portions not described in detail.
Referring to the micro service access method shown in fig. 2, the method includes:
S210, obtaining a micro-service access request through a shunt management gateway.
S220, analyzing the micro-service access request through the shunt management gateway to obtain a micro-service access path.
The micro-service access path may be a routing address of the micro-service. The micro service access request may be an HTTP (Hyper Text Transfer Protocol ) request, and the service access path may be a URL (Uniform Resource Locator ) path, for example.
Specifically, the micro-service access request can be analyzed through the shunt management gateway to obtain a micro-service access path.
S230, inquiring the split micro-service registration information in the split management gateway according to the micro-service access path through the split management gateway to obtain an inquiry result.
The offload microservice registration information may include microservice access paths and corresponding microservice access gateways.
Specifically, the split micro service registration information in the cache of the split management gateway can be queried through the split management gateway according to the micro service access path to obtain the micro service access gateway with a corresponding relation with the micro service access path, and the micro service access gateway is determined to be a query result.
S240, through the diversion management gateway, when the query result is not empty, the micro-service access request is diverted to the micro-service access gateway corresponding to the query result.
The query result is not null, and it can be understood that the offload micro service registration information in the offload management gateway cache includes the micro service access path and the information of the corresponding micro service access gateway.
Specifically, when the query result is not empty, the micro service access request can be shunted to the micro service access gateway corresponding to the query result through the shunt management gateway.
S250, accessing the micro services in the corresponding container clusters according to the micro service access requests through the micro service access gateway, wherein the micro services are deployed in the container clusters, the micro service access gateway is used for providing access interfaces for all the micro services in the container clusters, and the split management gateway is deployed outside the container clusters and used for accessing a plurality of micro service access gateways.
According to the technical scheme, the micro-service access request is acquired through the shunt management gateway, the micro-service access request is analyzed through the shunt management gateway to obtain the micro-service access path, the shunt management gateway is used for inquiring shunt micro-service registration information in the shunt management gateway according to the micro-service access path to obtain an inquiry result, when the inquiry result is not empty through the shunt management gateway, the micro-service access request is shunted to the micro-service access gateway corresponding to the inquiry result, the micro-service access gateway is used for accessing the micro-service in the corresponding container cluster according to the micro-service access request, the micro-service access gateway is deployed in the container cluster, the shunt management gateway is deployed outside the container cluster and used for accessing the plurality of micro-service access gateways, and the quick shunt of the micro-service access request is realized by utilizing the correspondence between the micro-service access path and the micro-service access gateway contained in the shunt micro-service registration information, so that the access efficiency and access accuracy of the micro-service are further improved.
In an alternative embodiment of the invention, after inquiring the split micro service registration information in the split management gateway according to the micro service access path through the split management gateway to obtain the inquiry result, the method further comprises the step of splitting the micro service access request to the general micro service access gateway when the inquiry result is empty through the split management gateway.
Alternatively, the general micro service access gateway may be any micro service access gateway. The generic micro service access gateway may be set and adjusted empirically by the skilled person. Alternatively, the general micro service access gateway may be the micro service access gateway with the highest frequency of use among the micro service access gateways. Alternatively, the generic micro service access gateway may be a micro service access gateway that contains the cluster of containers with the largest number of micro services. Alternatively, the general micro service access gateway may be a micro service access gateway dedicated to splitting the micro service access request with the query result being empty. Alternatively, the general micro service access gateway may receive a micro service access request with a null query result and a micro service access request with a non-null query result.
Specifically, the micro service access request can be shunted to the general micro service access gateway through the shunt management gateway when the query result of the micro service access path is empty.
According to the scheme, the split-flow micro-service registration information in the split-flow management gateway is queried according to the micro-service access path in the split-flow management gateway, after a query result is obtained, the split-flow management gateway is used for splitting the micro-service access request to the general micro-service access gateway when the query result is empty, so that the fault tolerance of micro-service access is improved.
Fig. 3 is a schematic diagram of a micro service access method according to a second embodiment of the present invention. As shown in fig. 3, a offload management gateway is added outside the container cluster. Illustratively, the offload management gateway is a nmginx (reverse proxy) gateway. Alternatively, ngnix gateway deployments may use X86 server virtual machines, with a total of 20 container clusters. The split management gateway includes a cluster split controller and a micro-service detector. The distribution management gateway is deployed outside the container cluster, and has no influence on the container cluster, the micro services deployed inside the container cluster and the application corresponding to the micro services. The number of container clusters may include at least two. The container cluster is internally provided with a micro service access gateway, a registry and a plurality of micro services. Wherein the micro service access gateway is used for accessing a plurality of micro services in the container cluster. The registry is used to store access microservice registration information. Micro services are used to implement a certain function of an application.
Fig. 4 is a working schematic diagram of a cluster shunt controller according to a second embodiment of the present invention. As shown in fig. 4, when the cluster distribution controller in the distribution management gateway receives a micro-service access request sent by a user, the distribution micro-service registration information in the cache is loaded. And matching the split micro-service registration information in the cache through micro-service identification, and determining a micro-service access gateway corresponding to the micro-service access request. And shunting different micro-service access requests to the micro-service access gateway under the corresponding container cluster for processing through micro-service shunting.
Fig. 5 is a schematic diagram of the operation of the micro service detector according to the second embodiment of the present invention. As shown in fig. 5, the micro-service detector has two operation modes, namely, abnormal micro-service detection and periodic micro-service detection. The abnormal micro-service detection may be to detect the micro-service access gateway of each container cluster by identifying the micro-service access abnormal event (e.g. 404 error) fed back by the micro-service access gateway, so as to perfect the split micro-service registration information. Periodic micro-service detection may be to use a micro-service access gateway that periodically detects each container cluster to perfect the offload micro-service registration information.
Fig. 6 is a flowchart of a method for accessing micro services according to an embodiment of the present invention. The micro service access method shown in fig. 6 includes:
s610, obtaining a micro-service access request.
Specifically, the micro-service access request can be obtained through the split management gateway.
S620, analyzing the micro service access path in the micro service access request.
Specifically, the micro service access path in the micro service access request can be analyzed through the split management gateway.
S630, judging whether the split micro service registration information in the cache is in the split micro service registration information, if so, executing S650, and if not, executing S640.
Specifically, whether the micro service access path is in the cached split micro service registration information or not can be inquired through the split management gateway, if so, the inquiry result is considered to be not empty, and if not, the inquiry result is considered to be empty.
S640, appointing to shunt to the general micro service access gateway.
Specifically, the shunting management gateway can be used for appointing shunting to the general micro-service access gateway when the query result is empty.
S650, obtaining the shunt micro-service registration information.
Specifically, the shunt microservice registration information in the shunt management gateway cache can be obtained through the shunt management gateway.
S660, determining to shunt to the micro service access gateway corresponding to the service registration information.
Specifically, the micro service access gateway corresponding to the service registration information can be determined through the distribution management gateway.
S670, forwarding the micro service access request to a corresponding micro service access gateway.
Specifically, the micro service access request may be forwarded to the corresponding micro service access gateway through the offload management gateway.
S680, recording abnormal call.
Specifically, the micro service access abnormal event fed back by the micro service access gateway can be obtained, and the micro service access abnormal event is recorded.
The proposal describes the processing logic of the cluster distribution controller in the distribution management gateway, identifies the micro-service access path through the micro-service access request, judges the micro-service access gateway corresponding to the micro-service access request according to the distribution micro-service registration information in the cache, distributes the micro-service access request to the micro-service access gateway on the corresponding container cluster, realizes the micro-service access, and improves the efficiency and accuracy of the micro-service access.
Fig. 7 is a flowchart of a method for updating split microservice registration information according to an embodiment of the present invention. Referring to fig. 7, the method for updating the registration information of the split micro service includes:
s710, analyzing records of abnormal calls.
Specifically, the micro-service access abnormal events fed back by the micro-service access gateway can be obtained through the shunt management gateway, and the number of the micro-service access abnormal events is recorded.
S720, analyzing a timing strategy.
Specifically, the period of accessing each micro service access gateway can be obtained through the split management gateway. Wherein the timing policy may comprise a period of access to each of said micro service access gateways.
S730, judging whether the access to the micro-service registration information is required, if so, executing S740, and if not, returning to executing S710 and S720.
Specifically, it may be determined whether the number of micro service access abnormal events is greater than or equal to a preset access abnormal event number threshold, and whether a period of accessing each of the micro service access gateways is reached is determined to determine whether access to micro service registration information needs to be detected. If the number of the detected micro service access abnormal events is greater than or equal to the preset access abnormal event number threshold value and/or the period of accessing each micro service access gateway is reached, the detection of access micro service registration information is considered to be needed, and S740 is executed, otherwise, S710 and S720 are executed.
S740, calling the micro service access gateway of different container clusters to acquire the access micro service registration information.
Specifically, the micro service access gateway of each container cluster can be called through the split management gateway to obtain the access micro service registration information corresponding to each micro service access gateway.
S750, obtaining the shunt micro-service registration information in the cache.
Specifically, the shunt microservice registration information in the shunt management gateway cache can be obtained through the shunt management gateway.
S760, updating the registration information of the streaming micro service.
Specifically, the distribution micro-service registration information can be updated through the distribution management gateway according to the access micro-service registration information of each container cluster.
The scheme describes processing logic in an internal service detector of the split-flow management gateway, judges whether split-flow micro-service registration information in the split-flow management gateway needs to be updated according to a micro-service access abnormal event fed back by the micro-service access gateway and a timing strategy, detects complete access micro-service registration information by calling the micro-service access gateways of different container clusters, compares the split-flow micro-service registration information in a cache with all access micro-service registration information acquired by detection, and updates the difference into the split-flow micro-service registration information for loading use of a cluster split-flow controller.
Example III
Fig. 8 is a schematic structural diagram of a micro service access device according to a third embodiment of the present invention. The embodiment of the invention is applicable to the situation of accessing the micro-service, the device can execute the micro-service access method, the device can be realized in the form of hardware and/or software, and the device can be configured in the electronic equipment carrying the micro-service access function.
The micro-service access device shown in fig. 8 comprises a diversion management gateway 810 and a micro-service access gateway 820, wherein the diversion management gateway 810 is used for acquiring micro-service access requests, the diversion management gateway 810 is used for sending the micro-service access requests to the micro-service access gateways corresponding to the diversion micro-service registration information according to the micro-service access requests and the diversion micro-service registration information in the diversion management gateway, the micro-service access gateway 820 is used for accessing the micro-services in the corresponding container clusters according to the micro-service access requests, the micro-service access gateway is deployed in the container clusters and used for providing access interfaces for all the micro-services in the container clusters, and the diversion management gateway is deployed outside the container clusters and used for performing access management on the plurality of micro-service access gateways.
According to the technical scheme, the micro-service access request is acquired through the distribution management gateway, the micro-service access request is sent to the micro-service access gateway corresponding to the distribution micro-service registration information according to the micro-service access request and the distribution micro-service registration information in the distribution management gateway through the distribution management gateway, the micro-service in the corresponding container cluster is accessed according to the micro-service access request through the micro-service access gateway, the micro-service access gateway is used for providing access interfaces for all the micro-services in the container cluster, the distribution management gateway is deployed outside the container cluster and used for accessing the plurality of micro-service access gateways, distribution of the micro-service access request is realized through the distribution micro-service registration information in the distribution management gateway, the problem that application access is affected by deployment of the micro-service of a plurality of containers is solved, the speed and accuracy of micro-service access are improved, meanwhile, the perception of front-end users is reduced, the problem of focusing on deployment of the micro-service in the application development process is solved, and the application expansibility is enhanced.
In an alternative embodiment of the present invention, the split management gateway 810 includes a split management gateway 810 configured to parse a micro service access request to obtain a micro service access path, a split management gateway 810 configured to query split micro service registration information in the split management gateway according to the micro service access path to obtain a query result, and a split management gateway 810 configured to split the micro service access request to the micro service access gateway corresponding to the query result when the query result is not null.
In an alternative embodiment of the present invention, after the split micro service registration information in the split management gateway is queried according to the micro service access path through the split management gateway 810 to obtain the query result, the split management gateway 810 further includes the split management gateway 810, configured to split the micro service access request to the general micro service access gateway when the query result is empty.
In an alternative embodiment of the present invention, after accessing the micro services in the corresponding container clusters according to the micro service access request through the micro service access gateway 820, the micro service access gateway 820 and the split management gateway 810 further include a split management gateway 810, configured to obtain micro service access abnormal events fed back by the micro service access gateway and record the number of the micro service access abnormal events, and the split management gateway 810 is configured to obtain access micro service registration information of each container cluster through each micro service access gateway when the number of the micro service access abnormal events is greater than or equal to a preset access abnormal event number threshold, and update the split micro service registration information in the split management gateway.
In an alternative embodiment of the present invention, the offload management gateway 810 further includes an offload management gateway 810, configured to periodically access each micro service access gateway, obtain access micro service registration information of each container cluster, and update offload micro service registration information in the offload management gateway.
In an alternative embodiment of the present invention, the micro service access gateway 820 includes a micro service access gateway 820 for parsing the micro service access request to obtain a micro service access path, and a micro service access gateway 820 for accessing the micro service in the corresponding container cluster according to the micro service access path.
In an alternative embodiment of the present invention, the offload management gateway 810 includes offload management gateway 810 configured to obtain a number of micro service access requests received by each micro service access gateway in each container cluster, where one container cluster corresponds to at least two micro service access gateways, offload management gateway 810 is configured to select, from each micro service access gateway corresponding to offload micro service registration information, a micro service access gateway with a smaller number of received micro service access requests, to determine the micro service access gateway as a target micro service access gateway, and offload management gateway 810 is configured to send the micro service access requests to the target micro service access gateway, so that the number of micro service access requests handled by each micro service access gateway in the same container cluster reaches load balance.
The micro service access device provided by the embodiment of the invention can execute the micro service access method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
In the technical scheme of the embodiment of the invention, related micro service access requests, micro service access abnormal events fed back by the micro service access gateway, access micro service registration information and the like, storage, application and the like all accord with the regulations of related laws and regulations, and the rules of the public order are not violated.
Example IV
Fig. 9 shows a schematic diagram of an electronic device 900 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 9, the electronic device 900 includes at least one processor 901, and a memory such as a Read Only Memory (ROM) 902, a Random Access Memory (RAM) 903, etc., communicatively connected to the at least one processor 901, wherein the memory stores a computer program executable by the at least one processor, and the processor 901 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 902 or the computer program loaded from the storage unit 908 into the Random Access Memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 can also be stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other by a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
Various components in the electronic device 900 are connected to the I/O interface 905, including an input unit 906 such as a keyboard, a mouse, etc., an output unit 907 such as various types of displays, speakers, etc., a storage unit 908 such as a magnetic disk, an optical disk, etc., and a communication unit 909 such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the electronic device 900 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunications networks.
Processor 901 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of processor 901 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 901 performs the various methods and processes described above, such as the micro service access method.
In some embodiments, the micro service access method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 908. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 900 via the ROM 902 and/or the communication unit 909. When the computer program is loaded into RAM 903 and executed by processor 901, one or more steps of the micro-service access method described above may be performed. Alternatively, in other embodiments, processor 901 may be configured to perform the micro-service access method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above can be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be a special or general purpose programmable processor, operable to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user, for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback), and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a Local Area Network (LAN), a Wide Area Network (WAN), a blockchain network, and the Internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and Virtual private server (VPS PRIVATE SERVER) service.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (9)

1.一种微服务访问方法,其特征在于,包括:1. A microservice access method, characterized in that it includes: 通过分流管理网关,获取微服务访问请求;Microservice access requests are obtained through the traffic management gateway; 通过所述分流管理网关,根据所述微服务访问请求和所述分流管理网关中的分流微服务注册信息,将所述微服务访问请求发送至所述分流微服务注册信息对应的微服务访问网关;Through the traffic management gateway, the microservice access request is sent to the microservice access gateway corresponding to the traffic microservice registration information, based on the microservice access request and the traffic microservice registration information in the traffic management gateway. 通过所述微服务访问网关,根据所述微服务访问请求,访问对应的容器集群中的微服务;所述微服务部署于所述容器集群中;所述微服务访问网关用于为所述容器集群中的各所述微服务提供访问接口;所述分流管理网关部署于所述容器集群之外,用于对多个所述微服务访问网关进行访问;The microservice access gateway accesses the corresponding microservice in the container cluster according to the microservice access request; the microservice is deployed in the container cluster; the microservice access gateway is used to provide access interfaces for each microservice in the container cluster; the traffic management gateway is deployed outside the container cluster and is used to access multiple microservice access gateways. 通过所述分流管理网关,获取所述微服务访问网关反馈的微服务访问异常事件,并记录所述微服务访问异常事件的数量;其中,所述微服务访问异常事件为无法访问到对应的微服务的事件;The traffic management gateway obtains microservice access exception events reported by the microservice access gateway and records the number of such events; wherein, a microservice access exception event is an event in which the corresponding microservice cannot be accessed. 通过所述分流管理网关,在所述微服务访问异常事件的数量大于等于预设访问异常事件数量阈值时,通过各所述微服务访问网关,获取各所述容器集群的访问微服务注册信息,对所述分流管理网关中的所述分流微服务注册信息进行更新;其中,所述访问微服务注册信息和所述分流微服务注册信息中均包含微服务访问路径和对应的微服务访问网关;所述分流微服务注册信息中包含全部微服务访问网关上传的所述访问微服务注册信息;所述访问微服务注册信息中包含单个微服务访问网关的微服务注册信息;所述访问微服务注册信息为微服务在相应的微服务访问网关中的注册信息。When the number of microservice access anomaly events is greater than or equal to a preset threshold, the traffic management gateway obtains the access microservice registration information of each container cluster through each microservice access gateway and updates the traffic management gateway's traffic microservice registration information. Both the access microservice registration information and the traffic microservice registration information contain microservice access paths and corresponding microservice access gateways. The traffic microservice registration information includes all access microservice registration information uploaded by all microservice access gateways. The access microservice registration information also includes the microservice registration information of a single microservice access gateway. The access microservice registration information represents the registration information of the microservice in its corresponding microservice access gateway. 2.根据权利要求1所述的方法,其特征在于,所述通过所述分流管理网关,根据所述微服务访问请求和所述分流管理网关中的分流微服务注册信息,将所述微服务访问请求发送至所述分流微服务注册信息对应的微服务访问网关,包括:2. The method according to claim 1, characterized in that, the step of sending the microservice access request to the microservice access gateway corresponding to the microservice registration information through the traffic distribution management gateway, based on the microservice access request and the traffic distribution microservice registration information in the traffic distribution management gateway, includes: 通过所述分流管理网关,对所述微服务访问请求进行解析,得到微服务访问路径;The microservice access request is parsed through the traffic management gateway to obtain the microservice access path; 通过所述分流管理网关,根据所述微服务访问路径,对所述分流管理网关中的分流微服务注册信息进行查询,得到查询结果;The traffic distribution management gateway is used to query the registration information of the traffic distribution microservices in the traffic distribution management gateway according to the microservice access path, and the query results are obtained. 通过所述分流管理网关,在所述查询结果不为空时,将所述微服务访问请求分流至查询结果对应的微服务访问网关。When the query result is not empty, the microservice access request is routed to the microservice access gateway corresponding to the query result through the traffic management gateway. 3.根据权利要求2所述的方法,其特征在于,在所述通过所述分流管理网关,根据所述微服务访问路径,对所述分流管理网关中的分流微服务注册信息进行查询,得到查询结果之后,还包括:3. The method according to claim 2, characterized in that, after querying the traffic distribution microservice registration information in the traffic distribution management gateway according to the microservice access path through the traffic distribution management gateway to obtain the query result, it further includes: 通过所述分流管理网关,在所述查询结果为空时,将所述微服务访问请求分流至通用微服务访问网关。When the query result is empty, the microservice access request is diverted to the general microservice access gateway through the traffic management gateway. 4.根据权利要求1所述的方法,其特征在于,还包括:4. The method according to claim 1, characterized in that it further comprises: 通过所述分流管理网关,周期性访问各所述微服务访问网关,获取各所述容器集群的所述访问微服务注册信息,对所述分流管理网关中的所述分流微服务注册信息进行更新。The traffic distribution management gateway periodically accesses each of the microservice access gateways to obtain the access microservice registration information of each container cluster, and updates the traffic distribution microservice registration information in the traffic distribution management gateway. 5.根据权利要求1所述的方法,其特征在于,所述通过所述微服务访问网关,根据所述微服务访问请求,访问对应的容器集群中的微服务,包括:5. The method according to claim 1, wherein accessing the corresponding microservice in the container cluster through the microservice access gateway according to the microservice access request includes: 通过所述微服务访问网关,对所述微服务访问请求进行解析,得到微服务访问路径;The microservice access gateway parses the microservice access request to obtain the microservice access path; 通过所述微服务访问网关,根据所述微服务访问路径,访问对应的容器集群中的微服务。Through the microservice access gateway, the corresponding microservice in the container cluster is accessed according to the microservice access path. 6.根据权利要求1所述的方法,其特征在于,所述将所述微服务访问请求发送至所述分流微服务注册信息对应的微服务访问网关,包括:6. The method according to claim 1, wherein sending the microservice access request to the microservice access gateway corresponding to the traffic splitting microservice registration information comprises: 通过分流管理网关,获取各容器集群中的各微服务访问网关接收到微服务访问请求的数量;一个所述容器集群对应至少两个微服务访问网关;The number of microservice access requests received by each microservice access gateway in each container cluster is obtained through the traffic management gateway; each container cluster corresponds to at least two microservice access gateways. 通过分流管理网关,根据各所述微服务访问网关接收到的微服务访问请求的数量,在所述分流微服务注册信息对应的各微服务访问网关中,选取接收到的微服务访问请求的数量较少的微服务访问网关,确定为目标微服务访问网关;By using the traffic management gateway, based on the number of microservice access requests received by each microservice access gateway, the microservice access gateway with the fewer microservice access requests received is selected from the microservice access gateways corresponding to the traffic microservice registration information and determined as the target microservice access gateway. 通过分流管理网关,将所述微服务访问请求发送至所述目标微服务访问网关,以使同一容器集群中的各微服务访问网关处理的微服务访问请求的数量达到负载均衡。By using a traffic management gateway, the microservice access requests are sent to the target microservice access gateway, so that the number of microservice access requests processed by each microservice access gateway in the same container cluster can be load balanced. 7.一种微服务访问装置,其特征在于,包括:分流管理网关和微服务访问网关;7. A microservice access device, characterized in that it comprises: a traffic management gateway and a microservice access gateway; 所述分流管理网关,用于获取微服务访问请求;The traffic management gateway is used to obtain microservice access requests; 所述分流管理网关,用于根据所述微服务访问请求和所述分流管理网关中的分流微服务注册信息,将所述微服务访问请求发送至所述分流微服务注册信息对应的微服务访问网关;The traffic distribution management gateway is used to send the microservice access request to the microservice access gateway corresponding to the traffic distribution microservice registration information based on the microservice access request and the traffic distribution microservice registration information in the traffic distribution management gateway. 所述微服务访问网关,用于根据所述微服务访问请求,访问对应的容器集群中的微服务;所述微服务部署于所述容器集群中;所述微服务访问网关用于为所述容器集群中的各所述微服务提供访问接口;所述分流管理网关部署于所述容器集群之外,用于对多个所述微服务访问网关进行访问管理;The microservice access gateway is used to access the corresponding microservice in the container cluster according to the microservice access request; the microservice is deployed in the container cluster; the microservice access gateway is used to provide access interfaces for each of the microservices in the container cluster; the traffic management gateway is deployed outside the container cluster and is used to manage access to multiple microservice access gateways. 所述分流管理网关,用于获取所述微服务访问网关反馈的微服务访问异常事件,并记录所述微服务访问异常事件的数量;其中,所述微服务访问异常事件为无法访问到对应的微服务的事件;The traffic management gateway is used to obtain microservice access exception events fed back by the microservice access gateway and record the number of microservice access exception events; wherein, the microservice access exception event is an event in which the corresponding microservice cannot be accessed. 所述分流管理网关,用于在所述微服务访问异常事件的数量大于等于预设访问异常事件数量阈值时,通过各所述微服务访问网关,获取各所述容器集群的访问微服务注册信息,对所述分流管理网关中的所述分流微服务注册信息进行更新;其中,所述访问微服务注册信息和所述分流微服务注册信息中均包含微服务访问路径和对应的微服务访问网关;所述分流微服务注册信息中包含全部微服务访问网关上传的所述访问微服务注册信息;所述访问微服务注册信息中包含单个微服务访问网关的微服务注册信息;所述访问微服务注册信息为微服务在相应的微服务访问网关中的注册信息。The traffic distribution management gateway is used to update the traffic distribution microservice registration information in the traffic distribution management gateway when the number of microservice access exception events is greater than or equal to a preset threshold for the number of access exception events, by obtaining the access microservice registration information of each container cluster through each microservice access gateway; wherein, both the access microservice registration information and the traffic distribution microservice registration information contain microservice access paths and corresponding microservice access gateways; the traffic distribution microservice registration information contains the access microservice registration information uploaded by all microservice access gateways; the access microservice registration information contains the microservice registration information of a single microservice access gateway; the access microservice registration information is the registration information of the microservice in the corresponding microservice access gateway. 8.一种电子设备,其特征在于,所述电子设备包括:8. An electronic device, characterized in that the electronic device comprises: 至少一个处理器;以及At least one processor; and 与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected to the at least one processor; wherein, 所述存储器存储有可被所述至少一个处理器执行的计算机程序,所述计算机程序被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-6中任一项所述的微服务访问方法。The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the microservice access method according to any one of claims 1-6. 9.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机指令,所述计算机指令用于使处理器执行时实现权利要求1-6中任一项所述的微服务访问方法。9. A computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, the computer instructions being configured to cause a processor to execute and implement the microservice access method according to any one of claims 1-6.
CN202310563104.2A 2023-05-18 2023-05-18 Microservice access methods, devices, electronic devices and storage media Active CN116614552B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310563104.2A CN116614552B (en) 2023-05-18 2023-05-18 Microservice access methods, devices, electronic devices and storage media

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310563104.2A CN116614552B (en) 2023-05-18 2023-05-18 Microservice access methods, devices, electronic devices and storage media

Publications (2)

Publication Number Publication Date
CN116614552A CN116614552A (en) 2023-08-18
CN116614552B true CN116614552B (en) 2026-04-24

Family

ID=87683001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310563104.2A Active CN116614552B (en) 2023-05-18 2023-05-18 Microservice access methods, devices, electronic devices and storage media

Country Status (1)

Country Link
CN (1) CN116614552B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112671882A (en) * 2020-12-18 2021-04-16 上海安畅网络科技股份有限公司 Same-city double-activity system and method based on micro-service
CN114827246A (en) * 2022-03-18 2022-07-29 中国人寿保险股份有限公司 Gateway flow control method and device, electronic equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3782351B1 (en) * 2018-04-18 2024-09-18 Mavenir Networks, Inc. Services-based architecture for ims
CN114911602B (en) * 2021-02-07 2024-11-15 中移(苏州)软件技术有限公司 A server cluster load balancing method, device, equipment and storage medium
CN114884956B (en) * 2022-07-05 2022-09-06 北京世纪好未来教育科技有限公司 Implementation method, device and multi-cluster architecture system of multi-cluster architecture

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112671882A (en) * 2020-12-18 2021-04-16 上海安畅网络科技股份有限公司 Same-city double-activity system and method based on micro-service
CN114827246A (en) * 2022-03-18 2022-07-29 中国人寿保险股份有限公司 Gateway flow control method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN116614552A (en) 2023-08-18

Similar Documents

Publication Publication Date Title
US10560465B2 (en) Real time anomaly detection for data streams
US9002932B2 (en) Cloud computing access gateway and method for providing a user terminal access to a cloud provider
US10069707B2 (en) System and method for seamless horizontal scaling using logical scalable units
US11275667B2 (en) Handling of workload surges in a software application
US10554741B1 (en) Point to node in a multi-tiered middleware environment
CN112583882A (en) Methods, systems, articles of manufacture, and apparatus for managing telemetry data in an edge environment
US9363177B2 (en) System and methods for communicating in a telecommunication network via independent key routing and proxies
CN111124819A (en) Method and device for monitoring full link
CN114172966A (en) Service calling method and device and service processing method and device under unitized architecture
CN111327647A (en) A method, device and electronic device for a container to provide external services
US9380018B2 (en) System and method for communicating in a telecommunication network via common key routing and proxies
US10715608B2 (en) Automatic server cluster discovery
US11228490B1 (en) Storage management for configuration discovery data
US20210224102A1 (en) Characterizing operation of software applications having large number of components
CN115134412A (en) Service calling method and device, electronic equipment and computer readable storage medium
US9338126B2 (en) System and method for communicating in a telecommunication network via independent key routing and data locality tables
CN107045466A (en) Auditing method, the apparatus and system of business datum
CN116614552B (en) Microservice access methods, devices, electronic devices and storage media
US9363224B2 (en) System and methods for communicating in a telecommunication network using common key routing and data locality tables
CN116260750B (en) Traffic mirroring methods, devices, electronic equipment, storage media and products
US20240089339A1 (en) Caching across multiple cloud environments
CN114356575A (en) User request processing method and device
CN117896275A (en) Link tracking method and device, equipment, service node, storage medium and system
US12537872B1 (en) Blockchain data synchronization and service
CN121217697A (en) A domain name resolution method, apparatus, system, device, and storage medium

Legal Events

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