An edge computing container allocation and layer download sorting architecture and method
By grouping image layers and sorting layer downloads, the allocation of containers and the download order of image layers in edge computing are optimized, which solves the problem of container startup delay and achieves faster container startup time and higher edge node utilization.
Patent Information
- Application Number
- CN202110808605.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-16
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2041-07-16
AI Technical Summary
In edge computing, the container startup delay problem, especially the long image download time, leads to large startup delays. Existing methods may affect the stability of the container or require modification of the system architecture, and cannot effectively optimize the total startup time of multiple containers and consider the download order.
An edge computing container allocation and layer download sorting architecture is designed. By grouping image layers, allocating containers, and sorting layer downloads, the allocation of containers on edge nodes and the download order of image layers are optimized. The Sidney decomposition method and greedy algorithm are used to optimize the image layer download process.
It effectively reduces the total startup time of containers, optimizes the joint scheduling of multiple containers, reduces image download redundancy, and improves the utilization of edge nodes without modifying the existing container system.
Smart Images

Figure CN113641448B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, specifically to the fields of distributed systems, edge computing, and machine learning in computer networks, and involves methods such as resource scheduling in edge computing and distributed systems, and deep reinforcement learning for machine learning. Background Art
[0002] For applications with short execution times (for example, processing periodic updates from IoT sensors) or edge computing that require fast response times (for example, robotic motion), container startup latency is a very thorny issue. Container startup latency involves fetching the container image from a remote registry (if it doesn't exist locally) to its host and installing it. In edge computing, due to limited bandwidth, the longer the image download time, the greater the startup latency. Image download time accounts for a large part of the startup time, because image installation latency is lower (about 1 second) and is more stable on heterogeneous devices. In addition, due to limited storage resources, dynamic user mobility, and the large number of container images, it is impossible to store all images on each edge node in advance. Therefore, a large number of container startup times have become an issue that needs to be optimized.
[0003] Recent work has focused on reducing container startup latency by retrieving image files on demand, extracting common portions of image files, or reorganizing images. These efforts require modifications to the container or the entire system architecture. Related work also considers the size of the container image's existing layers on edge nodes when deciding container scheduling, thereby reducing container startup time on deployment nodes.
[0004] Currently, there are methods to reduce container startup time by modifying the container file structure or container system architecture, which will reduce container isolation and stability. However, this method requires developers to spend a lot of time modifying their already released containers.
[0005] The method of directly determining container scheduling based on the size of existing image layers on edge nodes ignores the following issues: First, in edge computing scenarios where multiple containers are co-scheduled, the goal is to optimize the total startup time of multiple containers. Second, in scenarios where multiple containers are co-scheduled, the order in which image layers are downloaded further affects the total container startup time. Finally, the heterogeneity of download bandwidth between edge nodes also affects container startup time. Summary of the Invention
[0006] To overcome these issues, we designed an edge computing container allocation and layer download sorting architecture and method. This method first groups layers shared by the same set of containers to reduce the size of the optimization problem and speed up the method. Secondly, it selects a container and places it on the appropriate edge node, taking into account both layer sharing between containers and the size of existing image layers on the edge node. Finally, to sort the image layer downloads for each edge node, we designed an edge computing container allocation and layer download sorting architecture and method.
[0007] Specifically include the following:
[0008] An edge computing container allocation and layer download sorting architecture and method thereof: The edge computing architecture includes UEs, edge nodes, a scheduler, and a container repository. The edge nodes are connected to a plurality of UEs via wireless communication. Each edge node has a download queue, and the edge node sequentially downloads image layers from the container repository according to the layer sequence in its download queue. The scheduler is used to collect information from the container repository and edge nodes. The container repository is a container image repository or a collection of repositories, and the container repository is deployed in the cloud.
[0009] Furthermore, 2. An edge computing container allocation and layer download sorting architecture and method thereof: the method mainly includes: (1) image layer grouping, (2) container allocation, and (3) image layer download sorting.
[0010] The image layers are grouped as follows: any two layers li, li′ that have the same relationship with each container repository will be added to the same group, and the entire image layer group is regarded as one image layer.
[0011] The container allocation is as follows: a container warehouse and an edge node are selected for allocation, and the container warehouse allocation variables are determined according to a layer-aware container allocation algorithm. The specific steps of the layer-aware container allocation algorithm are as follows:
[0012]
[0013]
[0014] The image layer download sorting is as follows: First, we divide the container layers into multiple sorted sets according to the Sidney decomposition method, then schedule the container layers in the same set on a container-by-container basis, and use the greedy image layer sorting algorithm to select the container with the smallest remaining size in each round and download its remaining image layers. The greedy image layer sorting algorithm specifically steps are as follows:
[0015]
[0016]
[0017] Furthermore, an edge computing container allocation and layer download sorting architecture and method thereof, the container warehouse scheduling process includes:
[0018] (1) Multiple UEs offload multiple tasks.
[0019] (2) The scheduler collects task information and edge node status.
[0020] (3) Based on the collected information, the scheduler makes decisions on container repository allocation and layer download sorting.
[0021] (4) Using these decisions and other prior information, each edge node has a download queue and downloads image layers according to the sequence in the download queue.
[0022] (5) Each container repository starts running after downloading all the image layers belonging to it.
[0023] Furthermore, the edge computing container allocation and layer download sorting architecture and method thereof, the layer grouping and container allocation method are implemented and run in the scheduler, and the layer sorting method can be implemented in the kubelet of each node.
[0024] Furthermore, the edge computing container allocation and layer download sorting architecture and method thereof, wherein the container creation step comprises the following steps:
[0025] First, the user calls the API to initiate a pod creation request.
[0026] The scheduler then creates the pod on the selected node based on the output of the layer grouping and container allocation method and returns the result.
[0027] Finally, each node's kubelet manages image layer downloads based on the results of the layer ordering method and creates containers in a given pod.
[0028] Furthermore, an edge computing container allocation and layer download sorting architecture and method thereof, wherein the layer-aware container allocation algorithm calculates A container and node pair is selected based on a score in which the layer share and the existing layer size are combined.
[0029] Furthermore, an edge computing container allocation and layer download sorting architecture and method thereof are provided, wherein the container layers in the same set are scheduled as containers in units, such as j←argmin in the greedy image layer sorting algorithm. jp j As shown, in each round, the container with the smallest remaining size is selected and its remaining image layers are downloaded. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is the architecture diagram of the edge computing of the present invention.
[0031] Figure 2 This is a structural diagram of the open source container management system Kubernetes in an embodiment of the present invention.
[0032] Figure 3 This is a CDF graph of container startup time for different scheduling algorithms under uniform distribution in an embodiment of the present invention.
[0033] Figure 4 This is a CDF graph of container startup time for different scheduling algorithms under the Zipf distribution in an embodiment of the present invention.
[0034] Figure 5 This is a comparison chart of different maximum container running numbers in an embodiment of the present invention.
[0035] Figure 6 is a comparison diagram of different maximum bandwidths in an embodiment of the present invention.
[0036] Figure 7 is a comparison diagram of different maximum storage spaces in the embodiment of the present invention.
[0037] Figure 8 This is a reference diagram showing the impact of layer grouping with different numbers of containers on the algorithm running time in an embodiment of the present invention.
[0038] Figure 9 Reference figure for the impact of layer grouping with different numbers of edge nodes on algorithm running time in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the invention for which protection is sought, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0040] To achieve this goal, we first modeled the container scheduling and image layer download sorting problem in edge computing and proved that it is an NP-hard problem. Taking into account the heterogeneity of edge nodes and the shared nature of image layers across multiple images, we designed an image layer-aware scheduling method and discussed its feasibility on Kubernetes, an open-source container management system. Finally, simulation experiments demonstrated the effectiveness of this method.
[0041] Here I would like to specifically explain the structure of the open source container management system Kubernetes. A Kubernetes cluster consists of at least one master node and multiple computing nodes. The master node includes a highly available key-value database called etcd, an API server for exposing APIs, a scheduler for scheduling deployments, and a controller for managing the entire cluster. Each node is the workhorse of a Kubernetes cluster and consists of many pods and a management component, kubelet. In the node, kubelet is used to process tasks and manage pods. A pod is a collection of containers and is the core management unit of Kubernetes. For a specific structural diagram, please refer to the attached Figure 2 .
[0042] The scenario we consider is a heterogeneous edge computing environment, which includes multiple user equipments (UEs), a set of heterogeneous edge nodes E = {e1, e2, ..., e |E|}, scheduler and container repository. The scheduler is used to collect information about containers and edge nodes. Then, it determines the container allocation and layer download order. The container repository is a container image repository or a collection of repositories. The container scheduling process includes: (1) Multiple UEs offload multiple tasks. (2) The scheduler collects task information and edge node status. (3) Based on the collected information, the scheduler makes decisions on container allocation and layer download order. (4) Using these decisions and other prior information, each edge node has a download queue and downloads image layers according to the sequence in the download queue. (5) Each container starts running after downloading all the image layers belonging to it.
[0043] Assume that each UE offloads tasks running on a specific container. Therefore, C = {c1, c2, ..., c |C|} is used to represent both containers and all tasks. Binary variable a jk Represents container c j Is it assigned to edge node e? k If c j Assigned to e k , then a jk =1, otherwise a jk = 0. Each container c jshould be assigned to an edge node, which means that the UE will assign task c j Offloading to edge nodes:
[0044]
[0045] The layer set consisting of all containers is represented as L = {l1, l2, ..., l |L|}. Layer l i The size of p is defined as i . Relation variable r ij For presentation layer i and container c j If the layer l i Belongs to container c j The image of the container c j Requires layer l i , then the binary variable r ij ∈{0,1} is set to 1, otherwise it is set to 0. Before scheduling r ij is known. The layers are shared by different images, so the edge nodes only need to download the layers once. The binary variable d ik ∈{0,1} is defined as whether it is at the edge node e k Upload and download layer i . Edge node e k Complete download layer l i The time of layer l is defined as i Ready time t l ik Container c j The startup time is defined as t c j Before downloading all layers belonging to its image, the container c j Unable to connect to edge node e k So t c j Greater than its layer at its designated edge node e k Medium ready time:
[0046]
[0047] Edge nodes are computing devices deployed at access points that connect to UEs via low-latency wireless communication. The storage, bandwidth, and running container limits of an edge node (ek) are defined as sk, bk, and mk, respectively. The total size of layers stored in an edge node (ek) cannot exceed its storage limit:
[0048] A limited number of containers can run simultaneously on an edge node:
[0049]
[0050] Assume that each edge node has a download queue. The edge node downloads one layer at a time from the front (left) of the queue. The layers in the download queue need to be sorted. The download priority of layers li and li′ on edge node ek is defined as a binary variable xkii′∈{0,1}. If xkii′ is set to 1, layer li should be downloaded before layer li′, otherwise, layer li′ should be downloaded before layer li. In particular, xkii is equal to 1 to ensure that the ready time of each layer includes its own download time. In addition, the priority between the two layers needs to be relative:
[0051] Furthermore, the priority order between layers is transitive, specifically defined as:
[0052] Taking into account both the queuing time and the downloading time, the ready time of the li layer on the edge node ek can be calculated using the following formula:
[0053]
[0054] Our goal is to optimize the sum of the startup times of all containers. The optimization problem is formulated as:
[0055]
[0056]
[0057] The variable M in (9) is set to a large positive number, such as |C|. The constraint in (9) ensures that for each layer l i , when any container c that needs it j Assigned to an edge node e k (i.e., a jk =1), then layer l should be i Download to edge node e k That is d ik = 1. Otherwise, d ik Equal to 0 to minimize the download amount. Through the reduction method, it can be proved that the above scheduling problem is an NP-hard problem even when there is only one edge node.
[0058] To address this issue, we designed a layer-aware heuristic scheduling method, which consists of the following three parts:
[0059] 1. Image layer grouping. Any two layers that have the same relationship with each container i , l i′ will be added to the same group, i.e., l i , l i′ satisfy:
[0060]
[0061] Because the download of an image must be completed after all its layers are ready, grouping the image layers will effectively reduce the problem size without affecting the scheduling results. Secondly, grouping the image layers only requires traversing all the relationship variables r ij The time complexity is O(|L||E|). In the next two parts, we will treat the entire group of image layers as one image layer.
[0062] 2. Container allocation. We select a container and an edge node for allocation each time, taking two important factors into consideration:
[0063] (1) Layer sharing between containers. If containers are assigned to edge nodes without considering layer sharing, different edge nodes tend to download duplicate layers, which consumes additional bandwidth. In addition, downloading redundant layers also increases queuing delay. As a result, the total startup time of all containers increases.
[0064] (2) The existing layer size of each edge node. Allocating containers to edge nodes based solely on the layer sharing between containers and edge nodes will result in an imbalanced workload between different edge nodes. Although this eliminates redundant layer downloads, it will cause most image layers to be downloaded on a small number of edge nodes, leaving other nodes unused, resulting in higher queuing delays. Therefore, we design a layer-aware container allocation algorithm, namely, Method 1 below, which takes the above two factors into account:
[0065]
[0066]
[0067] In method 1, the input is the bandwidth set {b k |e k ∈E}, storage set {s k |e k ∈E}, the number of running containers is limited to {m k |e k ∈E}, layer size {p i |l i ∈L} and relation variables {r ij |l i ∈L,c j ∈C}. The output is the allocation decision a of the container jk Specifically, in each loop, a container and node pair is selected by computing a score in Line 10, which is composed of the layer share and the existing layer size.
[0068] Image layer download sorting. When the container allocation variable is determined, the binary variable d ik By assigning variable a jk Determine by equation (9). Decompose the original problem into |E| independent image layer download sorting problems. For each image layer download sorting problem, we first transform it into the problem of minimizing the weighted total completion time of dependent tasks on a single machine. Sidney Decomposition is an effective method to solve this problem and can achieve an approximation ratio of 2. Therefore, we design a greedy image layer sorting algorithm based on Sidney Decomposition, which is the method 2 mentioned below. The specific steps are:
[0069]
[0070]
[0071] In Method 2, container layers are divided into multiple sets. The order of the sets is determined by SidneyDecomposition, which also determines the order of container layers within different sets. We schedule container layers within the same set on a container-by-container basis. As shown in line 15 of Method 2, in each round, the container with the smallest remaining size is selected and its remaining image layers are downloaded. Specific embodiments
[0073] We implemented the scheduling method and simulation environment in a simulated environment using Python 3.6 on a desktop computer with an Intel Core i7-10750H 2.60GHz CPU and 16GB of RAM. In our experiments, we considered a real-world edge computing scenario with multiple edge nodes. By default, we set the bandwidth to 10Mbps, the number of edge nodes to 15, the limit on the number of running containers to 50, the storage capacity limit to 20GB, the total number of containers to 200, and the hyperparameter α to 0.5. With the default settings, the container has sufficient capacity to store layers and run containers.
[0074] In terms of data, we collected the latest versions of the 5,000 most popular images from DockerHub. To compare with other scheduling methods, we selected the 155 most commonly used images from the crawled dataset. After filtering out image layers with size 0, there were a total of 810 image layers. The total size of the 155 images was 60 GB, and the total size of all layers was 30 GB. For each experiment, all containers were randomly selected from the above 155 images based on Zipf distribution and uniform distribution. We set the Zipf shape factor to 1.1 by default. For each experiment, we repeated it ten times.
[0075] We compare our method (LASA) with the following baseline methods:
[0076] (1) Random Scheduling (RS): Containers are randomly assigned to edge nodes and sequence layers according to the allocation order each time.
[0077] (2) Layer match scheduling (LS): For each container in a random order, select an edge node where most of the image layers are stored locally and arrange the layers according to the allocation order of the container.
[0078] (3) Sidney decomposition-based scheduling (SDS): First, all containers are sorted by Sidney decomposition, and then each container is continuously assigned to a node until the set threshold is reached. Then, the layers in each edge node are sorted by method 2.
[0079] (4) Kubernetes Scheduling (K8S): A scheduling strategy used in Kubernetes that schedules containers to edge nodes that store the required image locally, otherwise schedule them to edge nodes that have the smallest download size.
[0080] Under the default settings, we compared the overall results of different scheduling methods under uniform distribution and Zipf distribution, as shown in the attached figure. Figure 3 and attached Figure 4 The advantages of this method (LASA shown in the figure) can be clearly compared: for containers of different sizes and under different distributions, this method can stably reduce the total startup time.
[0081] At the same time, we compared the performance of different methods in different heterogeneous environments, specifically:
[0082] 1. Comparison of total container startup time with different maximum number of running containers. The results are shown in the attached figure. Figure 5 ,
[0083] 2. Comparison of total container startup time at different maximum bandwidths. The results are shown in the attached figure. Figure 6 ,
[0084] 3. Comparison of total container startup time with different maximum storage spaces. The results are shown in the attached figure. Figure 7 ,
[0085] As can be seen from the above experimental results, this method achieves a shorter container startup time than the baseline method in different heterogeneous environments.
[0086] In addition, we compared the running time of the method with and without layer grouping, specifically:
[0087] 1. The impact of different number of container layer grouping on the method running time, the results are shown in the attached Figure 8 As shown,
[0088] 2. The impact of layer grouping with different numbers of edge nodes on the running time of the method. The results are shown in the attached Figure 9 shown.
[0089] By comparison, we can find that enabling layer grouping can effectively reduce the method running time by 50%-70%.
[0090] It can be clearly seen from the specific implementation methods and examples that this method has the following beneficial effects:
[0091] (1) This method takes into account the sharing of image layers between containers and reduces the total startup time of containers by jointly scheduling multiple containers.
[0092] (2) This method considers the joint allocation of multiple containers in a heterogeneous edge computing scenario. It also further considers the download order of image layers on each node after the container allocation is completed. Considering both container allocation and image layer download order can minimize the total startup time of multiple containers.
[0093] (3) This method effectively reduces the scale of the optimization problem by grouping image layers without affecting the optimization results of the total container startup time.
[0094] (4) By collecting real container and image data from DockerHub and designing simulation experiments, we prove that compared with other scheduling methods, this method effectively reduces the total startup time of the container without requiring developers to modify the structure of the container system.
[0095] The above descriptions are merely embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied to other related system fields, are also included in the scope of protection of the present invention.
Claims
1. A method for allocating edge computing containers and sorting layer downloads, characterized by: The edge computing architecture includes UEs, edge nodes, a scheduler, and a container repository. The edge nodes are connected to numerous UEs via wireless communication. Each edge node has a download queue, and the edge node sequentially downloads image layers from the container repository according to the layer sequence in its download queue. The scheduler is used to collect information about the container repository and edge nodes. The container repository is a container image repository or a collection of repositories, and the container repository is deployed in the cloud. The method comprises: (1) grouping image layers, (2) allocating containers, and (3) sorting image layer downloads; The image layers are grouped as follows: any two layers li, li′ that have the same relationship with each container repository will be added to the same group, and the entire image layer group is considered as one image layer; The container allocation is as follows: selecting a container warehouse and an edge node to implement allocation, and determining the container warehouse allocation variable according to the layer-aware container allocation algorithm; The image layer download sorting method is as follows: first, the container layers are divided into multiple sorted sets according to the Sidney decomposition method, and then the container layers in the same set are scheduled on a container basis. According to the greedy image layer sorting algorithm, the container with the smallest remaining size is selected in each round and its remaining image layers are downloaded.
2. The edge computing container allocation and layer download sorting method according to claim 1, characterized in that: The specific steps of the layer-aware container allocation algorithm are as follows: Input: {b k |e k ∈E},{s k |e k ∈E},{m k |e k ∈E},{p i |l i ∈L},{r ij |l i ∈L,c j ∈C} Output: a jk , a jk Decisions about container allocation; initialization Where E={e1,e2,…,e |E| } represents heterogeneous edge nodes, C={c1,c2,…,c |C| } represents the container and all tasks; Initialize C r ←C whenever j a ←−1,k a ←-1 C j ∈C r : For e k ∈E: L′←L k ∪{l i |l i ∈L,r ij =1} D L ←L′\L k If score <score a and And N k +1≤m k : j a ←j,score a ←score,k a ←k Among them, a jk Is a binary variable, representing the container c j Is it assigned to edge node e? k , if c j Assigned to e k , then a jk =1, otherwise a jk =0; each container c j should be assigned to an edge node, which means that the UE will assign task c j Offload to edge nodes; p i For layer l i Definition of the size of r ij is a relational variable used to represent layer l i and container c j If the relationship between layer l i Belongs to container c j The image of the container c j Requires layer l i , then the binary variable r ij ∈{0,1} is set to 1, otherwise it is set to 0; Binary variable d ik ∈{0,1} is defined as whether it is at the edge node e k Upload and download layer i , edge node e k Complete download layer l i The time of layer l is defined as i Ready time t l ik , container c j The startup time is defined as t c j ; The greedy image layer sorting algorithm steps are as follows: Input: {p i |l i ∈L},{r ij |l i ∈L,c j ∈C},b k ,C Output: Y=SidneyDecomposition({p i |l i ∈L},{r ij |l i ∈L,c j ∈C}) Initialize L sequenced ←{} To S l ∈Y: to J j ∈S l : when right L^j←{l_i|l i ∈L,r ij =1}\L sequenced j←argmin j p j Right i ∈L j : Right i′ ∈L sequenced : L sequenced ←L sequenced ∪{l i } 3. The edge computing container allocation and layer download sorting method according to claim 2, characterized in that: The container registry scheduling process includes: (1) Multiple UEs offload multiple tasks; (2) The scheduler collects task information and edge node status; (3) Based on the collected information, the scheduler makes decisions on container repository allocation and layer download ordering; (4) Using these decisions and other prior information, each edge node has a download queue and downloads image layers according to the sequence in the download queue; (5) Each container repository starts running after downloading all the image layers belonging to it.
4. The method for allocating edge computing containers and sorting layer downloads according to claim 3, wherein: The layer grouping and container repository allocation algorithms are implemented and run in the scheduler, and the layer sorting algorithm can be implemented in the kubelet of each node.
5. The method for edge computing container allocation and layer download sorting according to claim 4, characterized in that: Creating a container repository involves the following steps: (1) The user calls the API to initiate a pod creation request; (2) The scheduler creates a pod on the selected node based on the output of the layer grouping and container repository allocation algorithm and returns the result; (3) The kubelet of each node manages the image layer download according to the results of the layer sorting algorithm and creates a container repository in a given pod.
6. The edge computing container allocation and layer download sorting method according to claim 5, characterized in that: The layer-aware container allocation algorithm calculates A container and node pair is selected based on a score in which the layer share and the existing layer size are combined.
7. The method for edge computing container allocation and layer download sorting according to claim 6, characterized in that: In the image layer download sorting, the container layers in the same set are scheduled as containers, such as j←argmin in the greedy image layer sorting algorithm. j p j As shown, in each round, the container with the smallest remaining size is selected and its remaining image layers are downloaded.
Citation Information
Patent Citations
Vehicle edge calculation transfer scheduling method based on deep reinforcement learning
CN110989614A
KR20210065428A