[go: up one dir, main page]

WO2025140263A1 - Traffic management method, service mesh system, apparatus, and cluster - Google Patents

Traffic management method, service mesh system, apparatus, and cluster Download PDF

Info

Publication number
WO2025140263A1
WO2025140263A1 PCT/CN2024/142165 CN2024142165W WO2025140263A1 WO 2025140263 A1 WO2025140263 A1 WO 2025140263A1 CN 2024142165 W CN2024142165 W CN 2024142165W WO 2025140263 A1 WO2025140263 A1 WO 2025140263A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
agent
tenant
data packet
configuration information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2024/142165
Other languages
French (fr)
Chinese (zh)
Inventor
张伟
黄毽
张永明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Cloud Computing Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Cloud Computing Technologies Co Ltd filed Critical Huawei Cloud Computing Technologies Co Ltd
Publication of WO2025140263A1 publication Critical patent/WO2025140263A1/en
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/78Architectures of resource allocation
    • H04L47/783Distributed allocation of resources, e.g. bandwidth brokers

Definitions

  • the present application relates to the field of data processing technology, and in particular to a traffic management method, a service grid system, a device and a cluster.
  • the industry has proposed an ambient mode service mesh technology.
  • the ambient mode is also called the sidecarless mode. It splits the functions of the sidecar into the transport layer proxy and the application layer proxy. The transport layer proxy and the application layer proxy are separated from the container group, thus avoiding the defect that the sidecar increases the workload of the node where the container group is located.
  • each tenant has an exclusive application layer proxy, and one application layer proxy is only used to manage the traffic of one tenant's service. Since each application layer proxy occupies independent computing resources, a large number of computing resources will inevitably be idle during the idle phase of the tenant's business, resulting in low computing resource utilization.
  • the embodiments of the present application provide a traffic management method, a service grid system, a device and a cluster, which can improve the computing resource utilization of the service grid system.
  • a traffic management method is provided, which is applied to a service grid system, wherein the service grid system includes a first service node and an agent cluster; wherein the first service node runs a first transport layer L4 agent and a first service container group of a first tenant; the agent cluster runs a first application layer L7 agent, the first L7 agent includes configuration information of multiple services, different services in the multiple services belong to the same tenant or different tenants, and the configuration information of the service is used by the first L7 agent to perform traffic management on data packets of the service; the method includes: the first L4 agent receives a first data packet sent by the first service container group; the first L4 agent sends an identifier of the first tenant and the first data packet to the first L7 agent; the first L7 agent identifies the configuration information of the first service in the configuration information of multiple services based on the identifier of the first tenant, and the first service belongs to the first tenant; the first L7 agent performs traffic management on the first data packet based on the configuration information of the
  • the same L7 agent can include the configuration information of services of multiple tenants.
  • the L7 agent obtains the identifier of the tenant, and obtains the configuration information of the services of the tenant from the configuration information of the services of multiple tenants based on the identifier of the tenant, and then can perform traffic management on the data packets of the services of the tenant based on the configuration information of the services of the tenant.
  • the same L7 agent can perform traffic management on the data packets of the services of multiple tenants, realizing multi-tenant sharing of the L7 agent. Multi-tenant sharing of the L7 agent can improve the computing resource utilization of the L7 agent, reduce the scheduling pressure of the L7 agent, etc., for the following reasons.
  • the idle phases of the services of different tenants are often not completely consistent, that is, the idle phases of different tenants are usually different.
  • the services of some tenants are in the idle phase
  • the services of other tenants may be in the busy phase.
  • the L7 agent can be prevented from being idle, thereby improving the computing resource utilization of the L7 agent.
  • L7 proxy multiple tenants share the L7 proxy, and each tenant does not need to create an L7 proxy, which can reduce the number of L7 proxies in the service grid system. This can not only reduce the computing resources required to deploy the L7 proxy in the service grid system, but also reduce the scheduling pressure of the L7 proxy.
  • the L7 proxy is shared by multiple tenants, which means that there is no need to create L7 proxies at the tenant level.
  • the administrator of the service grid system can pre-create one or more L7 proxies in the proxy cluster.
  • the service grid system console can send the configuration information of the service to the L7 proxy, so that the L7 proxy can manage the traffic of the service data packets based on the configuration information of the service. This improves the timeliness of traffic management for new services.
  • L7 proxy is shared by multiple tenants, not exclusive to a certain tenant, which allows L7 proxy to be created uniformly by the administrator, and the redundancy of service configuration information can be controlled.
  • the service grid system console can send the configuration information of the service to N L7 proxies, where N is an integer greater than or equal to 1, and the size of N can be set by the administrator. In this way, the configuration information of the service can be avoided from being stored in the L7 proxy with high redundancy, saving the memory resources of the L7 proxy.
  • the first service node also runs a second service container group of a second tenant; the method includes: a first L4 agent receives a second data packet sent by the second service container group; the first L4 agent sends an identifier of the second tenant and the second data packet to a first L7 agent; the first L7 agent identifies, based on the identifier of the second tenant, configuration information of the second service in configuration information of multiple services, and the second service belongs to the second tenant; the first L7 agent performs traffic management on the second data packet based on the configuration information of the second service.
  • the first L7 agent can perform traffic management on the data packets of the first tenant's service and the data packets of the second tenant's service.
  • the first tenant and the second tenant can share the first L7 agent, thereby improving the computing resource utilization of the first L7 agent and reducing the scheduling pressure of the L7 agent.
  • the first service includes a service corresponding to the first data packet and other services; the first L7 agent performs traffic management on the first data packet based on the configuration information of the first service, including: the first L7 agent identifies the configuration information of the service corresponding to the first data packet in the configuration information of the first service based on an identifier of the service corresponding to the first data packet; the first L7 agent performs traffic management on the first data packet based on the configuration information of the service corresponding to the first data packet.
  • the L4 proxy can identify the L7 proxy that includes the configuration information of the first tenant's service from the multiple L7 proxies based on the tenant's identifier, so that the data packets of the first tenant's service can be sent to the L7 proxy that includes the configuration information of the first tenant's service, and then the traffic management of the data packets of the first tenant's service can be performed through the L7 proxy.
  • the L4 agent 130 may select a target L7 agent for the data packet 111 from the multiple L7 proxies.
  • the target L7 proxy of the data packet 111 can be obtained.
  • the L7 agent may perform traffic management on the data packet 111 based on the configuration information of the service of the tenant A1 identified in step 606 .
  • the data packet 111 is a data packet of the service A11 of the tenant A1. If the configuration information of the service of the tenant A1 identified in step 606 is the configuration information of the service A11, then in step 607, the traffic management of the data packet 111 can be performed directly based on the configuration information of the service of the tenant A1 identified in step 606.
  • the configuration information of the service of tenant A1 identified in step 606 includes configuration information of other services of tenant A1 in addition to the configuration information of service A11
  • the configuration information of service A11 is first identified from the configuration information of the service of tenant A1 identified in step 606. Then, traffic management is performed on data packet 111 based on the configuration information of service A11.
  • data packet 111 includes the identifier of the service requested by data packet 111, that is, the identifier of service A11.
  • L7 agent 310 can parse data packet 111 to obtain the identifier of service A11. Then, based on the identifier of service A11, L7 agent 310 identifies the configuration information of service A11 in the configuration information of the service of tenant A1 identified in step 606. Specifically, as described above, the identifier of the service and the configuration information of the service have an associated relationship. L7 agent 310 can identify the configuration information of service A11 based on the associated relationship and the identifier of service A11.
  • the traffic management of the data packet 111 by the L7 agent 310 may include: selecting a target service instance of the data packet 111.
  • the data packet 111 is a service request
  • the L7 agent 310 may select a service instance for executing the service request.
  • the L7 agent 310 may be set to select the service container group 210 as the target service instance of the data packet 111, that is, select the service container in the service container group 210 to process the data packet 111.
  • the L7 agent 310 may send the data packet 111 to the L4 agent (i.e., the L4 agent 230) in the service node (i.e., the service node 200) where the service container group 210 is located through step 608.
  • the L4 agent 230 may forward the received data packet 111 to the service container group 210.
  • the L4 agent 230 may send the data packet 111 to the service container group 210 through a DNAT operation.
  • the L4 agent 230 executes step 610 only when it is confirmed that the tenant A1 and the tenant to which the service container group 210 belongs are the same, thereby further ensuring the isolation between tenants.
  • L7 agent 310 in addition to supporting the services of tenant A1, L7 agent 310 also performs services of other tenants, such as services of tenant A2. That is, L7 agent 310 also includes configuration information of services of tenant A2.
  • the business container group 120 of tenant A2 can be set to run in the business node 100.
  • L4 agent 130 can send the data packet 121 and the identifier of tenant A2 to L7 agent 310.
  • L7 agent 310 can identify the configuration information of tenant A2 in the configuration information of multiple services included in L7 agent 310 based on the identifier of tenant A2. Then, L7 agent 310 can perform traffic management on data packet 121 based on the configuration information of tenant A2.
  • L7 agent 310 selects business container group 220 in business node 200 as the target service instance of data packet 121.
  • L7 agent 310 sends data packet 121 and the identifier of tenant A2 to L4 agent 230.
  • the L4 proxy 230 confirms, based on the identifier of the tenant A2, that the tenant A2 and the service container group 220 belong to the same tenant, it sends the data packet 121 to the service container group 220 .
  • the same L7 proxy can manage the traffic of data packets of services of multiple tenants, realizing multi-tenant sharing of L7 proxy. This can improve the computing resource utilization of L7 proxy and reduce the scheduling pressure of L7 proxy.
  • an embodiment of the present application also provides a traffic management method.
  • the method can be performed by a first L7 agent in a service grid system.
  • the service grid system includes a first business node and a proxy cluster; wherein the first business node runs a first L4 agent and a first business container group of a first tenant; the first L7 agent runs in the proxy cluster, and the first L7 agent includes configuration information of multiple services, different services in the multiple services belong to the same tenant or different tenants, and the configuration information of the service is used by the first L7 agent to perform traffic management on the data packets of the service.
  • the service grid system here can be the service grid system shown in Figure 1
  • the proxy cluster can be the proxy cluster 300 described above
  • the first L7 agent can specifically be the L7 agent 310 described above
  • the first business node can be the business node 100 described above
  • the first L4 agent can be the L4 agent 130 described above
  • the first tenant can be the tenant A1 described above.
  • the method includes the following steps.
  • step 701 the first L7 agent receives the identifier of the first tenant and the first data packet sent by the first L4 agent, where the first data packet is received by the first L4 agent from the first service container group.
  • the first service container group may be the service container group 110 described above, and the first data packet may be the data packet 111 described above.
  • the specific implementation of step 701 may refer to the introduction of steps 601 to 605 in FIG. 6 above, and will not be repeated here.
  • step 702 the first L7 agent identifies configuration information of a first service from the configuration information of the plurality of services based on the identifier of the first tenant, and the first service belongs to the first tenant.
  • the specific implementation of step 702 can refer to the introduction of step 606 in FIG. 6 above, which will not be repeated here.
  • Step 703 The first L7 agent performs traffic management on the first data packet based on the configuration information of the first service.
  • the specific implementation of step 702 can refer to the above description of step 607 in FIG. 6, which will not be repeated here.
  • the first service node also runs a second service container group of a second tenant; the method includes: the first L7 agent receives the identifier of the second tenant and a second data packet sent by the first L4 agent, the second data packet is received by the first L4 agent from the second service container group; the first L4 agent sends the identifier of the second tenant and the second data packet to the first L7 agent; the first L7 agent identifies the configuration information of the second service in the configuration information of the plurality of services based on the identifier of the second tenant, the second service belongs to the second tenant; the first L7 agent performs traffic management on the second data packet based on the configuration information of the second service.
  • the second tenant may be the tenant A2 described above
  • the second service container group may be the service container group 120 described above
  • the second data packet may be the data packet 121 described above.
  • the first service includes the service corresponding to the first data packet and other services; the first L7 agent performs traffic management on the first data packet based on the configuration information of the first service, including: the first L7 agent identifies the configuration information of the service corresponding to the first data packet in the configuration information of the first service based on the identifier of the service corresponding to the first data packet; the first L7 agent performs traffic management on the first data packet based on the configuration information of the service corresponding to the first data packet.
  • the service corresponding to the first data packet may be the service A11 described above.
  • the proxy cluster corresponding to the service of the first data packet also runs a second L7 proxy, and the second L7 proxy includes configuration information of at least one service; the first L7 proxy receives the identifier of the first tenant and the first data packet sent by the first L4 proxy, including: when the number of services belonging to the first tenant in the multiple services is greater than the number of services belonging to the first tenant in the at least one service, the first L7 proxy receives the identifier of the first tenant and the first data packet sent by the first L4 proxy.
  • the second L7 proxy can be the L7 proxy 320 described above.
  • the specific implementation method of this embodiment can refer to the above introduction to steps 603-605 in Figure 6, which will not be repeated here.
  • the proxy cluster also runs a second L7 proxy, and the second L7 proxy also includes the configuration information of the first service; the first L7 proxy receives the identifier of the first tenant and the first data packet sent by the first L4 proxy, including: when the load of the second L7 proxy is greater than the load of the first L7 proxy, the first L7 proxy receives the identifier of the first tenant and the first data packet sent by the first L4 proxy.
  • the second L7 proxy can be the L7 proxy 320 described above. The specific implementation of this embodiment can refer to the above introduction to steps 603-605 in Figure 6, which will not be repeated here.
  • the service grid system further comprises: a console connected to the proxy cluster; the method further comprises: the first L7 proxy receives and records configuration information of two or more services from the console; wherein the two or more services belong to the same tenant, or the output of one of the two or more services is the input of another service.
  • the specific implementation of this embodiment can refer to the above description of the embodiments shown in Figures 3 to 5, which will not be repeated here.
  • the service grid system further includes a second service node, the second service node running a second L4 agent and a third service container group; the first L7 agent performs traffic management on the first data packet based on the configuration information of the first service, including: the first L7 agent selects the third service container group as the target container group of the first data packet; the first L7 agent sends the first data packet and the identifier of the first tenant to the second L4 agent; wherein the second L4 agent is used to: confirm that the tenants to which the first tenant and the third service container group belong are the same tenant based on the identifier of the first tenant; and send the first data packet to the third service container group.
  • the second service node may be the service node 200 described above, and the third service container group may also be the service container group 210 described above. The specific implementation of this embodiment can refer to the above description of steps 608-610 in FIG. 6, which will not be repeated here.
  • the same L7 agent can include the configuration information of services of multiple tenants.
  • the L7 agent obtains the identifier of the tenant, and obtains the configuration information of the tenant's services from the configuration information of the services of multiple tenants based on the identifier of the tenant, and then can perform traffic management on the data packets of the tenant's services based on the configuration information of the tenant's services.
  • the same L7 agent can perform traffic management on the data packets of the services of multiple tenants, realizing multi-tenant sharing of the L7 agent. Multi-tenant sharing of the L7 agent can improve the computing resource utilization of the L7 agent, reduce the scheduling pressure of the L7 agent, etc.
  • an embodiment of the present application provides a traffic management device 800.
  • the device 800 is configured in a first L7 agent in a service grid system, and the service grid system includes a first service node and a proxy cluster; the first service node runs a first L4 agent and a first service container group of a first tenant; the first L7 agent runs in the proxy cluster, and the first L7 agent includes configuration information of multiple services, different services in the multiple services belong to the same tenant or different tenants, and the configuration information of the service is used by the first L7 agent to perform traffic management on the data packets of the service.
  • the device 800 includes:
  • a receiving module 810 is configured to receive an identifier of the first tenant and a first data packet sent by the first L4 agent, where the first data packet is received by the first L4 agent from the first service container group;
  • an identification module 820 configured to identify, based on the identifier of the first tenant, configuration information of a first service from the configuration information of the plurality of services, the first service belonging to the first tenant;
  • the management module 830 is used to perform traffic management on the first data packet based on the configuration information of the first service.
  • the first service node also runs a second service container group of a second tenant; the receiving module 810 is also used to: receive the identifier of the second tenant and a second data packet sent by the first L4 agent, the second data packet is received by the first L4 agent from the second service container group; the identification module 820 is also used to: based on the identifier of the second tenant, identify the configuration information of the second service in the configuration information of the multiple services, the second service belongs to the second tenant; the management module 830 is also used to: based on the configuration information of the second service, perform traffic management on the second data packet.
  • the first service includes the service corresponding to the first data packet and other services; the management module 830 is used to: based on the identifier of the service corresponding to the first data packet, identify the configuration information of the service corresponding to the first data packet in the configuration information of the first service; based on the configuration information of the service corresponding to the first data packet, perform traffic management on the first data packet.
  • the proxy cluster also runs a second L7 agent, which includes configuration information of at least one service; the receiving module 810 is used to: when the number of services belonging to the first tenant in the multiple services is greater than the number of services belonging to the first tenant in the at least one service, receive the identifier of the first tenant and the first data packet sent by the first L4 agent.
  • the proxy cluster also runs a second L7 proxy, which also includes configuration information of the first service; the receiving module 810 is used to: when the load of the second L7 proxy is greater than the load of the first L7 proxy, receive the identifier of the first tenant and the first data packet sent by the first L4 agent.
  • the service grid system also includes: a console connected to the proxy cluster; the receiving module 810 is used to: receive and record configuration information of two or more services from the console; wherein the two or more services belong to the same tenant, or the output of one of the two or more services is the input of another service.
  • Processor 904 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).
  • CPU central processing unit
  • GPU graphics processing unit
  • MP microprocessor
  • DSP digital signal processor
  • the embodiment of the present application also provides another computing device cluster.
  • the connection relationship between the computing devices in the computing device cluster can be similar to the connection mode of the computing device cluster described in Figures 10 and 11.
  • the difference is that the memory 906 in one or more computing devices 900 in the computing device cluster can store the same instructions for executing the method shown in Figure 7.

Landscapes

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

Abstract

Provided in the present application are a traffic management method, a service mesh system, an apparatus, and a cluster. The method comprises: a first L4 agent receiving a first data packet sent by a first service container group; the first L4 agent sending an identifier of a first tenant and the first data packet to a first L7 agent; the first L7 agent identifying configuration information of a first service among configuration information of a plurality of services on the basis of the identifier of the first tenant, wherein the first service belongs to the first tenant; and the first L7 agent performing traffic management on the first data packet on the basis of the configuration information of the first service. The method can increase a computing resource utilization rate of a service mesh system.

Description

流量管理方法、服务网格系统、装置及集群Traffic management method, service grid system, device and cluster

本申请要求于2023年12月25日提交中国国家知识产权局、申请号为202311817785.7、申请名称为“一种服务网格系统”的中国专利申请的优先权,以及于2024年3月6日提交中国国家知识产权局、申请号为202410256865.8、申请名称为“流量管理方法、服务网格系统、装置及集群”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office of China on December 25, 2023, with application number 202311817785.7 and application name “A service grid system”, and the priority of the Chinese patent application filed with the State Intellectual Property Office of China on March 6, 2024, with application number 202410256865.8 and application name “Traffic management method, service grid system, device and cluster”, all contents of which are incorporated by reference in this application.

技术领域Technical Field

本申请涉及数据处理技术领域,尤其涉及一种流量管理方法、服务网格系统、装置及集群。The present application relates to the field of data processing technology, and in particular to a traffic management method, a service grid system, a device and a cluster.

背景技术Background Art

当前,典型的服务网格(service mesh)技术利用边车(sidecar)实现流量路由、负载均衡、流量控制等服务间的流量管理。边车是注入到容器组中的,安装、升级边车都需要重新启动容器组,这增加了容器组所在节点的工作负载。Currently, typical service mesh technology uses sidecars to implement traffic management between services such as traffic routing, load balancing, and traffic control. Sidecars are injected into container groups. Installing and upgrading sidecars requires restarting the container group, which increases the workload of the node where the container group is located.

业界提出了一种外围(ambient)模式的服务网格技术。ambient模式也称无边车(sidecarless)模式,其将边车的功能拆分至传输层代理和应用层代理,并且传输层代理、应用层代理与容器组是分离的,从而避免了边车增加容器组所在节点的工作负载的缺陷。The industry has proposed an ambient mode service mesh technology. The ambient mode is also called the sidecarless mode. It splits the functions of the sidecar into the transport layer proxy and the application layer proxy. The transport layer proxy and the application layer proxy are separated from the container group, thus avoiding the defect that the sidecar increases the workload of the node where the container group is located.

在现有的ambient模式中,每个租户独占应用层代理,一个应用层代理仅用于对一个租户的服务进行流量管理。由于每个应用层代理都占据独立的计算资源,在租户的业务空闲阶段,不可避免地出现大量计算资源闲置的情况,导致计算资源利用率低。In the existing ambient mode, each tenant has an exclusive application layer proxy, and one application layer proxy is only used to manage the traffic of one tenant's service. Since each application layer proxy occupies independent computing resources, a large number of computing resources will inevitably be idle during the idle phase of the tenant's business, resulting in low computing resource utilization.

发明内容Summary of the invention

本申请实施例提供了一种流量管理方法、服务网格系统、装置及集群,可以提升服务网格系统的计算资源利用率。The embodiments of the present application provide a traffic management method, a service grid system, a device and a cluster, which can improve the computing resource utilization of the service grid system.

第一方面,提供了一种流量管理方法,该方法应用于服务网格系统,服务网格系统包括第一业务节点和代理集群;其中,第一业务节点运行有第一传输层L4代理和第一租户的第一业务容器组;代理集群运行有第一应用层L7代理,第一L7代理包括多个服务的配置信息,多个服务中的不同服务属于同一租户或不同租户,服务的配置信息用于第一L7代理对服务的数据包进行流量管理;该方法包括:第一L4代理接收第一业务容器组发出的第一数据包;第一L4代理将第一租户的标识和第一数据包发送至第一L7代理;第一L7代理基于第一租户的标识,在多个服务的配置信息中识别第一服务的配置信息,第一服务属于第一租户;第一L7代理基于第一服务的配置信息,对第一数据包进行流量管理。In a first aspect, a traffic management method is provided, which is applied to a service grid system, wherein the service grid system includes a first service node and an agent cluster; wherein the first service node runs a first transport layer L4 agent and a first service container group of a first tenant; the agent cluster runs a first application layer L7 agent, the first L7 agent includes configuration information of multiple services, different services in the multiple services belong to the same tenant or different tenants, and the configuration information of the service is used by the first L7 agent to perform traffic management on data packets of the service; the method includes: the first L4 agent receives a first data packet sent by the first service container group; the first L4 agent sends an identifier of the first tenant and the first data packet to the first L7 agent; the first L7 agent identifies the configuration information of the first service in the configuration information of multiple services based on the identifier of the first tenant, and the first service belongs to the first tenant; the first L7 agent performs traffic management on the first data packet based on the configuration information of the first service.

