Container cluster traffic scheduling method, electronic device and computer readable storage medium

By acquiring node information and switch load within the container cluster and formulating traffic scheduling strategies, the problems of high network latency and high computing resource requirements in existing technologies are solved, achieving efficient scheduling of east-west traffic and improved bandwidth utilization within the container cluster.

CN118827672BActive Publication Date: 2025-11-04CHINA MOBILE FINANCIAL TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311640490.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-01
Publication Date
2025-11-04
Estimated Expiration
2043-12-01

AI Technical Summary

Technical Problem

Existing traffic scheduling solutions suffer from high network latency and high computing resource requirements in data centers, making them ineffective in managing east-west traffic scheduling within container clusters.

Method used

By obtaining container online messages through the container network interface within the container cluster, extracting node information, and combining it with switch load information, east-west traffic scheduling strategies are formulated. Scheduling is performed directly within the container network, avoiding packet disassembly analysis and saving computing resources.

Benefits of technology

It improves traffic scheduling efficiency, reduces network latency, enables efficient scheduling of east-west traffic within the container cluster, improves bandwidth utilization, and avoids network congestion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118827672B_ABST
    Figure CN118827672B_ABST
Patent Text Reader

Abstract

The application discloses a container cluster traffic scheduling method, an electronic device and a computer readable storage medium, relates to the technical field of computer networks, and the container cluster traffic scheduling method comprises the following steps: based on a container online message sent by a container cloud platform to a container network interface, extracting source and destination node information in node information of a cluster where each container is located; querying switch load information inside a container cluster, and determining an east-west direction traffic scheduling strategy according to the source and destination node information and the switch load information. The technical scheme of the application does not need to identify traffic by unpacking, saves computing resources, reduces network delay, can also schedule east-west direction traffic in a container cluster, and solves the technical problem of high network delay of a traditional traffic scheduling scheme.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of mobile communication, in particular to a container cluster traffic scheduling method, an electronic device and a computer readable storage medium. BACKGROUND

[0002] With the continuous development of cloud data and other technologies, the application of data centers is also becoming more and more widespread. Among them, the traffic scheduling system is an important part of the data center. The traffic scheduling system can dynamically schedule network traffic according to the network load of the data center, so as to improve the bandwidth utilization and avoid network congestion.

[0003] The current traffic scheduling scheme mainly includes placing the traffic scheduling system outside the container cluster, using six-tuple, DPI (deep packet inspection) or machine learning method to identify and unpack the traffic, and then marking the data packet with the corresponding mark. After calculating the scheduling path, the data packet is matched according to the mark for traffic scheduling and forwarding. However, the traffic identification method of this scheme is relatively complex, requires more computing resources, has high performance overhead and high network delay. Moreover, since the traffic scheduling system is located outside the container cluster, it can only realize the traffic scheduling in the north-south direction, which has certain limitations. SUMMARY

[0004] The main purpose of the present application is to provide a container cluster traffic scheduling method, an electronic device and a computer readable storage medium, which aims to solve the technical problem of high network delay of the traditional traffic scheduling scheme.

[0005] To achieve the above purpose, the present application provides a container cluster traffic scheduling method, which comprises:

[0006] Based on the container online message sent by the container cloud platform to the container network interface, the source and destination node information in the node information of each container cluster is extracted;

[0007] The switch load information inside the container cluster is queried, and the east-west direction traffic scheduling strategy is determined according to the source and destination node information and the switch load information.

[0008] Optionally, the source and destination node information includes source node ID and destination node ID, and the step of extracting the source and destination node information in the node information of each container cluster based on the container online message sent by the container cloud platform to the container network interface comprises:

[0009] When the container is online, the container online message is sent to the container network interface through the API server in the container cloud platform;

[0010] Obtaining cluster node information of the container in the container online message, and extracting source node ID and destination node ID corresponding to the container from the cluster node information.

[0011] Optionally, the east-west traffic scheduling policy comprises a scheduling priority, and the step of determining the east-west traffic scheduling policy according to the source-destination node information and the switch load information comprises:

[0012] When the number of concurrent containers is greater than or equal to a preset threshold, constructing a source-destination ID combination corresponding to each container according to source-destination node information corresponding to each container, wherein the source-destination ID combination comprises a source node ID and a destination node ID;

[0013] Grouping each container according to a comparison between source-destination ID combinations of each container, to obtain a plurality of container groups;

[0014] Determining a scheduling priority corresponding to each container group according to the number of containers in each container group, wherein the more the number of containers, the higher the scheduling priority.

[0015] Optionally, the step of grouping each container according to a comparison between source-destination ID combinations of each container, to obtain a plurality of container groups comprises:

[0016] Containers with the same source node ID and destination node ID are divided into the same group;

[0017] Containers with only one of the source node ID and the destination node ID being the same are divided into the same group;

[0018] Containers with the source node ID and the destination node ID being different from other containers are respectively divided into separate groups.

[0019] Optionally, the east-west traffic scheduling policy further comprises a target switch, and after the step of determining a scheduling priority corresponding to each container group according to the number of containers in each container group, the method further comprises:

[0020] Determining a priority of each switch according to the switch load information, wherein the lower the load of a switch, the higher the priority of the switch;

