Communication method and device based on service grid cluster and cluster

By introducing multiple proxy modes into the service mesh cluster and realizing the identification and adaptation of the proxy mode of the target node, the problem of communication between nodes in different proxy modes is solved, flexible proxy mode deployment and resource utilization is realized, and the cost is met The demand for saving and increasing resource utilization.

CN119232732APending Publication Date: 2024-12-31HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311152940.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-06-30
Filing Date
2023-09-07
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

In the existing service mesh technology, data agents under different proxy modes cannot be interoperable, resulting in nodes in the service mesh cluster that must adopt the same proxy mode, limiting the flexible deployment and resource utilization of the proxy mode.

Method used

By introducing multiple proxy modes into the service mesh cluster, and realizing the proxy mode of the node where the target container group is located in the data proxy, using configuration information and data proxy addresses for data packet forwarding, nodes of different proxy modes are realized in the data proxy mode. communication between.

Benefits of technology

It realizes inter-node communication with different proxy modes, allowing the deployment of nodes with different proxy modes in the service mesh cluster, improving resource utilization and flexibility, and meeting different needs such as saving costs and improving resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232732A_ABST
    Figure CN119232732A_ABST
Patent Text Reader

Abstract

The invention discloses a communication method and device based on a service grid cluster and the cluster, and can be applied to the technical field of micro-services. The method comprises the following steps: a first data agent receives a first data packet sent by a first container group; the first container group and the first data agent run on a first service node in the plurality of service nodes, and the first container group corresponds to the first data agent; when the first data agent confirms that the destination of the first data packet is a second container group, the first data agent identifies an agent mode adopted by a second service node where the second container group is located; and the first data agent sends the first data packet to a second data agent corresponding to the second container group based on the agent mode adopted by the second service node and the address of the second container group, so that the first data packet is sent to the second container group through the second data agent. According to the method, the container groups in the nodes with different proxy modes can communicate with each other, and the method can be used for deploying the nodes with different proxy modes in the same service grid cluster.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on June 30, 2023, with application number 202310789435.8 and application name “A Service Grid System”, the entire contents of which are incorporated by reference in this application. Technical Field

[0002] The present application relates to the field of microservice technology, and in particular to a communication method, device and cluster based on a service grid cluster. Background Art

[0003] Microservice architecture is a service-oriented architecture (SOA) that divides a complex system into multiple small services. These small services are called microservices. Each microservice is responsible for implementing an independent business logic. Microservices can run in containers. Among them, multiple containers containing microservices with high interdependencies can form a container group.

[0004] Service mesh technology separates the traffic management logic in microservices into data agents outside microservices to achieve lightweight business and infrastructure-based service governance. At present, service mesh technology has developed a variety of proxy modes, such as container group-level proxy mode and node-level proxy mode. Among them, in the container group-level proxy mode, a data agent only provides traffic management for one container group. In the node-level proxy mode, a data agent provides traffic management for multiple container groups running on a node. This leads to different communication methods for data agents in different proxy modes, making data agents in different proxy modes unable to communicate with each other. This requires that nodes in a service mesh cluster must adopt the same proxy mode, and users cannot select different proxy modes in the service mesh cluster according to their needs. Summary of the invention

[0005] The embodiments of the present application propose a communication method, device and cluster based on a service grid cluster, which can enable container groups in nodes with different proxy modes to communicate with each other.

[0006] In a first aspect, a communication method based on a service grid cluster is provided, wherein the cluster has multiple proxy modes, and the cluster includes multiple business nodes, wherein a business node adopts one of the multiple proxy modes, and each proxy mode is adopted by at least one business node; the business node runs a container group and a data proxy corresponding to the container group, and the data proxy corresponding to the container group is used to perform traffic management on the data packet sent by the container group; the method includes: a first data proxy receives a first data packet sent by a first container group; the first container group and the first data proxy run on a first business node among multiple business nodes, and the first container group corresponds to the first data proxy; when the first data proxy confirms that the destination of the first data packet is a second container group, the first data proxy identifies the proxy mode adopted by the second business node where the second container group is located; based on the proxy mode adopted by the second business node and the address of the second container group, the first data proxy sends the first data packet to the second data proxy corresponding to the second container group, so as to send the first data packet to the second container group through the second data proxy.

[0007] Among them, the multiple proxy modes include a proxy mode in which multiple container groups correspond to the same data proxy, and a proxy mode in which container groups and data proxies correspond one to one. Among them, multiple container groups corresponding to the same data proxy means that multiple container groups correspond to the same or the same group of data proxies. A group of data proxies may include multiple data proxies. The proxy mode adopted by the first service node can be a proxy mode in which multiple container groups correspond to the same data proxy, or a proxy mode in which container groups and data proxies correspond one to one.

[0008] By using this method, when the container group running on the first service node sends a data packet to other container groups, the proxy mode of the node where the target container group of the data packet is located can be identified. Then, based on the proxy mode of the node where the target container group is located and the address of the target container group, the data packet is sent to the node where the target container group is located. Therefore, different sending methods can be adopted for nodes with different proxy modes, so that container groups in nodes with different proxy modes can communicate with each other.

[0009] Since this method enables container groups in nodes with different proxy modes to communicate with each other, using this method, it is not necessary for nodes in the cluster to adopt the same proxy mode. Users can deploy nodes with different proxy modes in the service grid cluster, or change the proxy mode of one or some nodes in the cluster, or add nodes with different proxy modes from existing nodes to the cluster, thereby realizing flexible deployment of node proxy mode.

[0010] That is to say, through this method, users can deploy nodes with different proxy modes in the service grid cluster according to their needs (such as saving costs, improving resource utilization, etc.).

[0011] In a possible implementation, the cluster includes a grid console, which is used to send configuration information of the second container group to the first data proxy, where the configuration information is used to indicate a proxy mode of the second service node; identifying the proxy mode adopted by the second service node where the second container group is located includes: identifying the proxy mode adopted by the second service node based on the configuration information of the second container group.

[0012] In this implementation, the grid console can send the configuration information of the container group to the data proxy, so that when the data proxy sends a data packet destined for a container group, it can identify the proxy mode of the node where the container group is located based on the configuration information of the container group.

[0013] In a possible implementation, based on the configuration information of the second container group, identifying the proxy mode adopted by the second service node includes: when it is detected that the configuration information includes the address of the second data proxy, the first data proxy confirms that the proxy mode adopted by the second service node is that multiple container groups correspond to the same data proxy.

[0014] In this implementation, the proxy mode adopted by the node where the container group is located is indicated by whether the configuration information of the container group contains the address of the data proxy. This not only enables the data proxy that forwards data with the container group as the destination to identify the proxy mode adopted by the node where the container group is located based on the configuration information, but also enables the address of the data proxy corresponding to the container group to be obtained from the configuration information.

[0015] In one possible implementation, the second business node corresponds to a controller, and the controller is used to send the address of the second data agent to the grid console when confirming that the proxy mode adopted by the second business node is that multiple container groups correspond to the same data agent, so that the grid console includes the address of the second data agent in the configuration information.