通过第一方面提供的方法,同一L7代理可以包括多个租户的服务的配置信息,在需要对租户的服务的数据包进行流量管理时,L7代理获取该租户的标识,并基于该租户的标识从多个租户的服务的配置信息中获取该租户的服务的配置信息,进而可基于该租户的服务的配置信息对该租户的服务的数据包进行流量管理。如此,使得同一L7代理能够对多个租户的服务的数据包进行流量管理,实现了多租户共享L7代理。多租户共享L7代理可以提升L7代理的计算资源利用率、降低L7代理的调度压力等,原因如下。Through the method provided in the first aspect, the same L7 agent can include the configuration information of services of multiple tenants. When it is necessary to perform traffic management on the data packets of the services of the tenant, the L7 agent obtains the identifier of the tenant, and obtains the configuration information of the services of the tenant from the configuration information of the services of multiple tenants based on the identifier of the tenant, and then can perform traffic management on the data packets of the services of the tenant based on the configuration information of the services of the tenant. In this way, the same L7 agent can perform traffic management on the data packets of the services of multiple tenants, realizing multi-tenant sharing of the L7 agent. Multi-tenant sharing of the L7 agent can improve the computing resource utilization of the L7 agent, reduce the scheduling pressure of the L7 agent, etc., for the following reasons.

首先,不同租户的业务的空闲阶段往往并非完全一致,即不同租户的空闲阶段通常是不同的,当一部分租户的业务处于空闲阶段时,另一部分的租户的业务可能处于繁忙阶段,如此,可避免L7代理处于闲置状态,提升了L7代理的计算资源利用率。First, the idle phases of the services of different tenants are often not completely consistent, that is, the idle phases of different tenants are usually different. When the services of some tenants are in the idle phase, the services of other tenants may be in the busy phase. In this way, the L7 agent can be prevented from being idle, thereby improving the computing resource utilization of the L7 agent.

其次,多个租户共享L7代理,无需每个租户均创建L7代理,可减少服务网格系统中L7代理的数量。这不仅可以降低在服务网格系统中部署L7代理所需的计算资源,还可以降低L7代理的调度压力。Secondly, multiple tenants share the L7 proxy, and each tenant does not need to create an L7 proxy, which can reduce the number of L7 proxies in the service grid system. This can not only reduce the computing resources required to deploy the L7 proxy in the service grid system, but also reduce the scheduling pressure of the L7 proxy.

另外,L7代理由多个租户共享,说明无需按照租户粒度创建L7代理。服务网格系统的管理员可以在代理集群中预先创建一个或多个L7代理,每当有新的服务创建时,服务网格系统的控制台可以将该服务的配置信息发送至L7代理中,使得L7代理可基于该服务的配置信息对该服务的数据包进行流量管理。这提升了对新的服务进行流量管理的及时性。In addition, the L7 proxy is shared by multiple tenants, which means that there is no need to create L7 proxies at the tenant level. The administrator of the service grid system can pre-create one or more L7 proxies in the proxy cluster. Whenever a new service is created, the service grid system console can send the configuration information of the service to the L7 proxy, so that the L7 proxy can manage the traffic of the service data packets based on the configuration information of the service. This improves the timeliness of traffic management for new services.

并且,L7代理是多租户共享的,并非专属某个租户,这使得L7代理可由管理员统一创建,可以控制服务的配置信息的冗余度。具体而言,每当有新的服务创建时,服务网格系统的控制台可以将该服务的配置信息发送至N个L7代理中,其中,N是大于或等于1的整数,其中,N的大小可由管理员设置。如此,可以避免服务的配置信息高冗余地存储在L7代理中,节省了L7代理的内存资源。In addition, L7 proxy is shared by multiple tenants, not exclusive to a certain tenant, which allows L7 proxy to be created uniformly by the administrator, and the redundancy of service configuration information can be controlled. Specifically, whenever a new service is created, the service grid system console can send the configuration information of the service to N L7 proxies, where N is an integer greater than or equal to 1, and the size of N can be set by the administrator. In this way, the configuration information of the service can be avoided from being stored in the L7 proxy with high redundancy, saving the memory resources of the L7 proxy.

在一种可能的实现方式中,第一业务节点还运行有第二租户的第二业务容器组;该方法包括:第一L4代理接收第二业务容器组发出的第二数据包;第一L4代理将第二租户的标识和第二数据包发送至第一L7代理;第一L7代理基于第二租户的标识,在多个服务的配置信息中识别第二服务的配置信息,第二服务属于第二租户;第一L7代理基于第二服务的配置信息,对第二数据包进行流量管理。In a possible implementation, the first service node also runs a second service container group of a second tenant; the method includes: a first L4 agent receives a second data packet sent by the second service container group; the first L4 agent sends an identifier of the second tenant and the second data packet to a first L7 agent; the first L7 agent identifies, based on the identifier of the second tenant, configuration information of the second service in configuration information of multiple services, and the second service belongs to the second tenant; the first L7 agent performs traffic management on the second data packet based on the configuration information of the second service.

在该实现方式中,第一L7代理可以对第一租户的服务的数据包和第二租户的服务的数据包进行流量管理。也就是说,第一租户和第二租户可以共享第一L7代理,从而可以提升第一L7代理的计算资源利用率、降低L7代理的调度压力等。In this implementation, the first L7 agent can perform traffic management on the data packets of the first tenant's service and the data packets of the second tenant's service. In other words, the first tenant and the second tenant can share the first L7 agent, thereby improving the computing resource utilization of the first L7 agent and reducing the scheduling pressure of the L7 agent.

在一种可能的实现方式中,第一服务包括第一数据包对应的服务和其他服务;第一L7代理基于第一服务的配置信息,对第一数据包进行流量管理,包括:第一L7代理基于第一数据包对应的服务的标识,在第一服务的配置信息中识别第一数据包对应的服务的配置信息;第一L7代理基于第一数据包对应的服务的配置信息,对第一数据包进行流量管理。In one possible implementation, the first service includes a service corresponding to the first data packet and other services; the first L7 agent performs traffic management on the first data packet based on the configuration information of the first service, including: the first L7 agent identifies the configuration information of the service corresponding to the first data packet in the configuration information of the first service based on an identifier of the service corresponding to the first data packet; the first L7 agent performs traffic management on the first data packet based on the configuration information of the service corresponding to the first data packet.

第一L7代理可以对第一租户的多个服务的数据包进行流量管理。当第一L7代理需要对某服务的数据包进行流量管理时,可以基于该服务的标识在第一租户的多个服务的配置信息中识别该服务的配置信息,进而可以基于该服务的配置信息对该服务的数据包进行流量管理。The first L7 proxy can perform traffic management on data packets of multiple services of the first tenant. When the first L7 proxy needs to perform traffic management on data packets of a certain service, it can identify the configuration information of the service in the configuration information of multiple services of the first tenant based on the identifier of the service, and then can perform traffic management on the data packets of the service based on the configuration information of the service.

在一种可能的实现方式中,代理集群运行有多个L7代理;第一L4代理将第一租户的标识和第一数据包发送至第一L7代理,包括:第一L4代理基于第一租户的标识,从多个L7代理中识别包括第一租户的服务的配置信息的L7代理;第一L4代理基于第一数据包对应的服务的标识,从包括第一租户的服务的配置信息的L7代理中识别包括第一数据包对应的服务的配置信息的L7代理,得到第一L7代理。In one possible implementation, a proxy cluster runs multiple L7 proxies; the first L4 proxy sends the identifier of the first tenant and the first data packet to the first L7 proxy, including: the first L4 proxy identifies the L7 proxy including the configuration information of the service of the first tenant from multiple L7 proxies based on the identifier of the first tenant; the first L4 proxy identifies the L7 proxy including the configuration information of the service corresponding to the first data packet from the L7 proxies including the configuration information of the service of the first tenant based on the identifier of the service corresponding to the first data packet, and obtains the first L7 proxy.

当代理集群运行有多个L7代理时,L4代理可以基于租户的标识,从该多个L7代理中识别包括第一租户的服务的配置信息的L7代理,从而可以将第一租户的服务的数据包发送至包括第一租户的服务的配置信息的L7代理,进而可以通过该L7代理对第一租户的服务的数据包进行流量管理。When the proxy cluster runs multiple L7 proxies, the L4 proxy can identify the L7 proxy that includes the configuration information of the first tenant's service from the multiple L7 proxies based on the tenant's identifier, so that the data packets of the first tenant's service can be sent to the L7 proxy that includes the configuration information of the first tenant's service, and then the traffic management of the data packets of the first tenant's service can be performed through the L7 proxy.

在一种可能的实现方式中,代理集群还运行有第二L7代理,第二L7代理包括至少一个服务的配置信息;第一L4代理将第一租户的标识和第一数据包发送至第一L7代理,包括:当多个服务中属于第一租户的服务的数量大于至少一个服务中属于第一租户的服务的数量时,第一L4代理将第一租户的标识和第一数据包发送至第一L7代理。In one possible implementation, the proxy cluster also runs a second L7 proxy, and the second L7 proxy includes configuration information of at least one service; the first L4 proxy sends the identifier and the first data packet of the first tenant to the first L7 proxy, including: when the number of services belonging to the first tenant in multiple services is greater than the number of services belonging to the first tenant in at least one service, the first L4 proxy sends the identifier and the first data packet of the first tenant to the first L7 proxy.

为方便描述,包括服务的配置信息的L7代理可称为支持该服务的L7代理。优先选用支持第一租户较多服务的L7代理,对第一租户的服务的数据包进行流量管理,可以节省第一租户的业务容器组之间的数据传输,原因如下。For the convenience of description, the L7 proxy including the configuration information of the service can be referred to as the L7 proxy supporting the service. The L7 proxy supporting more services of the first tenant is preferably selected to manage the traffic of the data packets of the services of the first tenant, which can save the data transmission between the service container groups of the first tenant for the following reasons.

同一租户的两个或两个以上服务可能是顺序执行的,即一个服务的输出是下个服务的输入。L7代理在对同一租户的两个或两个以上服务的数据包进行流量管理时,该两个或两个以上服务共享路由缓存。其中,路由缓存保存了两个或两个以上服务的目标服务实例(即一个或一些具体的业务容器组)的地址。当两个或两个以上服务可以由同一业务容器组提供时,通过共享路由缓存的地址,L7代理可以将该两个或两个以上服务的数据包发送至同一目标服务实例,从而将该两个或两个以上服务的数据包调度到同一业务容器组中。如此,可以在同一业务容器组中完成该两个或两个以上服务的数据包的处理,节省了业务容器组之间的数据传输。Two or more services of the same tenant may be executed sequentially, that is, the output of one service is the input of the next service. When the L7 agent performs traffic management on data packets of two or more services of the same tenant, the two or more services share a routing cache. Among them, the routing cache saves the addresses of the target service instances (that is, one or some specific business container groups) of two or more services. When two or more services can be provided by the same business container group, by sharing the address of the routing cache, the L7 agent can send the data packets of the two or more services to the same target service instance, thereby scheduling the data packets of the two or more services to the same business container group. In this way, the processing of the data packets of the two or more services can be completed in the same business container group, saving data transmission between business container groups.

支持第一租户较多服务的L7代理支持第一租户中顺序执行的两个或两个以上服务的可能性越大,并且需要流量管理的服务可能属于两个或两个以上服务。因此,优先选用支持第一租户较多服务的L7代理,对第一租户的服务的数据包进行流量管理,提升了第一租户的两个或两个以上服务的数据包由同一业务容器组处理的概率,从而可以节省业务容器组之间的数据传输。The L7 proxy that supports more services of the first tenant is more likely to support two or more services executed sequentially in the first tenant, and the services that need traffic management may belong to two or more services. Therefore, the L7 proxy that supports more services of the first tenant is preferably used to perform traffic management on the data packets of the services of the first tenant, which increases the probability that the data packets of the two or more services of the first tenant are processed by the same service container group, thereby saving data transmission between service container groups.

在一种可能的实现方式中,代理集群还运行有第二L7代理,第二L7代理也包括第一服务的配置信息;第一L4代理将第一租户的标识和第一数据包发送至第一L7代理,包括:当第二L7代理的负载大于第一L7代理的负载时,第一L4代理将第一租户的标识和第一数据包发送至第一L7代理。In one possible implementation, the proxy cluster also runs a second L7 proxy, which also includes configuration information of the first service; the first L4 proxy sends the identifier and the first data packet of the first tenant to the first L7 proxy, including: when the load of the second L7 proxy is greater than the load of the first L7 proxy, the first L4 proxy sends the identifier and the first data packet of the first tenant to the first L7 proxy.

在该实现方式,优先选用负载小的L7代理对当前需要流量管理的服务进行流量管理,保障了多个L7代理之间的负载均衡,提升了多个L7代理的整体资源利用率。In this implementation, L7 proxies with small loads are preferentially selected to perform traffic management on services that currently require traffic management, thereby ensuring load balancing among multiple L7 proxies and improving the overall resource utilization of multiple L7 proxies.

在一种可能的实现方式中,服务网格系统还包括:与代理集群连接的控制台;该方法还包括:控制台将两个或两个以上服务的配置信息发送至代理集群中的同一L7代理;其中,两个或两个以上服务属于同一租户,或者,两个或两个以上服务中的一个服务的输出是另一个服务的输入。In one possible implementation, the service grid system also includes: a console connected to the proxy cluster; the method also includes: the console sends configuration information of two or more services to the same L7 proxy in the proxy cluster; wherein the two or more services belong to the same tenant, or the output of one of the two or more services is the input of another service.

将需要顺序执行的两个或两个以上服务的配置信息发送至同一L7代理,从而可以使用同一L7代理支持该两个或两个以上服务的数据包进行流量管理,使得该两个或两个以上的服务的数据包可调度到同一业务容器组中,由同一业务容器组处理该两个或两个以上服务的数据包,从而可以节省业务容器组之间的数据传输。The configuration information of two or more services that need to be executed sequentially is sent to the same L7 agent, so that the same L7 agent can be used to support traffic management of the data packets of the two or more services, so that the data packets of the two or more services can be scheduled to the same service container group, and the data packets of the two or more services are processed by the same service container group, thereby saving data transmission between service container groups.

在一种可能的实现方式中,代理集群运行有多个L7代理;其中,在多个L7代理中,同一L7代理包括最少数量服务的配置信息,或者,同一L7代理包括最少数量租户的配置信息。In a possible implementation, the proxy cluster runs multiple L7 proxies; wherein, among the multiple L7 proxies, the same L7 proxy includes configuration information of the least number of services, or the same L7 proxy includes configuration information of the least number of tenants.

在该实现方式中,在选择用于支持新创建的服务的L7代理时,优先选择支持较少服务的L7代理。如此,可以保障多个L7代理之间的负载均衡。或者,在选择用于支持新创建的服务的L7代理时,优先选择支持较少租户的L7代理。如此,可以避免同一L7代理同时成为多个租户的亲和L7代理,避免了该L7代理的负载过大。In this implementation, when selecting an L7 proxy to support a newly created service, an L7 proxy that supports fewer services is preferred. In this way, load balancing between multiple L7 proxies can be guaranteed. Alternatively, when selecting an L7 proxy to support a newly created service, an L7 proxy that supports fewer tenants is preferred. In this way, the same L7 proxy can be prevented from becoming an affinity L7 proxy for multiple tenants at the same time, thereby preventing the L7 proxy from being overloaded.

在一种可能的实现方式中,服务网格系统还包括第二业务节点,第二业务节点运行有第二L4代理和第三业务容器组;第一L7代理基于第一服务的配置信息,对第一数据包进行流量管理,包括:第一L7代理选择第三业务容器组为第一数据包的目标容器组;第一L7代理向第二L4代理发送第一数据包和第一租户的标识;该方法还包括:第二L4代理基于第一租户的标识,确认第一租户和第三业务容器组所属的租户是同一租户;第二L4代理将第一数据包发送至第三业务容器组。In a possible implementation, the service grid system also includes a second service node, and the second service node runs a second L4 agent and a third service container group; the first L7 agent performs traffic management on the first data packet based on the configuration information of the first service, including: the first L7 agent selects the third service container group as the target container group of the first data packet; the first L7 agent sends the first data packet and the identifier of the first tenant to the second L4 agent; the method also includes: the second L4 agent confirms that the first tenant and the tenant to which the third service container group belongs are the same tenant based on the identifier of the first tenant; the second L4 agent sends the first data packet to the third service container group.

在该实现方式中,服务网格出方向的L4代理在确认数据包所属租户和该数据包的目标业务容器组所属租户是同一租户的情况下,才将该数据包发送至目标业务容器组。如此,保障了租户之间的隔离。In this implementation, the L4 proxy in the outbound direction of the service grid sends the data packet to the target service container group only when it confirms that the tenant to which the data packet belongs and the tenant to which the target service container group of the data packet belongs are the same tenant. In this way, the isolation between tenants is guaranteed.

第二方面,提供了一种服务网格系统,服务网格系统包括第一业务节点和代理集群;其中,第一业务节点运行有第一L4代理和第一租户的第一业务容器组;代理集群运行有第一L7代理,第一L7代理包括多个服务的配置信息,多个服务中的不同服务属于同一租户或不同租户,服务的配置信息用于第一L7代理对服务的数据包进行流量管理;其中,第一L4代理用于:接收第一业务容器组发出的第一数据包;第一L4代理用于:将第一租户的标识和第一数据包发送至第一L7代理;第一L7代理用于:基于第一租户的标识,在多个服务的配置信息中识别第一服务的配置信息,第一服务属于第一租户;第一L7代理用于:基于第一服务的配置信息,对第一数据包进行流量管理。In a second aspect, a service grid system is provided, the service grid system comprising a first business node and an agent cluster; wherein the first business node runs a first L4 agent and a first business container group of a first tenant; the agent cluster runs a first L7 agent, the first L7 agent comprises configuration information of multiple services, different services among the multiple services belong to the same tenant or different tenants, and the configuration information of the service is used by the first L7 agent to perform traffic management on data packets of the service; wherein the first L4 agent is used to: receive a first data packet sent by the first business container group; the first L4 agent is used to: send an identifier of the first tenant and the first data packet to the first L7 agent; the first L7 agent is used to: based on the identifier of the first tenant, identify the configuration information of the first service in the configuration information of multiple services, the first service belongs to the first tenant; the first L7 agent is used to: based on the configuration information of the first service, perform traffic management on the first data packet.

在一种可能的实现方式中,第一业务节点还运行有第二租户的第二业务容器组;第一L4代理还用于:接收第二业务容器组发出的第二数据包;第一L4代理还用于:将第二租户的标识和第二数据包发送至第一L7代理;第一L7代理还用于:基于第二租户的标识,在多个服务的配置信息中识别第二服务的配置信息,第二服务属于第二租户;第一L7代理还用于:基于第二服务的配置信息,对第二数据包进行流量管理。In a possible implementation, the first service node also runs a second service container group of a second tenant; the first L4 agent is also used to: receive a second data packet sent by the second service container group; the first L4 agent is also used to: send the identifier of the second tenant and the second data packet to the first L7 agent; the first L7 agent is also used to: based on the identifier of the second tenant, identify the configuration information of the second service in the configuration information of multiple services, and the second service belongs to the second tenant; the first L7 agent is also used to: based on the configuration information of the second service, perform traffic management on the second data packet.

在一种可能的实现方式中,第一服务包括第一数据包对应的服务和其他服务;第一L7代理用于:基于第一数据包对应的服务的标识,在第一服务的配置信息中识别第一数据包对应的服务的配置信息;基于第一数据包对应的服务的配置信息,对第一数据包进行流量管理。In one possible implementation, the first service includes a service corresponding to the first data packet and other services; the first L7 agent is used to: based on an identifier of the service corresponding to the first data packet, identify configuration information of the service corresponding to the first data packet in the configuration information of the first service; and perform traffic management on the first data packet based on the configuration information of the service corresponding to the first data packet.

在一种可能的实现方式中,代理集群还运行有第二L7代理,第二L7代理包括至少一个服务的配置信息;第一L4代理用于:当多个服务中属于第一租户的服务的数量大于至少一个服务中属于第一租户的服务的数量时,将第一租户的标识和第一数据包发送至第一L7代理。In one possible implementation, the proxy cluster also runs a second L7 proxy, which includes configuration information of at least one service; the first L4 proxy is used to: when the number of services belonging to the first tenant in multiple services is greater than the number of services belonging to the first tenant in at least one service, send the first tenant's identifier and the first data packet to the first L7 proxy.

在一种可能的实现方式中,代理集群还运行有第二L7代理,第二L7代理也包括第一服务的配置信息;第一L4代理用于:当第二L7代理的负载大于第一L7代理的负载时,将第一租户的标识和第一数据包发送至第一L7代理。In one possible implementation, the proxy cluster also runs a second L7 proxy, which also includes configuration information of the first service; the first L4 proxy is used to: when the load of the second L7 proxy is greater than the load of the first L7 proxy, send the first tenant's identifier and the first data packet to the first L7 proxy.

在一种可能的实现方式中,服务网格系统还包括:与代理集群连接的控制台;控制台用于:将两个或两个以上服务的配置信息发送至代理集群中的同一L7代理;其中,两个或两个以上服务属于同一租户,或者,两个或两个以上服务中的一个服务的输出是另一个服务的输入。In one possible implementation, the service grid system also includes: a console connected to the proxy cluster; the console is used to: send configuration information of two or more services to the same L7 proxy in the proxy cluster; wherein the two or more services belong to the same tenant, or the output of one of the two or more services is the input of another service.

在一种可能的实现方式中,服务网格系统还包括第二业务节点,第二业务节点运行有第二L4代理和第三业务容器组;第一L7代理用于:选择第三业务容器组为第一数据包的目标容器组;向第二L4代理发送第一数据包和第一租户的标识;第二L4代理用于:基于第一租户的标识,确认第一租户和第三业务容器组所属的租户是同一租户;将第一数据包发送至第三业务容器组。In a possible implementation, the service grid system also includes a second service node, which runs a second L4 agent and a third service container group; the first L7 agent is used to: select the third service container group as the target container group of the first data packet; send the first data packet and the identifier of the first tenant to the second L4 agent; the second L4 agent is used to: confirm, based on the identifier of the first tenant, that the first tenant and the tenant to which the third service container group belongs are the same tenant; and send the first data packet to the third service container group.

第三方面,提供了一种流量管理方法,该方法应用于服务网格系统中的第一L7代理,服务网格系统包括第一业务节点和代理集群;其中,第一业务节点运行有第一L4代理和第一租户的第一业务容器组;第一L7代理运行在代理集群中,第一L7代理包括多个服务的配置信息,多个服务中的不同服务属于同一租户或不同租户,服务的配置信息用于第一L7代理对服务的数据包进行流量管理;该方法包括:第一L7代理接收第一L4代理发送的第一租户的标识和第一数据包,第一数据包是第一L4代理从第一业务容器组接收的;第一L7代理基于第一租户的标识,在多个服务的配置信息中识别第一服务的配置信息,第一服务属于第一租户;第一L7代理基于第一服务的配置信息,对第一数据包进行流量管理。In a third aspect, a traffic management method is provided, which is applied to a first L7 agent in a service grid system, wherein the service grid system includes a first business node and an agent cluster; wherein the first business node runs a first L4 agent and a first business container group of a first tenant; the first L7 agent runs in the agent cluster, the first L7 agent includes configuration information of multiple services, different services in the multiple services belong to the same tenant or different tenants, and the configuration information of the service is used by the first L7 agent to perform traffic management on data packets of the service; the method includes: the first L7 agent receives an identifier of the first tenant and a first data packet sent by the first L4 agent, the first data packet is received by the first L4 agent from the first business container group; the first L7 agent identifies the configuration information of the first service in the configuration information of multiple services based on the identifier of the first tenant, and the first service belongs to the first tenant; the first L7 agent performs traffic management on the first data packet based on the configuration information of the first service.