[0021] Allocating a corresponding target switch for each container group according to a priority order of each switch, wherein the target switch is used to provide a routing path for the container group.

[0022] Optionally, after the step of allocating a corresponding target switch for each container group according to a priority order of each switch, the method further comprises:

[0023] requesting a lock by the container in the container group to a corresponding target switch, and determining a request result according to a lock state of the target switch;

[0024] if the request result is failure and the container is in the same group as a container that has requested success, setting a state of the container to a spin state within a preset time;

[0025] if the request result is failure and the container is not in the same group as a container that has requested success, re-determining a target switch of the container according to a source and destination ID combination of the container;

[0026] if the request result is success, setting the lock state of the target switch to locked;

[0027] after an operation of the container is completed, adding a routing path of the container to an OVS flow table, and setting the lock state of the target switch to a release state.

[0028] Optionally, the east-west direction traffic scheduling strategy includes an east-west direction traffic scheduling path and a target switch, and the step of determining the east-west direction traffic scheduling strategy according to the source and destination node information and the switch load information includes:

[0029] when the number of concurrent containers is less than a preset threshold, obtaining at least one scheduling path between a source end node and a destination end node in source and destination nodes of the container;

[0030] determining a total load of each of the scheduling paths according to the switch load information;

[0031] selecting a scheduling path with the lowest total load as the east-west direction traffic scheduling path of the container;

[0032] selecting a spine switch of the scheduling path as the target switch of the container.

[0033] Optionally, the container cluster traffic scheduling method further includes:

[0034] extracting a network configuration requirement of an application running in the container from the container online message;

[0035] querying load information corresponding to each network port matched with the container, and selecting a path with the lowest load as a north-south direction traffic scheduling path of the container cluster connecting an external network from network ports meeting the network configuration requirement.

[0036] The application also provides a container cluster traffic scheduling device, which includes:

[0037] The information extraction module is configured to extract source and destination node information in node information of each container cluster based on a container online message sent by the container cloud platform to the container network interface.

[0038] The policy making module is configured to query switch load information inside the container cluster, and determine an east-west direction traffic scheduling policy according to the source and destination node information and the switch load information.

[0039] The present application also provides an electronic device, which is a physical device, and the electronic device comprises a memory, a processor, and a program of the container cluster traffic scheduling method stored in the memory and executable on the processor, and the program of the container cluster traffic scheduling method can implement the steps of the container cluster traffic scheduling method when executed by the processor.

[0040] The present application also provides a computer readable storage medium, and the computer readable storage medium stores a program of a container cluster traffic scheduling method, and the program of the container cluster traffic scheduling method can implement the steps of the container cluster traffic scheduling method when executed by a processor.

[0041] The present application also provides a computer program product comprising a computer program, and the computer program can implement the steps of the container cluster traffic scheduling method when executed by a processor.

[0042] The present application provides a container cluster traffic scheduling method, an electronic device, and a computer readable storage medium. First, node information of each container cluster is extracted based on a container online message sent by a container cloud platform to a container network interface. Then, switch load information inside the container cluster is queried, and an east-west direction traffic scheduling policy is determined according to the source and destination node information and the switch load information. In the technical solution of the present application, application program information, source and destination node information, and the like of a container are obtained through a container network interface inside the container cluster, and then, in combination with switch load information, relevant information of a newly online container can be obtained before data packets, without the need for packet analysis, thereby saving computing resources and avoiding an increase in network delay. Moreover, the technical solution directly performs traffic scheduling in the container network interface, implements the formulation and execution of a policy for scheduling east-west direction traffic in the container cluster, and solves the problem that a traditional traffic scheduling system cannot manage data flow directions inside a container network. BRIEF DESCRIPTION OF DRAWINGS

[0043] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, for those of ordinary skill in the art, the other drawings can also be obtained based on these drawings without any creative effort.

[0045] Figure 1 The flowchart of the container cluster traffic scheduling method according to the first embodiment of the present application;

[0046] Figure 2 The structural diagram of the container network traffic scheduling system to which the container cluster traffic scheduling method according to the present application is applied;

[0047] Figure 3 The path diagram of the east-west direction traffic scheduling in the container cluster traffic scheduling method according to the present application;

[0048] Figure 4 The structural diagram of the container cluster traffic scheduling device according to the embodiment of the present application;

[0049] Figure 5 The device structural diagram of the hardware running environment involved in the container cluster traffic scheduling method according to the embodiment of the present application.

[0050] The object implementation, functional features and advantages of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION

[0051] In order to make the above object, features and advantages of the present application more apparent and easy to understand, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those of ordinary skill in the art without any creative effort fall within the scope of protection of the present application.

[0052] Embodiment One

[0053] In the current data center, a traffic scheduling system is usually placed outside the container cluster, and methods such as six-tuple, DPI or machine learning are used for traffic identification and packet disassembly, which will generate a large performance overhead and require a large amount of computing resources, causing certain network delay and negatively affecting the user experience. Moreover, since the traffic scheduling system is placed outside the container cluster, it can only schedule north-south direction traffic and cannot schedule east-west direction traffic within the container cluster, which has certain limitations, and therefore a container cluster traffic scheduling method is needed that can reduce the demand for computing resources and performance overhead and effectively schedule east-west direction traffic within the container cluster.