[0016] In this implementation, the controller corresponding to the node where the container group is located can report the address of the data proxy corresponding to the container group to the grid console; wherein the grid console can include the address of the data proxy corresponding to the container group in the configuration information, thereby indicating the proxy mode of the node where the container group is located through the configuration information.

[0017] In a possible implementation, the proxy mode adopted by the second service node is that multiple container groups correspond to the same data proxy; the first data proxy sends the first data packet to the second data proxy corresponding to the second container group based on the proxy mode adopted by the second service node and the address of the second container group, including: the first data proxy obtains the address of the second data proxy; the first data proxy sends the first data packet and the address of the second container group to the second data proxy based on the address of the second data proxy; wherein the second data proxy is used to forward the first data packet to the second container group based on the address of the second container group.

[0018] In this implementation, the proxy mode adopted by the second service node is that multiple container groups correspond to the same data proxy, which means that the second data proxy corresponds to other container groups in addition to the second container group. In this way, the first data proxy can send the first data packet and the address of the second container group to the second data proxy based on the address of the second data proxy, so that the second data proxy can send the first data packet to the second container group based on the address of the second container group.

[0019] In a possible implementation, sending the first data packet and the address of the second container group to the second data proxy based on the address of the second data proxy includes: adding a header to the first data packet to obtain a second data packet; the header includes the address of the second container group; sending the second data packet to the second data proxy based on the address of the second data proxy; the second data proxy is used to obtain the address of the second container group from the header.

[0020] In this implementation, the first data packet can be further encapsulated to obtain a second data packet, and the address of the second container group is added to the header of the second data packet. In this way, by sending the second data packet to the second data proxy, the first data packet and the address of the second container group are sent to the second data proxy.

[0021] In a possible implementation, the proxy mode adopted by the second service node is a one-to-one correspondence between the container group and the data proxy; the first data proxy sends the first data packet to the second data proxy corresponding to the second container group based on the proxy mode adopted by the second service node and the address of the second container group, including: the first data proxy uses the address of the second container group as the address of the second data proxy, and sends the first data packet to the second data proxy.

[0022] In this implementation, the proxy mode adopted by the second service node is a one-to-one correspondence between the container group and the data proxy, which means that the second data proxy corresponds only to the second container group and not to other container groups. In this way, the first data proxy can send the first data packet and the address of the second container group to the second data proxy based on the address of the second container group.

[0023] In a second aspect, a communication device is provided, which is used as a first data agent run by a first business node in a service grid cluster, the cluster has multiple agent modes, and the cluster includes multiple business nodes, wherein a business node adopts one of the multiple agent modes, and each agent mode is adopted by at least one business node; the business node runs a container group and a data agent corresponding to the container group, and the data agent corresponding to the container group is used to perform traffic management on the data packet sent by the container group; the device includes: a receiving module, which is used to receive a first data packet sent by the first container group; the first container group runs on the first business node, and the first container group corresponds to the first data agent; an identification module, which is used to identify the agent mode adopted by the second business node where the second container group is located when confirming that the destination of the first data packet is the second container group; a sending module, which is used to send the first data packet to the second data agent corresponding to the second container group based on the agent mode adopted by the second business node and the address of the second container group, so as to send the first data packet to the second container group through the second data agent.

[0024] In a possible implementation, the cluster includes a grid console, which is used to send configuration information of the second container group to the first data proxy, where the configuration information is used to indicate a proxy mode of the second service node; and the identification module is used to: identify the proxy mode adopted by the second service node based on the configuration information of the second container group.

[0025] In a possible implementation, the identification module is used to: when detecting that the configuration information includes the address of the second data proxy, the first data proxy confirms that the proxy mode adopted by the second service node is that multiple container groups correspond to the same data proxy.

[0026] In one possible implementation, the second business node corresponds to a controller, and the controller is used to send the address of the second data agent to the grid console when confirming that the proxy mode adopted by the second business node is that multiple container groups correspond to the same data agent; wherein the grid console is used to include the address of the second data agent in the configuration information.

[0027] In a possible implementation, the proxy mode adopted by the second service node is that multiple container groups correspond to the same data proxy; the sending module is used for: the first data proxy obtains the address of the second data proxy; the first data proxy sends the first data packet and the address of the second container group to the second data proxy based on the address of the second data proxy; wherein the second data proxy is used for forwarding the first data packet to the second container group based on the address of the second container group.

[0028] In a possible implementation, the sending module is used to: add a header to the first data packet to obtain a second data packet, wherein the header includes an address of the second container group; send the second data packet to the second data proxy based on the address of the second data proxy; and the second data proxy is used to obtain the address of the second container group from the header.

[0029] In a possible implementation, the proxy mode adopted by the second service node is a one-to-one correspondence between container groups and data proxies; the sending module is used for: the first data proxy uses the address of the second container group as the address of the second data proxy to send the first data packet to the second data proxy.

[0030] In a third aspect, a node for running a container group is provided, including a processor and a memory, wherein the processor is used to execute instructions stored in the memory to execute the method provided in the first aspect.

[0031] In a fourth aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method provided in the first aspect.

[0032] In a fifth aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computer device cluster, the computer device cluster executes the method provided in the first aspect.

[0033] The beneficial effects of the second to fifth aspects can be referred to the above introduction to the beneficial effects of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A schematic diagram of a service grid cluster provided in an embodiment of the present application;

[0035] Figure 2 A schematic diagram of a service grid cluster provided in an embodiment of the present application;

[0036] Figure 3 A data processing flow chart of a service grid cluster provided in an embodiment of the present application;

[0037] Figure 4 A flow chart of a communication method provided in an embodiment of the present application;

[0038] Figure 5 A flow chart of a communication method based on a service grid cluster provided in an embodiment of the present application;

[0039] Figure 6 A schematic diagram of the structure of a communication device provided in an embodiment of the present application;

[0040] Figure 7A schematic diagram of the structure of a node provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] The scheme provided by the embodiment of the present application will be described below in conjunction with the accompanying drawings. In the embodiment of the present application, "multiple" means two or more, and "multiple" means two or more.

[0042] First, some technical terms that may be involved in the embodiments of the present application are introduced.

[0043] Microservice architecture is a service-oriented architecture (SOA) that divides a complex system into multiple small services or applications. The small service or application can be called a microservice. Each microservice is responsible for implementing an independent business logic. Microservices are built around business functions and can be deployed independently. Microservices are interdependent and can provide a range of functions. Microservices are easy to understand and modify, which brings flexibility in language and framework selection. Microservices can run in containers. Among them, the containers where multiple microservices with high interdependence are located can constitute a container group. Among them, in the K8S (kubernetes) system, the container group can be encapsulated into a pod.

[0044] Traffic management: also known as traffic service governance, is a type of service governance. Traffic management usually includes connection, security, flow control, grayscale release, observation capabilities, etc. In the service grid,

[0045] Service governance: also known as SOA governance, is the process used to manage the adoption and implementation of microservices architecture. In service mesh technology, service governance is performed by data agents outside of microservices.

