Distributed micro-service architecture flow distribution method, system, equipment and medium
By using service gateways and service routers to pass signaling and topological link relationships in a distributed microservice architecture, the forwarding information table is generated, which solves the poor application scope and performance bottlenecks of communication between microservices under centralized control, and achieves efficient microservices Improved communication and scalability between services.
Patent Information
- Application Number
- CN202310836389.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-07
- Publication Date
- 2025-01-07
AI Technical Summary
Service-based networks with centralized control have poor application scope, performance bottlenecks and scalability challenges in large-scale distributed microservice deployment and complex communication requirements.
By introducing service gateways and service routers into the distributed microservice architecture, using signaling to transmit service identification information and topological link relationships, generating forwarding information tables for forwarding communication packets, and optimizing communication between microservices through detection tasks and authentication mechanisms path.
It realizes a distributed service mesh architecture suitable for large-scale deployment, improves the robustness and scalability of the service mesh, can independently deploy infrastructure, provide services to multiple organizations, and improves practicality.
Smart Images

Figure CN119276779A_ABST
Abstract
Description
Background Art
[0002] In related technologies, service-oriented networks for communication between microservices mostly adopt a centralized control approach. However, the above approach cannot cope with the challenges and expansion bottlenecks faced by future large-scale distributed microservice deployments and complex communication requirements between microservices, and has problems such as poor scope of application.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0004] The present disclosure provides a distributed microservice architecture traffic diversion method, system, device and medium, which at least to a certain extent overcome the problem of poor applicability of inter-microservice communication in existing centralized control service-oriented networks.
[0005] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0006] According to one aspect of the present disclosure, a distributed microservice architecture traffic diversion method is provided, including: a Pod carrying multiple microservices sends a first signaling to a service gateway, the first signaling is used to notify the service gateway of service identification information of the microservices carried by the Pod; the service gateway sends a second signaling to a service router, the second signaling is used to notify the service router of a topological link relationship and service identification information under each interface of the service gateway; the service node obtains a forwarding information table based on the service identification information based on the topological link relationship, so as to forward communication messages according to the forwarding information table, wherein the service node includes a service gateway or a service router.
[0007] In one embodiment of the present disclosure, the service node obtains a forwarding information table based on the service identification information based on the topological link relationship, including: the service node obtains a forwarding information table based on the service identification information based on a routing algorithm and the topological link relationship.
[0008] In one embodiment of the present disclosure, the service node obtains a forwarding information table based on the service identification information based on the routing algorithm and the topological link relationship, including: the service node forms a link state database based on the service identification information based on the service identification information and the topological link relationship; runs the routing algorithm to process the data in the link state database to form a routing information table based on the service identification information; and obtains a forwarding information table based on the service identification information according to the routing information table.
[0009] In one embodiment of the present disclosure, the service identification information includes: at least one of a service prefix and a namespace.
[0010] In one embodiment of the present disclosure, before the service gateway sends the second signaling to the service router, the method further includes: sending an authentication request to a service prefix authentication entity through a third signaling, wherein the third signaling is used to authenticate whether the service identification information requested by the Pod is legal; if the authentication is successful, executing the operation of the service gateway sending the second signaling to the service router.
[0011] In one embodiment of the present disclosure, the method further includes: if the authentication fails, the service prefix authentication entity sends an authentication failure notification to the service gateway.
[0012] In one embodiment of the present disclosure, the method also includes: the service gateway initiates a detection task to the target microservice, so that the target microservice performs detection according to the detection task, and reports the detection result to the service gateway; the service gateway receives the detection result reported by the target microservice, and reports the detection result to the service grid centralized scheduling center; if the detection result does not meet the preset conditions, the service grid centralized scheduling center generates a forwarding strategy based on the detection result, and sends the forwarding strategy to the service gateway and service router of the path corresponding to the target microservice.
[0013] In one embodiment of the present disclosure, the detection result does not meet the preset conditions, including at least one of the following: the bandwidth of the path corresponding to the target microservice is less than or equal to the preset bandwidth threshold; the delay of the path corresponding to the target microservice is greater than or equal to the preset delay threshold; the jitter of the path corresponding to the target microservice is greater than or equal to the preset jitter threshold.
[0014] According to another aspect of the present disclosure, a distributed microservice architecture traffic diversion system is also provided, the system comprising multiple Pods, multiple service gateways, and multiple service routers, wherein a Pod is linked to a service gateway, wherein the Pod is used to carry multiple microservices and send a first signaling to the service gateway, wherein the first signaling is used to notify the service gateway of the service identification information of the microservices carried by the Pod; the service gateway is used to send a second signaling to the service router, wherein the second signaling is used to notify the service router of the topological link relationship and the service identification information under each interface of the service gateway; the service node is used to obtain a forwarding information table based on the service identification information based on the topological link relationship, so as to forward communication messages according to the forwarding information table, wherein the service node comprises a service gateway or a service router.
[0015] According to another aspect of the present disclosure, a service gateway is provided, including: a first signaling receiving module, used to receive a first signaling sent by a Pod carrying multiple microservices, the first signaling being used to notify the service gateway of service identification information of the microservices carried by the Pod; a second signaling sending module, used to send a second signaling to a service router, the second signaling being used to notify the service router of a topological link relationship and service identification information under each interface of the service gateway; a first information table generating module, used to obtain a forwarding information table based on the service identification information based on the topological link relationship, so as to forward communication messages according to the forwarding information table.
[0016] According to another aspect of the present disclosure, a service router is provided, including: a second signaling receiving module, used to receive a second signaling sent by a service gateway, the second signaling being used to notify the service router of a topological link relationship and service identification information under each interface of the service gateway; a second information table generating module, used to obtain a forwarding information table based on the service identification information based on the topological link relationship, so as to forward communication messages according to the forwarding information table.
[0017] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the above-mentioned distributed microservice architecture traffic diversion method by executing the executable instructions.
[0018] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned distributed microservice architecture traffic diversion method is implemented.
[0019] According to another aspect of the present disclosure, a computer program product is provided, including executable instructions, which are stored in a computer-readable storage medium. A processor of an electronic device reads the executable instructions from the computer-readable storage medium, and the processor executes the executable instructions, so that the electronic device executes the above-mentioned distributed microservice architecture traffic diversion method.
[0020] In the disclosed embodiment, the Pod carrying multiple microservices sends a first signaling to the service gateway, and the first signaling is used to notify the service gateway of the service identification information of the microservices carried by the Pod; the service gateway sends a second signaling to the service router, and the second signaling is used to notify the service router of the topological link relationship and the service identification information under each interface of the service gateway; the service node obtains a forwarding information table based on the service identification information based on the topological link relationship, and forwards the communication message according to the forwarding information table. The present disclosure provides a new fully distributed service grid implementation architecture, which is suitable for large-scale, single-domain or cross-domain deployment, improves the robustness of the service grid, can independently deploy infrastructure, can provide services to multiple organizations at the same time, and is highly practical.
[0021] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0023] Figure 1 A schematic diagram showing an exemplary system architecture of a distributed microservice architecture traffic diversion method according to an embodiment of the present disclosure.
[0024] Figure 2 A flow chart of a distributed microservice architecture traffic diversion method provided by an embodiment of the present disclosure is shown.
[0025] Figure 3 A flow chart of a method for generating a forwarding information table provided by an embodiment of the present disclosure is shown.
[0026] Figure 4 A flow chart of another distributed microservice architecture traffic diversion method provided by an embodiment of the present disclosure is shown.
[0027] Figure 5 A flow chart of another distributed microservice architecture traffic diversion method provided by an embodiment of the present disclosure is shown.
[0028] Figure 6 A flow chart of another distributed microservice architecture traffic diversion method provided by an embodiment of the present disclosure is shown.
[0029] Figure 7 A schematic diagram of the structure of a service gateway provided in an embodiment of the present disclosure is shown.
[0030] Figure 8 A schematic diagram of the structure of a service router provided in an embodiment of the present disclosure is shown.
[0031] Fig. 9 A structural block diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0032] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0033] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0034] For ease of understanding, before introducing the embodiments of the present disclosure, several terms involved in the embodiments of the present disclosure are first explained as follows:
[0035] Service is a component or microservice in an application.
[0036] Pod, in a Kubernetes cluster, is the basis of all business types. It is a collection of one or more containers that share storage, network, and namespace, as well as specifications for how to run. In a Pod, all containers are uniformly arranged and scheduled and run in a shared context.
[0037] Service Gateway, Service Gateway, SG.
[0038] SPA, Service Prefix Authentication, is used to authenticate the service prefix owned by the Pod.
[0039] Service Router, Service Router, SR.
[0040] In related technologies, service-oriented network architecture is usually implemented through centralized control.
[0041] The proxy deployed in the same Pod as the microservice completes the common functions required for communication between microservices, such as service registration, service discovery, service scheduling, and service measurement. All forwarding-level communications between microservices are implemented through the proxy. The complex links between proxies form a new basic communication facility, namely the service mesh.
[0042] The implementation process of the key functions of the centralized control service-oriented network architecture is as follows:
[0043] Service registration: The microservice registers with the Proxy to which it belongs, and then the Proxy registers with the centralized control center.
[0044] Service discovery: The centralized control center sends relevant service registration information to each proxy to synchronize microservice information.
[0045] Service measurement: The proxy actively detects the quality of each target microservice and reports relevant information to the centralized control center.
[0046] Service scheduling: The centralized control center sends relevant service scheduling strategies to each proxy. Each proxy analyzes the received microservice communication requirements and performs scheduling based on the scheduling strategy and microservice communication requirements.
[0047] In summary, the centralized service-oriented network architecture is difficult to meet the communication needs of large-scale and complex microservices, and there are performance, scalability, and reliability bottlenecks.
[0048] In order to solve the problems existing in the centralized service-oriented network architecture, the present disclosure provides a distributed microservice architecture to better cope with the complex communication requirements between microservices.
[0049] The specific implementation of the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.
[0050] Figure 1 A schematic diagram of an exemplary application system architecture to which the distributed microservice architecture traffic diversion method in the embodiments of the present disclosure can be applied is shown.
[0051] like Figure 1 As shown, the system architecture includes microservices 101, multiple service gateways 102, multiple service routers 103, a service prefix authentication (SPA) entity 104, and a service grid centralized scheduling center 105, for example, Figure 1 The system is provided with four service gateways 102, which are respectively microservice gateways 1 to 4; the system is provided with three service routers 103, which are respectively microservice routers 1 to 3.
[0052] Microservice 101 is a logical collection of multiple Pods for a service and a strategy for accessing the Pods. It can be seen as a group of external access interfaces for Pods that provide the same service. With the help of microservices, applications can easily implement service discovery and load balancing.
[0053] In one embodiment, the Pod where the microservice 101 is located can declare the service identification information of the above Pod to the service gateway linked to the Pod.
[0054] A Pod is linked to a service gateway 102, and a service gateway 102 can be linked to at least one Pod. Figure 1 In the example, service gateway 1 links two Pods. The microservice under one Pod is defined as microservice A / 1, which serves as the service identification information of the Pod. The microservice under another Pod is defined as microservice B / 1, which serves as the service identification information of the other Pod.
[0055] The service gateway 102 may also be referred to as an internetwork connector or a protocol converter. The service gateway 102 implements network interconnection above the network layer, and can be used for both wide area network interconnection and local area network interconnection.
[0056] In one embodiment, the service gateway 102 can exchange information between the service identification information of each Pod and the corresponding service router 103 through different interfaces of the service gateway 102, and the corresponding gateway interface can be selected according to service requirements.
[0057] The service router 104 may include, but is not limited to, a provider edge router, a hub router, a spoke router, an autonomous system border router, a regional edge router, and the like.
[0058] In addition, the system architecture may also include other suitable network devices such as switches, hubs, modems, bridges, repeaters, multiplexers, network adapters, network interfaces, network racks, chassis, servers, computing devices, one or more combinations or variations of one or more virtual machines shown in the accompanying drawings.
[0059] The SPA entity 104 is used to authenticate the service identification information of the Pod sent by the service gateway 102, and the service gateway 102 implements the proxy registration in the SPA manner. After the service gateway 102 passes the authentication to the SPA entity, the service gateway 102 and the service router 103 distribute the information through the distributed protocol to achieve the synchronization of microservice information.
[0060] One service gateway 102 can be linked to one SPA entity 104 .
[0061] The service grid centralized dispatching center 105 is centrally deployed by domain and can initiate regular automatic detection to each target microservice according to the service gateway based on service requirements, record and report the detection results, specify forwarding strategies, and issue the above forwarding strategies to each service gateway and service router in the path, so as to select service nodes with superior performance from multiple microservices that can provide the same functions.
[0062] The microservice 101 in the embodiment of the present disclosure may be initiated by a client of an application installed in a terminal device. Based on different terminal platforms, the specific form of the client of the application may also be different, for example, the application client may be a mobile client, a PC client, etc.
[0063] Those skilled in the art will know that Figure 1 The number of microservices 101, service gateways 102, service routers 103, and SPA entities 104 is only illustrative, and any number of microservices 101, service gateways 102, service routers 103, and SPA entities 104 may be provided according to actual needs. The embodiments of the present disclosure are not limited to this.
[0064] The solution provided by the embodiment of the present disclosure is that the Pod carrying multiple microservices sends a first signaling to the service gateway, and the first signaling is used to notify the service gateway of the service identification information of the microservices carried by the Pod; the service gateway sends a second signaling to the service router, and the second signaling is used to notify the service router of the topological link relationship and the service identification information under each interface of the service gateway; the service node obtains a forwarding information table based on the service identification information based on the topological link relationship, and forwards communication messages according to the forwarding information table. The present disclosure provides a new fully distributed service grid implementation architecture, which is suitable for large-scale, single-domain or cross-domain deployment, improves the robustness of the service grid, can independently deploy infrastructure, can provide services to multiple organizations at the same time, and is highly practical. It is specifically described through the following embodiments:
[0065] First, a distributed microservice architecture traffic diversion method is provided in an embodiment of the present disclosure, and the method can be executed by any system with computing processing capabilities.
[0066] Figure 2 A flow chart of a distributed microservice architecture traffic diversion method according to an embodiment of the present disclosure is shown as follows: Figure 2 As shown, the distributed microservice architecture traffic diversion method provided in the embodiment of the present disclosure includes the following steps:
[0067] S202. The Pod carrying multiple microservices sends a first signaling to the service gateway, where the first signaling is used to notify the service gateway of service identification information of the microservices carried by the Pod.
[0068] In a distributed microservice architecture, an application system includes multiple microservices, which may include routing request microservices, security authentication microservices, traffic monitoring microservices, log and monitoring microservices, etc. Multiple microservices can be deployed on the same server or on different servers.
[0069] The service gateway is the network gateway through which clients access system requests and system responses. The service gateway encapsulates the internal functional architecture of the system and provides different interfaces for each client access.
[0070] It should be noted that the service identification information of the microservice carried by the Pod may include: at least one of the service prefix ServicePrefix and the namespace.
[0071] The above service prefixes can be expressed in words, letters, numbers, symbols, etc., for example Figure 1 Microservice A / 1, Microservice B / 1, etc. are used to distinguish different Pods and ensure the uniqueness of the microservices under the Pod.
[0072] Namespace can be a uniform resource identifier name, which is used to distinguish different Pods. You can directly specify the identifier or use keywords as the namespace.
[0073] The first signaling in the above S202 is used to implement information interaction between the Pod where the microservice is located and the service gateway. In the present disclosure, the Pod where each microservice is located notifies the service gateway of the service prefix or namespace of the microservice carried by the Pod through the first signaling.
[0074] In one embodiment, the service gateway serves as the default gateway for the microservice carried by the Pod, and the service gateway can absorb and forward all service traffic sent from the Pod where the microservice is located.
[0075] For example, Figure 1 As shown, the service gateways linked to the Pod where microservice A / 1 is located and the Pod where microservice B / 1 is located are both microservice gateway 1, and service gateway 1 serves as the default gateway corresponding to the above two Pods; accordingly, the service gateways linked to the Pods corresponding to microservice A / 2, microservice B / 2, and microservice C / 2 are all microservice gateway 2, which serves as the default gateway corresponding to the above three Pods.
[0076] S204: The service gateway sends a second signaling to the service router, where the second signaling is used to notify the service router of the topological link relationship and the service identification information of each interface of the service gateway.
[0077] The second signaling is used to implement information interaction between each service gateway and service router, and between each service router. The second signaling can establish a link relationship between each service gateway and each service router through their reachable service identification information and topological link relationship.
[0078] The topological connection relationship is used to characterize the link relationship between the service gateway and the service router, and the link relationship between multiple service routers.
[0079] S206. The service node obtains a forwarding information table based on the service identification information based on the topological link relationship, and forwards the communication message according to the forwarding information table, wherein the service node includes one of a service gateway and a service router.
[0080] The topological link relationship can be obtained through the link state algorithm or the distance vector algorithm.
[0081] Among them, for the link state algorithm, each service router has all the information of other service routers in the distributed service network architecture and the traffic status of the service network. A service router sends a query message to an adjacent service router to test the link status of each service router. After receiving the link status of the above service router and the adjacent service router, it sends a link state message to all service routers participating in the shortest path first algorithm, and refreshes the topological link relationship saved by the above service router according to the data in the message.
[0082] In the distance vector algorithm, each service router only has the information of the service routers connected to itself, and periodically broadcasts its own routing information to adjacent service routers to inform them of the reachable networks and the distance to the networks.
[0083] The forwarding information table is used to store the correspondence between the service identification information and the path pointing to the specific destination address. One service identification information corresponds to one path pointing to the specific destination address. It should be noted that different service identification information can correspond to the same path pointing to the specific destination address, or can correspond to different paths pointing to the specific destination address.
[0084] When two microservices need to communicate, one microservice corresponds to the source address and the other microservice corresponds to the destination address, for example, Figure 1Microservice A / 1 communicates with microservice B / 4, and microservice A / 1 sends relevant communication messages to microservice B / 4, with microservice A / 1 as the source address and microservice B / 4 as the destination address. The communication message is sent to the default service gateway 1 corresponding to microservice A / 1, and service gateway 1 forwards the communication message according to the forwarding information table until the communication message reaches service gateway 4 at the destination address, and service gateway 4 sends the communication message to the Pod where microservice B / 4 is located.
[0085] For the return traffic, that is, sending the communication message of microservice B / 4 to microservice A / 1, the process is similar to the above process and will not be repeated here.
[0086] It should be noted that the service node may be a service gateway or a service router. The service gateway or the service router obtains a forwarding information table based on the service identification information according to their respective topological link relationships.
[0087] In the disclosed embodiment, the Pod carrying multiple microservices sends a first signaling to the service gateway, and the first signaling is used to notify the service gateway of the service identification information of the microservices carried by the Pod; the service gateway sends a second signaling to the service router, and the second signaling is used to notify the service router of the topological link relationship and the service identification information under each interface of the service gateway; the service node obtains a forwarding information table based on the service identification information based on the topological link relationship, and forwards the communication message according to the forwarding information table. The present disclosure provides a new fully distributed service grid implementation architecture, which is suitable for large-scale, single-domain or cross-domain deployment, improves the robustness of the service grid, can independently deploy infrastructure, can provide services to multiple organizations at the same time, and is highly practical.
[0088] In one embodiment, the above-mentioned S204 service node obtains the forwarding information table based on the service identification information based on the topological link relationship, including: the service node obtains the forwarding information table based on the service identification information based on the routing algorithm and the topological link relationship.
[0089] Figure 3 FIG. 2 shows a flow chart of a method for generating a forwarding information table provided by an embodiment of the present disclosure. Figure 3 As shown, in one embodiment, the service node in the above S204 obtains a forwarding information table based on the service identification information based on the routing algorithm and the topological link relationship, including:
[0090] S302, the service node forms a link state database based on the service identification information based on the service identification information and the topological link relationship;
[0091] S304, running a routing algorithm to process the data in the link state database to form a routing information table based on the service identification information;
[0092] S306: Obtain a forwarding information table based on the service identification information according to the routing information table.
[0093] The topology link relationship can be synchronized with the link state database through link state advertisement (LSA).
[0094] The Link State DataBase (LSDB) is used to store the interface status information of each service router. The Link State DataBase can store the link information of the service router's own interface, and can also store the link information sent by the adjacent service router.
[0095] In one embodiment, the routing algorithm may be a Dijkstra algorithm, a Floyd algorithm, or other routing algorithms.
[0096] The Dijkstra algorithm is a shortest path algorithm from one vertex (starting point) to the remaining vertices (end points), which solves the problem of the shortest path in a weighted graph.
[0097] Floyd's algorithm can solve the problem of the shortest path between every pair of vertices.
[0098] Routing Information Base (RIB table, routing table): The routing information table is used to store the correspondence between service identification information and the path pointing to a specific destination address. One service identification information corresponds to one path pointing to a specific destination address. It should be noted that different service identification information can correspond to the same path pointing to a specific destination address, or can correspond to different paths pointing to a specific destination address.
[0099] The routing information table may include the destination network address, subnet mask, service gateway, next hop, interface, number of hops, etc.
[0100] The forwarding information table is used to represent and / or constitute the active routes used by the service router to forward all service traffic.
[0101] Figure 4 Another flow chart of a distributed microservice architecture traffic diversion method provided by an embodiment of the present disclosure is shown. In one embodiment, Figure 4 As shown, before the service gateway sends the second signaling to the service router in S204, the method further includes:
[0102] S203, sending an authentication request to the service prefix authentication entity through a third signaling, where the third signaling is used to authenticate whether the service identification information requested by the Pod is legal;
[0103] S2042: If the authentication is successful, the service gateway sends a second signaling to the service router.
[0104] In one embodiment, the third signaling is used to implement information interaction between the service gateway and the service prefix authentication entity to authenticate whether the service identification information such as the service prefix or namespace requested by the Pod is legal.
[0105] When the service prefix authentication entity determines that the service identification information requested by the Pod is legal, the service prefix authentication entity sends an authentication success message to the service gateway through the third signaling, so that the service gateway can absorb and forward all service traffic sent by the Pod where the above microservice is located.
[0106] In an embodiment of the present disclosure, the service gateway sends an authentication request to the service prefix authentication entity through a third signaling. When the service prefix authentication entity authenticates the service identification information in the request as legitimate, it indicates that the service identification information received by the service gateway is sent by the Pod linked to the service gateway, thereby realizing proxy registration.
[0107] Optional, such as Figure 5 As shown, the distributed microservice architecture traffic diversion method provided by the embodiment of the present disclosure also includes:
[0108] S2044. If the authentication fails, the service prefix authentication entity sends an authentication failure notification to the service gateway.
[0109] When the service prefix authentication entity determines that the service identification information requested by the Pod is illegal, the service prefix authentication entity sends an authentication failure message to the service gateway through the third signaling, indicating that the service identification information received by the service gateway is not sent by the Pod linked to the service gateway, so that the service gateway refuses to forward all service traffic issued by the Pod where the above microservice is located.
[0110] Figure 6 A flow chart of another distributed microservice architecture traffic diversion method provided by an embodiment of the present disclosure is shown. In one embodiment, the distributed service architecture traffic diversion method provided by the present disclosure further includes:
[0111] S602, the service gateway initiates a detection task to the target microservice, so that the target microservice performs detection according to the detection task and reports the detection result to the service gateway;
[0112] S604: The service gateway receives the detection result reported by the target microservice and reports the detection result to the service grid centralized dispatching center;
[0113] S606. If the detection result does not meet the preset conditions, the service grid centralized dispatching center generates a forwarding strategy based on the detection result and sends the forwarding strategy to the service gateway and service router of the path corresponding to the target microservice.
[0114] In one embodiment, the service gateway may periodically initiate a detection task to the target microservice, for example, once a day, or once every 6 hours.
[0115] The above detection task is used to detect the measurement tasks of parameters such as bandwidth, delay, jitter, etc. on the path corresponding to the target microservice. Accordingly, the detection result includes at least one of the bandwidth value, delay value, jitter, etc. on the path corresponding to the target microservice.
[0116] It should be noted that the detection result does not meet the preset conditions, including at least one of the following: the bandwidth of the path corresponding to the target microservice is less than or equal to the preset bandwidth threshold; the delay of the path corresponding to the target microservice is greater than or equal to the preset delay threshold; the jitter of the path corresponding to the target microservice is greater than or equal to the preset jitter threshold.
[0117] When the detection results meet the preset conditions, there is no need to re-customize the forwarding strategy.
[0118] In one embodiment, information interaction between the service gateway or service router and the service grid centralized scheduling center is achieved through the fourth signaling, and the fourth signaling is used for reporting the communication quality between microservices and issuing the communication forwarding strategy between microservices.
[0119] In the disclosed embodiment, each service gateway initiates a detection task on demand and sends the detection results reported by the microservice to the service grid centralized scheduling center. When the detection results do not meet the preset conditions, the forwarding strategy is re-customized to select a service node with superior performance from multiple microservices that can provide the same functions.
[0120] In order to deepen the understanding of the traffic diversion method of the distributed microservice architecture disclosed in the present invention, the following is combined with the attached Figure 1 Provide detailed explanation.
[0121] Continue to refer Figure 1 The distributed microservice architecture traffic diversion method provided by the present disclosure includes a forwarding layer process and a control layer process. The service identification information is described using a service prefix.
[0122] Among them, Figure 1 As shown, the control plane process is as follows:
[0123] ① The Pod to which the microservice belongs notifies the service prefix or namespace of the microservice carried by the Pod to the service gateway to which it is linked through the first signaling (or Class 1 signaling). All microservices under the Pod use the service prefix to name the microservices above it.
[0124] Exemplarily, microservice A / 1 notifies service gateway 1 of the service prefix of microservice A / 1 through the first signaling, and the service prefix can be represented by microservice A / 1.
[0125] ②After receiving the service prefix notification, the service gateway sends an authentication request to the service prefix authentication entity through the third signaling (or type 2 signaling) to confirm the service prefix (Service Prefix) of the microservice carried by the Pod.
[0126] ③ The service gateway notifies the service router to which it is connected of its topological link relationship and the service prefix under each interface through the second signaling (or type 3 signaling).
[0127] Exemplarily, service gateway 1 notifies service router 1 of its topological link relationship through the second signaling; service router 1 notifies service router 2 and service router 3 of the topological link relationship and the service prefix of microservice 1 through the second signaling.
[0128] Other microservices and service gateways use similar processes for notification, which will not be described in detail.
[0129] The service gateway and service router form a link state database based on the service prefix according to the received link state advertisement LSA of the service prefix, and respectively run the Dijkstra algorithm to form the RIB and FIB tables based on the service prefix.
[0130] ④ The service gateway initiates a detection task to the target microservice, so that the target microservice performs detection according to the detection task and reports the detection result to the service gateway; the service gateway receives the detection result reported by the target microservice and reports the detection result to the service grid centralized dispatching center; if the detection result does not meet the preset conditions, the service grid centralized dispatching center generates a forwarding strategy based on the detection result, and sends the forwarding strategy to the service gateway and service router corresponding to the path of the target microservice.
[0131] The forwarding process is as follows:
[0132] When microservice A / 1 and microservice B / 4 need to communicate, microservice A / 1 sends the relevant communication message, where the destination service is set to microservice B / 4. The communication message is sent to its default service gateway 1, which forwards the communication message in sequence according to the FIB table formed by the control layer interaction until the data packet reaches the service gateway 4 where the destination service is located; the service gateway 4 sends the communication message to the Pod where the destination service is located.
[0133] The return traffic uses a similar process and will not be described here.
[0134] Based on the same inventive concept, the embodiments of the present disclosure also provide a distributed microservice architecture traffic diversion system, such as the following embodiments. Since the principle of solving the problem in the system embodiment is similar to that in the above method embodiment, the implementation of the system embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0135] In one embodiment, the distributed microservice architecture traffic diversion system provided by the embodiment of the present disclosure includes multiple Pods, multiple service gateways 102, and multiple service routers 103, and one Pod is linked to one service gateway 102.
[0136] Among them, Pod is used to carry multiple microservices and send a first signaling to the service gateway 102, the first signaling is used to notify the service gateway 102 of the service identification information of the microservice carried by the Pod; the service gateway 102 is used to send a second signaling to the service router 103, the second signaling is used to notify the service router 103 of the topological link relationship and the service identification information under each interface of the service gateway 102; the service node is used to obtain a forwarding information table based on the service identification information based on the topological link relationship, so as to forward communication messages according to the forwarding information table, wherein the service node includes one of the service gateway 102 and the service router 103.
[0137] In one embodiment, the service node is used to obtain a forwarding information table based on the service identification information based on a routing algorithm and a topological link relationship.
[0138] In one embodiment, the service node is used to form a link state database based on the service identification information based on the service identification information and the topological link relationship; run a routing algorithm to process the data in the link state database to form a routing information table based on the service identification information; and obtain a forwarding information table based on the service identification information according to the routing information table.
[0139] It should be noted that the service identification information includes: at least one of a service prefix and a namespace.
[0140] In one embodiment, the service gateway 102 is used to send an authentication request to the service prefix authentication entity 104 through a third signaling before the service gateway sends the second signaling to the service router, and the third signaling is used to authenticate whether the service identification information requested by the Pod is legal; if the authentication is successful, the service gateway executes the operation of sending the second signaling to the service router.
[0141] In one embodiment, the service prefix authentication entity 104 is further configured to send an authentication failure notification to the service gateway if the authentication fails.
[0142] In one embodiment, the system also includes a service grid centralized dispatching center 105; wherein each service gateway 102 is used to initiate a detection task to the target microservice, so that the target microservice performs detection according to the detection task and reports the detection result to the service gateway; receives the detection result reported by the target microservice, and reports the detection result to the service grid centralized dispatching center 105; the service grid centralized dispatching center 105 is used to generate a forwarding strategy based on the detection result if the detection result does not meet the preset conditions, and sends the forwarding strategy to the service gateway and service router of the path corresponding to the target microservice.
[0143] It should be noted that the detection result does not meet the preset conditions, including at least one of the following: the bandwidth of the path corresponding to the target microservice is less than or equal to the preset bandwidth threshold; the delay of the path corresponding to the target microservice is greater than or equal to the preset delay threshold; the jitter of the path corresponding to the target microservice is greater than or equal to the preset jitter threshold.
[0144] Figure 7 FIG. 2 is a schematic diagram showing a structure of a service gateway provided in an embodiment of the present disclosure. Figure 7 As shown, in one embodiment, the service gateway provided by the embodiment of the present disclosure includes a first signaling receiving module 710 , a second signaling sending module 720 and a first information table generating module 730 .
[0145] Among them, the first signaling receiving module 710 is used to receive a first signaling sent by a Pod carrying multiple microservices, and the first signaling is used to notify the service gateway of the service identification information of the microservice carried by the Pod;
[0146] A second signaling sending module 720 is used to send a second signaling to the service router, where the second signaling is used to notify the service router of the topological link relationship and the service identification information under each interface of the service gateway;
[0147] The first information table generating module 730 is used to obtain a forwarding information table based on the service identification information based on the topological link relationship, so as to forward the communication message according to the forwarding information table.
[0148] Figure 8FIG. 2 is a schematic diagram showing the structure of a service router provided in an embodiment of the present disclosure. Figure 8 As shown, in one embodiment, a service router provided by an embodiment of the present disclosure includes a second signaling receiving module 810 and a second information table generating module 820.
[0149] A second signaling receiving module 810 is used to receive a second signaling sent by the service gateway, where the second signaling is used to notify the service router of the topological link relationship and the service identification information under each interface of the service gateway;
[0150] The second information table generating module 820 is used to obtain a forwarding information table based on the service identification information based on the topological link relationship, so as to forward the communication message according to the forwarding information table.
[0151] It should be noted that the implementation of the above-mentioned service gateway and service router is the same as the implementation of the corresponding devices in the method embodiment, and will not be repeated here.
[0152] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0153] Refer to the following Fig. 9 An electronic device 900 according to this embodiment of the present invention will be described. Fig. 9 The electronic device 900 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0154] like Fig. 9 As shown, the electronic device 900 is in the form of a general computing device. The components of the electronic device 900 may include but are not limited to: at least one processing unit 910, at least one storage unit 920, and a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910).
[0155] The storage unit stores program codes, which can be executed by the processing unit 910, so that the processing unit 910 performs the steps of various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 910 can perform the following steps: Figure 2The Pod carrying multiple microservices shown in the figure sends a first signaling to the service gateway, and the first signaling is used to notify the service gateway of the service identification information of the microservices carried by the Pod; the service gateway sends a second signaling to the service router, and the second signaling is used to notify the service router of the topological link relationship and the service identification information under each interface of the service gateway; the service node obtains a forwarding information table based on the service identification information based on the topological link relationship, and forwards communication messages according to the forwarding information table, wherein the service node includes one of a service gateway and a service router.
[0156] The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 9201 and / or a cache storage unit 9202 , and may further include a read-only storage unit (ROM) 9203 .
[0157] The storage unit 920 may also include a program / utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0158] Bus 930 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0159] The electronic device 900 may also communicate with one or more external devices 940 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the system, and / or any device that enables the electronic device 900 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 950. Furthermore, the system may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 960. Fig. 9 As shown, the network adapter 960 communicates with other modules of the electronic device 900 via the bus 930. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0160] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0161] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0162] A program product for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0163] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0164] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0165] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0166] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0167] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0168] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0169] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0170] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A distributed microservice architecture traffic diversion method, characterized in that: include: The Pod carrying multiple microservices sends a first signaling to the service gateway, where the first signaling is used to notify the service gateway of service identification information of the microservices carried by the Pod; The service gateway sends a second signaling to the service router, where the second signaling is used to notify the service router of the topological link relationship and the service identification information under each interface of the service gateway; The service node obtains a forwarding information table based on the service identification information based on the topological link relationship, so as to forward the communication message according to the forwarding information table, wherein the service node includes one of a service gateway and a service router.
2. The method according to claim 1, characterized in that The service node obtains a forwarding information table based on the service identification information based on the topological link relationship, including: The service node obtains a forwarding information table based on the service identification information based on a routing algorithm and the topological link relationship.
3. The method according to claim 2, characterized in that The service node obtains a forwarding information table based on the service identification information based on the routing algorithm and the topological link relationship, including: The service node forms a link state database based on the service identification information based on the service identification information and the topological link relationship; Running the routing algorithm to process the data in the link state database to form a routing information table based on the service identification information; According to the routing information table, a forwarding information table based on the service identification information is obtained.
4. The method according to claim 1, characterized in that: The service identification information includes: at least one of a service prefix and a namespace.
5. The method according to claim 1, characterized in that Before the serving gateway sends the second signaling to the serving router, the method further includes: Send an authentication request to the service prefix authentication entity through a third signaling, where the third signaling is used to authenticate whether the service identification information requested by the Pod is legal; If the authentication is successful, the service gateway sends a second signaling to the service router.
6. The method according to claim 5, characterized in that The method further comprises: If the authentication fails, the service prefix authentication entity sends an authentication failure notification to the service gateway.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: The service gateway initiates a detection task to the target microservice, so that the target microservice performs detection according to the detection task and reports the detection result to the service gateway; The service gateway receives the detection result reported by the target microservice, and reports the detection result to the service grid centralized scheduling center; If the detection result does not meet the preset conditions, the service grid centralized scheduling center generates a forwarding strategy according to the detection result, and sends the forwarding strategy to the service gateway and service router of the path corresponding to the target microservice.
8. The method according to claim 7, characterized in that The detection result does not meet the preset condition, including at least one of the following: The bandwidth of the path corresponding to the target microservice is less than or equal to the preset bandwidth threshold; The delay of the path corresponding to the target microservice is greater than or equal to the preset delay threshold; The jitter of the path corresponding to the target microservice is greater than or equal to a preset jitter threshold.
9. A distributed microservice architecture traffic distribution system, the system comprising multiple Pods, multiple service gateways, and multiple service routers, one Pod is linked to one service gateway, characterized in that: in, The Pod is used to carry multiple microservices and send a first signaling to a service gateway, where the first signaling is used to notify the service gateway of service identification information of the microservices carried by the Pod; The service gateway is used to send a second signaling to the service router, wherein the second signaling is used to notify the service router of the topological link relationship and the service identification information under each interface of the service gateway; A service node is used to obtain a forwarding information table based on the service identification information based on the topological link relationship, so as to forward communication messages according to the forwarding information table, wherein the service node includes one of a service gateway and a service router.
10. A service gateway, characterized in that: include: A first signaling receiving module, used to receive a first signaling sent by a Pod carrying multiple microservices, where the first signaling is used to notify the service gateway of service identification information of the microservice carried by the Pod; A second signaling sending module, used to send a second signaling to the service router, wherein the second signaling is used to notify the service router of the topological link relationship and the service identification information under each interface of the service gateway; The first information table generating module is used to obtain a forwarding information table based on the service identification information based on the topological link relationship, so as to forward the communication message according to the forwarding information table.
11. A service router, characterized in that: include: A second signaling receiving module, used to receive a second signaling sent by the service gateway, wherein the second signaling is used to notify the service router of the topological link relationship and the service identification information under each interface of the service gateway; The second information table generating module is used to obtain a forwarding information table based on the service identification information based on the topological link relationship, so as to forward the communication message according to the forwarding information table.
12. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the distributed microservice architecture traffic diversion method described in any one of claims 1-8 by executing the executable instructions.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the distributed microservice architecture traffic diversion method described in any one of claims 1 to 8 is implemented.