[0054] Based on the above needs, the embodiments of the present application provide a container cluster traffic scheduling method. In the first embodiment of the container cluster traffic scheduling method of the present application, referring to Figure 1 , the container cluster traffic scheduling method comprises:

[0055] Step S10, based on the container online message sent by the container cloud platform to the container network interface, extracting the source and destination node information in the node information of the cluster where each container is located;

[0056] In the embodiments of the present application, it should be noted that the present container cluster traffic scheduling method can be built-in in the form of a plug-in in the traffic scheduling system within the container cluster for execution, without the need for external resources, thereby realizing the scheduling of internal traffic of the container cluster, and being more accurate and detailed than the traditional six-tuple, DPI or machine learning method. Among them, the container cloud platform is Kubernetes (K8S), the container cloud platform for sending the container online message is kube-apiserver, and kube-apiserve is one of the most important core components of Kubernetes, mainly providing REST API interfaces for cluster management, including authentication and authorization, data verification, and cluster state changes, and providing data interaction and communication between other modules.

[0057] Exemplarily, when a new container is online, the kube-apiserver will send the online message to the CNI (container network interface) within the container cluster, obtain the application information of the container running and the node information of the cluster where the container is located through the CNI interface within the cluster, and the network connection demand information corresponding to the application, so as to determine the east-west direction traffic scheduling strategy in the subsequent process, in addition, the source and destination node information includes the ID (Identity Document, identity) information corresponding to the source and destination nodes respectively.

[0058] Step S20, querying the switch load information within the container cluster, and determining the east-west direction traffic scheduling strategy according to the source and destination node information and the switch load information.

[0059] It should be noted that the east-west traffic scheduling strategy includes switch allocation and path determination when the source end node and the destination end node in the container cluster perform traffic scheduling, and a reasonable east-west traffic scheduling strategy can directly implement traffic scheduling in the container network, improve traffic scheduling efficiency, cope with the sudden and frequent use scenarios in the bandwidth use of the container network, and further improve bandwidth utilization and avoid network congestion.

[0060] It should be noted that the switch load information is each switch that can be used when the source end node and the destination end node corresponding to the application program running in the determined container perform routing connection, and after the load conditions of all switches connected with the source end node and the destination end node are determined, a path with the lowest load can be selected as the scheduling path of the east-west traffic scheduling, so as to ensure that the traffic scheduling of the application program is performed in the environment with the lowest load, thereby reducing network latency.

[0061] In addition to querying the switch load information in the container cluster, the port usage of the switches in the network architecture and the bandwidth usage of each ISP (Internet Service Provider) line can also be queried to calculate the port path between the container cloud platform and the external Internet.

[0062] Exemplarily, the container cloud platform queries the port usage of the switches in the network architecture, the load information of each port of the switches, and the bandwidth usage of each ISP line in real time through the SNMP (Simple Network Management Protocol) protocol.

[0063] The role of the container cloud platform in the above network monitoring is to query and store the port usage and load information of the switches in the entire network architecture and the bandwidth usage of each ISP line in real time. To implement traffic scheduling, the real-time load condition of the entire network needs to be mastered, and therefore the container cloud platform needs to periodically access all switches in the entire network through the SNMP protocol and record the load condition and port usage of each switch in the ETCD (Extended Distributed KeyValue) database to generate a suitable traffic scheduling path.

[0064] After obtaining the east-west traffic scheduling strategy in step S20, traffic scheduling can be performed in the container cluster to improve the traffic scheduling efficiency in the container cluster, and the path of the network traffic is dynamically scheduled according to the real-time network load condition to improve bandwidth utilization and avoid network congestion.

[0065] In another possible embodiment, the container cluster traffic scheduling method can be applied to a container network traffic scheduling system, the overall structure and data flow of which are as shown in the figure, which includes an application identification module, a network monitoring module, a path calculation module and a flow table updating module, the kube-apiserver is connected with the CNI of the application identification module, the flow table updating module is connected with the OVS-CNI module, and it should be noted that POD1-POD3 are the smallest deployable computing units created and managed in K8S. Figure 2

[0066] The application identification module works in the OVS-CNI and is used to discover new online containers sent to the CNI through the kube-apiserver, collect APP information of the new online containers, node information in the cluster where the containers are located, MAC information of the containers and IP address information of the containers, and store the collected information to the ETCD database.

[0067] The network monitoring module accesses all network switches through the SNMP protocol to determine the load information of the switch ports, and stores the load information of each switch port to the ETCD database.

[0068] The path calculation module determines the east-west direction routing path in the cluster based on the node information of the source and destination applications and the load information of the switches between the two nodes stored in the ETCD database, and determines the north-south direction routing path outside the cluster based on the network demand of the applications and the load information of the ISP line.

[0069] The flow table updating module creates a copy of the OVS flow table (a rule table of network traffic) generated by the path calculation module at each node of the container cluster, and edits the copy when the OVS flow table changes.

[0070] The container network traffic scheduling system is built-in in the container cluster in the form of a plug-in, can directly obtain detailed information of the applications in the containers through the messages sent to the CNI by the kube-apiserver, does not need to further identify the traffic by unpacking, saves the computing resources, and avoids increasing the network delay.