[0046] Data proxy: used to perform service management for the container group corresponding to the data proxy, such as traffic management. Data proxy can be implemented through containers or processes. Generally, data proxy can be divided into one-to-one data proxy and one-to-many data proxy. Among them, one-to-one data proxy is also called container group-level data proxy, and one-to-one data proxy means that one or a group of data proxy corresponds to only one container group, that is, the container group and the data proxy correspond one-to-one. A typical one-to-one data proxy is a sidecar. Among them, when the container group is encapsulated into a pod, the data proxy corresponding to the container group (such as a sidecar) is also encapsulated into the pod. One-to-many data proxy means that one or a group of data proxy corresponds to multiple container groups, that is, one-to-many data proxy corresponds to multiple container groups. A typical one-to-many data proxy is a node-level proxy (nodeproxy). For a node-level data proxy, a node runs a data proxy, and the container group running on the node that needs service management is managed by the data proxy. Exemplarily, a node can run two or more one-to-many data proxies, and different one-to-many data proxies on the same node can correspond to multiple container groups on the node respectively. Specifically, one one-to-many data proxy on a node corresponds to a container group set on the node, and another one-to-many data proxy on the node corresponds to another container group set. Each container group set includes two or more container groups. A group of data proxies includes one or more data proxies.

[0047] Proxy mode: Determined by the number of container groups corresponding to the data proxy, different proxy modes have different types of data proxy. Generally, proxy modes can be divided into one-to-many proxy mode and one-to-many proxy mode. One-to-one proxy mode is also called one-to-one correspondence mode between container groups and data proxy. The data proxy in this mode is one-to-one data proxy. One-to-many proxy mode is also called multiple container groups correspond to the same data proxy mode. The data proxy in this mode is one-to-many data proxy, that is, multiple container groups correspond to the same or the same group of data proxy.

[0048] Service grid: A technology that manages services for container groups through data proxies outside the container group. In the service grid, the data proxy obtains data packets sent by the container group and performs service management (such as traffic management) on the data packets to send the data packets to the data proxy of the target container group. The data proxy of the target container group sends the data packets to the target container group. The behavior of the data proxy obtaining the data packets sent by the container group is called entering the service grid, and the behavior of the data proxy sending the data packets to the target container group is called exiting the service grid.

[0049] Service grid services: refers to services where data packets need to be managed by data agents (such as traffic management). That is, the data packets sent by the container group of the service are obtained by the data agent corresponding to the container group and then enter the service grid.

[0050] Non-service grid services: refers to services where data packets do not need to be governed by a data proxy.

[0051] Service mesh cluster: can be referred to as a cluster for short, which consists of multiple nodes, and nodes can be added or deleted from the cluster.

[0052] Node: Also called a business node, it is used to run container groups and data agents. A node can run multiple container groups and at least one data agent. A node adopts a proxy mode, such as a one-to-one proxy mode or a one-to-many proxy mode. A node can be a virtual computing device, such as a virtual machine (VM). A node can also be a physical computing device, such as a computer, a bare metal server, etc.

[0053] Next, a service grid cluster 100 provided in an embodiment of the present application is introduced.

[0054] See also Figure 1 , the service grid cluster 100 may be composed of multiple nodes such as node 110, node 120, node 130, and node 140. In the service grid cluster 100, a part of the nodes may adopt a proxy mode, such as a one-to-one proxy mode, and another part of the nodes may adopt another proxy mode, such as a one-to-many proxy mode. That is, the service grid cluster 100 has multiple proxy modes, and the nodes in the service grid cluster 100 may adopt one of the multiple proxy modes, and each of the multiple proxy modes is adopted by at least one node in the service grid cluster 100.

[0055] The nodes in the service grid cluster 100 run a container group and a data agent corresponding to the container group. The data agent corresponding to the container group is used to perform service management, such as traffic management, on the data packets sent by the container group.

[0056] For example, Figure 1As shown, the node 110 runs at least a container group 111 and a data agent 112. The node 120 runs at least a container group 121 and a data agent 122. Among them, the node 110 and the node 120 can adopt a one-to-one agent mode, that is, the data agent 112 and the container group 111 correspond one-to-one, and the data agent 122 and the container group 121 correspond one-to-one. In an example, the data agent 112 and the container group 111 can be encapsulated into the same pod, and the data agent 122 and the container group 121 can be encapsulated into the same pod.

[0057] like Figure 1 As shown, node 130 may run container group 131, container group 132, and data agent 133. Node 140 may run container group 141, container group 142, and data agent 143. Among them, node 130 and node 140 may adopt an agent mode in which one data agent corresponds to multiple containers at the same time, that is, a one-to-many agent mode, such as a node-level agent mode. Specifically, data agent 133 corresponds to container group 131 and container group 132 at the same time, and data agent 143 corresponds to container group 141 and container group 142 at the same time. In an example, container group 131 and container group 132 may be respectively encapsulated into different pods, and container group 141 and container group 142 may be respectively encapsulated into different pods.

[0058] The data agent 143, the data agent 133, the data agent 122, and the data agent 112 can communicate with each other, so that the container groups in the nodes using different agent modes can communicate with each other, and the container groups in the nodes using the same agent mode can also communicate with each other. The communication between the data agent 143, the data agent 133, the data agent 122, and the data agent 112 can be achieved through the following scheme.

[0059] In addition, in the following description, when no special distinction is made between data agent 143, data agent 133, data agent 122, and data agent 112, they may be referred to as data agents. Among them, data agent 122 and data agent 112 in a one-to-one agent mode may be referred to as a one-to-one data agent. Data agent 133 and data agent 143 in a one-to-many agent mode may be referred to as a one-to-many data agent.

[0060] Figure 2 A possible implementation of the service grid cluster 100 is shown. Figure 2 As shown, the service grid cluster 100 includes an agent mode recorder 150, a grid console 160, a sub-cluster controller 170, a management platform 180, and the like.

[0061] The proxy mode recorder 150 is used to record the proxy mode adopted by the nodes in the service grid cluster 100. Among them, when a node is added to the service grid cluster 100, the proxy mode adopted by the node can be recorded in the proxy mode recorder 150. Exemplarily, the proxy mode adopted by the node can be manually recorded in the proxy mode recorder 150. Exemplarily, the proxy mode recorder 150 records the association between the node's identifier and the proxy mode. The proxy mode associated with the node's identifier is the proxy mode adopted by the node. Exemplarily, the proxy mode recorder 150 records the association between the identifier of the subcluster to which the node belongs and the proxy mode. The proxy mode associated with the identifier of the subcluster to which the node belongs is the proxy mode adopted by the node.

[0062] The grid console 160 is also called a control node, which serves as the grid control plane 160 of the cluster 100 and is used to manage data proxies, services of the service grid, and container groups of the services in the cluster 100. A container group of a service refers to a service instance that provides the service.

[0063] like Figure 2 As shown, nodes using the one-to-one proxy mode can form a one-to-one proxy mode sub-cluster, and nodes using the one-to-many proxy mode can form a one-to-many proxy mode sub-cluster. A sub-cluster controller 170 is provided in each sub-cluster. The sub-cluster controller 170 can also be called a container group monitoring module, which is used to monitor the creation of container groups in the sub-cluster where the sub-cluster controller 170 is located, and when monitoring the creation of container groups, the container group information of the created container group is reported to the grid console 160.