在一种可能的实现方式中,第一业务节点还运行有第二租户的第二业务容器组;该方法包括:第一L7代理接收第一L4代理发送的第二租户的标识和第二数据包,第二数据包是第一L4代理从第二业务容器组接收的;第一L4代理将第二租户的标识和第二数据包发送至第一L7代理;第一L7代理基于第二租户的标识,在多个服务的配置信息中识别第二服务的配置信息,第二服务属于第二租户;第一L7代理基于第二服务的配置信息,对第二数据包进行流量管理。In a possible implementation, the first service node also runs a second service container group of a second tenant; the method includes: a first L7 agent receives an identifier of the second tenant and a second data packet sent by a first L4 agent, where the second data packet is received by the first L4 agent from the second service container group; the first L4 agent sends the identifier of the second tenant and the second data packet to the first L7 agent; the first L7 agent identifies configuration information of the second service in configuration information of multiple services based on the identifier of the second tenant, and the second service belongs to the second tenant; the first L7 agent performs traffic management on the second data packet based on the configuration information of the second service.

在一种可能的实现方式中,第一服务包括第一数据包对应的服务和其他服务;第一L7代理基于第一服务的配置信息,对第一数据包进行流量管理,包括:第一L7代理基于第一数据包对应的服务的标识,在第一服务的配置信息中识别第一数据包对应的服务的配置信息;第一L7代理基于第一数据包对应的服务的配置信息,对第一数据包进行流量管理。In one possible implementation, the first service includes a service corresponding to the first data packet and other services; the first L7 agent performs traffic management on the first data packet based on the configuration information of the first service, including: the first L7 agent identifies the configuration information of the service corresponding to the first data packet in the configuration information of the first service based on an identifier of the service corresponding to the first data packet; the first L7 agent performs traffic management on the first data packet based on the configuration information of the service corresponding to the first data packet.

在一种可能的实现方式中,代理集群还运行有第二L7代理,第二L7代理包括至少一个服务的配置信息;第一L7代理接收第一L4代理发送第一租户的标识和第一数据包,包括:当多个服务中属于第一租户的服务的数量大于至少一个服务中属于第一租户的服务的数量时,第一L7代理接收第一L4代理发送的第一租户的标识和第一数据包。In a possible implementation, the proxy cluster also runs a second L7 proxy, which includes configuration information of at least one service; the first L7 proxy receives the identifier and the first data packet of the first tenant sent by the first L4 agent, including: when the number of services belonging to the first tenant in multiple services is greater than the number of services belonging to the first tenant in at least one service, the first L7 proxy receives the identifier and the first data packet of the first tenant sent by the first L4 agent.

在一种可能的实现方式中,代理集群还运行有第二L7代理,第二L7代理也包括第一服务的配置信息;第一L7代理接收第一L4代理发送的第一租户的标识和第一数据包,包括:当第二L7代理的负载大于第一L7代理的负载时,第一L7代理接收第一L4代理发送的第一租户的标识和第一数据包。In one possible implementation, the proxy cluster also runs a second L7 proxy, which also includes configuration information of the first service; the first L7 proxy receives the identifier and the first data packet of the first tenant sent by the first L4 proxy, including: when the load of the second L7 proxy is greater than the load of the first L7 proxy, the first L7 proxy receives the identifier and the first data packet of the first tenant sent by the first L4 proxy.

在一种可能的实现方式中,服务网格系统还包括:与代理集群连接的控制台;该方法还包括:第一L7代理从控制台接收并记录两个或两个以上服务的配置信息;其中,两个或两个以上服务属于同一租户,或者,两个或两个以上服务中的一个服务的输出是另一个服务的输入。In one possible implementation, the service grid system also includes: a console connected to the proxy cluster; the method also includes: a first L7 proxy receives and records configuration information of two or more services from the console; wherein the two or more services belong to the same tenant, or the output of one of the two or more services is the input of another service.

在一种可能的实现方式中,服务网格系统还包括第二业务节点,第二业务节点运行有第二L4代理和第三业务容器组;第一L7代理基于第一服务的配置信息,对第一数据包进行流量管理,包括:第一L7代理选择第三业务容器组为第一数据包的目标容器组;第一L7代理向第二L4代理发送第一数据包和第一租户的标识;其中,第二L4代理用于:基于第一租户的标识,确认第一租户和第三业务容器组所属的租户是同一租户;将第一数据包发送至第三业务容器组。In a possible implementation, the service grid system also includes a second service node, and the second service node runs a second L4 agent and a third service container group; the first L7 agent performs traffic management on the first data packet based on the configuration information of the first service, including: the first L7 agent selects the third service container group as the target container group of the first data packet; the first L7 agent sends the first data packet and the identifier of the first tenant to the second L4 agent; wherein the second L4 agent is used to: based on the identifier of the first tenant, confirm that the first tenant and the tenant to which the third service container group belongs are the same tenant; and send the first data packet to the third service container group.

第四方面,提供了一种流量管理装置,该装置配置于服务网格系统中的第一L7代理,服务网格系统包括第一业务节点和代理集群;其中,第一业务节点运行有第一L4代理和第一租户的第一业务容器组;第一L7代理运行在代理集群中,第一L7代理包括多个服务的配置信息,多个服务中的不同服务属于同一租户或不同租户,服务的配置信息用于第一L7代理对服务的数据包进行流量管理;该装置包括:接收模块,用于接收第一L4代理发送的第一租户的标识和第一数据包,第一数据包是第一L4代理从第一业务容器组接收的;识别模块,用于基于第一租户的标识,在多个服务的配置信息中识别第一服务的配置信息,第一服务属于第一租户;管理模块,用于基于第一服务的配置信息,对第一数据包进行流量管理。In a fourth aspect, a traffic management device is provided, which is configured in a first L7 agent in a service grid system, and the service grid system includes a first business node and an agent cluster; wherein the first business node runs a first L4 agent and a first business container group of a first tenant; the first L7 agent runs in the agent cluster, and the first L7 agent includes configuration information of multiple services, different services in the multiple services belong to the same tenant or different tenants, and the configuration information of the service is used by the first L7 agent to perform traffic management on data packets of the service; the device includes: a receiving module, which is used to receive an identifier of the first tenant and a first data packet sent by the first L4 agent, and the first data packet is received by the first L4 agent from the first business container group; an identification module, which is used to identify the configuration information of the first service in the configuration information of multiple services based on the identifier of the first tenant, and the first service belongs to the first tenant; a management module, which is used to perform traffic management on the first data packet based on the configuration information of the first service.

在一种可能的实现方式中,第一业务节点还运行有第二租户的第二业务容器组;接收模块还用于:接收第一L4代理发送的第二租户的标识和第二数据包,第二数据包是第一L4代理从第二业务容器组接收的;识别模块还用于:基于第二租户的标识,在多个服务的配置信息中识别第二服务的配置信息,第二服务属于第二租户;管理模块还用于:基于第二服务的配置信息,对第二数据包进行流量管理。In a possible implementation, the first service node also runs a second service container group of a second tenant; the receiving module is further used to: receive an identifier of the second tenant and a second data packet sent by the first L4 agent, where the second data packet is received by the first L4 agent from the second service container group; the identification module is further used to: based on the identifier of the second tenant, identify configuration information of the second service in configuration information of multiple services, where the second service belongs to the second tenant; the management module is further used to: perform traffic management on the second data packet based on the configuration information of the second service.

在一种可能的实现方式中,第一服务包括第一数据包对应的服务和其他服务;管理模块用于:基于第一数据包对应的服务的标识,在第一服务的配置信息中识别第一数据包对应的服务的配置信息;基于第一数据包对应的服务的配置信息,对第一数据包进行流量管理。In one possible implementation, the first service includes a service corresponding to the first data packet and other services; the management module is used to: based on an identifier of the service corresponding to the first data packet, identify configuration information of the service corresponding to the first data packet in the configuration information of the first service; and perform traffic management on the first data packet based on the configuration information of the service corresponding to the first data packet.

在一种可能的实现方式中,代理集群还运行有第二L7代理,第二L7代理包括至少一个服务的配置信息;接收模块用于:当多个服务中属于第一租户的服务的数量大于至少一个服务中属于第一租户的服务的数量时,接收第一L4代理发送的第一租户的标识和第一数据包。In one possible implementation, the proxy cluster also runs a second L7 proxy, which includes configuration information of at least one service; the receiving module is used to: when the number of services belonging to the first tenant in multiple services is greater than the number of services belonging to the first tenant in at least one service, receive the identifier of the first tenant and the first data packet sent by the first L4 agent.

在一种可能的实现方式中,代理集群还运行有第二L7代理,第二L7代理也包括第一服务的配置信息;接收模块用于:当第二L7代理的负载大于第一L7代理的负载时,接收第一L4代理发送的第一租户的标识和第一数据包。In a possible implementation, the proxy cluster also runs a second L7 proxy, which also includes configuration information of the first service; the receiving module is used to: when the load of the second L7 proxy is greater than the load of the first L7 proxy, receive the identifier of the first tenant and the first data packet sent by the first L4 proxy.

在一种可能的实现方式中,服务网格系统还包括:与代理集群连接的控制台;接收模块用于:从控制台接收并记录两个或两个以上服务的配置信息;其中,两个或两个以上服务属于同一租户,或者,两个或两个以上服务中的一个服务的输出是另一个服务的输入。In one possible implementation, the service grid system also includes: a console connected to the proxy cluster; a receiving module is used to: receive and record configuration information of two or more services from the console; wherein the two or more services belong to the same tenant, or the output of one of the two or more services is the input of another service.

在一种可能的实现方式中,服务网格系统还包括第二业务节点,第二业务节点运行有第二L4代理和第三业务容器组;管理模块用于:第一L7代理选择第三业务容器组为第一数据包的目标容器组;第一L7代理向第二L4代理发送第一数据包和第一租户的标识;其中,第二L4代理用于:基于第一租户的标识,确认第一租户和第三业务容器组所属的租户是同一租户;将第一数据包发送至第三业务容器组。In a possible implementation, the service grid system also includes a second service node, and the second service node runs a second L4 agent and a third service container group; the management module is used for: the first L7 agent selects the third service container group as the target container group of the first data packet; the first L7 agent sends the first data packet and the identifier of the first tenant to the second L4 agent; wherein the second L4 agent is used for: based on the identifier of the first tenant, confirming that the first tenant and the tenant to which the third service container group belongs are the same tenant; and sending the first data packet to the third service container group.

第五方面,提供了一种计算设备集群,包括至少一个计算设备,每个计算设备包括处理器和存储器;至少一个计算设备的处理器用于执行至少一个计算设备的存储器中存储的指令,以使得计算设备集群执行第二方面提供的方法。In a fifth aspect, a computing device cluster is provided, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster executes the method provided in the second aspect.

第六方面,提供了一种计算机可读存储介质,包括计算机程序指令,当计算机程序指令由计算设备集群执行时,计算设备集群执行第二方面提供的方法。In a sixth 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 second aspect.

第七方面,提供了一种包含指令的计算机程序产品,当指令被计算机设备集群运行时,使得计算机设备集群执行第二方面提供的方法。In a seventh 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 second aspect.

第二方面至第七方面的有益效果可参考上文对第一方面的有益效果的介绍,在此不再赘述。。The beneficial effects of the second aspect to the seventh aspect can be referred to the above description of the beneficial effects of the first aspect, and will not be repeated here.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本申请实施例提供的一种服务网格系统的结构示意图;FIG1 is a schematic diagram of the structure of a service grid system provided in an embodiment of the present application;

图2为本申请实施例提供的L7代理的结构示意图;FIG2 is a schematic diagram of the structure of an L7 proxy provided in an embodiment of the present application;

图3为本申请实施例提供的一种服务配置方法的示意图;FIG3 is a schematic diagram of a service configuration method provided in an embodiment of the present application;

图4为本申请实施例提供的一种服务配置方法的示意图;FIG4 is a schematic diagram of a service configuration method provided in an embodiment of the present application;

图5为本申请实施例提供的一种服务配置方法的流程图;FIG5 is a flow chart of a service configuration method provided in an embodiment of the present application;

图6为本申请实施例提供的一种流量管理方法的流程图;FIG6 is a flow chart of a traffic management method provided in an embodiment of the present application;

图7为本申请实施例提供的一种流量管理方法的流程图;FIG7 is a flow chart of a traffic management method provided in an embodiment of the present application;

图8为本申请实施例提供的一种流量管理装置的结构示意图;FIG8 is a schematic diagram of the structure of a flow management device provided in an embodiment of the present application;

图9为本申请实施例提供的一种计算设备的结构示意图;FIG9 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;

图10为本申请实施例提供的一种计算设备集群的结构示意图;FIG10 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;

图11为本申请实施例提供的一种计算设备集群通过网络连接的结构示意图。FIG. 11 is a schematic diagram of a structure in which a computing device cluster is connected via a network, provided in an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

下面将结合附图对本申请实施例提供的方案进行描述。其中,在本申请实施例中,“多个”是指两个或两个以上。“第一”、“第二”等仅是用于区别类似的对象,不必用于描述特定的顺序或对象数量。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, "plurality" refers to two or more. "First", "second", etc. are only used to distinguish similar objects and are not necessarily used to describe a specific order or number of objects.

为便于理解本申请实施例提供的方案,先对本申请实施例可能涉及的技术用语进行介绍。To facilitate understanding of the solutions provided by the embodiments of the present application, the technical terms that may be involved in the embodiments of the present application are first introduced.

微服务架构(microservice architecture):是一种面向服务的架构(service oriented architecture,SOA),其将复杂系统切分为多个小服务或者说应用。可以将该小服务或者说应用称为微服务。每个微服务负责实现一个独立的业务逻辑。微服务是围绕业务功能进行构建的,可以独立部署。微服务之间通过相互依赖,从而可以提供一系列的功能。微服务易于被理解和修改,带来了语言和框架选择灵活性。微服务可以运行在容器(container)中。其中,多个相互之间依赖性较高微服务所在的容器可以构成一个容器组。其中,在K8S(kubernetes)系统中,容器组可封装成为一个pod。Microservice architecture (microservice architecture): It 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.

业务容器:是指运行微服务的容器。Business container: refers to the container that runs microservices.

业务容器组:由多个业务容器组构成的容器组。通常,同一容器组中的业务容器运行的微服务之间的依赖性较高。Business container group: A container group consisting of multiple business container groups. Usually, the microservices running in the business containers in the same container group have high dependencies.

服务网格:即service mesh,是一种通过业务容器外的数据代理对业务容器提供的服务(例如微服务)进行服务治理的技术。具体而言,数据代理获取业务容器发出的数据包,并对数据包进行服务治理(例如流量管理),以将该数据包发送至目标容器组的数据代理。目标容器组的数据代理,将该数据包发送至目标容器组。其中,可以将容器组发出的数据包被数据代理获取的行为称为入服务网格,数据代理将数据包发送至目标容器组的行为称为出服务网格。Service mesh: Service mesh is a technology that manages services (such as microservices) provided by business containers through data agents outside business containers. Specifically, the data agent obtains data packets sent by the business container and performs service management (such as traffic management) on the data packets to send the data packets to the data agent of the target container group. The data agent of the target container group sends the data packet to the target container group. Among them, the behavior of the data packet sent by the container group being obtained by the data agent can be called entering the service mesh, and the behavior of the data agent sending the data packet to the target container group is called exiting the service mesh.

服务治理:也称SOA治理(SOA governance),是用来保障微服务架构的各微服务实例可正常工作以及不同微服务实例之间可正常通信的手段的总称。其中,微服务实例也可称为服务实例或业务容器实例。Service governance: also known as SOA governance, is a general term for the means to ensure that each microservice instance of the microservice architecture can work normally and that different microservice instances can communicate normally. Among them, microservice instances can also be called service instances or business container instances.

流量管理:也称为流量服务治理,为服务治理中的一种。流量管理通常包括流量路由、负载均衡、流量控制、流量观测等。Traffic management: also known as traffic service governance, is a type of service governance. Traffic management usually includes traffic routing, load balancing, traffic control, traffic observation, etc.

服务的配置信息:是用于数据代理对服务的数据包进行流量管理的信息。其中,服务的数据包是发向该服务的服务实例的数据包。服务的配置信息可以包括服务的服务实例的数量、服务实例的地址、服务实例的最大处理能力等。示例性的,服务实例的最大处理能力可以是服务实例的吞吐量。Service configuration information: information used by the data proxy to manage the traffic of service data packets. The service data packets are data packets sent to the service instances of the service. The service configuration information may include the number of service instances of the service, the addresses of the service instances, the maximum processing capacity of the service instances, etc. Exemplarily, the maximum processing capacity of the service instances may be the throughput of the service instances.

数据代理:也称数据面代理,是用于在数据面对服务实例进行服务治理的模块或装置。数据代理可以是进程,其中,数据代理进程可运行在容器中。在边车模式中,数据代理是边车。在ambient模式中数据代理包括传输层代理和应用层代理。在开放系统互联(open system interconnection,OSI)网络模型中,传输层是第四层(layer 4,L4),应用层是第七层(L7),因此,传输层代理也可以称为L4代理,应用层代理也可以称为L7代理。其中,L4代理用于实现低级流量管理,例如基于传输控制协议(transmission control protocol,TCP)对数据包进行路由。L7代理用于实现高级流量管理,例如基于数据包中的服务的元数据信息(例如服务名称、版本等)对数据包进行路由。L4代理和L7代理的功能将在下文进行具体介绍,在此不再赘述。Data agent: also known as data plane agent, is a module or device used to perform service governance on service instances on the data plane. Data agent can be a process, wherein the data agent process can run in a container. In the sidecar mode, the data agent is a sidecar. In the ambient mode, the data agent includes a transport layer agent and an application layer agent. In the open system interconnection (OSI) network model, the transport layer is the fourth layer (layer 4, L4) and the application layer is the seventh layer (L7). Therefore, the transport layer agent can also be called an L4 agent, and the application layer agent can also be called an L7 agent. Among them, the L4 agent is used to implement low-level traffic management, such as routing data packets based on the transmission control protocol (TCP). The L7 agent is used to implement high-level traffic management, such as routing data packets based on the metadata information of the service in the data packet (such as service name, version, etc.). The functions of the L4 agent and the L7 agent will be specifically introduced below and will not be repeated here.

节点:用于运行业务容器组和/或数据代理。典型的节点有虚拟机(virtual machine,VM)、计算机(例如服务器)、裸金属服务器(bare metal server)等。其中,用于运行业务容器组的节点可称为业务节点,其中,在本申请实施例中,L4代理也运行在业务节点中。用于运行L7代理的节点可称为代理节点。一个或多个业务节点可组成业务集群,一个或多个代理节点可组成代理集群。代理集群也可称为托管集群或代理托管集群。Node: used to run a business container group and/or a data agent. Typical nodes include virtual machines (VMs), computers (e.g., servers), bare metal servers, etc. Among them, the node used to run a business container group can be called a business node, wherein, in the embodiment of the present application, the L4 agent also runs in the business node. The node used to run the L7 agent can be called an agent node. One or more business nodes can form a business cluster, and one or more agent nodes can form an agent cluster. The agent cluster can also be called a hosting cluster or an agent hosting cluster.

在相关技术中,为了在不同租户之间实现隔离,每个租户均独占L7代理。具体而言,租户负责创建并维护该租户的L7代理,并且该租户的L7代理仅对该租户的业务容器组发出的数据包进行流量管理。服务网格系统存在数量众多的租户,并且,每个租户可能创建多个L7代理,这使得服务网格系统中存在大量的L7代理。其中,每个L7代理运行在单独的容器中的,大量的代理需要大量的容器。每个容器有独占固定的计算资源,例如中央处理器(central processing unit,CPU)、内存资源等。通常,租户的业务有繁忙阶段和空闲阶段。在租户的业务的空闲阶段,该租户的L7代理处于闲置状态,导致计算资源利用率低。In the related art, in order to achieve isolation between different tenants, each tenant has an exclusive L7 agent. Specifically, the tenant is responsible for creating and maintaining the tenant's L7 agent, and the tenant's L7 agent only performs traffic management on the data packets sent by the tenant's business container group. There are a large number of tenants in the service grid system, and each tenant may create multiple L7 agents, which means that there are a large number of L7 agents in the service grid system. Among them, each L7 agent runs in a separate container, and a large number of agents require a large number of containers. Each container has exclusive fixed computing resources, such as a central processing unit (CPU), memory resources, etc. Usually, a tenant's business has a busy phase and an idle phase. In the idle phase of the tenant's business, the tenant's L7 agent is idle, resulting in low computing resource utilization.

并且,大量的L7代理的调度压力较大,例如,需要大量的工作选择用于部署L7代理的节点。Moreover, the scheduling pressure of a large number of L7 agents is relatively high. For example, a large amount of work is required to select nodes for deploying L7 agents.

以及,由于L7代理是租户独占的,而不同租户的服务的数量可能不同,需要的L7代理的数量也不同。因此,难以由服务网格系统的管理员进行统一的L7代理创建和维护,需要租户自己创建和维护L7代理。租户维护L7代理,增加了租户的工作量。并且,租户往往缺乏专业知识,难以对L7代理进行专业的维护,导致L7代理出现故障的风险较大。例如,当升级L7代理时,由于租户缺乏专业知识,L7代理升级存在很大的识别风险。Also, since the L7 agent is exclusive to tenants, and the number of services of different tenants may be different, the number of L7 agents required is also different. Therefore, it is difficult for the administrator of the service grid system to create and maintain a unified L7 agent, and tenants need to create and maintain the L7 agent themselves. Tenants maintain the L7 agent, which increases the workload of tenants. In addition, tenants often lack professional knowledge and find it difficult to professionally maintain the L7 agent, resulting in a greater risk of L7 agent failure. For example, when upgrading the L7 agent, due to the lack of professional knowledge of the tenants, there is a great risk of identification of the L7 agent upgrade.

另外,租户往往会创建多个L7代理,L7代理的数量超出了租户的业务需要,这导致了计算资源的浪费。而且,相关技术中的控制台每当检测到L7代理创建时,将该L7代理所属租户的所有服务的配置信息发送至该L7代理中。也就是说,租户的每个L7代理均存储了该租户的所有服务的配置信息,这导致服务的配置信息高冗余地存储在L7代理中,耗费了大量的内存资源。In addition, tenants often create multiple L7 proxies, and the number of L7 proxies exceeds the business needs of tenants, which leads to a waste of computing resources. Moreover, whenever the console in the related art detects the creation of an L7 proxy, it sends the configuration information of all services of the tenant to which the L7 proxy belongs to the L7 proxy. In other words, each L7 proxy of a tenant stores the configuration information of all services of the tenant, which results in the highly redundant storage of the service configuration information in the L7 proxy, consuming a large amount of memory resources.