[0071] Further, the source and destination node information includes a source node ID and a destination node ID, and the step S10 of extracting the node information of the cluster where each container is located based on the container online message sent by the container cloud platform to the container network interface can include:

[0072] In step S11, when the container is online, the API server in the container cloud platform sends the container online message to the container network interface.​

[0073] In step S12, the cluster node information of the container in the container online message is acquired, and the source end node ID and the destination end node ID corresponding to the container are extracted from the cluster node information.

[0074] In the embodiment of the present application, it should be noted that when the container is online, the kube-apiserver (API server) sends the online message to the CNI, and the CNI creates a virtual network card for the container and connects it to the OVS (Open vSwitch, high-quality virtual switch) network bridge. The online message of the container contains the application APP information running in the container and the K8S cluster node NODE (node) information where the container is located.

[0075] In addition, when the CNI creates a virtual network card for the container, the MAC (address) information of the container and the IP (Internet Protocol Address) address information allocated to the container are recorded. According to these information, the network connection requirements, network priority and bandwidth requirements and other network configuration requirement information corresponding to the APP (application) can be queried from the configuration file. These information are saved in the ETCD database, which is used to determine the traffic scheduling intersection. In addition, when receiving the container offline message, the information related to the container is deleted from the database.

[0076] In the embodiment of the present application, the source end node ID and the destination end node ID are used to represent the source end position and the destination end position required in the traffic scheduling of the application running in the container, that is, the starting point and the end point in the traffic scheduling path. In addition, when there are many concurrent containers, the source end node ID and the destination end node ID can also be used to determine the containers with the same source end and destination end, so as to facilitate the unified allocation of switches and avoid the situation that the switches are overloaded.

[0077] In a feasible embodiment, the east-west direction traffic scheduling strategy includes a scheduling priority, and the step of determining the east-west direction traffic scheduling strategy according to the source and destination node information and the switch load information can include:

[0078] In step S21, when the number of concurrent containers is greater than or equal to a preset threshold, a source and destination ID combination corresponding to each container is constructed according to the source and destination node information corresponding to each container, wherein the source and destination ID combination includes a source end node ID and a destination end node ID.

[0079] In step S22, each container is grouped according to the comparison between the source and destination ID combinations of each container, and a plurality of container groups are obtained.

[0080] Step S23, according to the number of containers in each container group, determine the scheduling priority corresponding to each container group respectively, wherein the more the number of containers, the higher the scheduling priority.

[0081] In the embodiment of the application, when the number of concurrent containers is large, that is, the number of containers running simultaneously exceeds the capacity of the overall scale of the network structure, the scheduling of the capacity needs to be grouped and prioritized to avoid network congestion causing excessive network delay. The preset threshold depends on the overall scale of the network structure, the size of the business, etc., and can be adjusted according to the actual application requirements.

[0082] It should be noted that the source and destination ID combination is the combination of the source node ID and the destination node ID corresponding to each container, for example, source and destination ID combination = {source node ID, destination node ID}. In the embodiment of the application, containers are grouped according to the same source node ID and destination node ID in the source and destination ID combination of each container, so as to screen out container combinations with the same source node ID and destination node ID. The reason for grouping containers is that if the source and destination nodes of different containers correspond to the same, and the number of grouped containers is large, it means that there are many tasks to be processed between the two nodes, which need to be processed as soon as possible. In order to avoid long waiting time for users, the technical solution of the embodiment of the application can effectively improve the routing priority of the containers corresponding to the source and destination ID combination.

[0083] Specifically, in step S22, the step of grouping each container according to the comparison between the source and destination ID combinations of each container includes:

[0084] Step S231, containers with the same source node ID and destination node ID are divided into the same group;

[0085] Step S232, containers with only one of the source node ID and the destination node ID being the same are divided into the same group;

[0086] Step S233, containers with different source node ID and destination node ID from other containers are respectively divided into separate groups.

[0087] It should be noted that the priority of each group in the embodiment of the application is not fixed, and the user can set the determination time interval of the priority according to the requirements, such as determining the priority of each group once every 0.1 ms, keeping the timely update of the priority of the group, ensuring the timely processing of the most urgent task, reducing the waiting time of the user, and improving the user experience.

[0088] After the priority order of the containers is determined, the corresponding switches can be assigned to the containers, specifically, the east-west traffic scheduling strategy further comprises a target switch, after the step of determining the scheduling priority of each container group according to the number of containers in each container group, the method further comprises:

[0089] In step S24, the priority of each switch is determined according to the switch load information, wherein the lower the load of the switch, the higher the priority of the switch;

[0090] In step S25, the corresponding target switch is assigned to each container group according to the priority order of each switch, wherein the target switch is used to provide a routing path for the container group.

[0091] In the embodiment of the application, the load data of each switch is first obtained, and then the scheduling is performed according to the order from low to high of the load and the order from high to low of the container group priority, that is, the switch with low load provides a routing path for the container group with high priority, to determine the target switch of each container.