[0064] like Figure 2 As shown, each subcluster corresponds to a management platform 180. The management platform 180 allows users to create container groups in the subcluster corresponding to the management platform 180. Exemplarily, the management platform 180 can be implemented as an application programming interface server (API server) of k8s.

[0065] In some embodiments, the node using the one-to-many proxy mode runs a manager 190, for example, the node 130 and the node 140 respectively run a manager 190. The manager 190 is used to monitor the creation of services, and when a new service is created, and the created service is a service to be added to the service grid, and the container group of the created service needs to run on the node where the manager 190 is located, the interception rule of the interception module in the node where the manager 190 is located is modified, so that the interception module can intercept the data packet sent by the container group of the service on the node to the data proxy, so that the data packet enters the service grid.

[0066] Next, combine Figure 3 , introduce the functions of each functional module, node or platform mentioned above.

[0067] When the data proxy is started, the grid console 160 can register with the data proxy so that the grid console 160 can sense the existence of the data proxy and manage the data proxy. Figure 3 As shown, the one-to-one data agent in the cluster 100 may be registered with the grid console 160 through step 300a, and the one-to-many data agents in the cluster 100 may be registered with the grid console 160 through step 300b.

[0068] like Figure 3 As shown, the sub-cluster controller 170 can monitor the creation of a container group in step 301. The sub-cluster controller 170 monitors the creation of a container group in the sub-cluster where the sub-cluster controller 170 is located. For the convenience of description, the sub-cluster where the sub-cluster controller 170 is located can be referred to as the sub-cluster. Specifically, the sub-cluster controller 170 can monitor whether the management platform 180 corresponding to the sub-cluster has received the creation information of the container group. If the creation information of the container group is received, the container group creation is monitored.

[0069] The creation information of the container group refers to information used to create the container group. Exemplarily, the creation information of the container group may be a deployment file of the container group. When the management platform 180 receives the creation information of the container group, the container group may be created in a node in the subcluster corresponding to the management platform 180.

[0070] It can be assumed that in step 302, the management platform 180 receives the creation information of the container group A1. Then in step 303, the sub-cluster controller 170 monitors the creation event of the container group A1. The creation event includes the address of the container group A1 and the identifier of the service to which the container group A1 belongs (for example, the service name). The sub-cluster controller 170 can parse the creation information of the container group A1 to obtain the creation event of the container group A1.

[0071] After listening to the creation event of container group A1, the subcluster controller 170 can obtain the proxy mode of the node where container group A1 is located from the proxy mode recorder 150. Exemplarily, as described above, the proxy mode recorder 150 records the association between the node identifier and the proxy mode. The subcluster controller 170 can obtain the identifier of the node where container group A1 is located based on the address of container group A1, and then query the proxy mode corresponding to the identifier of the node in the proxy mode recorder 150, and obtain the queried proxy mode. Exemplarily, as described above, the proxy mode recorder 150 records the association between the identifier of the subcluster to which the node belongs and the proxy mode. The subcluster controller 170 can obtain the identifier of the subcluster, and then query the proxy mode corresponding to the identifier of the subcluster in the proxy mode recorder 150, and obtain the queried proxy mode.

[0072] If the proxy mode obtained by the sub-cluster controller 170 is a one-to-one proxy mode, it means that the data proxy corresponding to the container group A1 is a one-to-one data proxy, that is, the container group A1 and the data proxy correspond one-to-one. In this case, the sub-cluster controller 170 can execute step 305a to send a container group message including the address of the container group A1 to the grid console 160. That is, in step 305a, the sub-cluster controller 170 reports the address of the container group A1 to the grid console 160.

[0073] If the proxy mode obtained by the sub-cluster controller 170 is a one-to-many proxy mode, it means that the data proxy corresponding to the container group A1 is a one-to-many data proxy, that is, the data proxy corresponding to the container group A1 is also used to correspond to other container groups. In this case, the sub-cluster controller 170 can execute step 305a to send a container group message including the address of the container group A1 and the address of the data proxy corresponding to the container group A1 to the grid console 160. That is, in step 305a, the sub-cluster controller 170 reports the address of the container group A1 and the address of the data proxy corresponding to the container group A1 to the grid console 160.

[0074] For the convenience of description, the data proxy corresponding to the container group A1 may be referred to as data proxy B1. When the data proxy B1 is a node-level data proxy, the address of the data proxy B1 may specifically be the address of the node where the data proxy B1 is located.

[0075] In some embodiments, the address of the container group, the data proxy, or the node may specifically be an Internet protocol (IP) address of the container group, the data proxy, or the node.

[0076] In some embodiments, the container group information sent by the sub-cluster controller 170 to the grid console also includes the identifier of the service to which the container group A1 belongs. Exemplarily, the identifier of the service may specifically be the name of the service. Exemplarily, the service is specifically a service in k8s, and the identifier of the service may specifically be the cluster IP (cluster IP) of the service. Wherein, clusterIP is a virtual IP, which represents a service. Cluster IP is associated with the IP of at least one container group, which is an instance of the service represented by cluster IP and is used to provide the service represented by cluster IP. The access request issued by the container group as a client carries cluster IP. The service represented by Cluster IP is the service requested to be accessed by the access request. The access request is intercepted by the interception module to the data agent corresponding to the container group, and the data agent performs service management on the access request, for example, based on the cluster IP carried by the access request, selects a target container group for the access request. The target container group is an instance of the service and can provide the service. Then, the data agent can forward the access request to the target container group.

[0077] After receiving the container group information of the container group A1 through step 305a or step 305b, the grid console 160 may send the configuration information of the container group A1 to each data proxy in the cluster 100 based on the container group information. For example, the configuration information of the container group A1 may be sent to a one-to-one data proxy in the cluster 100 through step 306a, and the configuration information of the container group A1 may be sent to a one-to-many data proxy in the cluster 100 through step 306b.

[0078] The configuration information of container group A1 is used to indicate the proxy mode of the node where container group A1 is located. When the proxy mode of the node where container group A1 is located is a one-to-one proxy mode, the configuration information of container group A1 includes the address of container group A1 and the identifier of the service to which container group A1 belongs (e.g., cluster IP, name, etc.).

[0079] When the proxy mode of the node where the container group A1 is located is a one-to-many proxy mode, the configuration information of the container group A1 includes the address of the container group A1, the address of the data proxy B1 corresponding to the container group A1, and the identifier of the service to which the container group A1 belongs. In some embodiments, the grid console 160 can associate the container group A1 with the data proxy B1, and indicate to each data proxy in the cluster 100 that the container group A1 is associated with the data proxy B1 through the configuration information of the container group A1. Exemplarily, the grid console 160 can establish an association relationship between the container group A1 and the data proxy B1, and include the association relationship in the configuration information of the container group A1, so that the association relationship can be sent to each data proxy in the cluster 100. In one example, the association relationship between the container group A1 and the data proxy B1 can specifically be an association relationship between the address of the container group A1 and the data proxy B1.