参阅图1,本申请实施例提供了一种服务网格系统,该服务网格系统包括一个或多个业务节点和代理集群。业务节点用于运行业务容器组和L4代理,代理集群用于运行L7代理。L7代理可以包括多个服务的配置信息。其中,对该多个服务中的不同服务可以分别属于不同的租户,也就是说,同一L7代理可以包括不同租户的服务的配置信息。服务的配置信息用于L7代理该服务的数据包进行流量管理,也就是说,同一L7代理可以对不同租户的服务的数据包进行流量管理,即多个租户可以共享L7代理。当某个租户的业务容器组发出数据包时,L4代理可以将该数据包和该租户的标识发送至L7代理。L7代理可以基于租户的标识从多个服务的配置信息中识别该租户的服务的配置信息,然后,可以基于该租户的服务的配置信息对该数据包进行流量管理。Referring to FIG. 1 , an embodiment of the present application provides a service grid system, which includes one or more service nodes and an agent cluster. The service node is used to run a service container group and an L4 agent, and the agent cluster is used to run an L7 agent. The L7 agent may include configuration information of multiple services. Different services among the multiple services may belong to different tenants, respectively, that is, the same L7 agent may include configuration information of services of different tenants. The configuration information of the service is used by the L7 agent to perform traffic management on the data packets of the service, that is, the same L7 agent can perform traffic management on the data packets of services of different tenants, that is, multiple tenants can share the L7 agent. When a data packet is sent by a service container group of a tenant, the L4 agent may send the data packet and the identifier of the tenant to the L7 agent. The L7 agent may identify the configuration information of the tenant's service from the configuration information of multiple services based on the identifier of the tenant, and then, the data packet may be traffic managed based on the configuration information of the tenant's service.

在本申请实施例提供的服务网格系统中,多个租户共享L7代理,提升了L7代理的计算资源利用率。具体而言,不同租户的业务的空闲阶段通常是不同的,当一部分租户的业务处于空闲阶段时,另一部分的租户的业务可能处于繁忙阶段,如此,可避免L7代理处于闲置状态,提升了L7代理的计算资源利用率。In the service grid system provided in the embodiment of the present application, multiple tenants share the L7 proxy, which improves the computing resource utilization of the L7 proxy. Specifically, the idle phases of the services of different tenants are usually different. When the services of some tenants are in the idle phase, the services of other tenants may be in the busy phase. In this way, the L7 proxy can be prevented from being idle, which improves the computing resource utilization of the L7 proxy.

并且,多个租户共享L7代理,无需每个租户均创建L7代理,可减少服务网格系统中L7代理的数量。这不仅可以降低在服务网格系统中部署L7代理所需的计算资源,还可以降低L7代理的调度压力。In addition, multiple tenants share the L7 proxy, and each tenant does not need to create an L7 proxy, which can reduce the number of L7 proxies in the service grid system. This can not only reduce the computing resources required to deploy the L7 proxy in the service grid system, but also reduce the scheduling pressure of the L7 proxy.

以及,L7代理由多个租户共享,说明无需按照租户粒度创建L7代理了。服务网格系统的管理员可以在代理集群中预先创建一个或多个L7代理,每当有新的服务创建时,服务网格系统的控制台可以将该服务的配置信息发送至L7代理中,使得L7代理可基于该服务的配置信息对该服务的数据包进行流量管理。In addition, the L7 proxy is shared by multiple tenants, which means that there is no need to create L7 proxies at the tenant level. The administrator of the service grid system can pre-create one or more L7 proxies in the proxy cluster. Whenever a new service is created, the service grid system console can send the configuration information of the service to the L7 proxy, so that the L7 proxy can manage the traffic of the service data packets based on the configuration information of the service.

另外,L7代理由管理员统一创建,可以控制服务的配置信息的冗余度。具体而言,每当有新的服务创建时,服务网格系统的控制台可以将该服务的配置信息发送至N个L7代理中,其中,N是大于或等于1的整数,其中,N的大小可由管理员设置。如此,可以避免服务的配置信息高冗余地存储在L7代理中,节省了L7代理的内存资源。In addition, L7 proxies are created uniformly by administrators, and the redundancy of service configuration information can be controlled. Specifically, whenever a new service is created, the service grid system console can send the service configuration information to N L7 proxies, where N is an integer greater than or equal to 1, and the size of N can be set by the administrator. In this way, the service configuration information can be prevented from being stored in the L7 proxy with high redundancy, saving the memory resources of the L7 proxy.

接下来,对本申请实施例提供的服务网格系统进行具体介绍。Next, the service grid system provided in the embodiment of the present application is introduced in detail.

如图1所示,服务网格系统包括多个业务节点,例如业务节点100和业务节点200。一个业务节点可以部署有多个业务容器组以及至少一个L4代理。例如,业务节点100部署有业务容器组110、业务容器组120以及L4代理130等。再例如,业务节点200部署有业务容器组210、业务容器组220以及L4代理230等。其中,同一业务节点中的不同的业务容器组可以属于不同的租户,也可以属于同一租户。同一租户可以在不同的业务节点中部署业务容器组。例如,业务容器组110和业务容器组210属于租户A1,业务容器组120和业务容器组220属于租户A2。L4代理为节点级别,即L4代理可以管理该L4代理所在的业务节点中的多个业务容器组发出的数据包。例如,为业务容器组发出的数据包选择L7代理,并建立L4代理与选择的L7代理之间的连接(例如TCP连接)。As shown in FIG1 , the service grid system includes a plurality of service nodes, such as service node 100 and service node 200. A service node may be deployed with a plurality of service container groups and at least one L4 agent. For example, service node 100 is deployed with service container group 110, service container group 120, and L4 agent 130, etc. For another example, service node 200 is deployed with service container group 210, service container group 220, and L4 agent 230, etc. Among them, different service container groups in the same service node may belong to different tenants or to the same tenant. The same tenant may deploy service container groups in different service nodes. For example, service container group 110 and service container group 210 belong to tenant A1, and service container group 120 and service container group 220 belong to tenant A2. The L4 agent is at the node level, that is, the L4 agent may manage data packets sent by multiple service container groups in the service node where the L4 agent is located. For example, an L7 agent is selected for a data packet sent by a service container group, and a connection (e.g., a TCP connection) is established between the L4 agent and the selected L7 agent.

服务网格系统包括代理集群300。代理集群300由至少一个代理节点组成。代理集群300可部署有一个或多个L7代理,例如L7代理310和/或L7代理320。其中,一个L7代理可以运行在代理集群300中的一个或多个代理节点中。另外,一个代理节点可以运行一个或多个L7代理。The service grid system includes a proxy cluster 300. The proxy cluster 300 is composed of at least one proxy node. The proxy cluster 300 may be deployed with one or more L7 proxies, such as an L7 proxy 310 and/or an L7 proxy 320. Among them, one L7 proxy may run in one or more proxy nodes in the proxy cluster 300. In addition, one proxy node may run one or more L7 proxies.

L7代理可以包括多个服务的配置信息,L7代理可以基于服务的配置信息对该服务的数据包进行流量管理。其中,该多个服务中的不同服务可以属于同一租户,也可以属于不同租户。即该多个服务中的不同服务可以是同一租户的业务容器组提供的服务,也可以是不同租户的业务容器组提供的服务。换言之,L7代理不再以租户粒度进行流量管理,而是以服务粒度进行流量管理。The L7 proxy may include configuration information of multiple services, and the L7 proxy may perform traffic management on the data packets of the service based on the configuration information of the service. Among them, different services in the multiple services may belong to the same tenant or different tenants. That is, different services in the multiple services may be services provided by the business container group of the same tenant or services provided by the business container group of different tenants. In other words, the L7 proxy no longer performs traffic management at the tenant granularity, but at the service granularity.

在一些实施例中,如图2所示,L4代理130具有拦截模块131、获取模块132和发送模块133。拦截模块131可以拦截业务节点100中的业务容器组发出的数据包,使得业务容器组发出的数据包进入服务网格。例如,业务容器组110发出数据包111,拦截模块131拦截数据包111。获取模块132可以解析数据包111,得到业务容器组110的标识。示例性的,容器组的标识可以是容器组的网际协议(internet protocol,IP)地址。其中,获取模块132可以解析数据包111,得到源IP(source IP,SrcIP)地址,从而得到业务容器组110的IP地址。然后,获取模块132可以基于业务容器组110的标识,从服务网格系统的网格控制台400中获取业务容器组110所属租户的标识。In some embodiments, as shown in FIG. 2 , the L4 agent 130 has an interception module 131, an acquisition module 132, and a sending module 133. The interception module 131 can intercept a data packet sent by a service container group in the service node 100, so that the data packet sent by the service container group enters the service grid. For example, the service container group 110 sends a data packet 111, and the interception module 131 intercepts the data packet 111. The acquisition module 132 can parse the data packet 111 to obtain an identifier of the service container group 110. Exemplarily, the identifier of the container group can be an Internet protocol (IP) address of the container group. Among them, the acquisition module 132 can parse the data packet 111 to obtain a source IP (source IP, SrcIP) address, thereby obtaining the IP address of the service container group 110. Then, the acquisition module 132 can obtain the identifier of the tenant to which the service container group 110 belongs from the grid console 400 of the service grid system based on the identifier of the service container group 110.

其中,网格控制台也可以称为网格控制面或控制台,用于控制服务网格系统中的L7代理、L4代理等,以及为服务网格系统的管理员提供用于管理服务网格系统的接口(例如应用程序编程接口(application programming interface,API))等。Among them, the grid console can also be called the grid control plane or console, which is used to control the L7 agent, L4 agent, etc. in the service grid system, and provide administrators of the service grid system with interfaces for managing the service grid system (such as application programming interface (API)).

L4代理130中的发送模块133可以将数据包111和租户的标识发送至L7代理310。The sending module 133 in the L4 agent 130 may send the data packet 111 and the identifier of the tenant to the L7 agent 310 .

在一些实施例中,如图2所示,L7代理310包括一个或多个监听器,例如监听器311、监听器312等。在一个示例中,数据包111可以包括数据包111所请求服务的服务标识。在一个例子中,服务标识可以是服务IP(service IP,Svc IP)。L7代理310中的不同监听器对应不同的服务,监听器用于监听该监听器对应的服务的数据包。其中,监听器可以检测发送到L7代理310的数据包中的服务标识,若该服务标识所代表的服务是该监听器对应的服务,则该监听器接收该数据包。In some embodiments, as shown in FIG. 2 , the L7 agent 310 includes one or more listeners, such as a listener 311, a listener 312, etc. In one example, the data packet 111 may include a service identifier of a service requested by the data packet 111. In one example, the service identifier may be a service IP (service IP, Svc IP). Different listeners in the L7 agent 310 correspond to different services, and the listener is used to listen to data packets of the service corresponding to the listener. Among them, the listener can detect the service identifier in the data packet sent to the L7 agent 310, and if the service represented by the service identifier is the service corresponding to the listener, the listener receives the data packet.

在一些实施例中,如图2所示,L7代理310包括多个租户监听器。其中,多个租户监听器中不同租户监听器用于监听并接收不同租户的服务的数据包。例如,租户A1的监听器用于监听并接收租户A1的服务的数据包(例如数据包111),租户A2的监听器用于监听并接收租户A2的服务的数据包(例如数据包121)。In some embodiments, as shown in FIG2 , the L7 agent 310 includes multiple tenant listeners. Among the multiple tenant listeners, different tenant listeners are used to listen to and receive data packets of services of different tenants. For example, the listener of tenant A1 is used to listen to and receive data packets of services of tenant A1 (e.g., data packet 111), and the listener of tenant A2 is used to listen to and receive data packets of services of tenant A2 (e.g., data packet 121).

L7代理310包括多个租户服务监听器。其中,租户服务监听器用于监听并接收租户的某个服务。其中,由于不同租户的服务的服务标识可能相同,在L7代理中,服务标识联合租户的标识用于标识服务。也就是说,服务的唯一标识由该服务的服务标识和该服务的租户的标识组成。例如,租户A1的服务1的唯一标识由服务1的标识和租户A1的标识组成,租户A2的服务2的唯一标识由服务2的标识和租户A2的标识组成。The L7 agent 310 includes multiple tenant service listeners. The tenant service listener is used to listen to and receive a service of a tenant. Since the service identifiers of services of different tenants may be the same, in the L7 agent, the service identifier and the tenant identifier are used to identify the service. In other words, the unique identifier of the service consists of the service identifier of the service and the identifier of the tenant of the service. For example, the unique identifier of service 1 of tenant A1 consists of the identifier of service 1 and the identifier of tenant A1, and the unique identifier of service 2 of tenant A2 consists of the identifier of service 2 and the identifier of tenant A2.

继续参阅图2,L7代理310包括流量管理模块313。在接收到数据包111后,流量管理模块313可以从保存的多个服务的配置信息获取租户A1的服务的配置信息,然后,基于租户A1的服务的配置信息对数据包111进行流量管理,例如基于服务实例负载均衡(load balance,LB)策略,选择数据包111的目标服务实例,并向选择出的目标服务实例发送数据包111。Continuing to refer to FIG. 2 , the L7 proxy 310 includes a traffic management module 313. After receiving the data packet 111, the traffic management module 313 can obtain the configuration information of the service of the tenant A1 from the configuration information of the saved multiple services, and then perform traffic management on the data packet 111 based on the configuration information of the service of the tenant A1, for example, based on the service instance load balancing (LB) strategy, select the target service instance of the data packet 111, and send the data packet 111 to the selected target service instance.

在一些实施例中,L7代理310还包括观测模块314。其中,观测模块314用于观测和统计向某个服务实例发送数据包的路径、时间等信息。观测模块314基于观测到的信息,得到观测报告,并向服务网格系统的观测中心上报观测报告。In some embodiments, the L7 agent 310 further includes an observation module 314. The observation module 314 is used to observe and collect statistics on the path, time, and other information of sending a data packet to a certain service instance. The observation module 314 obtains an observation report based on the observed information and reports the observation report to the observation center of the service grid system.

上文大概介绍了L7代理的功能。接下来,介绍L7代理的部署方式。The above article briefly introduces the functions of L7 proxy. Next, we will introduce how to deploy L7 proxy.

在本申请实施例中,部署在代理集群300中的L7代理是服务网格系统的管理员创建的。在一些实施例中,在服务网格系统正式投入使用之前,服务网格系统的管理员可以在代理集群300中创建一个或多个L7代理。例如,服务网格系统的管理员可以基于服务网格系统的容量,创建相应数量的L7代理。其中,服务网格系统的容量是指服务网格系统最多可部署的业务容器组的数量。In the embodiment of the present application, the L7 proxy deployed in the proxy cluster 300 is created by the administrator of the service grid system. In some embodiments, before the service grid system is officially put into use, the administrator of the service grid system can create one or more L7 proxies in the proxy cluster 300. For example, the administrator of the service grid system can create a corresponding number of L7 proxies based on the capacity of the service grid system. The capacity of the service grid system refers to the maximum number of business container groups that can be deployed by the service grid system.

参阅图3,每当有租户的服务创建时,网格控制台400可以将该服务的配置信息、服务的标识、A1的标识发送至一个或多个L7代理中,使得L7代理可以基于该服务的配置信息对该服务的数据包进行流量管理。在一些实施例中,如图3所示,当在业务节点中创建租户A1的服务时,业务节点可以执行步骤301,将该服务的配置信息、该服务的标识以及租户A1的标识发送至网格控制台400。网格控制台400可以执行步骤302,为该服务选择L7代理。Referring to FIG3 , whenever a tenant's service is created, the grid console 400 may send the configuration information of the service, the service identifier, and the identifier of A1 to one or more L7 agents, so that the L7 agents can perform traffic management on the data packets of the service based on the configuration information of the service. In some embodiments, as shown in FIG3 , when a service of tenant A1 is created in a service node, the service node may execute step 301 to send the configuration information of the service, the identifier of the service, and the identifier of tenant A1 to the grid console 400. The grid console 400 may execute step 302 to select an L7 agent for the service.

在选择出L7代理后,网格控制台400执行步骤303a,向选择出的L7代理发送该服务的配置信息、服务的标识、租户A1的标识。L7代理在接收到服务的配置信息、服务的标识和租户A1的标识时,可以将服务的配置信息、服务的标识和租户A1的标识关联,得到服务的配置信息、服务的标识和租户A1的标识的关联关系。例如,在关联清单中,记录服务的配置信息、服务的标识和租户A1的标识。如此,通过租户A1的标识可得到租户A1的服务的配置信息,通过租户A1的标识和服务的标识可得到租户A1的该服务的配置信息。After selecting the L7 agent, the grid console 400 executes step 303a to send the configuration information of the service, the identifier of the service, and the identifier of tenant A1 to the selected L7 agent. When the L7 agent receives the configuration information of the service, the identifier of the service, and the identifier of tenant A1, it can associate the configuration information of the service, the identifier of the service, and the identifier of tenant A1 to obtain an association relationship among the configuration information of the service, the identifier of the service, and the identifier of tenant A1. For example, in the association list, the configuration information of the service, the identifier of the service, and the identifier of tenant A1 are recorded. In this way, the configuration information of the service of tenant A1 can be obtained through the identifier of tenant A1, and the configuration information of the service of tenant A1 can be obtained through the identifier of tenant A1 and the identifier of the service.

网格控制台还执行步骤303b,向服务网格系统中每个业务节点中的L4代理发送选择的L7代理和租户A1的关联关系,使得L4代理可以基于该关联关系,识别包括租户A1的服务的配置信息的L7代理。The grid console also executes step 303b to send the association relationship between the selected L7 agent and tenant A1 to the L4 agent in each business node in the service grid system, so that the L4 agent can identify the L7 agent including the configuration information of the service of tenant A1 based on the association relationship.

一个业务容器组可以包括多个容器。其中的每个容器作为服务实例,可以提供一种服务。同一业务容器组中的容器所提供的服务之间关系紧密,例如,一个容器提供的服务的输出往往是另一个容器提供的服务的输入。同一容器组中的容器共享存储空间,其中,存储空间可以是内存或缓存。如此,若将需要顺序执行的两个或两个以上服务的数据包调度到同一业务容器组中,由同一业务容器组中的容器处理该两个或两个以上服务的数据包,无需在容器组间传递相关数据。举例而言,业务容器组B1中的容器B11和容器B12分别提供服务C1和服务C2,业务容器组B2中的容器B21和容器B22也分别提供服务C1和服务C2,并且,服务C1的输出是服务C2的输入。服务C1的数据包和服务C2的数据包是需要顺序处理数据包。若该两个服务的数据包都调度到业务容器组B1,容器B11处理服务C1的数据包的结果(即服务C1的输出)可保存在容器B11和容器B12共享的存储空间中。容器B12在处理服务C2的数据包时,可以从该存储空间中获取服务C1的输出,从而节省了业务容器组之间的数据传输。若服务C1的数据包调度到业务容器组B1,服务C2的数据包调度到业务容器组B2,则业务容器组B2在处理服务C2的数据包时,需要从业务容器组B1获取服务C1的输出,这需要在业务容器组进行数据传输。A business container group may include multiple containers. Each container, as a service instance, may provide a service. The services provided by the containers in the same business container group are closely related. For example, the output of a service provided by one container is often the input of a service provided by another container. The containers in the same container group share a storage space, wherein the storage space may be a memory or a cache. In this way, if the data packets of two or more services that need to be executed sequentially are scheduled to the same business container group, the data packets of the two or more services are processed by the containers in the same business container group, and there is no need to transfer related data between container groups. For example, containers B11 and B12 in business container group B1 provide services C1 and C2 respectively, and containers B21 and B22 in business container group B2 also provide services C1 and C2 respectively, and the output of service C1 is the input of service C2. The data packets of service C1 and the data packets of service C2 are data packets that need to be processed sequentially. If the data packets of the two services are both scheduled to business container group B1, the result of container B11 processing the data packets of service C1 (i.e., the output of service C1) can be stored in the storage space shared by containers B11 and B12. When processing the data packet of service C2, container B12 can obtain the output of service C1 from the storage space, thereby saving data transmission between service container groups. If the data packet of service C1 is scheduled to service container group B1, and the data packet of service C2 is scheduled to service container group B2, then when service container group B2 processes the data packet of service C2, it needs to obtain the output of service C1 from service container group B1, which requires data transmission between service container groups.

参阅图4,网格控制台400在步骤302,基于服务之间的亲和性,选择L7代理,以将具有亲和性的多个服务的配置信息发送至同一L7代理中。4 , in step 302 , the grid console 400 selects an L7 agent based on the affinity between services, so as to send configuration information of multiple services with affinity to the same L7 agent.

在一些实施例中,同一租户的服务之间具有亲和性,因此,可以将同一租户的服务的配置信息发送至同一L7代理中。L7代理在对同一租户的两个或两个以上服务的数据包进行流量管理时,该两个或两个以上服务的数据包共享路由缓存。其中,路由缓存保存了数据包的目标服务实例(即一个或一些具体的业务容器组)的地址。当该两个或两个以上服务可以由同一业务容器组提供时,通过共享路由缓存的地址,L7代理可以将该两个或两个以上服务的数据包发送至同一目标服务实例,从而将该两个或两个以上服务的数据包调度到同一业务容器组中。其中,该多个两个或两个以上服务可以是需要顺序执行的两个或两个以上服务,如此,可以节省业务容器组之间的数据传输。In some embodiments, there is affinity between the services of the same tenant, so the configuration information of the services of the same tenant can be sent to the same L7 agent. When the L7 agent performs traffic management on data packets of two or more services of the same tenant, the data packets of the two or more services share a routing cache. Among them, the routing cache saves the address of the target service instance (i.e., one or some specific business container groups) of the data packet. When the two or more services can be provided by the same business container group, by sharing the address of the routing cache, the L7 agent can send the data packets of the two or more services to the same target service instance, thereby scheduling the data packets of the two or more services to the same business container group. Among them, the multiple two or more services can be two or more services that need to be executed sequentially, so that data transmission between business container groups can be saved.

在一些实施例中,需要顺序执行的两个或两个以上服务之间具有亲和性,因此,可以将需要顺序执行的两个或两个以上服务的配置信息发送至同一L7代理中。L7代理在对该两个或两个以上服务的数据包进行流量管理时,该两个或两个以上服务共享路由缓存。其中,路由缓存保存了数据包的目标服务实例的地址。当该两个或两个以上服务由同一业务容器组提供时,通过共享路由缓存的地址,L7代理可以将该两个或两个以上服务的数据包发送至同一目标服务实例,从而将该两个或两个以上服务的数据包调度到同一业务容器组中。如此,可以节省业务容器组之间的数据传输。In some embodiments, there is affinity between two or more services that need to be executed sequentially, so the configuration information of the two or more services that need to be executed sequentially can be sent to the same L7 agent. When the L7 agent performs traffic management on the data packets of the two or more services, the two or more services share a routing cache. The routing cache stores the address of the target service instance of the data packet. When the two or more services are provided by the same business container group, the L7 agent can send the data packets of the two or more services to the same target service instance by sharing the address of the routing cache, thereby scheduling the data packets of the two or more services to the same business container group. In this way, data transmission between business container groups can be saved.