[0092] For example, the priority sequence of the container group includes {A, B, C, D}, wherein the priority of the container group A, the container group B, the container group C, and the container group D decreases in turn, and the priority sequence of the switch includes {a, b, c, d}, wherein the switch a, the switch b, the switch c, and the switch d. Therefore, the target switch assigned to the container group A is a, the target switch assigned to the container group B is b, and so on.

[0093] In the technical solution of the embodiment of the application, in order to ensure that the target switch is not used by multiple containers and overloads, a locking operation is introduced, specifically, after the step of assigning the corresponding target switch to each container group according to the priority order of each switch, the method further comprises:

[0094] In step A10, the container in the container group requests a lock from the corresponding target switch, and determines the request result according to the lock state of the target switch;

[0095] In step A20, if the request result is failure and the container is in the same group as the container that has successfully requested, the state of the container within a preset time is set to a spinning state;

[0096] In step A30, if the request fails and the container is not in the same group as the container that has successfully requested, the target switch of the container is re-determined according to the source ID combination of the container;

[0097] In step A40, if the request result is success, the lock state of the target switch is set to locked;

[0098] Step A50, after the operation of the container is completed, the routing path of the container is added to the OVS flow table, and the lock state of the target switch is set to the release state.

[0099] It should be noted that the locking operation is an atomic operation, so only one container can successfully acquire the lock. After the container successfully acquires the lock, the lock state of the switch in the database is set to locked. In the prior art scheme, after the spin lock is added, the container that does not acquire the lock state will enter a continuous spinning state and repeatedly attempt to acquire the lock, which will consume a large amount of CPU (Central Processing Unit, CPU) resources. In the technical scheme of the present application, a constraint condition is set for the spinning of the container, that is, the containers in the same group can spin within a predetermined time, and the containers in different groups give up acquiring the lock and instead determine a new target switch. Therefore, the technical scheme of the present application takes into account the consumption of CPU resources and avoids multiple calculations of the routing path.

[0100] Specifically, when the lock state of the target switch is locked, the request of other containers is rejected, and the request result is failure. When the lock state of the target switch is released, the request of other containers is agreed, and the request result is success.

[0101] Exemplarily, the container cloud platform adds a field indicating the lock state for each switch. When the container is routed to the switch and the switch is in the locked state, the container needs to request the lock of the switch to use the switch to achieve the routing purpose. In the embodiment of the present application, a spin lock logic is provided to process the multi-container concurrency problem, and a field indicating the lock state is added for each switch in the ETCD database. When multiple online containers need to be routed to the switch at the same time, the spin lock mechanism provided in the technical scheme of the embodiment of the present application is used to make only one container able to successfully acquire the lock, thereby avoiding the overload of the switch.

[0102] In addition, when the newly online container successfully acquires the lock (i.e., the request result is success), the container cloud platform sets the lock state of the target switch to locked. After the routing path of the newly online container is added to the OVS flow table, the locked state of the target switch is released and the load condition of the switch is updated.

[0103] To improve the scheduling efficiency, unlike the prior art which releases the lock after the thread task is executed, the container cloud platform adds the routing path to the OVS traffic after the new online container acquires the lock in the technical solution of the embodiment of the application, that is, the lock is released after a write operation is performed, which reduces the waiting time of the containers in the spinning state and further saves the consumption of CPU resources. Finally, the container cloud platform re-computes the target switch for the unscheduled new online container based on the updated switch load. When the load of the switch is updated, the path re-computed for the unscheduled container may change or may still use the original path to use the switch, so the embodiment of the application can well solve the problem of switch overload caused by concurrency.

[0104] On the other hand, when the number of concurrent containers is not large, the priority of the container does not need to be set, and the corresponding operations of each concurrent container can be executed at the same time. In this case, the east-west direction traffic scheduling strategy includes an east-west direction traffic scheduling path and a target switch, and the step of determining the east-west direction traffic scheduling strategy according to the source and destination node information and the switch load information can include:

[0105] Step S26, when the number of concurrent containers is less than a preset threshold, at least one scheduling path between the source node and the destination node in the source and destination node of the container is acquired;

[0106] Step S27, according to the switch load information, the total load of each scheduling path is determined;

[0107] Step S28, the scheduling path with the lowest total load is selected as the east-west direction traffic scheduling path of the container;

[0108] Step S29, the spine switch of the scheduling path is selected as the target switch of the container.

[0109] In the embodiment of the application, the source and destination nodes include a source node and a destination node, and there can be multiple connectable switch corresponding paths between the source node and the destination node. Exemplarily, the container cloud platform selects the path with the smallest load as the intra-cluster east-west direction traffic scheduling path from the connectable switch corresponding paths between the source and destination nodes of the current container, routes the spine layer switch of the scheduling path as the target switch, and completes the formulation of the overall east-west direction traffic scheduling strategy.

[0110] It can be understood that there are two traffic scheduling paths, one is used for connecting the east-west direction of the intra-data center application, and the other is used for connecting the north-south direction of the external Internet of the data center. In the embodiment of the application, when the east-west direction path is calculated, the spine layer switch of the path is selected as the target switch, and the path is routed to the target switch. Figure 3As shown, the load-minimal path needs to be calculated according to the NODE node information of the source node and the destination node where the application is located, and the load conditions of all reachable switches between the two NODE nodes.