[0080] In this way, each data agent in cluster 100 can obtain the configuration information of container group A1. The configuration information of container group A1 is used by the data agent to identify the proxy mode adopted by the node where container group A1 is located. Among them, when the address of the data agent is detected in the configuration information of container group A1, it can be confirmed that the proxy mode adopted by the node where container group A1 is located is a one-to-many proxy mode. When the address of the data agent is not detected in the configuration information of container group A1, it can be confirmed that the proxy mode adopted by the node where container group A1 is located is a one-to-one proxy mode. When the proxy mode of the node where container group A1 is located is identified, a data packet with the destination being container group A1 can be sent according to the proxy mode. The details will be introduced below and will not be repeated here.

[0081] The above takes container group A1 as an example to introduce a solution for a data proxy in cluster 100 to obtain configuration information of a container group. Referring to the solution for obtaining configuration information of container group A1, each data proxy in cluster 100 can obtain configuration information of each container group created in cluster 100.

[0082] In some embodiments, the node using the one-to-many proxy mode runs a manager 190. The manager 190 is used to monitor service creation, and when a new service is created, and the created service is a service of the service grid, and the container group of the created service needs to run on the node where the manager 190 is located, the interception rule of the interception module in the node where the manager 190 is located is modified, so that the interception module can intercept the data packet sent by the container group of the service running on the node to the data proxy, so that the data packet enters the service grid. The details are as follows.

[0083] See also Figure 3The manager 190 may monitor whether the grid console 160 has created a service. The grid console 160 may create a service in step 308. The creation of a service includes an identifier of the creation of the service, such as a name, a cluster IP, and the like.

[0084] The service creation also includes creating at least one service instance for the service, that is, creating at least one container group for providing the service. The creation of a service instance for a service may be referred to as endpoint configuration of the service.

[0085] When the manager 190 monitors that a service is created by the grid console 160, and one or more service instances of the service (i.e., one or more container groups providing the service) need to run on the node where the manager 190 is located, and the service is a service of the service grid, the information of the service can be obtained through step 309. The information of the service may include an identifier of the service (e.g., a cluster IP).

[0086] In step 310, the manager 190 can modify the interception rules of the interception module of the node where the manager 190 is located based on the identifier of the service, so that the interception module can intercept data packets (such as access requests) carrying the identifier of the service. In one example, the interception module is based on IP tables (iptables). If the identifier of the service is in the IP table, the interception module intercepts the data packets carrying the identifier of the service into the data proxy. If the identifier of the service is not in the IP table, the interception module does not intercept the data packets carrying the identifier of the service. Then, modifying the interception rules in step 310 specifically refers to adding the identifier of the service received by step 309 to the IP table. In this way, the data packets carrying the identifier of the service can be intercepted by the interception module to the data proxy, so that the data proxy can perform service management on the data packets, such as traffic management.

[0087] In some embodiments, the information of the service obtained by the manager 190 in step 309 includes the identifier of the service and the information of the container group that needs to be run on the node where the manager 190 is located (such as the name and address of the container group). The container group is a container group used to provide the service. If the service belongs to the service of the service grid, that is, the service provided by the container group belongs to the service of the service grid, the manager 190 corresponds the container group to a data agent running on the node where the manager 190 is located, so that the data packets sent by the container group can enter the service grid through the data agent.

[0088] Through the manager 190, the interception module can intercept data packets of services that require the service grid, but not intercept data packets of services that are not in the service grid. Targeted interception of data packets is achieved. As a result, the node can not only deploy services in the service grid, but also deploy services in non-service grids.

[0089] Continue reading Figure 3 , the grid console 160 can send the configuration information of the created service to each data proxy in the cluster 100 through steps 311a and 311b. The configuration information of the service includes the identifier of the service (such as clusterIP, name, etc.), the address of the instance of the service (i.e., the container group providing the service), etc. In this way, when the data proxy receives a data packet carrying the identifier of the service, it can select a target container group for the data packet.

[0090] In some embodiments, the configuration information of the service also includes configuration information of the filter. The configuration information of the filter is used for the data proxy to configure the filter. The filter is used for the data proxy to select a method of sending the data packet to the data proxy corresponding to the container group when sending the data packet to the container group providing the service, based on the proxy mode adopted by the node where the container group is located. The details will be introduced below and will not be repeated here.

[0091] The configuration information sent by the network console 160 to the one-to-many data proxy also includes the configuration information of the listener. The configuration information of the listener is used by the data proxy to configure the listener. The listener is used by the data proxy to monitor the address of the container group carried by the received data packet, and the address of the container group is the address of the target container group of the data packet. Thus, the data proxy can forward the data packet to the target container group.

[0092] Combination of the above Figure 3 , introduces the functions of each functional module, node or platform in the cluster 100. Through the functions of these functional modules, communication between nodes in different proxy modes can be achieved. The details are as follows.

[0093] See also Figure 4 , the container group C1 can be set as a container group in the cluster 100. The container group C1 can send a data packet C11 in step 401. Exemplarily, in step 401, the container group C1 can act as a client and send an access request for accessing the server. That is, the data packet C11 can be an access request.

[0094] Data agent D1 is the data agent corresponding to container group C1. In some embodiments, data agent D1 can be a one-to-one data agent. In other words, the agent mode of the node where data agent D1 is located is a one-to-one agent mode, that is, a mode in which container groups and data agents correspond one to one. In some embodiments, data agent D1 can be a one-to-many data agent (e.g., a node-level data agent). In other words, the agent mode of the node where data agent D1 is located is a one-to-many agent mode, that is, a mode in which multiple container groups correspond to the same data agent.

[0095] The data proxy D1 may receive the data packet C11. Exemplarily, the data packet C11 includes a service identifier (eg, cluster IP), and the service identifier is located in the IP table of the interception module. Thus, the interception module intercepts the data packet C11 to the data proxy D1.

[0096] In step 402, the data agent D1 may perform traffic management on the data packet C11. Traffic management includes selecting a target container group for the data packet C11 through routing and load balancing calculations, that is, selecting which container group will eventually receive and process the data packet C11. Wherein, when the data packet C11 may be an access request. The data agent D1 selects the server of the access request, that is, selects the container group for providing the service requested by the access request. Exemplarily, the data packet C11 includes an identifier of a service, and the service may correspond to multiple container groups (that is, there may be multiple container groups for providing the service). The data agent D1 selects a container group from the multiple container groups as the target container group for the data packet C11.

[0097] The data agent D1 may be configured to select the container group C2 in the cluster 100 as the target container group of the data packet C11. That is, the data agent D1 confirms that the target container group of the data packet C11 is the container group C2 in step 402. In step 403, the data agent D1 may identify the proxy mode of the node where the container group C2 is located.

[0098] In some embodiments, as described above for Figure 3 In the introduction of the illustrated embodiment, the data proxy D1 can obtain configuration information including the container group C2. The configuration information of the container group C2 indicates the proxy mode of the node where the container group C2 is located. The data proxy D1 can use the configuration information of the container group C2 to identify the proxy mode of the node where the container group C2 is located.

[0099] If the data proxy D1 detects that the configuration information of the container group C2 includes the address of the data proxy, it is confirmed that the proxy mode of the node where the container group C2 is located is a one-to-many proxy mode. If the data proxy D1 detects that the configuration information of the container group C2 does not include the address of the data proxy, it is confirmed that the proxy mode of the node where the container group C2 is located is a one-to-one proxy mode.