其中,具有亲和性的服务是指同一租户的服务或需要顺序执行的服务。其中,需要顺序执行的服务中的服务也是属于同一租户的。因此,具有亲和性的服务是租户粒度的。包括某租户具有亲和性的服务的配置信息的L7代理可称为该租户的亲和L7代理。Among them, the services with affinity refer to the services of the same tenant or the services that need to be executed sequentially. Among them, the services in the services that need to be executed sequentially also belong to the same tenant. Therefore, the services with affinity are tenant-granular. The L7 agent that includes the configuration information of the services with affinity for a tenant can be called the affinity L7 agent of the tenant.

在一些实施例中,代理集群300运行有多个L7代理。在步骤302,可以在多个L7代理中选择包括最少数量服务的配置信息的L7代理。也就是说,当有服务创建时,将创建的服务的配置信息发送至包括最少数量服务的配置信息的L7代理中。在一个示例中,在基于服务之间的亲和性,选择L7代理时,在多个L7代理中选择包括最少数量服务的配置信息的L7代理,以将创建的服务的配置信息发送至包括最少数量服务的配置信息的L7代理,使得包括最少数量服务的配置信息的L7代理对创建的服务的数据包进行流量管理,以实现负载均衡。In some embodiments, the proxy cluster 300 runs multiple L7 proxies. In step 302, an L7 proxy including configuration information of the least number of services may be selected from the multiple L7 proxies. That is, when a service is created, the configuration information of the created service is sent to the L7 proxy including configuration information of the least number of services. In one example, when selecting an L7 proxy based on affinity between services, an L7 proxy including configuration information of the least number of services is selected from the multiple L7 proxies to send the configuration information of the created service to the L7 proxy including configuration information of the least number of services, so that the L7 proxy including configuration information of the least number of services performs traffic management on data packets of the created service to achieve load balancing.

在一些实施例中,代理集群300运行有多个L7代理。在基于服务之间的亲和性,选择L7代理时,在多个L7代理中选择包括最少数量租户的配置信息的L7代理,以将创建的服务的配置信息发送至包括最少数量租户的配置信息的L7代理,使得包括最少数量租户的配置信息的L7代理对创建的服务的数据包进行流量管理。其中,租户的配置信息是租户的服务的配置信息。将某一租户具有亲和性的服务发送最少数量租户的配置信息的L7代理,可避免同一个L7代理同时成为多个租户的亲和代理,或者说,降低同一个L7代理同时成为多个租户的亲和L7代理的风险。In some embodiments, the proxy cluster 300 runs multiple L7 proxies. When selecting an L7 proxy based on the affinity between services, an L7 proxy including configuration information of the least number of tenants is selected from multiple L7 proxies to send the configuration information of the created service to the L7 proxy including configuration information of the least number of tenants, so that the L7 proxy including configuration information of the least number of tenants performs traffic management on the data packets of the created service. The configuration information of the tenant is the configuration information of the tenant's service. Sending a service with affinity to a tenant to the L7 proxy with configuration information of the least number of tenants can avoid the same L7 proxy from becoming an affinity proxy for multiple tenants at the same time, or in other words, reduce the risk of the same L7 proxy becoming an affinity L7 proxy for multiple tenants at the same time.

在一些实施例中,创建服务的YAML文件的注释(annotation)部分记录包括了服务之间的亲和性。网格控制台400可以获取服务的YAML文件的注释部分,通过服务的YAML文件的注释部分可以获取哪些服务之间具有亲和性。其中,YAML是一种标记性语言,也一种表达数据序列化的格式,常用于创建服务。其中,创建服务具体可以是创建提供该服务的容器。In some embodiments, the annotation part of the YAML file for creating the service records the affinity between the services. The grid console 400 can obtain the annotation part of the YAML file of the service, and can obtain which services have affinity through the annotation part of the YAML file of the service. Among them, YAML is a markup language and a format for expressing data serialization, which is often used to create services. Among them, creating a service can specifically be creating a container that provides the service.

在一些实施例中,可以通过图5所示方法,部署L7代理。In some embodiments, the L7 proxy can be deployed by the method shown in FIG. 5 .

首先,服务网格系统的管理员可以通过步骤501,在代理集群300中创建L7代理310等一个或多个L7代理。First, the administrator of the service grid system may create one or more L7 proxies such as the L7 proxy 310 in the proxy cluster 300 through step 501 .

租户A1可以通过步骤502,在业务节点200创建服务A11。其中,创建服务是指创建业务容器组,创建的业务容器组中的容器提供该服务。业务节点200可以通过步骤503,将服务A11的配置信息、服务A11的标识、租户A1的标识发送至网格控制台400。Tenant A1 can create service A11 in business node 200 through step 502. Creating a service means creating a business container group, and the container in the created business container group provides the service. Business node 200 can send configuration information of service A11, an identifier of service A11, and an identifier of tenant A1 to grid console 400 through step 503.

网格控制台400可以在步骤504,为服务A11选择L7代理。其中,可以基于服务之间的亲和性,为服务A11选择L7代理。具体参考上文介绍,在此不再赘述。The grid console 400 may select an L7 proxy for the service A11 in step 504. The L7 proxy may be selected for the service A11 based on the affinity between services. Please refer to the above introduction for details, which will not be repeated here.

可以设定在步骤504,网格控制台400选择出的L7代理是L7代理310。那么在步骤505,网格控制台400向L7代理310发送服务A11的配置信息、服务A11的标识、租户A1的标识。It can be assumed that in step 504, the L7 agent selected by the grid console 400 is the L7 agent 310. Then in step 505, the grid console 400 sends the configuration information of the service A11, the identifier of the service A11, and the identifier of the tenant A1 to the L7 agent 310.

L7代理310可以建立服务A11的配置信息、服务A11的标识以及租户A1的标识的关联关系。L7代理310可以保存服务A11的配置信息和该关联关系。在一些实施例中,L7代理310可以在步骤506,创建租户A1监听器。租户A1监听器用于监听租户A1的服务的数据包。在一些实施例中,L7代理310可以在步骤507,创建租户A1服务A11监听器。租户A1服务A11监听器用于监听租户A1的服务A11的数据包。The L7 agent 310 can establish an association relationship between the configuration information of service A11, the identifier of service A11, and the identifier of tenant A1. The L7 agent 310 can save the configuration information of service A11 and the association relationship. In some embodiments, the L7 agent 310 can create a tenant A1 listener in step 506. The tenant A1 listener is used to listen to data packets of the service of tenant A1. In some embodiments, the L7 agent 310 can create a tenant A1 service A11 listener in step 507. The tenant A1 service A11 listener is used to listen to data packets of the service A11 of tenant A1.

L7代理310还可以在步骤508,建立L7代理和租户A1的关联关系,并通过步骤509,将L7代理和租户A1的关联关系发送至网格控制台400。网格控制台400可以将L7代理和租户A1的关联关系发送至服务网格系统中每个L4代理中。L4代理可以保存接收到的关联关系。The L7 agent 310 may also establish an association relationship between the L7 agent and the tenant A1 in step 508, and send the association relationship between the L7 agent and the tenant A1 to the grid console 400 in step 509. The grid console 400 may send the association relationship between the L7 agent and the tenant A1 to each L4 agent in the service grid system. The L4 agent may save the received association relationship.

在一些实施例中,L7代理和租户A1的关联关系包括L7代理和租户A1的服务A11的关联关系。在一些实施例中,L7代理和租户A1的关联关系具体是L7代理的标识和租户A1的标识的关联关系。其中,可以在关联清单中记录L7代理的标识和租户A1的标识,以将L7代理和租户A1关联。In some embodiments, the association relationship between the L7 agent and the tenant A1 includes the association relationship between the L7 agent and the service A11 of the tenant A1. In some embodiments, the association relationship between the L7 agent and the tenant A1 is specifically the association relationship between the identifier of the L7 agent and the identifier of the tenant A1. The identifier of the L7 agent and the identifier of the tenant A1 can be recorded in the association list to associate the L7 agent with the tenant A1.

如此,可以完成L7代理的部署,以及使得L7代理能够对相关租户的服务的数据包进行流量管理。其中,通过本申请实施例提供的流量管理方法,L7代理可实现对相关租户的服务的数据包的流量管理。In this way, the deployment of the L7 proxy can be completed, and the L7 proxy can perform traffic management on the data packets of the services of the relevant tenants. Among them, through the traffic management method provided in the embodiment of the present application, the L7 proxy can implement traffic management on the data packets of the services of the relevant tenants.

接下来,结合图6,以L7代理310、租户A1为例,对本申请实施例提供的流量管理方法进行介绍。Next, in combination with Figure 6, taking the L7 agent 310 and tenant A1 as an example, the traffic management method provided in the embodiment of the present application is introduced.

其中,L7代理310包括多个服务的配置信息,该多个服务中的不同服务属于同一租户或不同租户,服务的配置信息用于L7代理310对该服务的数据包进行流量管理。如图6所示,该方法如下步骤。The L7 agent 310 includes configuration information of multiple services, different services in the multiple services belong to the same tenant or different tenants, and the configuration information of the service is used by the L7 agent 310 to perform traffic management on the data packets of the service. As shown in FIG6 , the method has the following steps.

步骤601,业务容器组110发出数据包111。其中,业务容器组110属于租户A1,数据包111可以是用于请求访问租户A1的服务A11的数据包,即数据包111是用于请求访问服务A11的服务请求。业务容器组110包括至少一个业务容器,数据包111具体可以是该至少一个业务容器中的一个或多个业务容器发出的。Step 601: The business container group 110 sends a data packet 111. The business container group 110 belongs to the tenant A1, and the data packet 111 may be a data packet for requesting access to the service A11 of the tenant A1, that is, the data packet 111 is a service request for requesting access to the service A11. The business container group 110 includes at least one business container, and the data packet 111 may be specifically sent by one or more business containers in the at least one business container.

业务容器组110所在业务节点(即业务节点100)中的L4代理130作为服务网格入方向的L4代理,可以拦截到数据包111。L4代理130在拦截到数据包111时,可以获取业务容器组110的标识。例如,L4代理130通过解析数据包111,得到数据包111的Src IP。数据包111的Src IP是业务容器组110的IP地址,是业务容器组110的一种标识。在步骤602,L4代理130可以基于业务容器组110的标识,获取业务容器组110所属租户(即租户A1)的标识。示例性的,L4代理130可以基于业务容器组110的标识,在网格控制台400查询到的租户A1的标识。The L4 agent 130 in the business node (i.e., business node 100) where the business container group 110 is located, as the L4 agent in the inbound direction of the service grid, can intercept the data packet 111. When intercepting the data packet 111, the L4 agent 130 can obtain the identifier of the business container group 110. For example, the L4 agent 130 obtains the Src IP of the data packet 111 by parsing the data packet 111. The Src IP of the data packet 111 is the IP address of the business container group 110, which is an identifier of the business container group 110. In step 602, the L4 agent 130 can obtain the identifier of the tenant (i.e., tenant A1) to which the business container group 110 belongs based on the identifier of the business container group 110. Exemplarily, the L4 agent 130 can obtain the identifier of tenant A1 queried in the grid console 400 based on the identifier of the business container group 110.

在步骤603,L4代理130可以基于租户A1的标识,在代理集群300部署的L7代理中筛选包括租户A1的服务的配置信息的L7代理。通常,代理集群300部署有多个L7代理,并且,部分L7代理包括租户A1的服务的配置信息。因此,需要基于租户A1的标识,在该多个L7代理中筛选包括租户A1的服务的配置信息的L7代理。其中,L4代理保存了L7代理和租户的关联关系,租户关联的L7代理包括该租户的服务的配置信息。L4代理130可以基于租户A1的标识,以及L7代理和租户的关联关系,得到租户A1关联的L7代理,即得到包括租户A1的服务的配置信息的L7代理。In step 603, the L4 agent 130 can filter the L7 agent including the configuration information of the service of tenant A1 in the L7 agent deployed in the agent cluster 300 based on the identifier of tenant A1. Usually, the agent cluster 300 is deployed with multiple L7 agents, and some of the L7 agents include the configuration information of the service of tenant A1. Therefore, it is necessary to filter the L7 agent including the configuration information of the service of tenant A1 in the multiple L7 agents based on the identifier of tenant A1. Among them, the L4 agent saves the association relationship between the L7 agent and the tenant, and the L7 agent associated with the tenant includes the configuration information of the service of the tenant. The L4 agent 130 can obtain the L7 agent associated with tenant A1 based on the identifier of tenant A1 and the association relationship between the L7 agent and the tenant, that is, obtain the L7 agent including the configuration information of the service of tenant A1.

在一些实施例中,租户A1可能具有多个服务,并且,该多个服务的配置信息可能在不同的L7代理中。也就是说,可能并非所有包括了租户A1的服务的L7代理都包括服务A11的配置信息。在步骤603,筛选包括租户A1的服务A11的配置信息的L7代理。其中,可以先基于租户A1的标识,筛选出包括租户A1的服务的配置信息的L7代理。然后,基于服务A11的标识,在包括租户A1的服务的配置信息的L7代理中筛选包括服务A11的配置信息的L7代理。In some embodiments, tenant A1 may have multiple services, and the configuration information of the multiple services may be in different L7 proxies. That is, not all L7 proxies that include the services of tenant A1 may include the configuration information of service A11. In step 603, the L7 proxies that include the configuration information of service A11 of tenant A1 are filtered. Among them, the L7 proxies that include the configuration information of the services of tenant A1 can be filtered out based on the identifier of tenant A1. Then, based on the identifier of service A11, the L7 proxies that include the configuration information of the services of tenant A1 are filtered out.

当包括服务A11的配置信息的L7代理仅有一个时,包括租户A1的服务A11的配置信息的L7代理作为数据包111的目标L7代理。When there is only one L7 proxy including the configuration information of the service A11 , the L7 proxy including the configuration information of the service A11 of the tenant A1 serves as the target L7 proxy of the data packet 111 .

当包括服务A11的配置信息的L7代理有多个时,L4代理130可以在该多个L7代理中选择数据包111的目标L7代理。When there are multiple L7 proxies including the configuration information of the service A11 , the L4 agent 130 may select a target L7 agent for the data packet 111 from the multiple L7 proxies.

在一些实施例中,若L7代理支持租户A1的服务的数量越多,该L7代理成为数据包111的目标L7代理的可能性越大。其中,L7代理支持服务是指L7代理包括该服务的配置信息。也就是说,L7代理包括某服务的配置信息可称为该L7代理支持该服务。举例而言,L7代理310包括N个服务的配置信息,L7代理320包括M个服务的配置信息,并且该N个服务和该M个服务均包括服务A11。其中,N为、M均为大于或等于1的整数。若该N个服务中属于租户A1的服务的数量大于该M个服务中属于租户A1的服务的数量时,L4代理130选择L7代理310为数据包111的目标L7代理。也就是说,当L7代理310支持的服务中属于租户A1的服务的数量大于L7代理320支持的服务中属于租户A1的服务的数量时,L7代理310用作数据包111的目标L7代理。In some embodiments, the more services the L7 agent supports for tenant A1, the more likely the L7 agent is to be the target L7 agent for data packet 111. The L7 agent supporting services means that the L7 agent includes configuration information for the services. That is, the L7 agent including configuration information for a service can be referred to as the L7 agent supporting the service. For example, L7 agent 310 includes configuration information for N services, L7 agent 320 includes configuration information for M services, and both the N services and the M services include service A11. N and M are both integers greater than or equal to 1. If the number of services belonging to tenant A1 among the N services is greater than the number of services belonging to tenant A1 among the M services, L4 agent 130 selects L7 agent 310 as the target L7 agent for data packet 111. That is, when the number of services belonging to tenant A1 among the services supported by L7 agent 310 is greater than the number of services belonging to tenant A1 among the services supported by L7 agent 320, L7 agent 310 is used as the target L7 agent for data packet 111.

在一些实施例中,L7代理的负载越低,该L7代理成为数据包111的目标L7代理的可能性越大。举例而言,L7代理310和L7代理320均包括服务A11的配置信息。当L7代理320的负载大于L7代理310的负载时,L7代理310用作数据包111的目标L7代理。其中,L7代理的负载可通过L7代理的已用容量和最大容量的比值表示。该比值和L7代理的负载正相关。在一个例子中,最大容量是指最大连接数,已用容量是指已用连接数或者实际连接数。其中,此处的连接是指L7代理和发出数据包的业务容器组之间的连接。具体而言,L7代理所进行流量管理的数据包是业务容器组发出的,当L4代理选择L7代理对某个业务容器组发出的数据包进行流量管理时,L4代理建立该L7代理和该业务容器组之间的连接。因此,最大连接数也可以称为L7代理最多可连接的业务容器组的数量,已用连接数也可以称为L7代理已连接的业务容器组的数量。在一个例子中,最大容量是指单位时间内L7代理最多可接收的数据包的数量,已用容量是指单位时间内L7代理实际接收到的数据包的数量。In some embodiments, the lower the load of the L7 agent, the greater the possibility that the L7 agent becomes the target L7 agent of the data packet 111. For example, both L7 agent 310 and L7 agent 320 include configuration information of service A11. When the load of L7 agent 320 is greater than the load of L7 agent 310, L7 agent 310 is used as the target L7 agent of data packet 111. The load of the L7 agent can be represented by the ratio of the used capacity and the maximum capacity of the L7 agent. The ratio is positively correlated with the load of the L7 agent. In one example, the maximum capacity refers to the maximum number of connections, and the used capacity refers to the number of used connections or the actual number of connections. The connection here refers to the connection between the L7 agent and the service container group that sends the data packet. Specifically, the data packet for which the L7 agent performs traffic management is sent by the service container group. When the L4 agent selects the L7 agent to perform traffic management on the data packet sent by a certain service container group, the L4 agent establishes a connection between the L7 agent and the service container group. Therefore, the maximum number of connections can also be referred to as the maximum number of service container groups that the L7 proxy can connect to, and the used number of connections can also be referred to as the number of service container groups that the L7 proxy has connected to. In an example, the maximum capacity refers to the maximum number of data packets that the L7 proxy can receive per unit time, and the used capacity refers to the number of data packets actually received by the L7 proxy per unit time.

在一些实施例中,可以计算每个包括了服务A11的配置信息的L7代理的调度系数,然后,将调度系数最大的L7代理用作数据包111的目标L7代理。其中,调度系数的计算公式如下。In some embodiments, the scheduling coefficient of each L7 proxy including the configuration information of the service A11 may be calculated, and then the L7 proxy with the largest scheduling coefficient is used as the target L7 proxy of the data packet 111. The calculation formula of the scheduling coefficient is as follows.

L7代理的调度系数=租户的权重×(L7代理支持的服务中属于租户A1的服务的数量/L7代理支持的服务的总数量)×(1-L7代理的已用容量/L7代理的最大容量)。The scheduling coefficient of the L7 agent = the tenant's weight × (the number of services belonging to tenant A1 among the services supported by the L7 agent/the total number of services supported by the L7 agent) × (1-the used capacity of the L7 agent/the maximum capacity of the L7 agent).

其中,租户的权重可以是预设值。管理员可以针对某租户,为不同的L7代理设置不同的权重,以设置L7代理该租户的服务的数据包进行流量管理的优先级。The weight of the tenant may be a preset value. The administrator may set different weights for different L7 proxies for a certain tenant, so as to set the priority of the L7 proxy for traffic management of data packets of the tenant's service.

通过上述方式,可以得到数据包111的目标L7代理。In the above manner, the target L7 proxy of the data packet 111 can be obtained.

可以设定得到的数据包111的目标L7代理为L7代理310。L4代理130通过步骤605,将数据包111和租户A1的标识发送至L7代理310。在一些实施例中,L4代理130可以通过目的地址转换(destination network address translation,DNAT)操作,将数据包111和租户A1的标识发送至L7代理310。The target L7 agent of the obtained data packet 111 may be set to the L7 agent 310. The L4 agent 130 sends the data packet 111 and the identifier of the tenant A1 to the L7 agent 310 through step 605. In some embodiments, the L4 agent 130 may send the data packet 111 and the identifier of the tenant A1 to the L7 agent 310 through a destination network address translation (DNAT) operation.

L7代理可以在步骤606中,基于租户A1的标识,在L7代理310包括的多个服务的配置信息中识别租户A1的服务的配置信息。如上所述,租户A1的标识和租户A1的服务的配置信息具有关联关系。L7代理可基于该关联关系和租户A1的标识,识别出租户A1的服务的配置信息。In step 606, the L7 agent can identify the configuration information of the service of tenant A1 from the configuration information of multiple services included in the L7 agent 310 based on the identifier of tenant A1. As described above, the identifier of tenant A1 and the configuration information of the service of tenant A1 have an association relationship. The L7 agent can identify the configuration information of the service of tenant A1 based on the association relationship and the identifier of tenant A1.

接着,L7代理可以在步骤607中,基于步骤606识别出的租户A1的服务的配置信息,对数据包111进行流量管理。Next, in step 607 , the L7 agent may perform traffic management on the data packet 111 based on the configuration information of the service of the tenant A1 identified in step 606 .

其中,数据包111是租户A1的服务A11的数据包。若步骤606识别出的租户A1的服务的配置信息是该服务A11的配置信息,则在步骤607,可直接基于步骤606识别出的租户A1的服务的配置信息,对数据包111进行流量管理。The data packet 111 is a data packet of the service A11 of the tenant A1. If the configuration information of the service of the tenant A1 identified in step 606 is the configuration information of the service A11, then in step 607, the traffic management of the data packet 111 can be performed directly based on the configuration information of the service of the tenant A1 identified in step 606.

若步骤606识别出的租户A1的服务的配置信息除了包括该服务A11的配置信息外,还包括租户A1的其他服务的配置信息时,在步骤607,先从步骤606识别出的租户A1的服务的配置信息中,识别该服务A11的配置信息。然后,基于该服务A11的配置信息,对数据包111进行流量管理。If the configuration information of the service of tenant A1 identified in step 606 includes configuration information of other services of tenant A1 in addition to the configuration information of service A11, in step 607, the configuration information of service A11 is first identified from the configuration information of the service of tenant A1 identified in step 606. Then, traffic management is performed on data packet 111 based on the configuration information of service A11.

其中,数据包111包括了数据包111所请求服务的标识,即服务A11的标识。L7代理310可以解析数据包111,得到服务A11的标识。然后,L7代理310基于服务A11的标识,在步骤606识别出的租户A1的服务的配置信息中识别服务A11的配置信息。具体地,如上所述,服务的标识和服务的配置信息具有关联关系。L7代理310可基于该关联关系和服务A11的标识,识别服务A11的配置信息。Among them, data packet 111 includes the identifier of the service requested by data packet 111, that is, the identifier of service A11. L7 agent 310 can parse data packet 111 to obtain the identifier of service A11. Then, based on the identifier of service A11, L7 agent 310 identifies the configuration information of service A11 in the configuration information of the service of tenant A1 identified in step 606. Specifically, as described above, the identifier of the service and the configuration information of the service have an associated relationship. L7 agent 310 can identify the configuration information of service A11 based on the associated relationship and the identifier of service A11.