[0111] Figure 3 In some embodiments, a spine-leaf architecture is used as the data center network topology, where the leaf layer is composed of access switches that aggregate traffic from servers and are directly connected to spine switches. The spine switches interconnect all leaf switches in a full-mesh topology.

[0112] In the east-west direction traffic scheduling, if it is determined that the source node (Source NODE) where the source application is located and the destination node (Destnation NODE) where the destination application is located are respectively as shown in the following figure: Figure 3 As shown, the leaf layer switches corresponding to the source node and the destination node are leaf1 and leaf3, respectively. Figure 3 In the spine layer, the switches connecting the two leaf layer switches are spin1, spin2 and spin3, and the loads of the spin layer switches are 80%, 90% and 20%, respectively. Therefore, the spin3 with the minimum load is selected as the routing path, i.e. Figure 3 In the spine layer, the switches connecting the two leaf layer switches are spin1, spin2 and spin3, and the loads of the spin layer switches are 80%, 90% and 20%, respectively. Therefore, the spin3 with the minimum load is selected as the routing path, i.e.

[0113] On the other hand, in addition to providing the method for formulating the east-west direction traffic scheduling strategy, the present application also provides a method for formulating the north-south direction traffic scheduling strategy, wherein the container cluster traffic scheduling method can further include:

[0114] Step B10, extracting the network configuration requirement of the application running in the container from the container online message;

[0115] Step B20, querying the load information corresponding to each network port matched with the container, and selecting the path with the minimum load as the north-south direction traffic scheduling path for connecting the external network of the container cluster.

[0116] In the embodiments of the present application, the container cloud platform can select, according to the network configuration requirements of the application program in which the current container is located and ISP load information, a path with minimum ISP load from the internet ports matching the network configuration requirements as the north-south direction traffic scheduling of the cluster connected to the external internet.

[0117] Exemplarily, when calculating the north-south direction path, a matching best internet exit needs to be selected according to the network priority and bandwidth requirements of the application program and in combination with the load condition of the ISP line.

[0118] The technical solution of the embodiments of the present application can schedule the east-west direction traffic in the container cluster and schedule the north-south direction traffic outside the container cluster, thereby solving the problem that the traditional traffic scheduling system cannot manage the data flow direction in the container network.

[0119] The embodiments of the present application provide a container cluster traffic scheduling method. First, node information of each container in the cluster is extracted based on a container online message sent by a container cloud platform to a container network interface. Then, switch load information in the container cluster is queried, and an east-west direction traffic scheduling strategy is determined according to the source and destination node information and the switch load information. In the technical solution of the embodiments of the present application, the application program information and source and destination node information of the container are obtained through the container network interface in the container cluster, and then in combination with the switch load information, the relevant information of the newly online container can be obtained before the data packet, without the need for packet analysis, thereby saving the computing resources and avoiding increasing the network delay. Moreover, the technical solution of the embodiments of the present application directly schedules the traffic in the container network interface, realizes the formulation and execution of the scheduling strategy of the east-west direction traffic in the container cluster, and solves the problem that the traditional traffic scheduling system cannot manage the data flow direction in the container network.

[0120] Embodiment two

[0121] The embodiments of the present application also provide a container cluster traffic scheduling device. The container cluster traffic scheduling device is applied to an electronic device, and refers to Figure 4 , and the container cluster traffic scheduling device comprises:

[0122] An information extraction module 10 is configured to extract source and destination node information in node information of each container in the cluster based on a container online message sent by a container cloud platform to a container network interface.

[0123] A strategy formulation module 20 is configured to query switch load information in the container cluster, and determine an east-west direction traffic scheduling strategy according to the source and destination node information and the switch load information.

[0124] Optionally, the source and destination node information includes a source end node ID and a destination end node ID, and the information extraction module 10 is further configured to:

[0125] When the container is online, sending a container online message to the container network interface through an API server in the container cloud platform;

[0126] Obtaining cluster node information of the container in the container online message, and extracting the source end node ID and the destination end node ID corresponding to the container from the cluster node information.

[0127] Optionally, the east-west traffic scheduling strategy includes a scheduling priority, and the strategy formulation module 20 is further configured to:

[0128] When the number of concurrent containers is greater than or equal to a preset threshold, constructing a source-destination ID combination corresponding to each container according to the source and destination node information corresponding to each container, wherein the source-destination ID combination includes a source end node ID and a destination end node ID;

[0129] Grouping each container according to a comparison between the source-destination ID combinations of each container to obtain a plurality of container groups;

[0130] Determining a scheduling priority corresponding to each container group according to the number of containers in each container group, wherein the more the number of containers, the higher the scheduling priority.

[0131] Optionally, the strategy formulation module 20 is further configured to:

[0132] Dividing containers with the same source node ID and destination node ID into the same group;

[0133] Dividing containers with only one of the source node ID and the destination node ID being the same into the same group;

[0134] Dividing containers with the source node ID and the destination node ID being different from other containers into separate groups.

[0135] Optionally, the east-west traffic scheduling strategy further includes a target switch, and the strategy formulation module 20 is further configured to:

[0136] Determining a priority of each switch according to the switch load information, wherein the lower the load of the switch, the higher the priority of the switch;