[0100] In some embodiments, it can be determined whether the container group C2 is associated with a data proxy. If the container group C2 is associated with a data proxy, it is confirmed that the proxy mode of the node where the container group C2 is located is a one-to-many proxy mode, that is, multiple container groups correspond to the same data proxy. If the container group C2 is not associated with a data proxy, it is confirmed that the proxy mode of the node where the container group C2 is located is a one-to-one proxy mode, that is, the data proxy and the container group correspond one-to-one.

[0101] In some embodiments, the data agent D1 may also query the agent mode of the node where the container group C2 is located in the agent mode recorder 150 based on the address of the container group C2 to identify the agent mode of the node where the container group C2 is located.

[0102] After identifying the proxy mode of the node where the container group C2 is located, the data proxy D1 may execute step 404 to send the data packet C11 to the data proxy D2 corresponding to the container group C2 based on the identified proxy mode and the address of the container group C2.

[0103] In some embodiments, the proxy mode of the node where the container group C2 is located is a one-to-many proxy mode, that is, the data proxy D2 is a one-to-many data proxy, then in step 404, the address of the data proxy D2 is obtained, and based on the address of the data proxy D2, the data packet C11 and the address of the container group C2 are sent to the data proxy D2. In one example, the data proxy D1 can obtain the address of the data proxy D2 from the configuration information of the container group C2. In one example, the data proxy D1 can query the address of the data proxy D2 in the grid console 160 based on the address of the container group C2.

[0104] In some embodiments, the data proxy D1 may further encapsulate the data packet C11 to obtain a data packet C12 carrying the address of the data packet C11 and the container group C2. Exemplarily, a packet header may be added to the data packet C11 to obtain the data packet C12. The packet header includes the address of the container group C2. In step 403, based on the address of the data proxy D2, the data packet C12 is sent to the data proxy D2, thereby sending the address of the data packet C11 and the container group C2 to the data proxy D2.

[0105] Exemplarily, the data proxy D1 may establish a connection with the data proxy D2 based on the address of the data proxy D2, such as a transmission control protocol (TCP) connection. Through the connection, the data proxy D1 may send the data packet C12 to the data proxy D2.

[0106] In some embodiments, as described above for Figure 3As described in the embodiment shown, whenever a service is created in cluster 100, grid console 160 sends configuration information of the service to the data agent in cluster 100. Similarly, when the service to which data packet C11 belongs (i.e., the service represented by the identifier of the service included in data packet C11) is created, grid console 160 sends configuration information of the service to the data agent in cluster 100 (e.g., data agent D1). The configuration information includes filter configuration information. Data agent D1 can configure the filter based on the filter configuration information. The filter can add a header to data packet C11 to obtain data packet 112. Exemplarily, the filter is located at layer 4 (i.e., the transport layer) of the seven-layer network protocol, that is, the filter is a layer 4 protocol filter, and thus, the filter does not need to consider the content of data packet C11, and can directly encapsulate data packet C11.

[0107] In some embodiments, the proxy mode of the node where the container group C2 is located is a one-to-one proxy mode (i.e., the container group and the data proxy correspond one-to-one), that is, the data proxy D2 is a one-to-one data proxy, then in step 404, the data proxy D1 uses the address of the container group C2 as the address of the data proxy D2 and sends the data packet C11 to the data proxy D2. Exemplarily, the data proxy D1 can establish a connection with the data proxy D2 based on the address of the container group C2, such as a TCP connection. Through this connection, the data proxy D1 can send the data packet C11 to the data proxy D2.

[0108] Through step 404 , the data proxy D2 may receive the data packet C11 , and then, through step 405 , may send the data packet C11 to the container group C2 .

[0109] When the proxy mode of the node where the container group C2 is located is a one-to-many proxy mode, that is, when the data proxy D2 is a one-to-many data proxy, the data proxy D2 receives the data packet C11 and the address of the container group C2 through step 404. Through the address of the container group C2, the data proxy D2 can send the data packet C11 to the container group C2. Exemplarily, the data proxy D2 can establish a connection between the data proxy D2 and the container group C2 based on the address of the container group C2, such as a TCP connection. Then, the data proxy D2 sends the data packet C11 to the container group C2 through the connection.

[0110] In some embodiments, as described above, when the proxy mode of the node where the container group C2 is located is a one-to-many proxy mode, the data proxy D2 receives the data packet C12 through step 404. The data proxy D2 can parse the data packet C12 to obtain the address of the data packet C11 and the container group C2.

[0111] In some embodiments, as described above for Figure 3As described in the illustrated embodiment, whenever a service is created in cluster 100, grid console 160 sends configuration information of the service to one-to-many data agents in cluster 100. Similarly, when the service to which data packet C11 belongs (i.e., the service represented by the identifier of the service included in data packet C11) is created, grid console 160 sends configuration information of the service to one-to-many data agents (e.g., data agent D2) in cluster 100. The configuration information includes listener configuration information. Data agent D2 can configure the listener based on the listener configuration information. The listener can parse data packet C12 to obtain the address of data packet 111 and container group C2. Exemplarily, the listener is located at layer 4 (i.e., the transport layer) of the seven-layer network protocol.

[0112] When the data proxy D2 is a one-to-one data proxy, the data proxy D2 receives the data packet C11 through step 404. Since the data proxy D2 and the container group C2 correspond one-to-one, the data proxy D2 directly sends the data packet C11 to the container group corresponding to the data proxy D2 (i.e., the container group C2). Exemplarily, the address of the data proxy D2 itself is the address of the container group C2, and the data proxy D2 establishes a connection between the data proxy D2 and the container group C2 based on the address of the container group C2, such as a TCP connection. Then, the data proxy D2 sends the data packet C11 to the container group C2 through the connection.

[0113] Therefore, through the above scheme, no matter whether the proxy mode of the node where the container group C1 is located is a one-to-one proxy mode or a one-to-many proxy mode, and no matter whether the proxy mode of the node where the container group C2 is located is a one-to-one proxy mode or a one-to-many proxy mode, the data packet C11 can be transmitted from the container group C1 to the container group C2, thereby realizing the intercommunication of container groups across proxy modes.

[0114] Based on the above description, the embodiment of the present application provides a communication method based on a service grid cluster. The cluster has multiple proxy modes, and the cluster includes multiple service nodes, wherein a service node adopts one of the multiple proxy modes, and each proxy mode is adopted by at least one service node; the service node runs a container group and a data proxy corresponding to the container group, and the data proxy corresponding to the container group is used to perform traffic management on the data packets sent by the container group. Figure 5 As shown, the method includes the following steps.

[0115] Step 501: A first data proxy receives a first data packet sent by a first container group; the first container group and the first data proxy are run on a first service node among the plurality of service nodes, and the first container group corresponds to the first data proxy. Figure 4 The introduction of step 401 is implemented.

[0116] Step 502: When the first data proxy confirms that the destination of the first data packet is the second container group, it identifies the proxy mode adopted by the second service node where the second container group is located. Figure 4 The introduction and implementation of step 402 and step 403.