在一些实施例中,L7代理310对数据包111的流量管理可以包括:选择数据包111的目标服务实例。例如,数据包111为服务请求,L7代理310可以选择用于执行该服务请求服务实例。可以设定L7代理310选择业务容器组210为数据包111的目标服务实例,即选择业务容器组210中的业务容器处理数据包111。此时,L7代理310可以通过步骤608,向业务容器组210所在业务节点(即业务节点200)中的L4代理(即L4代理230)发送数据包111。在步骤610,L4代理230作为服务网格出方向的L4代理,可以将接收到的数据包111转发至业务容器组210。在一些实施例中,L4代理230可以通过DNAT操作,将数据包111发送至业务容器组210。In some embodiments, the traffic management of the data packet 111 by the L7 agent 310 may include: selecting a target service instance of the data packet 111. For example, the data packet 111 is a service request, and the L7 agent 310 may select a service instance for executing the service request. The L7 agent 310 may be set to select the service container group 210 as the target service instance of the data packet 111, that is, select the service container in the service container group 210 to process the data packet 111. At this time, the L7 agent 310 may send the data packet 111 to the L4 agent (i.e., the L4 agent 230) in the service node (i.e., the service node 200) where the service container group 210 is located through step 608. In step 610, the L4 agent 230, as the L4 agent in the outbound direction of the service grid, may forward the received data packet 111 to the service container group 210. In some embodiments, the L4 agent 230 may send the data packet 111 to the service container group 210 through a DNAT operation.

在一些实施例中,在步骤608,L7代理310向L4代理230发送数据包111和租户A1的标识。L4代理230可以执行步骤609,基于租户A1的标识,校验租户A1和业务容器组210所属租户相同。具体而言,L7代理310在选择出业务容器组210为数据包111的服务实例时,可以将业务容器组210的标识添加到数据包111中。例如,业务容器组210的标识为业务容器组210的地址,L7代理310将业务容器组210的地址添加到数据包111的目的地址(destination)对应的字段中。L4代理230可以解析数据包111,得到业务容器组210的标识。然后,L4代理230可以基于业务容器组210的标识,在网格控制台400查询到业务容器组210所属租户。在步骤609,L4代理230可以判断租户A1的标识和业务容器组210所属租户的标识是否相同。若相同,则租户A1和业务容器组210所属租户相同。若不相同,则租户A1和业务容器组210所属租户不同。In some embodiments, at step 608, the L7 agent 310 sends the data packet 111 and the identifier of the tenant A1 to the L4 agent 230. The L4 agent 230 may perform step 609 to verify that the tenant A1 and the business container group 210 belong to the same tenant based on the identifier of the tenant A1. Specifically, when the L7 agent 310 selects the business container group 210 as the service instance of the data packet 111, the identifier of the business container group 210 may be added to the data packet 111. For example, the identifier of the business container group 210 is the address of the business container group 210, and the L7 agent 310 adds the address of the business container group 210 to the field corresponding to the destination address (destination) of the data packet 111. The L4 agent 230 may parse the data packet 111 to obtain the identifier of the business container group 210. Then, based on the identifier of the business container group 210, the L4 agent 230 may query the tenant to which the business container group 210 belongs in the grid console 400. In step 609, the L4 agent 230 may determine whether the identifier of the tenant A1 is the same as the identifier of the tenant to which the service container group 210 belongs. If they are the same, the tenant A1 and the tenant to which the service container group 210 belongs are the same. If they are not the same, the tenant A1 and the tenant to which the service container group 210 belongs are different.

L4代理230在确认租户A1和业务容器组210所属租户相同的情况下,才执行步骤610。从而进一步保障了租户间的隔离。The L4 agent 230 executes step 610 only when it is confirmed that the tenant A1 and the tenant to which the service container group 210 belongs are the same, thereby further ensuring the isolation between tenants.

在一些实施例中,L4代理230在确认租户A1和业务容器组210所属租户不同的情况下,L4代理230可以发出告警或报错。In some embodiments, when the L4 agent 230 confirms that the tenant A1 and the tenant to which the service container group 210 belongs are different, the L4 agent 230 may issue an alarm or report an error.

在一些实施例中,L7代理310除了支持租户A1的服务外,还执行其他租户的服务,例如租户A2的服务。也就是说,L7代理310还包括租户A2的服务的配置信息。可以设定租户A2的业务容器组120运行在业务节点100中。当业务容器组120发出数据包121时,L4代理130可以将数据包121和租户A2的标识发送至L7代理310。L7代理310可以基于租户A2的标识,在L7代理310包括的多个服务的配置信息中识别出租户A2的配置信息。然后,L7代理310可基于租户A2的配置信息对数据包121进行流量管理。示例性的,通过流量管理,L7代理310选择业务节点200中的业务容器组220为数据包121的目标服务实例。L7代理310向L4代理230发送数据包121和租户A2的标识。L4代理230在基于租户A2的标识,确认租户A2和业务容器组220所属租户相同的情况下,向业务容器组220发送数据包121。In some embodiments, in addition to supporting the services of tenant A1, L7 agent 310 also performs services of other tenants, such as services of tenant A2. That is, L7 agent 310 also includes configuration information of services of tenant A2. The business container group 120 of tenant A2 can be set to run in the business node 100. When the business container group 120 sends a data packet 121, L4 agent 130 can send the data packet 121 and the identifier of tenant A2 to L7 agent 310. L7 agent 310 can identify the configuration information of tenant A2 in the configuration information of multiple services included in L7 agent 310 based on the identifier of tenant A2. Then, L7 agent 310 can perform traffic management on data packet 121 based on the configuration information of tenant A2. Exemplarily, through traffic management, L7 agent 310 selects business container group 220 in business node 200 as the target service instance of data packet 121. L7 agent 310 sends data packet 121 and the identifier of tenant A2 to L4 agent 230. When the L4 proxy 230 confirms, based on the identifier of the tenant A2, that the tenant A2 and the service container group 220 belong to the same tenant, it sends the data packet 121 to the service container group 220 .

综合以上,同一L7代理可以对多个租户的服务的数据包进行流量管理,实现了多租户共享L7代理。这可以提升L7代理的计算资源利用率、降低L7代理的调度压力等。In summary, the same L7 proxy can manage the traffic of data packets of services of multiple tenants, realizing multi-tenant sharing of L7 proxy. This can improve the computing resource utilization of L7 proxy and reduce the scheduling pressure of L7 proxy.

基于上文描述的内容,本申请实施例还提供了一种流量管理方法。该方法可以由服务网格系统中的第一L7代理执行。所述服务网格系统包括第一业务节点和代理集群;其中,所述第一业务节点运行有第一L4代理和第一租户的第一业务容器组;所述第一L7代理运行在所述代理集群中,所述第一L7代理包括多个服务的配置信息,所述多个服务中的不同服务属于同一租户或不同租户,所述服务的配置信息用于所述第一L7代理对所述服务的数据包进行流量管理。其中,此处的服务网格系统可以是图1所示的服务网格系统,代理集群可以是上文描述的代理集群300,第一L7代理具体可以是上文描述的L7代理310,第一业务节点可以是上文描述的业务节点100,第一L4代理可以是上文描述的L4代理130,第一租户可以是上文描述的租户A1。如图7所示,该方法包括如下步骤。Based on the content described above, an embodiment of the present application also provides a traffic management method. The method can be performed by a first L7 agent in a service grid system. The service grid system includes a first business node and a proxy cluster; wherein the first business node runs a first L4 agent and a first business container group of a first tenant; the first L7 agent runs in the proxy cluster, and the first L7 agent includes configuration information of multiple services, different services in the multiple services belong to the same tenant or different tenants, and the configuration information of the service is used by the first L7 agent to perform traffic management on the data packets of the service. Wherein, the service grid system here can be the service grid system shown in Figure 1, the proxy cluster can be the proxy cluster 300 described above, the first L7 agent can specifically be the L7 agent 310 described above, the first business node can be the business node 100 described above, the first L4 agent can be the L4 agent 130 described above, and the first tenant can be the tenant A1 described above. As shown in Figure 7, the method includes the following steps.

步骤701,所述第一L7代理接收所述第一L4代理发送的所述第一租户的标识和第一数据包,所述第一数据包是所述第一L4代理从所述第一业务容器组接收的。其中,第一业务容器组可以是上文描述的业务容器组110,第一数据包可以是上文描述的数据包111。步骤701的具体实现方式可以参考上文对图6中步骤601-步骤605的介绍,在此不再赘述。In step 701, the first L7 agent receives the identifier of the first tenant and the first data packet sent by the first L4 agent, where the first data packet is received by the first L4 agent from the first service container group. The first service container group may be the service container group 110 described above, and the first data packet may be the data packet 111 described above. The specific implementation of step 701 may refer to the introduction of steps 601 to 605 in FIG. 6 above, and will not be repeated here.

步骤702,所述第一L7代理基于所述第一租户的标识,在所述多个服务的配置信息中识别第一服务的配置信息,所述第一服务属于所述第一租户。步骤702的具体实现方式可以参考上文对图6中步骤606的介绍,在此不再赘述。In step 702, the first L7 agent identifies configuration information of a first service from the configuration information of the plurality of services based on the identifier of the first tenant, and the first service belongs to the first tenant. The specific implementation of step 702 can refer to the introduction of step 606 in FIG. 6 above, which will not be repeated here.

步骤703,所述第一L7代理基于所述第一服务的配置信息,对所述第一数据包进行流量管理。步骤702的具体实现方式可以参考上文对图6中步骤607的介绍,在此不再赘述。Step 703: The first L7 agent performs traffic management on the first data packet based on the configuration information of the first service. The specific implementation of step 702 can refer to the above description of step 607 in FIG. 6, which will not be repeated here.

在一些实施例中,所述第一业务节点还运行有第二租户的第二业务容器组;所述方法包括:所述第一L7代理接收所述第一L4代理发送的所述第二租户的标识和第二数据包,所述第二数据包是所述第一L4代理从所述第二业务容器组接收的;所述第一L4代理将所述第二租户的标识和所述第二数据包发送至所述第一L7代理;所述第一L7代理基于所述第二租户的标识,在所述多个服务的配置信息中识别第二服务的配置信息,所述第二服务属于所述第二租户;所述第一L7代理基于所述第二服务的配置信息,对所述第二数据包进行流量管理。其中,第二租户可以是上文描述的租户A2,第二业务容器组可以是上文描述的业务容器组120,第二数据包可以是上文描述的数据包121。In some embodiments, the first service node also runs a second service container group of a second tenant; the method includes: the first L7 agent receives the identifier of the second tenant and a second data packet sent by the first L4 agent, the second data packet is received by the first L4 agent from the second service container group; the first L4 agent sends the identifier of the second tenant and the second data packet to the first L7 agent; the first L7 agent identifies the configuration information of the second service in the configuration information of the plurality of services based on the identifier of the second tenant, the second service belongs to the second tenant; the first L7 agent performs traffic management on the second data packet based on the configuration information of the second service. The second tenant may be the tenant A2 described above, the second service container group may be the service container group 120 described above, and the second data packet may be the data packet 121 described above.

在一些实施例中,所述第一服务包括所述第一数据包对应的服务和其他服务;所述第一L7代理基于所述第一服务的配置信息,对所述第一数据包进行流量管理,包括:所述第一L7代理基于所述第一数据包对应的服务的标识,在所述第一服务的配置信息中识别所述第一数据包对应的服务的配置信息;所述第一L7代理基于所述第一数据包对应的服务的配置信息,对所述第一数据包进行流量管理。其中,所述第一数据包对应的服务可以是上文描述的服务A11。该实施例的具体实现方式可以参考上文对图6中步骤606的介绍,在此不再赘述。In some embodiments, the first service includes the service corresponding to the first data packet and other services; the first L7 agent performs traffic management on the first data packet based on the configuration information of the first service, including: the first L7 agent identifies the configuration information of the service corresponding to the first data packet in the configuration information of the first service based on the identifier of the service corresponding to the first data packet; the first L7 agent performs traffic management on the first data packet based on the configuration information of the service corresponding to the first data packet. The service corresponding to the first data packet may be the service A11 described above. The specific implementation method of this embodiment can refer to the above introduction to step 606 in Figure 6, which will not be repeated here.

在一些实施例中,所述第一数据包对应的服务所述代理集群还运行有第二L7代理,所述第二L7代理包括至少一个服务的配置信息;所述第一L7代理接收所述第一L4代理发送所述第一租户的标识和第一数据包,包括:当所述多个服务中属于所述第一租户的服务的数量大于所述至少一个服务中属于所述第一租户的服务的数量时,所述第一L7代理接收所述第一L4代理发送的所述第一租户的标识和所述第一数据包。其中,第二L7代理可以是上文描述的L7代理320。该实施例的具体实现方式可以参考上文对图6中步骤603-步骤605的介绍,在此不再赘述。In some embodiments, the proxy cluster corresponding to the service of the first data packet also runs a second L7 proxy, and the second L7 proxy includes configuration information of at least one service; the first L7 proxy receives the identifier of the first tenant and the first data packet sent by the first L4 proxy, including: when the number of services belonging to the first tenant in the multiple services is greater than the number of services belonging to the first tenant in the at least one service, the first L7 proxy receives the identifier of the first tenant and the first data packet sent by the first L4 proxy. The second L7 proxy can be the L7 proxy 320 described above. The specific implementation method of this embodiment can refer to the above introduction to steps 603-605 in Figure 6, which will not be repeated here.

在一些实施例中,所述代理集群还运行有第二L7代理,所述第二L7代理也包括所述第一服务的配置信息;所述第一L7代理接收所述第一L4代理发送的所述第一租户的标识和第一数据包,包括:当所述第二L7代理的负载大于所述第一L7代理的负载时,所述第一L7代理接收所述第一L4代理发送的所述第一租户的标识和所述第一数据包。其中,第二L7代理可以是上文描述的L7代理320。该实施例的具体实现方式可以参考上文对图6中步骤603-步骤605的介绍,在此不再赘述。In some embodiments, the proxy cluster also runs a second L7 proxy, and the second L7 proxy also includes the configuration information of the first service; the first L7 proxy receives the identifier of the first tenant and the first data packet sent by the first L4 proxy, including: when the load of the second L7 proxy is greater than the load of the first L7 proxy, the first L7 proxy receives the identifier of the first tenant and the first data packet sent by the first L4 proxy. The second L7 proxy can be the L7 proxy 320 described above. The specific implementation of this embodiment can refer to the above introduction to steps 603-605 in Figure 6, which will not be repeated here.

在一些实施例中,所述服务网格系统还包括:与所述代理集群连接的控制台;所述方法还包括:所述第一L7代理从所述控制台接收并记录两个或两个以上服务的配置信息;其中,所述两个或两个以上服务属于同一租户,或者,所述两个或两个以上服务中的一个服务的输出是另一个服务的输入。该实施例的具体实现方式可以参考上文对图3-图5所示实施例的介绍,在此不再赘述。In some embodiments, the service grid system further comprises: a console connected to the proxy cluster; the method further comprises: the first L7 proxy receives and records configuration information of two or more services from the console; wherein the two or more services belong to the same tenant, or the output of one of the two or more services is the input of another service. The specific implementation of this embodiment can refer to the above description of the embodiments shown in Figures 3 to 5, which will not be repeated here.

在一些实施例中,所述服务网格系统还包括第二业务节点,所述第二业务节点运行有第二L4代理和第三业务容器组;所述第一L7代理基于所述第一服务的配置信息,对所述第一数据包进行流量管理,包括:所述第一L7代理选择所述第三业务容器组为所述第一数据包的目标容器组;所述第一L7代理向所述第二L4代理发送所述第一数据包和所述第一租户的标识;其中,所述第二L4代理用于:基于所述第一租户的标识,确认所述第一租户和所述第三业务容器组所属的租户是同一租户;将所述第一数据包发送至所述第三业务容器组。第二业务节点可以是上文描述的业务节点200,第三业务容器组也可以是上文描述的业务容器组210。该实施例的具体实现方式可以参考上文对图6中步骤608-步骤610的介绍,在此不再赘述。In some embodiments, the service grid system further includes a second service node, the second service node running a second L4 agent and a third service container group; the first L7 agent performs traffic management on the first data packet based on the configuration information of the first service, including: the first L7 agent selects the third service container group as the target container group of the first data packet; the first L7 agent sends the first data packet and the identifier of the first tenant to the second L4 agent; wherein the second L4 agent is used to: confirm that the tenants to which the first tenant and the third service container group belong are the same tenant based on the identifier of the first tenant; and send the first data packet to the third service container group. The second service node may be the service node 200 described above, and the third service container group may also be the service container group 210 described above. The specific implementation of this embodiment can refer to the above description of steps 608-610 in FIG. 6, which will not be repeated here.

通过上述方法,同一L7代理可以包括多个租户的服务的配置信息,在需要对租户的服务的数据包进行流量管理时,L7代理获取该租户的标识,并基于该租户的标识从多个租户的服务的配置信息中获取该租户的服务的配置信息,进而可基于该租户的服务的配置信息对该租户的服务的数据包进行流量管理。如此,使得同一L7代理能够对多个租户的服务的数据包进行流量管理,实现了多租户共享L7代理。多租户共享L7代理可以提升L7代理的计算资源利用率、降低L7代理的调度压力等。Through the above method, the same L7 agent can include the configuration information of services of multiple tenants. When it is necessary to perform traffic management on the data packets of the tenant's services, the L7 agent obtains the identifier of the tenant, and obtains the configuration information of the tenant's services from the configuration information of the services of multiple tenants based on the identifier of the tenant, and then can perform traffic management on the data packets of the tenant's services based on the configuration information of the tenant's services. In this way, the same L7 agent can perform traffic management on the data packets of the services of multiple tenants, realizing multi-tenant sharing of the L7 agent. Multi-tenant sharing of the L7 agent can improve the computing resource utilization of the L7 agent, reduce the scheduling pressure of the L7 agent, etc.

参阅图8,本申请实施例提供了一种流量管理装置800。其中,所述装置800配置于服务网格系统中的第一L7代理,所述服务网格系统包括第一业务节点和代理集群;其中,所述第一业务节点运行有第一L4代理和第一租户的第一业务容器组;所述第一L7代理运行在所述代理集群中,所述第一L7代理包括多个服务的配置信息,所述多个服务中的不同服务属于同一租户或不同租户,所述服务的配置信息用于所述第一L7代理对所述服务的数据包进行流量管理。如图8所示,所述装置800包括:Referring to FIG8 , an embodiment of the present application provides a traffic management device 800. The device 800 is configured in a first L7 agent in a service grid system, and the service grid system includes a first service node and a proxy cluster; the first service node runs a first L4 agent and a first service container group of a first tenant; the first L7 agent runs in the proxy cluster, and the first L7 agent includes configuration information of multiple services, different services in the multiple services belong to the same tenant or different tenants, and the configuration information of the service is used by the first L7 agent to perform traffic management on the data packets of the service. As shown in FIG8 , the device 800 includes:

接收模块810,用于接收所述第一L4代理发送的所述第一租户的标识和第一数据包,所述第一数据包是所述第一L4代理从所述第一业务容器组接收的;A receiving module 810 is configured to receive an identifier of the first tenant and a first data packet sent by the first L4 agent, where the first data packet is received by the first L4 agent from the first service container group;

识别模块820,用于基于所述第一租户的标识,在所述多个服务的配置信息中识别第一服务的配置信息,所述第一服务属于所述第一租户;an identification module 820, configured to identify, based on the identifier of the first tenant, configuration information of a first service from the configuration information of the plurality of services, the first service belonging to the first tenant;

管理模块830,用于基于所述第一服务的配置信息,对所述第一数据包进行流量管理。The management module 830 is used to perform traffic management on the first data packet based on the configuration information of the first service.

在一些实施例中,所述第一业务节点还运行有第二租户的第二业务容器组;所述接收模块810还用于:接收所述第一L4代理发送的所述第二租户的标识和第二数据包,所述第二数据包是所述第一L4代理从所述第二业务容器组接收的;所述识别模块820还用于:基于所述第二租户的标识,在所述多个服务的配置信息中识别第二服务的配置信息,所述第二服务属于所述第二租户;所述管理模块830还用于:基于所述第二服务的配置信息,对所述第二数据包进行流量管理。In some embodiments, the first service node also runs a second service container group of a second tenant; the receiving module 810 is also used to: receive the identifier of the second tenant and a second data packet sent by the first L4 agent, the second data packet is received by the first L4 agent from the second service container group; the identification module 820 is also used to: based on the identifier of the second tenant, identify the configuration information of the second service in the configuration information of the multiple services, the second service belongs to the second tenant; the management module 830 is also used to: based on the configuration information of the second service, perform traffic management on the second data packet.

在一些实施例中,所述第一服务包括所述第一数据包对应的服务和其他服务;所述管理模块830用于:基于所述第一数据包对应的服务的标识,在所述第一服务的配置信息中识别所述第一数据包对应的服务的配置信息;基于所述第一数据包对应的服务的配置信息,对所述第一数据包进行流量管理。In some embodiments, the first service includes the service corresponding to the first data packet and other services; the management module 830 is used to: based on the identifier of the service corresponding to the first data packet, identify the configuration information of the service corresponding to the first data packet in the configuration information of the first service; based on the configuration information of the service corresponding to the first data packet, perform traffic management on the first data packet.

在一些实施例中,所述代理集群还运行有第二L7代理,所述第二L7代理包括至少一个服务的配置信息;所述接收模块810用于:当所述多个服务中属于所述第一租户的服务的数量大于所述至少一个服务中属于所述第一租户的服务的数量时,接收所述第一L4代理发送的所述第一租户的标识和所述第一数据包。In some embodiments, the proxy cluster also runs a second L7 agent, which includes configuration information of at least one service; the receiving module 810 is used to: when the number of services belonging to the first tenant in the multiple services is greater than the number of services belonging to the first tenant in the at least one service, receive the identifier of the first tenant and the first data packet sent by the first L4 agent.

在一些实施例中,所述代理集群还运行有第二L7代理,所述第二L7代理也包括所述第一服务的配置信息;所述接收模块810用于:当所述第二L7代理的负载大于所述第一L7代理的负载时,接收所述第一L4代理发送的所述第一租户的标识和所述第一数据包。In some embodiments, the proxy cluster also runs a second L7 proxy, which also includes configuration information of the first service; the receiving module 810 is used to: when the load of the second L7 proxy is greater than the load of the first L7 proxy, receive the identifier of the first tenant and the first data packet sent by the first L4 agent.

在一些实施例中,所述服务网格系统还包括:与所述代理集群连接的控制台;所述接收模块810用于:从所述控制台接收并记录两个或两个以上服务的配置信息;其中,所述两个或两个以上服务属于同一租户,或者,所述两个或两个以上服务中的一个服务的输出是另一个服务的输入。In some embodiments, the service grid system also includes: a console connected to the proxy cluster; the receiving module 810 is used to: receive and record configuration information of two or more services from the console; wherein the two or more services belong to the same tenant, or the output of one of the two or more services is the input of another service.