[0137] Allocating a corresponding target switch for each container group according to the priority order of each switch, wherein the target switch is used to provide a routing path for the container group.

[0138] Optionally, the strategy formulation module 20 is further configured to:

[0139] requesting a lock from a corresponding target switch by a container in the container group, and determining a request result according to a lock state of the target switch;

[0140] if the request result is failure and the container is in the same group as a container that has requested success, setting a state of the container to a spin state within a preset time;

[0141] if the request result is failure and the container is not in the same group as a container that has requested success, re-determining a target switch of the container according to a source and destination ID combination of the container;

[0142] if the request result is success, setting the lock state of the target switch to locked;

[0143] after an operation of the container is executed, adding a routing path of the container to an OVS flow table, and setting the lock state of the target switch to a release state.

[0144] Optionally, the east-west direction traffic scheduling strategy includes an east-west direction traffic scheduling path and a target switch, and the strategy making module 20 is further configured to:

[0145] when a number of concurrent containers is less than a preset threshold, obtaining at least one scheduling path between a source end node and a destination end node in source and destination nodes of a container;

[0146] determining a total load of each of the scheduling paths according to the switch load information;

[0147] selecting a scheduling path with the lowest total load as an east-west direction traffic scheduling path of the container;

[0148] selecting a spine switch of the scheduling path as a target switch of the container.

[0149] Optionally, the strategy making module 20 is further configured to:

[0150] extracting a network configuration requirement of an application running in the container from the container online message;

[0151] querying load information corresponding to each network port matched with the container, and selecting a path with the lowest load as a north-south direction traffic scheduling path of a container cluster connecting an external network from network ports meeting the network configuration requirement.

[0152] The container cluster traffic scheduling device provided in the application adopts the container cluster traffic scheduling method in the above embodiment, and solves the technical problem of high network delay of the traditional traffic scheduling scheme. Compared with the prior art, the container cluster traffic scheduling device provided in the embodiment of the application has the same beneficial effects as the container cluster traffic scheduling method provided in the above embodiment, and other technical features in the container cluster traffic scheduling device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0153] Embodiment three

[0154] The embodiment of the application provides an electronic device, which comprises at least one processor and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the container cluster traffic scheduling method in the above embodiment one.

[0155] Reference will be made to the following description Figure 5 , which shows a structural schematic diagram of an electronic device suitable for implementing the embodiments of the present disclosure. The electronic device in the embodiments of the present disclosure can include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablets), PMPs (portable media players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. Figure 5 The electronic device shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present disclosure.

[0156] As shown in Figure 5 , the electronic device can include a processing system 1001 (such as a central processor, a graphics processor, etc.), which can perform various appropriate actions and processes according to programs stored in a read only memory 1002 (ROM, read only memory) or loaded from a storage system 1003 to a random access memory 1004 (RAM, random access memory). In the RAM 1004, various programs and data required for the operation of the electronic device are also stored. The processing system 1004, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also linked to the bus 1005.

[0157] In general, the following systems can be linked to the I / O interface 1006: an input system 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output system 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage system 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication system 1009. The communication system 1009 can allow the electronic device to communicate wirelessly or wired with other devices to exchange data. While the electronic device is shown with various systems, it is understood that not all of the shown systems are required to be implemented or possessed. More or less systems can alternatively be implemented or possessed.

[0158] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication system, or installed from a storage system, or installed from a ROM. When the computer program is executed by a processing system, the above-mentioned functions defined in the methods of embodiments of the present disclosure are performed.

[0159] The electronic device provided in the present application adopts the container cluster traffic scheduling method in the above embodiments, and solves the technical problem of high network delay in the traditional traffic scheduling scheme. Compared with the prior art, the electronic device provided in the embodiments of the present application has the same beneficial effects as the container cluster traffic scheduling method provided in the above embodiments, and other technical features in the electronic device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0160] It should be understood that parts of the present disclosure can be realized by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0161] The above describes only the specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0162] Embodiment Four

[0163] The embodiment provides a computer readable storage medium having computer readable program instructions stored thereon, and the computer readable program instructions are used for executing the method for container cluster traffic scheduling in the above embodiment one.

[0164] The computer readable storage medium provided by the embodiment of the application may, for example, be a U disk, but is not limited to an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electric link having one or more conductive lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiment, the computer readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, system, or device. The program code contained on the computer readable storage medium can be transmitted by any suitable medium, including but not limited to an electric wire, an optical cable, an RF (radio frequency), and the like, or any suitable combination of the above.

[0165] The computer readable storage medium described above can be contained in an electronic device, or can exist separately and not be assembled into an electronic device.

[0166] The computer readable storage medium described above carries one or more programs, and when the one or more programs are executed by an electronic device, the electronic device is caused to: based on a container online message sent by a container cloud platform to a container network interface, extract source and destination node information in node information of a cluster where each container is located; query switch load information inside the container cluster, and determine an east-west direction traffic scheduling strategy according to the source and destination node information and the switch load information.

[0167] Computer program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be linked to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0168] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0169] The modules involved in the embodiments of the present disclosure can be implemented in the manner of software or hardware. Among them, the name of the module does not constitute a limitation to the unit itself in some cases.