[0117] Step 503: The first data proxy sends the first data packet to the second data proxy corresponding to the second container group based on the proxy mode adopted by the second service node and the address of the second container group, so that the first data packet is sent to the second container group through the second data proxy. Figure 4 The introduction and implementation of step 404 and step 405.

[0118] In some embodiments, the cluster includes a grid console; the grid console is used to send configuration information of the second container group to the first data proxy, and the configuration information is used to indicate the proxy mode of the second service node; the identifying the proxy mode adopted by the second service node where the second container group is located includes: based on the configuration information of the second container group, identifying the proxy mode adopted by the second service node. For details, please refer to the above Figure 3 Step 306a, step 306b and Figure 4 The introduction of step 403 is implemented.

[0119] In an example of this embodiment, the identifying the proxy mode adopted by the second service node based on the configuration information of the second container group includes: when it is detected that the configuration information includes the address of the second data agent, the first data agent confirms that the proxy mode adopted by the second service node is that multiple container groups correspond to the same data agent.

[0120] In another example of this embodiment, the second service node corresponds to a controller, and the controller is used to send the address of the second data proxy to the grid console when confirming that the proxy mode adopted by the second service node is that multiple container groups correspond to the same data proxy; wherein the grid console is used to include the address of the second data proxy in the configuration information. Figure 3 The introduction and implementation of step 303 and step 305b.

[0121] In some embodiments, the proxy mode adopted by the second service node is that multiple container groups correspond to the same data proxy; the first data proxy sends the first data packet to the second data proxy corresponding to the second container group based on the proxy mode adopted by the second service node and the address of the second container group, including: the first data proxy obtains the address of the second data proxy; the first data proxy sends the first data packet and the address of the second container group to the second data proxy based on the address of the second data proxy; wherein the second data proxy is used to forward the first data packet to the second container group based on the address of the second container group. For details, please refer to the above Figure 4 The introduction and implementation of step 404 and step 405.

[0122] In an example of this embodiment, sending the first data packet and the address of the second container group to the second data proxy based on the address of the second data proxy includes: adding a header to the first data packet to obtain a second data packet; the header includes the address of the second container group; sending the second data packet to the second data proxy based on the address of the second data proxy; the second data proxy is used to obtain the address of the second container group from the header.

[0123] In some embodiments, the proxy mode adopted by the second service node is a one-to-one correspondence between container groups and data agents; the first data agent sends the first data packet to the second data agent corresponding to the second container group based on the proxy mode adopted by the second service node and the address of the second container group, including: the first data agent uses the address of the second container group as the address of the second data agent, and sends the first data packet to the second data agent. For details, please refer to the above Figure 4 The introduction and implementation of step 404 and step 405.

[0124] pass Figure 5 According to the method shown, when the container group running on the first service node sends a data packet to other container groups, the proxy mode adopted by the node where the target container group of the data packet is located can be identified. Then, based on the proxy mode of the node where the target container group is located and the address of the target container group, the data packet is sent to the node where the target container group is located. Thus, targeted data packet sending methods are adopted for different proxy modes, thereby realizing communication between nodes with different proxy modes. Since this method realizes communication between nodes with different proxy modes, using this method, it is not necessary for the nodes in the cluster to adopt the same proxy mode. Users can deploy nodes with different proxy modes in the service grid cluster, or change the proxy mode of one or some nodes in the cluster, or add nodes with proxy modes different from those of existing nodes to the cluster, thereby realizing flexible deployment of node proxy modes.

[0125] See also Figure 6 , an embodiment of the present application provides a communication device 600. The device 600 is used as a first data proxy run by a first service node in a service grid cluster, the cluster has multiple proxy modes, and the cluster includes multiple service nodes, wherein a service node adopts one of the multiple proxy modes, and each proxy mode is adopted by at least one service node; the service node runs a container group and a data proxy corresponding to the container group, and the data proxy corresponding to the container group is used to perform traffic management on the data packets sent by the container group. Figure 6 As shown, the device 600 includes:

[0126] The receiving module 610 is configured to receive a first data packet sent by a first container group; the first container group runs on the first service node, and the first container group corresponds to the first data proxy;

[0127] an identification module 620, configured to identify a proxy mode adopted by a second service node where the second container group is located when confirming that the destination of the first data packet is the second container group;

[0128] The sending module 630 is configured to send the first data packet to a second data proxy corresponding to the second container group based on the proxy mode adopted by the second service node and the address of the second container group, so as to send the first data packet to the second container group through the second data proxy.

[0129] In some embodiments, the cluster includes a grid console, which is used to send configuration information of the second container group to the first data agent, and the configuration information is used to indicate the proxy mode of the second service node; the identification module is used to: identify the proxy mode adopted by the second service node based on the configuration information of the second container group.

[0130] In an example of this embodiment, the identification module is used for: when detecting that the configuration information includes the address of the second data agent, the first data agent confirms that the agent mode adopted by the second service node is that multiple container groups correspond to the same data agent.

[0131] In another example of this embodiment, the second business node corresponds to a controller; the controller is used to send the address of the second data agent to the grid console when confirming that the proxy mode adopted by the second business node is that multiple container groups correspond to the same data agent; wherein the grid console is used to include the address of the second data agent in the configuration information.

[0132] In some embodiments, the proxy mode adopted by the second service node is that multiple container groups correspond to the same data proxy; the sending module is used for: the first data proxy obtains the address of the second data proxy; the first data proxy sends the first data packet and the address of the second container group to the second data proxy based on the address of the second data proxy; wherein the second data proxy is used for forwarding the first data packet to the second container group based on the address of the second container group.

[0133] In some embodiments, the sending module is used to: add a header to the first data packet to obtain a second data packet; the header includes an address of the second container group; based on the address of the second data agent, send the second data packet to the second data agent; the second data agent is used to obtain the address of the second container group from the header.

[0134] In some embodiments, the proxy mode adopted by the second service node is a one-to-one correspondence between container groups and data proxies; the sending module is used for: the first data proxy uses the address of the second container group as the address of the second data proxy, and sends the first data packet to the second data proxy.

[0135] Among them, the receiving module 610, the identification module 620 and the sending module 630 can all be implemented by software, or can be implemented by hardware. Exemplarily, the implementation of the receiving module 610 is introduced below by taking the receiving module 610 as an example. Similarly, the implementation of the identification module 620 and the sending module 630 can refer to the implementation of the receiving module 610.

[0136] As an example of a software functional unit, the receiving module 610 may include code running on a computing instance, wherein the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container.

[0137] As an example of a hardware functional unit, the receiving module 610 may include at least one hardware module or device. For example, the receiving module 610 may also be a module or device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0138] It should be noted that, in other embodiments, the receiving module 610 may be used to execute Figure 5 In any step of the method shown, the identification module 620 can be used to perform Figure 5 For any step in the method shown, the sending module 630 can be used to perform Figure 5 The steps implemented by the receiving module 610, the identifying module 620 and the sending module 630 can be specified as needed, and the steps implemented by the receiving module 610, the identifying module 620 and the sending module 630 can be specified as needed. Figure 5 The different steps in the method shown are used to implement the overall functions of the apparatus 600 .