在一些实施例中,所述服务网格系统还包括第二业务节点,所述第二业务节点运行有第二L4代理和第三业务容器组;所述管理模块830用于:所述第一L7代理选择所述第三业务容器组为所述第一数据包的目标容器组;所述第一L7代理向所述第二L4代理发送所述第一数据包和所述第一租户的标识;其中,所述第二L4代理用于:基于所述第一租户的标识,确认所述第一租户和所述第三业务容器组所属的租户是同一租户;将所述第一数据包发送至所述第三业务容器组。In some embodiments, the service grid system further includes a second service node, which runs a second L4 agent and a third service container group; the management module 830 is used for: the first L7 agent selects the third service container group as the target container group of the first data packet; the first L7 agent sends the first data packet and the identifier of the first tenant to the second L4 agent; wherein the second L4 agent is used for: based on the identifier of the first tenant, confirming that the tenant to which the first tenant and the third service container group belong is the same tenant; and sending the first data packet to the third service container group.

其中,接收模块810、识别模块820和管理模块830均可以通过软件实现,或者可以通过硬件实现。示例性的,接下来以接收模块810为例,介绍接收模块810的实现方式。类似的,识别模块820和管理模块830的实现方式可以参考接收模块810的实现方式。Among them, the receiving module 810, the identification module 820 and the management module 830 can all be implemented by software, or can be implemented by hardware. Exemplarily, the implementation of the receiving module 810 is introduced below by taking the receiving module 810 as an example. Similarly, the implementation of the identification module 820 and the management module 830 can refer to the implementation of the receiving module 810.

模块作为软件功能单元的一种举例,接收模块810可以包括运行在计算实例上的代码。其中,计算实例可以包括物理主机(计算设备)、虚拟机、容器中的至少一种。进一步地,上述计算实例可以是一台或者多台。例如,接收模块810可以包括运行在多个主机/虚拟机/容器上的代码。需要说明的是,用于运行该代码的多个主机/虚拟机/容器可以分布在相同的region中,也可以分布在不同的region中。进一步地,用于运行该代码的多个主机/虚拟机/容器可以分布在相同的可用区AZ中,也可以分布在不同的AZ中,每个AZ包括一个数据中心或多个地理位置相近的数据中心。其中,通常一个region可以包括多个AZ。As an example of a software functional unit, the receiving module 810 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the receiving module 810 may include code running on multiple hosts/virtual machines/containers. It should be noted that the multiple hosts/virtual machines/containers used to run the code can be distributed in the same region or in different regions. Furthermore, the multiple hosts/virtual machines/containers used to run the code can be distributed in the same availability zone AZ or in different AZs, and each AZ includes a data center or multiple data centers with close geographical locations. Among them, usually a region can include multiple AZs.

同样,用于运行该代码的多个主机/虚拟机/容器可以分布在同一个VPC中,也可以分布在多个VPC中。其中,通常一个VPC设置在一个region内,同一region内两个VPC之间,以及不同region的VPC之间跨区通信需在每个VPC内设置通信网关,经通信网关实现VPC之间的互连。Similarly, multiple hosts/virtual machines/containers used to run the code can be distributed in the same VPC or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.

模块作为硬件功能单元的一种举例,接收模块810可以包括至少一个计算设备,如服务器等。或者,接收模块810也可以是利用专用集成电路(application-specific integrated circuit,ASIC)实现、或可编程逻辑器件(programmable logic device,PLD)实现的设备等。其中,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD)、现场可编程门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合实现。As an example of a hardware functional unit, the receiving module 810 may include at least one computing device, such as a server, etc. Alternatively, the receiving module 810 may also be a device implemented using 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.

接收模块810包括的多个计算设备可以分布在相同的region中,也可以分布在不同的region中。接收模块810包括的多个计算设备可以分布在相同的AZ中,也可以分布在不同的AZ中。同样,接收模块810包括的多个计算设备可以分布在同一个VPC中,也可以分布在多个VPC中。其中,所述多个计算设备可以是服务器、ASIC、PLD、CPLD、FPGA和GAL等计算设备的任意组合。The multiple computing devices included in the receiving module 810 can be distributed in the same region or in different regions. The multiple computing devices included in the receiving module 810 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the receiving module 810 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

需要说明的是,在其他实施例中,接收模块810可以用于执行图7所示方法中的任意步骤,识别模块820可以用于执行图7所示方法中的任意步骤,管理模块830可以用于执行图7所示方法中的任意步骤。接收模块810、识别模块820和管理模块830负责实现的步骤可根据需要指定,通过接收模块810、识别模块820和管理模块830分别实现图7所示方法中不同的步骤来实现流量管理装置800的全部功能。It should be noted that, in other embodiments, the receiving module 810 can be used to execute any step in the method shown in Figure 7, the identifying module 820 can be used to execute any step in the method shown in Figure 7, and the management module 830 can be used to execute any step in the method shown in Figure 7. The steps that the receiving module 810, the identifying module 820, and the management module 830 are responsible for implementing can be specified as needed, and the receiving module 810, the identifying module 820, and the management module 830 respectively implement different steps in the method shown in Figure 7 to realize all the functions of the traffic management device 800.

本申请还提供一种计算设备900。如图9所示,计算设备900包括:总线902、处理器904、存储器906和通信接口908。处理器904、存储器906和通信接口908之间通过总线902通信。计算设备900可以是服务器或终端设备。应理解,本申请不限定计算设备900中的处理器、存储器的个数。The present application also provides a computing device 900. As shown in FIG9 , the computing device 900 includes: a bus 902, a processor 904, a memory 906, and a communication interface 908. The processor 904, the memory 906, and the communication interface 908 communicate with each other through the bus 902. The computing device 900 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 the computing device 900.

总线902可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图9中仅用一条线表示,但并不表示仅有一根总线或一种类型的总线。总线902可包括在计算设备900各个部件(例如,存储器906、处理器904、通信接口908)之间传送信息的通路。The bus 902 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, FIG. 9 is represented by only one line, but does not mean that there is only one bus or one type of bus. The bus 902 may include a path for transmitting information between various components of the computing device 900 (e.g., the memory 906, the processor 904, and the communication interface 908).

处理器904可以包括中央处理器(central processing unit,CPU)、图形处理器(graphics processing unit,GPU)、微处理器(micro processor,MP)或者数字信号处理器(digital signal processor,DSP)等处理器中的任意一种或多种。Processor 904 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).

存储器906可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)。存储器906还可以包括非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM),快闪存储器,机械硬盘(hard disk drive,HDD)或固态硬盘(solid state drive,SSD)。The memory 906 may include a volatile memory (volatile memory), such as a random access memory (RAM). The memory 906 may also include a non-volatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

存储器906中存储有可执行的程序代码,处理器904执行该可执行的程序代码以分别实现前述接收模块810、识别模块820和管理模块830的功能,从而实现图7所示方法。也即,存储器906上存有用于执行图7所示方法的指令。The memory 906 stores executable program codes, and the processor 904 executes the executable program codes to respectively implement the functions of the aforementioned receiving module 810, identification module 820 and management module 830, thereby implementing the method shown in Figure 7. That is, the memory 906 stores instructions for executing the method shown in Figure 7.

通信接口908使用例如但不限于网络接口卡、收发器一类的收发模块,来实现计算设备900与其他设备或通信网络之间的通信。The communication interface 908 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 900 and other devices or communication networks.

本申请实施例还提供了一种计算设备集群。该计算设备集群包括至少一台计算设备。该计算设备可以是服务器,例如是中心服务器、边缘服务器,或者是本地数据中心中的本地服务器。在一些实施例中,计算设备也可以是台式机、笔记本电脑或者智能手机等终端设备。The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.

如图10所示,所述计算设备集群包括至少一个计算设备900。计算设备集群中的一个或多个计算设备900中的存储器906中可以存有相同的用于执行图7所示方法的指令。As shown in Fig. 10, the computing device cluster includes at least one computing device 900. The memory 906 in one or more computing devices 900 in the computing device cluster may store the same instructions for executing the method shown in Fig. 7.

在一些可能的实现方式中,该计算设备集群中的一个或多个计算设备900的存储器906中也可以分别存有用于执行图7所示方法的部分指令。换言之,一个或多个计算设备900的组合可以共同执行用于执行图7所示方法的指令。In some possible implementations, the memory 906 of one or more computing devices 900 in the computing device cluster may also respectively store some instructions for executing the method shown in Figure 7. In other words, a combination of one or more computing devices 900 may jointly execute instructions for executing the method shown in Figure 7.

需要说明的是,计算设备集群中的不同的计算设备900中的存储器906可以存储不同的指令,分别用于执行流量管理装置800的部分功能。也即,不同的计算设备900中的存储器906存储的指令可以实现接收模块810、识别模块820和管理模块830中的一个或多个模块的功能。It should be noted that the memory 906 in different computing devices 900 in the computing device cluster may store different instructions, which are respectively used to execute part of the functions of the traffic management device 800. That is, the instructions stored in the memory 906 in different computing devices 900 may implement the functions of one or more modules of the receiving module 810, the identifying module 820 and the managing module 830.

在一些可能的实现方式中,计算设备集群中的一个或多个计算设备可以通过网络连接。其中,所述网络可以是广域网或局域网等等。图11示出了一种可能的实现方式。如图11所示,两个计算设备900A和900B之间通过网络进行连接。具体地,通过各个计算设备中的通信接口与所述网络进行连接。在这一类可能的实现方式中,计算设备900A中的存储器906中存有执行接收模块810的功能的指令。同时,计算设备900B中的存储器906中存有执行识别模块820和管理模块830的功能的指令。In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network. The network may be a wide area network or a local area network, etc. FIG. 11 shows a possible implementation. As shown in FIG. 11 , two computing devices 900A and 900B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 906 in the computing device 900A stores instructions for executing the functions of the receiving module 810. At the same time, the memory 906 in the computing device 900B stores instructions for executing the functions of the identification module 820 and the management module 830.

应理解,图11中示出的计算设备900A的功能也可以由多个计算设备900完成。同样,计算设备900B的功能也可以由多个计算设备900完成。It should be understood that the functions of the computing device 900A shown in FIG11 may also be completed by multiple computing devices 900. Similarly, the functions of the computing device 900B may also be completed by multiple computing devices 900.

本申请实施例还提供了另一种计算设备集群。该计算设备集群中各计算设备之间的连接关系可以类似的参考图10和图11所述计算设备集群的连接方式。不同的是,该计算设备集群中的一个或多个计算设备900中的存储器906中可以存有相同的用于执行图7所示方法的指令。The embodiment of the present application also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to the connection mode of the computing device cluster described in Figures 10 and 11. The difference is that the memory 906 in one or more computing devices 900 in the computing device cluster can store the same instructions for executing the method shown in Figure 7.

在一些可能的实现方式中,该计算设备集群中的一个或多个计算设备900的存储器906中也可以分别存有用于执行图7所示方法的部分指令。换言之,一个或多个计算设备900的组合可以共同执行用于执行图7所示方法的指令。In some possible implementations, the memory 906 of one or more computing devices 900 in the computing device cluster may also respectively store some instructions for executing the method shown in Figure 7. In other words, a combination of one or more computing devices 900 may jointly execute instructions for executing the method shown in Figure 7.

本申请实施例还提供了一种包含指令的计算机程序产品。所述计算机程序产品可以是包含指令的,能够运行在计算设备上或被储存在任何可用介质中的软件或程序产品。当所述计算机程序产品在至少一个计算设备上运行时,使得至少一个计算设备执行图7所示方法。The embodiment of 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 the method shown in FIG. 7 .

本申请实施例还提供了一种计算机可读存储介质。所述计算机可读存储介质可以是计算设备能够存储的任何可用介质或者是包含一个或多个可用介质的数据中心等主机迁移设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘)等。该计算机可读存储介质包括指令,所述指令指示计算设备执行图7所示方法。The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can 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 can 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 the method shown in Figure 7.

最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的保护范围。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 (33)