[0170] The computer readable storage medium provided by the present application stores computer readable program instructions for executing the container cluster traffic scheduling method described above, and solves the technical problem of high network delay of the current traditional traffic scheduling scheme. Compared with the prior art, the beneficial effects of the computer readable storage medium provided by the embodiments of the present application are the same as those of the container cluster traffic scheduling method provided by the above-mentioned embodiments, which will not be repeated here.

[0171] Embodiment five

[0172] The application further provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the container cluster traffic scheduling method as described above.

[0173] The computer program product provided by the application solves the technical problem of high network delay in the conventional traffic scheduling scheme. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the application are the same as those of the container cluster traffic scheduling method provided by the above-mentioned embodiment, and are not described here.

[0174] The above is only a preferred embodiment of the application, and does not limit the patent scope of the application, and any equivalent structure or equivalent process transformation using the content of the specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent processing scope of the application.

Claims

1. A method for scheduling traffic of a container cluster, characterized in that, The container cluster traffic scheduling method comprises: Based on the container online message sent by the container cloud platform to the container network interface, the source and destination node information in the node information of each container cluster is extracted; Query the switch load information inside the container cluster, and determine the east-west direction traffic scheduling strategy according to the source and destination node information and the switch load information; Wherein, the east-west direction traffic scheduling strategy includes east-west direction traffic scheduling path and target switch, the step of determining the east-west direction traffic scheduling strategy according to the source and destination node information and the switch load information comprises: When the number of concurrent containers is less than the preset threshold, at least one scheduling path between the source node and the destination node in the source and destination node of the container is obtained; According to the switch load information, the total load of each scheduling path is determined; Select the scheduling path with the lowest total load as the east-west direction traffic scheduling path of the container; The spine switch of the scheduling path is taken as the target switch of the container.

2. The method of claim 1, wherein, The source and destination node information includes source node ID and destination node ID, and the step of extracting the source and destination node information in the node information of each container cluster based on the container online message sent by the container cloud platform to the container network interface comprises: When the container is online, the container online message is sent to the container network interface through the API server in the container cloud platform; Get the cluster node information of the container in the container online message, and extract the source node ID and destination node ID corresponding to the container from the cluster node information.

3. The method of claim 1, wherein the cluster of containers is a cluster of containers of a container orchestration system. The east-west direction traffic scheduling strategy includes scheduling priority, and the step of determining the east-west direction traffic scheduling strategy according to the source and destination node information and the switch load information comprises: When the number of concurrent containers is greater than or equal to the preset threshold, the source and destination node information corresponding to each container is constructed according to the source and destination node information corresponding to each container, wherein the source and destination node information includes source node ID and destination node ID; According to the comparison between the source and destination ID combinations of each container, the containers are grouped to obtain a plurality of container groups; According to the number of containers in each container group, the scheduling priority corresponding to each container group is determined, wherein the more the number of containers, the higher the scheduling priority.

4. The method of claim 3, wherein the step of determining the cluster of containers comprises: The step of grouping each container according to the comparison between the source and destination ID combinations of each container to obtain a plurality of container groups comprises: Containers with the same source node ID and destination node ID are divided into the same group; Containers with only one of the source node ID and the destination node ID are divided into the same group; Containers with source node ID and destination node ID different from other containers are respectively divided into separate groups.

5. The container cluster traffic scheduling method as described in claim 3, characterized in that, The east-west direction traffic scheduling strategy also includes target switch, and after the step of determining the scheduling priority corresponding to each container group according to the number of containers in each container group, the method further comprises: According to the switch load information, the priority of each switch is determined, wherein the lower the load, the higher the priority of the switch; According to the priority order of each of the switches, a corresponding target switch is allocated to each of the container groups, wherein the target switch is used to provide a routing path for the container group.

6. The method of claim 5, wherein, After the step of allocating the corresponding target switch to each of the container groups according to the priority order of each of the switches, the method further comprises: requesting a lock from the corresponding target switch by a container in the container group, and determining a request result according to a lock state of the target switch; if the request result is a failure and the container is in the same group as a container that has requested successfully, setting a state of the container in a preset time to a spin state; if the request result is a failure and the container is not in the same group as a container that has requested successfully, re-determining the target switch of the container according to a source ID combination of the container; if the request result is a success, setting the lock state of the target switch to a locked state; after the operation of the container is executed, adding the routing path of the container to an OVS flow table, and setting the lock state of the target switch to a release state.

7. The container cluster traffic scheduling method of any of claims 1-6, wherein, The container cluster traffic scheduling method further comprises: extracting a network configuration requirement of an application running in the container from the container online message; querying load information corresponding to each network port matched with the container, and selecting a path with the smallest load as a north-south direction traffic scheduling path of the container cluster connecting an external network from the network ports meeting the network configuration requirement.

8. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory communicatively linked with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the container cluster traffic scheduling method in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a program for implementing the container cluster traffic scheduling method, and the program is executed by the processor to implement the steps of the container cluster traffic scheduling method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • An SDN-based container network resource scheduling method

    CN109743261A

  • Container management method for regulation and control of cloud platform based on Docker container technology

    CN111221624A