[0139] The present application also provides a node 700. Figure 7 As shown, node 700 includes: bus 702, processor 704, memory 706 and communication interface 708. Processor 704, memory 706 and communication interface 708 communicate through bus 702. Node 700 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in node 700.

[0140] The bus 702 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The bus 702 may include a path for transmitting information between various components of the node 700 (eg, the memory 706, the processor 704, and the communication interface 708).

[0141] The processor 704 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0142] The memory 706 may include a volatile memory, such as a random access memory (RAM). The memory 706 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0143] The memory 706 stores executable program codes, and the processor 704 executes the executable program codes to respectively implement the functions of the aforementioned receiving module 610, the identification module 620, and the sending module 630, thereby implementing Figure 5 That is, the memory 706 stores the method for executing Figure 5 Instructions for the method shown.

[0144] The communication interface 708 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the node 700 and other devices or communication networks.

[0145] The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes Figure 5 The method shown.

[0146] The present application also provides a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be stored by a computing device or a host migration device such as a data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute Figure 5The method shown.

[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present application.

Claims

1. A communication method based on a service grid cluster, characterized in that: The cluster has multiple proxy modes, and the cluster includes multiple service nodes; wherein the service node adopts one of the multiple proxy modes, and each proxy mode is adopted by at least one service node; the service node runs a container group and a data proxy corresponding to the container group, and the data proxy corresponding to the container group is used to perform traffic management on the data packets sent by the container group; the method includes: The first data proxy receives a first data packet sent by a first container group; the first container group and the first data proxy run on a first service node among the multiple service nodes, and the first container group corresponds to the first data proxy; When confirming that the destination of the first data packet is the second container group, the first data proxy identifies the proxy mode adopted by the second service node where the second container group is located; The first data proxy sends the first data packet to a second data proxy corresponding to the second container group based on the proxy mode adopted by the second service node and the address of the second container group, so as to send the first data packet to the second container group through the second data proxy.

2. The method according to claim 1, characterized in that The cluster includes a grid console; the grid console is used to send configuration information of the second container group to the first data proxy, the configuration information is used to indicate the proxy mode of the second service node; The identifying the proxy mode adopted by the second service node where the second container group is located includes: Based on the configuration information of the second container group, a proxy mode adopted by the second service node is identified.

3. The method according to claim 2, characterized in that The identifying, based on the configuration information of the second container group, the proxy mode adopted by the second service node includes: When detecting that the configuration information includes the address of the second data proxy, the first data proxy confirms that the proxy mode adopted by the second service node is that multiple container groups correspond to the same data proxy.

4. The method according to claim 2 or 3, characterized in that: The second service node corresponds to a controller; the controller is used to send the address of the second data proxy to the grid console when confirming that the proxy mode adopted by the second service node is that multiple container groups correspond to the same data proxy; The grid console is used to include the address of the second data agent in the configuration information.

5. The method according to any one of claims 1 to 4, characterized in that The proxy mode adopted by the second service node is that multiple container groups correspond to the same data proxy; The first data proxy sends the first data packet to a second data proxy corresponding to the second container group based on the proxy mode adopted by the second service node and the address of the second container group, including: The first data agent obtains the address of the second data agent; The first data agent sends the first data packet and the address of the second container group to the second data agent based on the address of the second data agent; The second data proxy is used to forward the first data packet to the second container group based on the address of the second container group.

6. The method according to claim 5, characterized in that The sending the first data packet and the address of the second container group to the second data proxy based on the address of the second data proxy includes: adding a packet header to the first data packet to obtain a second data packet; the packet header includes an address of the second container group; Based on the address of the second data proxy, sending the second data packet to the second data proxy; The second data agent is used to obtain the address of the second container group from the packet header.

7. The method according to any one of claims 1 to 4, characterized in that The proxy mode adopted by the second service node is a one-to-one correspondence between container groups and data proxies; The first data proxy sends the first data packet to a second data proxy corresponding to the second container group based on the proxy mode adopted by the second service node and the address of the second container group, including: The first data proxy uses the address of the second container group as the address of the second data proxy and sends the first data packet to the second data proxy.

8. A communication device, characterized in that: The device is used as a first data proxy run by a first service node in a service grid cluster, the cluster has multiple proxy modes, and the cluster includes multiple service nodes; wherein the service node adopts one of the multiple proxy modes, and each proxy mode is adopted by at least one service node; the service node runs a container group and a data proxy corresponding to the container group, and the data proxy corresponding to the container group is used to perform traffic management on a data packet sent by the container group; the device includes: A receiving module, configured to receive a first data packet sent by a first container group; the first container group runs on the first service node, and the first container group corresponds to the first data proxy; an identification module, configured to identify, when confirming that the destination of the first data packet is the second container group, a proxy mode adopted by the second service node where the second container group is located; A sending module is used to send the first data packet to a second data proxy corresponding to the second container group based on the proxy mode adopted by the second service node and the address of the second container group, so as to send the first data packet to the second container group through the second data proxy.

9. The device according to claim 8, characterized in that The cluster includes a grid console, the grid console is used to send configuration information of the second container group to the first data proxy, the configuration information is used to indicate the proxy mode of the second service node; The identification module is used to identify the proxy mode adopted by the second service node based on the configuration information of the second container group.

10. The device according to claim 9, characterized in that The identification module is used for: when it is detected that the configuration information includes the address of the second data agent, the first data agent confirms that the agent mode adopted by the second service node is that multiple container groups correspond to the same data agent.

11. The device according to claim 9 or 10, characterized in that The second service node corresponds to a controller; the controller is used to send the address of the second data proxy to the grid console when confirming that the proxy mode adopted by the second service node is that multiple container groups correspond to the same data proxy; The grid console is used to include the address of the second data agent in the configuration information.

12. The device according to any one of claims 8 to 11, characterized in that The proxy mode adopted by the second service node is that multiple container groups correspond to the same data proxy; The sending module is used for: The first data agent obtains the address of the second data agent; Based on the address of the second data proxy, sending the first data packet and the address of the second container group to the second data proxy; The second data proxy is used to forward the first data packet to the second container group based on the address of the second container group.

13. The device according to claim 12, characterized in that The sending module is used for: adding a packet header to the first data packet to obtain a second data packet; the packet header includes an address of the second container group; Based on the address of the second data proxy, sending the second data packet to the second data proxy; The second data agent is used to obtain the address of the second container group from the packet header.

14. The device according to any one of claims 8 to 11, characterized in that The proxy mode adopted by the second service node is a one-to-one correspondence between container groups and data proxies; The sending module is used for: the first data proxy uses the address of the second container group as the address of the second data proxy to send the first data packet to the second data proxy.

15. A node running a container group, characterized in that: The invention comprises a processor and a memory, wherein the processor is used to execute instructions stored in the memory to perform the method according to any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, and when the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method as claimed in any one of claims 1 to 7.

17. A computer program product comprising instructions, characterized in that When the instructions are executed by a computer device cluster, the computer device cluster is caused to perform the method according to any one of claims 1 to 7.