一种流量管理方法,其特征在于,所述方法应用于服务网格系统,所述服务网格系统包括第一业务节点和代理集群;其中,所述第一业务节点运行有第一传输层L4代理和第一租户的第一业务容器组;所述代理集群运行有第一应用层L7代理,所述第一L7代理包括多个服务的配置信息,所述多个服务中的不同服务属于同一租户或不同租户,所述服务的配置信息用于所述第一L7代理对所述服务的数据包进行流量管理;所述方法包括:A traffic management method, characterized in that the method is applied to a service grid system, the service grid system includes a first service node and a proxy cluster; wherein the first service node runs a first transport layer L4 proxy and a first service container group of a first tenant; the proxy cluster runs a first application layer L7 proxy, the first L7 proxy includes configuration information of multiple services, different services in the multiple services belong to the same tenant or different tenants, and the configuration information of the service is used by the first L7 proxy to perform traffic management on data packets of the service; the method includes: 所述第一L4代理接收所述第一业务容器组发出的第一数据包;The first L4 agent receives a first data packet sent by the first service container group; 所述第一L4代理将所述第一租户的标识和所述第一数据包发送至所述第一L7代理;The first L4 agent sends the identifier of the first tenant and the first data packet to the first L7 agent; 所述第一L7代理基于所述第一租户的标识,在所述多个服务的配置信息中识别第一服务的配置信息,所述第一服务属于所述第一租户;The first L7 agent identifies, based on the identifier of the first tenant, configuration information of a first service from the configuration information of the plurality of services, the first service belonging to the first tenant; 所述第一L7代理基于所述第一服务的配置信息,对所述第一数据包进行流量管理。The first L7 agent performs traffic management on the first data packet based on the configuration information of the first service. 根据权利要求1所述的方法,其特征在于,所述第一业务节点还运行有第二租户的第二业务容器组;所述方法包括:The method according to claim 1 is characterized in that the first service node also runs a second service container group of a second tenant; the method comprises: 所述第一L4代理接收所述第二业务容器组发出的第二数据包;The first L4 agent receives a second data packet sent by the second service container group; 所述第一L4代理将所述第二租户的标识和所述第二数据包发送至所述第一L7代理;The first L4 agent sends the identifier of the second tenant and the second data packet to the first L7 agent; 所述第一L7代理基于所述第二租户的标识,在所述多个服务的配置信息中识别第二服务的配置信息,所述第二服务属于所述第二租户;The first L7 agent identifies, based on the identifier of the second tenant, configuration information of a second service from the configuration information of the plurality of services, where the second service belongs to the second tenant; 所述第一L7代理基于所述第二服务的配置信息,对所述第二数据包进行流量管理。The first L7 agent performs traffic management on the second data packet based on the configuration information of the second service. 根据权利要求1或2所述的方法,其特征在于,所述第一服务包括所述第一数据包对应的服务和其他服务;The method according to claim 1 or 2, characterized in that the first service includes a service corresponding to the first data packet and other services; 所述第一L7代理基于所述第一服务的配置信息,对所述第一数据包进行流量管理,包括:The first L7 agent performs traffic management on the first data packet based on the configuration information of the first service, including: 所述第一L7代理基于所述第一数据包对应的服务的标识,在所述第一服务的配置信息中识别所述第一数据包对应的服务的配置信息;The first L7 agent identifies, based on the identifier of the service corresponding to the first data packet, the configuration information of the service corresponding to the first data packet in the configuration information of the first service; 所述第一L7代理基于所述第一数据包对应的服务的配置信息,对所述第一数据包进行流量管理。The first L7 agent performs traffic management on the first data packet based on configuration information of a service corresponding to the first data packet. 根据权利要求3所述的方法,其特征在于,所述代理集群运行有多个L7代理;所述第一L4代理将所述第一租户的标识和所述第一数据包发送至所述第一L7代理,包括:The method according to claim 3, wherein the proxy cluster runs multiple L7 proxies; and the first L4 proxy sends the identifier of the first tenant and the first data packet to the first L7 proxy, comprising: 所述第一L4代理基于所述第一租户的标识,从所述多个L7代理中识别包括所述第一租户的服务的配置信息的L7代理;The first L4 agent identifies, from the plurality of L7 agents, an L7 agent including configuration information of the service of the first tenant based on the identifier of the first tenant; 所述第一L4代理基于所述第一数据包对应的服务的标识,从所述包括所述第一租户的服务的配置信息的L7代理中识别包括所述第一数据包对应的服务的配置信息的L7代理,得到所述第一L7代理。The first L4 agent identifies, based on the identifier of the service corresponding to the first data packet, an L7 agent including the configuration information of the service corresponding to the first data packet from the L7 agents including the configuration information of the service of the first tenant, and obtains the first L7 agent. 根据权利要求1-4中任一项所述的方法,其特征在于,所述代理集群还运行有第二L7代理,所述第二L7代理包括至少一个服务的配置信息;The method according to any one of claims 1 to 4, characterized in that the proxy cluster also runs a second L7 proxy, and the second L7 proxy includes configuration information of at least one service; 所述第一L4代理将所述第一租户的标识和所述第一数据包发送至所述第一L7代理,包括:The first L4 agent sends the identifier of the first tenant and the first data packet to the first L7 agent, including: 当所述多个服务中属于所述第一租户的服务的数量大于所述至少一个服务中属于所述第一租户的服务的数量时,所述第一L4代理将所述第一租户的标识和所述第一数据包发送至所述第一L7代理。When the number of services belonging to the first tenant in the multiple services is greater than the number of services belonging to the first tenant in the at least one service, the first L4 agent sends the identifier of the first tenant and the first data packet to the first L7 agent. 根据权利要求1-4中任一项所述的方法,其特征在于,所述代理集群还运行有第二L7代理,所述第二L7代理也包括所述第一服务的配置信息;The method according to any one of claims 1 to 4, characterized in that the proxy cluster also runs a second L7 proxy, and the second L7 proxy also includes the configuration information of the first service; 所述第一L4代理将所述第一租户的标识和所述第一数据包发送至所述第一L7代理,包括:The first L4 agent sends the identifier of the first tenant and the first data packet to the first L7 agent, including: 当所述第二L7代理的负载大于所述第一L7代理的负载时,所述第一L4代理将所述第一租户的标识和所述第一数据包发送至所述第一L7代理。When the load of the second L7 agent is greater than the load of the first L7 agent, the first L4 agent sends the identifier of the first tenant and the first data packet to the first L7 agent. 根据权利要求1-6中任一项所述的方法,其特征在于,所述服务网格系统还包括:与所述代理集群连接的控制台;The method according to any one of claims 1 to 6, characterized in that the service grid system further comprises: a console connected to the proxy cluster; 所述方法还包括:所述控制台将两个或两个以上服务的配置信息发送至所述代理集群中的同一L7代理;其中,所述两个或两个以上服务属于同一租户,或者,所述两个或两个以上服务中的一个服务的输出是另一个服务的输入。The method also includes: the console sending configuration information of two or more services to the same L7 agent in the agent cluster; wherein the two or more services belong to the same tenant, or the output of one of the two or more services is the input of another service. 根据权利要求7所述的方法,其特征在于,所述代理集群运行有多个L7代理;其中,在所述多个L7代理中,所述同一L7代理包括最少数量服务的配置信息,或者,所述同一L7代理包括最少数量租户的配置信息。The method according to claim 7 is characterized in that the proxy cluster runs multiple L7 proxies; wherein, among the multiple L7 proxies, the same L7 proxy includes configuration information of a minimum number of services, or the same L7 proxy includes configuration information of a minimum number of tenants. 根据权利要求1-8中任一项所述的方法,其特征在于,所述服务网格系统还包括第二业务节点,所述第二业务节点运行有第二L4代理和第三业务容器组;The method according to any one of claims 1 to 8, characterized in that the service grid system further comprises a second service node, and the second service node runs a second L4 proxy and a third service container group; 所述第一L7代理基于所述第一服务的配置信息,对所述第一数据包进行流量管理,包括:The first L7 agent performs traffic management on the first data packet based on the configuration information of the first service, including: 所述第一L7代理选择所述第三业务容器组为所述第一数据包的目标容器组;The first L7 proxy selects the third service container group as the target container group of the first data packet; 所述第一L7代理向所述第二L4代理发送所述第一数据包和所述第一租户的标识;The first L7 agent sends the first data packet and the identifier of the first tenant to the second L4 agent; 所述方法还包括:The method further comprises: 所述第二L4代理基于所述第一租户的标识,确认所述第一租户和所述第三业务容器组所属的租户是同一租户;The second L4 agent confirms, based on the identifier of the first tenant, that the first tenant and the tenant to which the third service container group belongs are the same tenant; 所述第二L4代理将所述第一数据包发送至所述第三业务容器组。The second L4 agent sends the first data packet to the third service container group. 一种服务网格系统,其特征在于,所述服务网格系统包括第一业务节点和代理集群;其中,所述第一业务节点运行有第一L4代理和第一租户的第一业务容器组;所述代理集群运行有第一L7代理,所述第一L7代理包括多个服务的配置信息,所述多个服务中的不同服务属于同一租户或不同租户,所述服务的配置信息用于所述第一L7代理对所述服务的数据包进行流量管理;其中,A service grid system, characterized in that the service grid system comprises a first service node and an agent cluster; wherein the first service node runs a first L4 agent and a first service container group of a first tenant; the agent cluster runs a first L7 agent, the first L7 agent comprises configuration information of a plurality of services, different services in the plurality of services belong to the same tenant or different tenants, and the configuration information of the service is used by the first L7 agent to perform traffic management on data packets of the service; wherein, 所述第一L4代理用于:接收所述第一业务容器组发出的第一数据包;The first L4 agent is used to: receive a first data packet sent by the first service container group; 所述第一L4代理用于:将所述第一租户的标识和所述第一数据包发送至所述第一L7代理;The first L4 agent is used to: send the identifier of the first tenant and the first data packet to the first L7 agent; 所述第一L7代理用于:基于所述第一租户的标识,在所述多个服务的配置信息中识别第一服务的配置信息,所述第一服务属于所述第一租户;The first L7 agent is used to: identify, based on the identifier of the first tenant, configuration information of a first service from the configuration information of the multiple services, the first service belonging to the first tenant; 所述第一L7代理用于:基于所述第一服务的配置信息,对所述第一数据包进行流量管理。The first L7 agent is used to: perform traffic management on the first data packet based on configuration information of the first service. 根据权利要求10所述的服务网格系统,其特征在于,所述第一业务节点还运行有第二租户的第二业务容器组;The service grid system according to claim 10, characterized in that the first service node also runs a second service container group of a second tenant; 所述第一L4代理还用于:接收所述第二业务容器组发出的第二数据包;The first L4 agent is further used to: receive a second data packet sent by the second service container group; 所述第一L4代理还用于:将所述第二租户的标识和所述第二数据包发送至所述第一L7代理;The first L4 agent is further used to: send the identifier of the second tenant and the second data packet to the first L7 agent; 所述第一L7代理还用于:基于所述第二租户的标识,在所述多个服务的配置信息中识别第二服务的配置信息,所述第二服务属于所述第二租户;The first L7 agent is further used to: identify, based on the identifier of the second tenant, configuration information of a second service in the configuration information of the plurality of services, the second service belonging to the second tenant; 所述第一L7代理还用于:基于所述第二服务的配置信息,对所述第二数据包进行流量管理。The first L7 agent is further used to: perform traffic management on the second data packet based on the configuration information of the second service. 根据权利要求10或11所述的服务网格系统,其特征在于,所述第一服务包括所述第一数据包对应的服务和其他服务;The service grid system according to claim 10 or 11, characterized in that the first service includes a service corresponding to the first data packet and other services; 所述第一L7代理用于:The first L7 proxy is used to: 基于所述第一数据包对应的服务的标识,在所述第一服务的配置信息中识别所述第一数据包对应的服务的配置信息;Based on the identifier of the service corresponding to the first data packet, identifying the configuration information of the service corresponding to the first data packet in the configuration information of the first service; 基于所述第一数据包对应的服务的配置信息,对所述第一数据包进行流量管理。Based on the configuration information of the service corresponding to the first data packet, traffic management is performed on the first data packet. 根据权利要求10-12中任一项所述的服务网格系统,其特征在于,所述代理集群还运行有第二L7代理,所述第二L7代理包括至少一个服务的配置信息;The service grid system according to any one of claims 10 to 12, characterized in that the proxy cluster further runs a second L7 proxy, and the second L7 proxy includes configuration information of at least one service; 所述第一L4代理用于:当所述多个服务中属于所述第一租户的服务的数量大于所述至少一个服务中属于所述第一租户的服务的数量时,将所述第一租户的标识和所述第一数据包发送至所述第一L7代理。The first L4 agent is configured to send the identifier of the first tenant and the first data packet to the first L7 agent when the number of services belonging to the first tenant in the multiple services is greater than the number of services belonging to the first tenant in the at least one service. 根据权利要求10-12中任一项所述的服务网格系统,其特征在于,所述代理集群还运行有第二L7代理,所述第二L7代理也包括所述第一服务的配置信息;The service grid system according to any one of claims 10 to 12, characterized in that the proxy cluster also runs a second L7 proxy, and the second L7 proxy also includes the configuration information of the first service; 所述第一L4代理用于:当所述第二L7代理的负载大于所述第一L7代理的负载时,将所述第一租户的标识和所述第一数据包发送至所述第一L7代理。The first L4 agent is used for sending the identifier of the first tenant and the first data packet to the first L7 agent when the load of the second L7 agent is greater than the load of the first L7 agent. 根据权利要求10-14中任一项所述的服务网格系统,其特征在于,所述服务网格系统还包括:与所述代理集群连接的控制台;The service grid system according to any one of claims 10-14, characterized in that the service grid system further comprises: a console connected to the proxy cluster; 所述控制台用于:将两个或两个以上服务的配置信息发送至所述代理集群中的同一L7代理;其中,所述两个或两个以上服务属于同一租户,或者,所述两个或两个以上服务中的一个服务的输出是另一个服务的输入。The console is used to send configuration information of two or more services to the same L7 agent in the agent cluster; wherein the two or more services belong to the same tenant, or the output of one of the two or more services is the input of another service. 根据权利要求10-15中任一项所述的服务网格系统,其特征在于,所述服务网格系统还包括第二业务节点,所述第二业务节点运行有第二L4代理和第三业务容器组;The service grid system according to any one of claims 10-15, characterized in that the service grid system further comprises a second service node, the second service node running a second L4 proxy and a third service container group; 所述第一L7代理用于:The first L7 proxy is used to: 选择所述第三业务容器组为所述第一数据包的目标容器组;Selecting the third service container group as the target container group of the first data packet; 向所述第二L4代理发送所述第一数据包和所述第一租户的标识;Sending the first data packet and the identifier of the first tenant to the second L4 agent; 所述第二L4代理用于:The second L4 proxy is used to: 基于所述第一租户的标识,确认所述第一租户和所述第三业务容器组所属的租户是同一租户;Based on the identifier of the first tenant, confirm that the first tenant and the tenant to which the third business container group belongs are the same tenant; 将所述第一数据包发送至所述第三业务容器组。The first data packet is sent to the third service container group. 一种流量管理方法,其特征在于,所述方法应用于服务网格系统中的第一L7代理,所述服务网格系统包括第一业务节点和代理集群;其中,所述第一业务节点运行有第一L4代理和第一租户的第一业务容器组;所述第一L7代理运行在所述代理集群中,所述第一L7代理包括多个服务的配置信息,所述多个服务中的不同服务属于同一租户或不同租户,所述服务的配置信息用于所述第一L7代理对所述服务的数据包进行流量管理;所述方法包括:A traffic management method, characterized in that the method is applied to a first L7 agent in a service grid system, the service grid system includes a first service node and an agent cluster; wherein the first service node runs a first L4 agent and a first service container group of a first tenant; the first L7 agent runs in the agent cluster, the first L7 agent includes configuration information of multiple services, different services in the multiple services belong to the same tenant or different tenants, and the configuration information of the service is used by the first L7 agent to perform traffic management on data packets of the service; the method includes: 所述第一L7代理接收所述第一L4代理发送的所述第一租户的标识和第一数据包,所述第一数据包是所述第一L4代理从所述第一业务容器组接收的;The first L7 agent receives the identifier of the first tenant and a first data packet sent by the first L4 agent, where the first data packet is received by the first L4 agent from the first service container group; 所述第一L7代理基于所述第一租户的标识,在所述多个服务的配置信息中识别第一服务的配置信息,所述第一服务属于所述第一租户;The first L7 agent identifies, based on the identifier of the first tenant, configuration information of a first service from the configuration information of the plurality of services, the first service belonging to the first tenant; 所述第一L7代理基于所述第一服务的配置信息,对所述第一数据包进行流量管理。The first L7 agent performs traffic management on the first data packet based on the configuration information of the first service. 根据权利要求17所述的方法,其特征在于,所述第一业务节点还运行有第二租户的第二业务容器组;所述方法包括:The method according to claim 17 is characterized in that the first service node also runs a second service container group of a second tenant; the method comprising: 所述第一L7代理接收所述第一L4代理发送的所述第二租户的标识和第二数据包,所述第二数据包所述第一L4代理从所述第二业务容器组接收的;The first L7 agent receives the identifier of the second tenant and a second data packet sent by the first L4 agent, where the second data packet is received by the first L4 agent from the second service container group; 所述第一L4代理将所述第二租户的标识和所述第二数据包发送至所述第一L7代理;The first L4 agent sends the identifier of the second tenant and the second data packet to the first L7 agent; 所述第一L7代理基于所述第二租户的标识,在所述多个服务的配置信息中识别第二服务的配置信息,所述第二服务属于所述第二租户;The first L7 agent identifies, based on the identifier of the second tenant, configuration information of a second service from the configuration information of the plurality of services, where the second service belongs to the second tenant; 所述第一L7代理基于所述第二服务的配置信息,对所述第二数据包进行流量管理。The first L7 agent performs traffic management on the second data packet based on the configuration information of the second service. 根据权利要求17或18所述的方法,其特征在于,所述第一服务包括所述第一数据包对应的服务和其他服务;The method according to claim 17 or 18, characterized in that the first service includes a service corresponding to the first data packet and other services; 所述第一L7代理基于所述第一服务的配置信息,对所述第一数据包进行流量管理,包括:The first L7 agent performs traffic management on the first data packet based on the configuration information of the first service, including: 所述第一L7代理基于所述第一数据包对应的服务的标识,在所述第一服务的配置信息中识别所述第一数据包对应的服务的配置信息;The first L7 agent identifies, based on the identifier of the service corresponding to the first data packet, the configuration information of the service corresponding to the first data packet in the configuration information of the first service; 所述第一L7代理基于所述第一数据包对应的服务的配置信息,对所述第一数据包进行流量管理。The first L7 agent performs traffic management on the first data packet based on configuration information of a service corresponding to the first data packet. 根据权利要求17-19中任一项所述的方法,其特征在于,所述代理集群还运行有第二L7代理,所述第二L7代理包括至少一个服务的配置信息;The method according to any one of claims 17 to 19, characterized in that the proxy cluster also runs a second L7 proxy, and the second L7 proxy includes configuration information of at least one service; 所述第一L7代理接收所述第一L4代理发送所述第一租户的标识和第一数据包,包括:The first L7 agent receives the identifier of the first tenant and the first data packet sent by the first L4 agent, including: 当所述多个服务中属于所述第一租户的服务的数量大于所述至少一个服务中属于所述第一租户的服务的数量时,所述第一L7代理接收所述第一L4代理发送的所述第一租户的标识和所述第一数据包。When the number of services belonging to the first tenant in the multiple services is greater than the number of services belonging to the first tenant in the at least one service, the first L7 agent receives the identifier of the first tenant and the first data packet sent by the first L4 agent. 根据权利要求17-20中任一项所述的方法,其特征在于,所述代理集群还运行有第二L7代理,所述第二L7代理也包括所述第一服务的配置信息;The method according to any one of claims 17 to 20, characterized in that the proxy cluster also runs a second L7 proxy, and the second L7 proxy also includes configuration information of the first service; 所述第一L7代理接收所述第一L4代理发送的所述第一租户的标识和第一数据包,包括:The first L7 agent receives the identifier of the first tenant and the first data packet sent by the first L4 agent, including: 当所述第二L7代理的负载大于所述第一L7代理的负载时,所述第一L7代理接收所述第一L4代理发送的所述第一租户的标识和所述第一数据包。When the load of the second L7 agent is greater than the load of the first L7 agent, the first L7 agent receives the identifier of the first tenant and the first data packet sent by the first L4 agent. 根据权利要求17-21中任一项所述的方法,其特征在于,所述服务网格系统还包括:与所述代理集群连接的控制台;The method according to any one of claims 17-21, characterized in that the service grid system further comprises: a console connected to the proxy cluster; 所述方法还包括:所述第一L7代理从所述控制台接收并记录两个或两个以上服务的配置信息;其中,所述两个或两个以上服务属于同一租户,或者,所述两个或两个以上服务中的一个服务的输出是另一个服务的输入。The method also includes: the first L7 agent receives and records configuration information of two or more services from the console; wherein the two or more services belong to the same tenant, or the output of one of the two or more services is the input of another service. 根据权利要求17-22中任一项所述的方法,其特征在于,所述服务网格系统还包括第二业务节点,所述第二业务节点运行有第二L4代理和第三业务容器组;The method according to any one of claims 17 to 22, characterized in that the service grid system further comprises a second service node, the second service node running a second L4 proxy and a third service container group; 所述第一L7代理基于所述第一服务的配置信息,对所述第一数据包进行流量管理,包括:The first L7 agent performs traffic management on the first data packet based on the configuration information of the first service, including: 所述第一L7代理选择所述第三业务容器组为所述第一数据包的目标容器组;The first L7 proxy selects the third service container group as the target container group of the first data packet; 所述第一L7代理向所述第二L4代理发送所述第一数据包和所述第一租户的标识;The first L7 agent sends the first data packet and the identifier of the first tenant to the second L4 agent; 其中,所述第二L4代理用于:Wherein, the second L4 agent is used for: 基于所述第一租户的标识,确认所述第一租户和所述第三业务容器组所属的租户是同一租户;Based on the identifier of the first tenant, confirm that the first tenant and the tenant to which the third business container group belongs are the same tenant; 将所述第一数据包发送至所述第三业务容器组。The first data packet is sent to the third service container group. 一种流量管理装置,其特征在于,所述装置配置于服务网格系统中的第一L7代理,所述服务网格系统包括第一业务节点和代理集群;其中,所述第一业务节点运行有第一L4代理和第一租户的第一业务容器组;所述第一L7代理运行在所述代理集群中,所述第一L7代理包括多个服务的配置信息,所述多个服务中的不同服务属于同一租户或不同租户,所述服务的配置信息用于所述第一L7代理对所述服务的数据包进行流量管理;所述装置包括:A traffic management device, characterized in that the device is configured in a first L7 agent in a service grid system, the service grid system includes a first service node and an agent cluster; wherein the first service node runs a first L4 agent and a first service container group of a first tenant; the first L7 agent runs in the agent cluster, the first L7 agent includes configuration information of multiple services, different services in the multiple services belong to the same tenant or different tenants, and the configuration information of the service is used by the first L7 agent to perform traffic management on data packets of the service; the device includes: 接收模块,用于接收所述第一L4代理发送的所述第一租户的标识和第一数据包,所述第一数据包是所述第一L4代理从所述第一业务容器组接收的;a receiving module, configured to receive an identifier of the first tenant and a first data packet sent by the first L4 agent, where the first data packet is received by the first L4 agent from the first service container group; 识别模块,用于基于所述第一租户的标识,在所述多个服务的配置信息中识别第一服务的配置信息,所述第一服务属于所述第一租户;an identification module, configured to identify, based on the identifier of the first tenant, configuration information of a first service from the configuration information of the plurality of services, the first service belonging to the first tenant; 管理模块,用于基于所述第一服务的配置信息,对所述第一数据包进行流量管理。A management module is used to perform traffic management on the first data packet based on the configuration information of the first service. 根据权利要求24所述的装置,其特征在于,所述第一业务节点还运行有第二租户的第二业务容器组;The device according to claim 24, characterized in that the first service node also runs a second service container group of a second tenant; 所述接收模块还用于:接收所述第一L4代理发送的所述第二租户的标识和第二数据包,所述第二数据包是所述第一L4代理从所述第二业务容器组接收的;The receiving module is further used to: receive the identifier of the second tenant and a second data packet sent by the first L4 agent, where the second data packet is received by the first L4 agent from the second service container group; 所述识别模块还用于:基于所述第二租户的标识,在所述多个服务的配置信息中识别第二服务的配置信息,所述第二服务属于所述第二租户;The identification module is further used to: identify the configuration information of the second service in the configuration information of the plurality of services based on the identifier of the second tenant, the second service belonging to the second tenant; 所述管理模块还用于:基于所述第二服务的配置信息,对所述第二数据包进行流量管理。The management module is further used to: perform traffic management on the second data packet based on the configuration information of the second service. 根据权利要求24或25所述的装置,其特征在于,所述第一服务包括所述第一数据包对应的服务和其他服务;The device according to claim 24 or 25, characterized in that the first service includes a service corresponding to the first data packet and other services; 所述管理模块用于:The management module is used for: 基于所述第一数据包对应的服务的标识,在所述第一服务的配置信息中识别所述第一数据包对应的服务的配置信息;Based on the identifier of the service corresponding to the first data packet, identifying the configuration information of the service corresponding to the first data packet in the configuration information of the first service; 基于所述第一数据包对应的服务的配置信息,对所述第一数据包进行流量管理。Based on the configuration information of the service corresponding to the first data packet, traffic management is performed on the first data packet. 根据权利要求24-26中任一项所述的装置,其特征在于,所述代理集群还运行有第二L7代理,所述第二L7代理包括至少一个服务的配置信息;The device according to any one of claims 24-26, characterized in that the proxy cluster also runs a second L7 proxy, and the second L7 proxy includes configuration information of at least one service; 所述接收模块用于:当所述多个服务中属于所述第一租户的服务的数量大于所述至少一个服务中属于所述第一租户的服务的数量时,接收所述第一L4代理发送的所述第一租户的标识和所述第一数据包。The receiving module is used to: when the number of services belonging to the first tenant in the multiple services is greater than the number of services belonging to the first tenant in the at least one service, receive the identifier of the first tenant and the first data packet sent by the first L4 agent. 根据权利要求24-26中任一项所述的装置,其特征在于,所述代理集群还运行有第二L7代理,所述第二L7代理也包括所述第一服务的配置信息;The device according to any one of claims 24-26, characterized in that the proxy cluster also runs a second L7 proxy, and the second L7 proxy also includes the configuration information of the first service; 所述接收模块用于:当所述第二L7代理的负载大于所述第一L7代理的负载时,接收所述第一L4代理发送的所述第一租户的标识和所述第一数据包。The receiving module is used for: when the load of the second L7 agent is greater than the load of the first L7 agent, receiving the identifier of the first tenant and the first data packet sent by the first L4 agent. 根据权利要求24-28中任一项所述的装置,其特征在于,所述服务网格系统还包括:与所述代理集群连接的控制台;The device according to any one of claims 24-28, characterized in that the service grid system further comprises: a console connected to the proxy cluster; 所述接收模块用于:从所述控制台接收并记录两个或两个以上服务的配置信息;其中,所述两个或两个以上服务属于同一租户,或者,所述两个或两个以上服务中的一个服务的输出是另一个服务的输入。The receiving module is used to: receive and record configuration information of two or more services from the console; wherein the two or more services belong to the same tenant, or the output of one of the two or more services is the input of another service. 根据权利要求24-29中任一项所述的装置,其特征在于,所述服务网格系统还包括第二业务节点,所述第二业务节点运行有第二L4代理和第三业务容器组;The device according to any one of claims 24-29, characterized in that the service grid system further comprises a second service node, the second service node running a second L4 proxy and a third service container group; 所述管理模块用于:The management module is used for: 所述第一L7代理选择所述第三业务容器组为所述第一数据包的目标容器组;The first L7 proxy selects the third service container group as the target container group of the first data packet; 所述第一L7代理向所述第二L4代理发送所述第一数据包和所述第一租户的标识;The first L7 agent sends the first data packet and the identifier of the first tenant to the second L4 agent; 其中,所述第二L4代理用于:Wherein, the second L4 agent is used for: 基于所述第一租户的标识,确认所述第一租户和所述第三业务容器组所属的租户是同一租户;Based on the identifier of the first tenant, confirm that the first tenant and the tenant to which the third business container group belongs are the same tenant; 将所述第一数据包发送至所述第三业务容器组。The first data packet is sent to the third service container group. 一种计算设备集群,其特征在于,包括至少一个计算设备,每个计算设备包括处理器和存储器;A computing device cluster, characterized in that it includes at least one computing device, each computing device includes a processor and a memory; 所述至少一个计算设备的处理器用于执行所述至少一个计算设备的存储器中存储的指令,以使得所述计算设备集群执行如权利要求17至23中任一项所述的方法。The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 17 to 23. 一种计算机可读存储介质,其特征在于,包括计算机程序指令,当所述计算机程序指令由计算设备集群执行时,所述计算设备集群执行如权利要求17至23中任一项所述的方法。A computer-readable storage medium, characterized in that it includes computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method as described in any one of claims 17 to 23. 一种包含指令的计算机程序产品,其特征在于,当所述指令被计算机设备集群运行时,使得所述计算机设备集群执行如权利要求17至23任一项所述的方法。A computer program product comprising instructions, characterized in that when the instructions are executed by a computer device cluster, the computer device cluster executes the method according to any one of claims 17 to 23.
PCT/CN2024/142165 2023-12-25 2024-12-25 Traffic management method, service mesh system, apparatus, and cluster Pending WO2025140263A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202311817785 2023-12-25
CN202311817785.7 2023-12-25
CN202410256865.8 2024-03-06
CN202410256865.8A CN120223632A (en) 2023-12-25 2024-03-06 Traffic management method, service grid system, device and cluster

Publications (1)

Publication Number Publication Date
WO2025140263A1 true WO2025140263A1 (en) 2025-07-03

Family

ID=96104960

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/142165 Pending WO2025140263A1 (en) 2023-12-25 2024-12-25 Traffic management method, service mesh system, apparatus, and cluster

Country Status (2)

Country Link
CN (1) CN120223632A (en)
WO (1) WO2025140263A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11088902B1 (en) * 2020-04-06 2021-08-10 Vmware, Inc. Synchronization of logical network state between global and local managers
US20220337654A1 (en) * 2021-04-15 2022-10-20 Cloudflare, Inc. Non-http layer 7 protocol applications running in the browser
WO2023049584A1 (en) * 2021-09-27 2023-03-30 Intel Corporation Network layer 7 offload to infrastructure processing unit for service mesh
CN116232900A (en) * 2022-12-28 2023-06-06 北京君禾世纪科技有限公司 System and method for limiting and sharing application layer bandwidth based on double agents
CN116405553A (en) * 2023-03-31 2023-07-07 阿里巴巴(中国)有限公司 A system supporting multi-tenant traffic forwarding, related cloud network and forwarding method
CN116601606A (en) * 2020-12-15 2023-08-15 谷歌有限责任公司 Multitenant Control Plane Management on Computing Platforms

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11088902B1 (en) * 2020-04-06 2021-08-10 Vmware, Inc. Synchronization of logical network state between global and local managers
CN116601606A (en) * 2020-12-15 2023-08-15 谷歌有限责任公司 Multitenant Control Plane Management on Computing Platforms
US20220337654A1 (en) * 2021-04-15 2022-10-20 Cloudflare, Inc. Non-http layer 7 protocol applications running in the browser
WO2023049584A1 (en) * 2021-09-27 2023-03-30 Intel Corporation Network layer 7 offload to infrastructure processing unit for service mesh
CN116232900A (en) * 2022-12-28 2023-06-06 北京君禾世纪科技有限公司 System and method for limiting and sharing application layer bandwidth based on double agents
CN116405553A (en) * 2023-03-31 2023-07-07 阿里巴巴(中国)有限公司 A system supporting multi-tenant traffic forwarding, related cloud network and forwarding method

Also Published As

Publication number Publication date
CN120223632A (en) 2025-06-27

Similar Documents

Publication Publication Date Title
EP4141666A1 (en) Dual user space-kernel space datapaths for packet processing operations
US10129152B2 (en) Setting method, server device and service chain system
US11099826B2 (en) Canary deployment using an application delivery controller
EP4209905A1 (en) Service mesh system employing microservice, and service governance method
EP4202668B1 (en) Computer system and container management method and device
CN107078969A (en) Computer device, system and method for realizing load balancing
US12095734B1 (en) Container-based association and sharing of domain name system configuration objects
CN109542659A (en) Using more activating methods, equipment, data center's cluster and readable storage medium storing program for executing
CN104272258A (en) System and method for supporting implicit versioning in a transactional middleware machine environment
CN102316043A (en) Port virtualization method, switch and communication system
WO2023066224A1 (en) Method and apparatus for deploying container service
WO2025010985A1 (en) Service governance method and apparatus, and computer-readable storage medium
CN103140851A (en) System including a middleware machine environment
CN115412549A (en) Information configuration method and device and request processing method and device
CN106161603A (en) A kind of method of networking, equipment and framework
CN114024971B (en) Service data processing method, kubernetes cluster and medium
CN116938829A (en) Data forwarding method and related equipment
WO2025140263A1 (en) Traffic management method, service mesh system, apparatus, and cluster
WO2021143183A1 (en) Method for deploying virtual machine, and related apparatus
US10802859B2 (en) Setting method for server apparatus and server apparatus for load balancing
CN111355602B (en) Resource object management method and device
CN108289113A (en) VBNG system multi-dummy machine load share methods and vBNG system equipments
CN118842629A (en) Network communication method, system, terminal and storage medium of trusted equipment
US10469374B2 (en) Multiple provider framework for virtual switch data planes and data plane migration
WO2024103726A1 (en) Cloud service deployment method based on cloud computing and cloud management platform

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24911187

Country of ref document: EP

Kind code of ref document: A1