Updating method and system of layer sensing container, terminal and storage medium

Through the layer-aware container update method, combined with reinforcement learning algorithms, and dynamically scheduling tasks, the problems of low container update efficiency and large update overhead in edge computing scenarios are solved, and more efficient container updates and task scheduling are achieved.

CN119988036AActive Publication Date: 2025-05-13BEIJING NORMAL UNIV AT ZHUHAI
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510457682.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2025-05-13
Estimated Expiration
2045-04-14

AI Technical Summary

Technical Problem

In edge computing scenarios, resources (such as CPU, memory, bandwidth, etc.) are usually limited, and the network transmission rate between edge nodes is uneven, resulting in low container update efficiency and large update overhead.

Method used

The layer-aware container update method is adopted to obtain the new layer size and mirror download delay required for the container to be updated in the target edge node, and the container initialization process is performed, and the update start and end time is calculated based on the total update delay. At the same time, the task end time of intensive tasks is determined, the container update and task scheduling overhead model is built, and the reinforcement learning algorithm is used to solve it to obtain the container update decision and task scheduling results.

Benefits of technology

By dynamically scheduling tasks, we can reduce task interruptions caused by container updates, improve container update efficiency, and reduce update overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988036A_ABST
    Figure CN119988036A_ABST
Patent Text Reader

Abstract

The invention discloses a layer perception container updating method and system, a terminal and a storage medium, and the method comprises the steps: obtaining a new layer size and a mirror image downloading delay required by a to-be-updated container, and carrying out the initialization processing of the container according to the new layer size, and obtaining an initialization delay; calculating total updating delay according to the mirror image downloading delay and the initialization delay, and calculating updating starting time and updating ending time of the to-be-updated container; determining an intensive task, calculating communication delay on the target edge node and operation delay in the to-be-updated container, and calculating task end time of the intensive task; modeling according to the update start time and the update end time of the to-be-updated container and the task end time of the intensive task to obtain a container update and task scheduling overhead model; and solving by adopting a reinforcement learning algorithm to obtain a container updating decision and a task scheduling result. The updating efficiency of the container can be effectively improved, and the updating overhead of the container can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of container update, and in particular to a layer-aware container update method, system, terminal and computer-readable storage medium. Background Art

[0002] With the rapid development of edge computing and cloud computing, container technology has become a core tool for application deployment and management in modern distributed systems. Containers are widely used in collaborative scenarios between edge nodes and the cloud due to their lightweight and efficient features. However, container version updates are a complex and critical process, especially in edge-cloud collaborative networks. Container updates usually involve operations such as downloading image layers, stopping and starting containers, etc. These operations will have a significant impact on the system's task scheduling and resource utilization.

[0003] However, in edge computing scenarios, existing technologies usually have limited resources (such as CPU, memory, and bandwidth), and the network transmission rate between edge nodes is uneven, resulting in low container update efficiency and high update overhead.

[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention

[0005] The main purpose of the present invention is to provide a layer-aware container update method, system, terminal and computer-readable storage medium, aiming to solve the problem that in the edge computing scenario, resources (such as CPU, memory and bandwidth, etc.) are usually limited, and the network transmission rate between edge nodes is uneven, resulting in low container update efficiency and high update overhead.

[0006] To achieve the above object, the present invention provides a layer-aware container update method, the layer-aware container update method comprising the following steps: Obtaining a new layer size and an image download delay required by the container to be updated in the target edge node, and performing container initialization processing according to the new layer size to obtain an initialization delay; Calculate a total update delay according to the image download delay and the initialization delay, and calculate an update start time and an update end time of the container to be updated according to the total update delay; Determine an intensive task on the target edge node, calculate a communication delay of the intensive task on the target edge node and an operation delay in the container to be updated, and calculate a task end time of the intensive task according to the communication delay and the operation delay; Modeling is performed according to the update start time, the update end time of the container to be updated, and the task end time of the intensive task to obtain a container update and task scheduling overhead model; A reinforcement learning algorithm is used to solve the container update and task scheduling overhead model to obtain container update decisions and task scheduling results.

[0007] Optionally, the layer-aware container update method, wherein the obtaining of the new layer size and the image download delay required for the container to be updated in the target edge node, and performing container initialization processing according to the new layer size to obtain the initialization delay, specifically includes: When a container update request is received, obtaining a new layer size and an image download delay required for the container to be updated in the target edge node according to the container update request; Among them, the expression of the new layer size is: ; in, is the new layer size, For the container to be updated, is the collection of containers to be updated. For layers, is a collection of layers, The container to be updated contains or does not contain situation, for In time Is it stored in the target edge node? The above situation, For Layer size; The expression of the image download delay is: ; in, Delayed download of mirrors, For other edge nodes, is the set of edge nodes, is the cloud bandwidth, for and The transmission rate between For Time layer Whether to store on the target edge node The above situation; The CPU frequency of the target edge node is obtained, and container initialization processing is performed according to the CPU frequency and the new layer size to obtain an initialization delay.

[0008] Optionally, in the layer-aware container update method, the initialization delay is expressed as: ; in, For initialization delay, is a constant, is the CPU frequency of the target edge node.

[0009] Optionally, in the update method of the layer-aware container, the expression of the total update delay is: ; in, is the total update delay; The expression of the update start time is: ; in, is the update start time of the container to be updated. The target edge node Containers to be updated on The start time of The expression of the update end time is: ; in, The update end time of the container to be updated.

[0010] Optionally, the updating method of the layer-aware container, wherein the determining of the intensive task on the target edge node, calculating the communication delay of the intensive task on the target edge node and the running delay in the container to be updated, and calculating the task end time of the intensive task according to the communication delay and the running delay, specifically includes: Determine an intensive task to be executed on the target edge node, and calculate an uplink wireless transmission rate of the intensive task on the target edge node; Calculate the communication delay of transmitting the intensive task to the target edge node according to the uplink wireless transmission rate; Calculating the running delay of the intensive task when it is executed in the container to be updated, and calculating the total execution delay of the intensive task when it is executed on the target edge node according to the running delay and the communication delay; The task release time of the intensive task is obtained, and the task end time of the intensive task is obtained according to the task release time and the total execution delay.

[0011] Optionally, the layer-aware container update method, wherein the modeling is performed according to the update start time, the update end time of the container to be updated, and the task end time of the intensive task to obtain a container update and task scheduling overhead model, specifically comprising: Calculating the current task status of the intensive task according to the task end time; Modeling is performed according to the update start time, the update end time and the current task state of the container to be updated to obtain a container update and task scheduling overhead model; The expression of the container update and task scheduling overhead model is: ; in, Updating and scheduling overhead models for containers, To balance the weight of container update and task scheduling overhead, To indicate the task, is a set of indicating tasks, is the current task status of the container to be updated.

[0012] Optionally, the layer-aware container update method, wherein the reinforcement learning algorithm includes an edge-cloud-aware collaborative container update algorithm and a task scheduling algorithm; The reinforcement learning algorithm is used to solve the container update and task scheduling overhead model to obtain the container update decision and task scheduling result, which specifically includes: Obtaining the node status of the target edge node, the container update status of the container to be updated, and the layer status of the layer to be updated in the container to be updated, and using the edge-cloud collaborative container update algorithm to obtain the container priority and the container update ratio according to the node status, the container update status, and the layer status; Solving the container update and task scheduling overhead model according to the container priority and the container update ratio to obtain a container update decision; The node remaining resources of the target edge node are obtained, and the container update and task scheduling overhead model is solved according to the node remaining resources by using a task scheduling algorithm to obtain a task scheduling result.

[0013] In addition, to achieve the above object, the present invention further provides a layer-aware container update system, wherein the layer-aware container update system includes: A container initialization processing module is used to obtain the new layer size and image download delay required by the container to be updated in the target edge node, and perform container initialization processing according to the new layer size to obtain the initialization delay; An update time calculation module, used to calculate a total update delay according to the image download delay and the initialization delay, and obtain an update start time and an update end time of the container to be updated according to the total update delay; A task end time calculation module, used to determine the intensive task on the target edge node, calculate the communication delay of the intensive task on the target edge node and the running delay in the container to be updated, and calculate the task end time of the intensive task according to the communication delay and the running delay; A model building module, used to build a model according to the update start time and the update end time of the container to be updated and the task end time of the intensive task, so as to obtain a container update and task scheduling overhead model; The model solving module is used to solve the container update and task scheduling overhead model by using a reinforcement learning algorithm to obtain a container update decision and a task scheduling result.

[0014] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and an update program for a layer-aware container stored in the memory and executable on the processor, and when the update program for the layer-aware container is executed by the processor, the steps of the layer-aware container update method as described above are implemented.

[0015] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores an update program for a layer-aware container, and when the update program for the layer-aware container is executed by a processor, the steps of the layer-aware container update method as described above are implemented.

[0016] In the present invention, the new layer size and the image download delay required for the container to be updated in the target edge node are obtained, and the container initialization processing is performed according to the new layer size to obtain the initialization delay; the total update delay is calculated according to the image download delay and the initialization delay, and the update start time and the update end time of the container to be updated are calculated according to the total update delay; the intensive task on the target edge node is determined, the communication delay of the intensive task on the target edge node and the running delay in the container to be updated are calculated, and the task end time of the intensive task is calculated according to the communication delay and the running delay; modeling is performed according to the update start time, the update end time and the task end time of the container to be updated to obtain a container update and task scheduling overhead model; the container update and task scheduling overhead model is solved by using a reinforcement learning algorithm to obtain a container update decision and a task scheduling result. The present invention calculates the update start time and update end time of the container to be updated and the task end time of the intensive task, and then constructs a container update and task scheduling overhead model, and adopts a reinforcement learning algorithm to solve it, so as to obtain the container update decision and task scheduling results. It can dynamically schedule tasks during the container update process, thereby reducing task interruptions caused by container updates, effectively improving the update efficiency of the container, and reducing the update overhead of the container. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a flow chart of a preferred embodiment of the updating method of the layer-aware container of the present invention; Figure 2 It is a schematic diagram of container update of layer sharing and edge cloud collaboration in edge computing of a preferred embodiment of the layer-aware container update method of the present invention; Figure 3 It is a schematic diagram of a dual-time-scale container update framework of a preferred embodiment of the layer-aware container update method of the present invention; Figure 4 It is a schematic diagram of the LECU algorithm structure of a preferred embodiment of the layer-aware container update method of the present invention; Figure 5 It is a schematic diagram of the edge system architecture of a preferred embodiment of the layer-aware container update method of the present invention; Figure 6 It is a schematic diagram of the overhead when the number of nodes is different in a preferred embodiment of the layer-aware container update method of the present invention; Figure 7 It is a schematic diagram of the overhead when the bandwidth is different in a preferred embodiment of the layer-aware container update method of the present invention; Figure 8 It is a schematic diagram of the algorithm convergence process of a preferred embodiment of the updating method of the layer perception container of the present invention; Fig. 9 It is a structural diagram of a preferred embodiment of the updating system of the layer perception container of the present invention; Fig.10 It is a structural diagram of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0019] With the rapid development of edge computing and cloud computing, container technology has become a core tool for application deployment and management in modern distributed systems. Containers are widely used in collaborative scenarios between edge nodes and the cloud due to their lightweight and high efficiency. However, container version updates are a complex and critical process, especially in edge-cloud collaborative networks. Container updates usually involve operations such as downloading image layers, stopping and starting containers, etc. These operations will have a significant impact on the system's task scheduling and resource utilization.

[0020] In edge computing scenarios, resources (such as CPU, memory, bandwidth, etc.) are usually limited, and the network transmission rate between edge nodes is uneven. Container updates need to minimize task interruptions and resource waste while ensuring task execution efficiency. Therefore, how to efficiently update containers in an edge-cloud collaborative environment while optimizing task scheduling has become an important research goal.

[0021] At present, existing technologies have made some progress in container updates and task scheduling in edge computing scenarios. First, the layered sharing technology uses the layered structure of container images to reduce repeated downloads by sharing read-only layers, thereby reducing image transmission overhead. For example, the study proposed a container migration and startup optimization method based on layered storage. In addition, the rolling update strategy avoids complete system downtime by gradually updating some nodes, which is suitable for resource-constrained scenarios. In recent years, reinforcement learning (RL) algorithms have been widely used to optimize container updates and task scheduling problems, such as comprehensively considering the effects of long-term benefits, layer sharing, and edge-cloud collaboration through reward functions. The latest LECU (Layer-aware Edge-cloud Collaborative Container Update) algorithm combines layered sharing and reinforcement learning, dynamically adjusts the update ratio, and reduces the interruption of updates to tasks through task scheduling algorithms. Experiments show that the LECU algorithm is superior to traditional methods in terms of update overhead and task scheduling overhead.

[0022] Although the existing technologies have achieved certain results in terms of container update efficiency and task scheduling optimization, there are still some shortcomings. First, the traditional rolling update strategy fails to dynamically adjust the update ratio, resulting in low update efficiency or high task interruption rate. Secondly, although the layered sharing technology reduces the amount of image downloads, it does not fully consider the dynamic nature of layer sharing and the differences in network conditions between nodes during the container update process. In addition, existing studies usually regard container updates and task scheduling as independent problems, ignoring the mutual influence between the two, making it difficult to achieve global optimization. Although the reinforcement learning algorithm can dynamically optimize the update strategy, its training process is complex, especially in large-scale edge-cloud collaboration scenarios, it may face problems of slow convergence and high computational overhead. Therefore, the existing technology still needs to be further improved in resource-constrained and task-sensitive edge computing scenarios to achieve more efficient container updates and task scheduling.

[0023] It can be seen that container technology is widely popular in edge computing (EC) due to its continuous integration and convenient deployment characteristics, and has become an important tool for application deployment. However, in order to improve performance, containers need to be updated frequently, which poses new challenges to cutting-edge applications such as large language models and digital twins. Traditional container update methods usually result in high download overhead and task interruption, which is unacceptable for resource-constrained and latency-sensitive edge computing tasks. At the same time, existing research has largely ignored the hierarchical structure of container images. By utilizing this hierarchical structure, repeated downloads can be effectively reduced, and the update time can be further shortened by transmitting different image layers from other edge nodes.

[0024] To solve the above problems, the present invention models the hierarchical container update problem in the edge-cloud collaboration scenario, with the goal of minimizing the container update overhead. The present invention proposes a hierarchical-aware edge-cloud collaborative container update algorithm based on reinforcement learning to optimize container update decisions. In addition, a heuristic task scheduling algorithm is designed to schedule tasks affected by container updates to other edge nodes, thereby minimizing the impact of task interruptions. The present invention implements the LECU algorithm on an edge system based on real data to verify its effectiveness. In addition, large-scale simulation experiments are conducted to evaluate the scalability of the algorithm. The results show that compared with the baseline method, the algorithm of the present invention reduces the container update overhead and task scheduling overhead by 14% and 19%, respectively.

[0025] The updating method of the layer-aware container described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the update method of the layer-aware container includes the following steps: Step S10: Obtain the new layer size and image download delay required by the to-be-updated container in the target edge node, and perform container initialization processing according to the new layer size to obtain the initialization delay.

[0026] At present, large language models and digital twin technologies can be easily deployed to edge clusters through containerization technology, but these applications need to be updated frequently to meet user needs more efficiently. At the same time, regular updates are also crucial, not only to add new features, but also to enhance security and fix potential vulnerabilities. The process of container updates usually includes downloading new image versions from the cloud, stopping old containers, and starting new containers. However, although the container itself is relatively lightweight, container updates may become very slow in actual operation due to limited bandwidth for image downloads in edge computing (EC) environments. In addition, the download of a large number of images may also impose a heavy burden on the remote cloud. Therefore, exploring a fast and efficient container update method is crucial for edge computing environments.

[0027] Currently, a variety of container update strategies have been proposed. However, existing research often ignores two key issues. First, images are composed of multiple layers that can be shared. Since new and old images usually share many of the same layers, container updates actually only need to download those layers that have changed. For example, Figure 2 As shown, two versions of Golang images are shown (Golang1.21.7 and Golang1.22.0, the Golang image is used to provide the Golang programming environment), but there are only two layers that differ.

[0028] Second, a distributed file system can share layers across different nodes, and if a node is missing a particular layer, it can be loaded from other nodes or downloaded from a remote cloud, such as Figure 2 As shown ( Figure 2 In , Both represent containers in edge nodes. Indicates the current container. For the updated container, , , , , Both represent layers in the container), indicating that edge nodes 2 and 3 need the layer of edge node 1 To update the container By loading the layer from edge node 1 , rather than through the remote cloud, the burden of the remote cloud can be reduced, so layer sharing and edge cloud collaboration can achieve more efficient container updates.

[0029] like Figure 3As shown, the present invention studies the layer-aware container update problem in the edge cloud network, and the proposed container update framework adopts the layer-aware edge-cloud collaborative container update algorithm (LECU) to handle the update of the new version of the container. In addition, in order to avoid large-scale task interruptions caused by the container update process, the present invention designs an efficient task scheduling algorithm RBA algorithm to balance the resource consumption of all edge nodes. When the user equipment (UE) offloads the task to the edge node, the resource balance allocation algorithm (RBA) is used for task scheduling.

[0030] Specifically, when a container update request is received, the new layer size and the image download delay required for the container to be updated in the target edge node are obtained according to the container update request; wherein the expression of the new layer size is: ;in, is the new layer size, For the container to be updated, is the collection of containers to be updated. For layers, is a collection of layers, The container to be updated contains or does not contain situation, for In time Is it stored in the target edge node? The above situation, For Layer size; The expression of the image download delay is: ;in, Delayed download of mirrors, For other edge nodes, is the set of edge nodes, is the cloud bandwidth, for and The transmission rate between For Time layer Whether to store on the target edge node The above situation; The CPU frequency of the target edge node is obtained, and container initialization processing is performed according to the CPU frequency and the new layer size to obtain an initialization delay. The expression of the initialization delay is: ;in, For initialization delay, is a constant, is the CPU frequency of the target edge node.

[0031] The present invention first models the edge computing system, and the edge node set is defined as ,in, is the first edge node, is the second edge node, Indicates the number of elements in a collection, for example, Indicates the number of edge nodes. Target edge node The remaining CPU and memory resources in and express( The target edge node The remaining CPUs in The target edge node remaining memory resources in the . Is the target edge node In addition, the target edge node The CPU frequency is expressed as , the bandwidth is defined as In addition, the number of images stored on edge nodes is also limited by the edge node storage capacity (storage capacity available indicates) restrictions.

[0032] A set of tasks that different IoT devices offload to edge nodes are ,in, For the first task, For the second task, is the number of tasks in the task set. At the same time, the present invention assumes that the resources required by the task are the same as the resources occupied by the container. The CPU and memory resources required are and ( For the task Required CPU, For the task Required memory resources). In addition, the task The data size is ,Task The release time is .

[0033] This set of containers is represented by , For the first container, For the second container, is the number of containers in the container set. A set of images is represented by , For the first image, For the second image, is the number of images in the image set, each image is associated with a container. The only difference between a container and an image is the writable container layer, so requesting a container is equivalent to requesting the corresponding image. The writable container layer is represented by , is the first container layer, For the second container layer, is the number of container layers in the writable container layer. The size of With the above definitions, we can calculate the container update overhead and task scheduling and execution overhead.

[0034] The calculation process of container update cost is as follows: 1. Image download: Layers can be shared between different images, so only the changed layers in the new image need to be downloaded. Container in The desired new layer size is: ,in, Indicator Container Whether to include layers ( ) or does not belong to ( ). Presentation Layer Is it in time ( ) is stored at the edge node superior( ). Furthermore, the edge node updates the container by downloading the image from the remote cloud or loading the image from other edge nodes through the distributed file system, where the image download delay can be expressed as: .

[0035] 2. Container initialization: The container initialization delay is affected by the CPU frequency of the target edge node and can be obtained in the following ways: .

[0036] Step S20: Calculate a total update delay according to the image download delay and the initialization delay, and calculate an update start time and an update end time of the container to be updated according to the total update delay.

[0037] Specifically, the expression of the total update delay is: ;in, is the total update delay; the expression of the update start time is: ;in, is the update start time of the container to be updated. The target edge node Containers to be updated on The start time of the update; the expression of the update end time is: ;in, The update end time of the container to be updated.

[0038] Given the target edge node Upload the container to be updated The update start time is , the start and end times of container updates are: ; .

[0039] Step S30, determine the intensive task on the target edge node, calculate the communication delay of the intensive task on the target edge node and the running delay in the container to be updated, and calculate the task end time of the intensive task according to the communication delay and the running delay.

[0040] Specifically, determine the intensive task that needs to be executed on the target edge node, and calculate the uplink wireless transmission rate of the intensive task on the target edge node; calculate the communication delay of the intensive task to the target edge node according to the uplink wireless transmission rate; calculate the running delay of the intensive task when it is executed in the container to be updated, and calculate the total execution delay of the intensive task when it is executed on the target edge node according to the running delay and the communication delay; obtain the task release time of the intensive task, and obtain the task end time of the intensive task according to the task release time and the total execution delay.

[0041] The specific calculation process of task scheduling and execution is as follows: UE (User Equipment) offloads computationally intensive tasks to edge nodes for execution. From the task To the target edge node Uplink wireless transmission rate It is expressed as: ;in, Indicates the target edge node bandwidth, Indicates at time Transmit to the target edge node The number of tasks, is the transmission power, It's time The channel gain between the UE and the target edge node is represents the power of Gaussian white noise. Transmit to the target edge node The communication delay can be expressed as: ;in, Indicates the size of the data required to perform the task. Usually, the communication delay of the result return is considered negligible and is therefore omitted.

[0042] Tasks are executed in separate containers and run concurrently. The computation delay can be defined as follows: ;in, It's a task The requested CPU frequency, Is the target edge node In addition, the target edge node In time The load is defined as In summary, at the target edge node Execute tasks on The total delay is: ;Task The release time is expressed as , so the completion time It can be expressed as: .

[0043] Step S40: Modeling is performed according to the update start time, the update end time of the container to be updated, and the task end time of the intensive task to obtain a container update and task scheduling overhead model.

[0044] Specifically, the current task state of the intensive task is calculated according to the task end time; modeling is performed according to the update start time, the update end time and the current task state of the container to be updated to obtain a container update and task scheduling overhead model; wherein the expression of the container update and task scheduling overhead model is: ;in, Updating and scheduling overhead models for containers, To balance the weight of container update and task scheduling overhead, To indicate the task, is a set of indicating tasks, is the current task status of the container to be updated.

[0045] The present invention assumes that the target edge node The last update started at , target edge node The last update ended at If a task is interrupted by an update during execution, the task will fail. The state can be expressed as: ,in, is the Iverson bracket, which is equal to 1 if the condition is met; otherwise, it is equal to 0. Indicates the task Whether it is assigned to the target edge node ( ) or not satisfied ( ).

[0046] The goal of this invention is to dynamically adjust the proportion and order of container updates to minimize the update time and reduce task interruptions caused by updates. To balance the overhead of container updates and task scheduling, the problem is formulated as: .

[0047] Step S50: Use a reinforcement learning algorithm to solve the container update and task scheduling overhead model to obtain a container update decision and a task scheduling result. The reinforcement learning algorithm includes a perceptual edge cloud collaboration container update algorithm and a task scheduling algorithm.

[0048] As a complex variant of the bin packing problem, traditional algorithms may not be able to effectively solve this problem in a reasonable time. By modeling it as a Markov decision process (MDP), RL (Reinforcement Learning) can effectively address the complexity and provide better solutions.

[0049] After modeling the above problem, the present invention adopts a reinforcement learning algorithm to solve the problem. Reinforcement learning mainly includes several aspects such as state space, action space, and reward function.

[0050] Specifically, the node status of the target edge node, the container update status of the container to be updated, and the layer status of the layer to be updated in the container to be updated are obtained, and the perceived edge cloud collaborative container update algorithm is used to obtain the container priority and the container update ratio according to the node status, the container update status and the layer status; the container update and task scheduling overhead model is solved according to the container priority and the container update ratio to obtain a container update decision; the node remaining resources of the target edge node are obtained, and the task scheduling algorithm is used to solve the container update and task scheduling overhead model according to the node remaining resources to obtain a task scheduling result.

[0051] Among them, the state space: state Contains information about multiple parties, time Status Including node status , container update status and layer status In short, The state at is defined as: .

[0052] Action space: When a container needs to be updated, the LECU algorithm (Layer-aware Edge-cloud Collaborative Container Update) determines the proportion of containers to be updated simultaneously and the update order, time The operation is defined as ,in is the fraction of containers updated simultaneously, is the update priority of each container. Here, The target edge node is specified The priority of the container. If the container update ratio does not reach , then select the edge node with higher priority for update.

[0053] Reward Function: The goal of this invention is to minimize the update time and reduce task interruption caused by the update. The reward can be expressed as: .

[0054] As shown in Table 1 below, the RBA algorithm (Resource Balance Allocation, a resource balance allocation algorithm, is an efficient task scheduling algorithm) is presented in detail in Algorithm 1 of Table 1. Its input includes a set of edge nodes and their available resources. As shown in rows 1 to 3, the algorithm scores each node based on its remaining resources. Subsequently, the edge nodes are sorted according to the scores (row 4). In rows 5 to 12, the algorithm verifies whether each node has enough resources to perform the task one by one. If a node meets the conditions, the task will be assigned to the node and the loop terminates. Finally, if all edge nodes cannot meet the scheduling requirements, the task will be assigned to the remote cloud (rows 13 to 14).

[0055] Table 1: Task allocation process based on RBA algorithm

[0056] like Figure 4 As shown in the figure, the framework of the LECU algorithm is to observe the states of nodes, containers, and layers from the environment. These states are then embedded, connected, and input into the policy network, which makes update decisions. Then, rewards are obtained from the actions taken. As shown in Table 2 below, in Algorithm 2 of Table 2, the update sequence queue is first obtained. and task scheduling queues . Store all containers that need to be updated, and the present invention updates them according to the priority Remove the container from In addition, All tasks that need to be scheduled are stored, and the present invention arranges tasks from As shown in lines 2 to 6, if the number of containers being updated is less than the number determined by the algorithm, then Then, as shown in lines 7 to 12, the task is updated from If the current time is greater than the task If the release time is reached, call Algorithm 1 to schedule this task; otherwise, put it back middle.

[0057] Table 2: Container update process based on LECU algorithm

[0058] like Figure 5 As shown ( Figure 5 The RBA algorithm in the invention, Reservation-Based Algorithm, is a reservation-based algorithm. This algorithm is mainly used in the fields of resource allocation and scheduling. It optimizes the performance and efficiency of the system by reserving resources in advance. AWS and MySQL are all different types of repositories). This is the edge system architecture of the present invention, which consists of a remote cloud and four edge nodes. The present invention simulates a cloud environment on a server equipped with a 10-core Intel i9-10900K 3.70 GHz CPU, 32 GB memory and 1024 GB disk, and runs Ubuntu 20.04 with Linux 5.4.0 kernel. Each edge node runs in an independent virtual machine (VM), configured with a 4-core CPU, 8 GB memory and 40 GB disk, and the operating system is Ubuntu 22.04 with Linux 5.15.38 kernel. The algorithm of the present invention is trained and inferred on an NVIDIA RTX 4070 Super GPU. In addition, in order to simulate the task offloading of the user equipment (UE), the present invention develops a task generator and a version generator for publishing new image versions.

[0059] Remote cloud: Set up in the cloud, the present invention deploys a private Docker registry (Docker is an open source application container engine that allows developers to package their own applications and dependent packages into a portable image and then publish it to any popular Linux or Windows operating system machine). Usually, the required image is downloaded from the official Docker Hub repository. However, this method may be affected by network fluctuations, resulting in image download failure or incomplete update. To solve this problem, the present invention deploys a private Docker registry to host all images used in the experiment. When a new version of the container is released, the edge node will start the container update process.

[0060] Edge nodes: Docker is installed on edge nodes, which are responsible for updating containers. The update process starts with a check operation of Docker to retrieve all image layers. Subsequently, the edge nodes only check and download image layers that are not yet available locally through the image sharing mechanism. However, in a distributed environment, efficient layer transmission is a key challenge. To this end, the present invention uses a peer-to-peer (P2P) protocol to establish a distributed network to improve the stability and reliability of transmission. This method performs particularly well in the layer transmission process of edge-cloud collaboration, and can more efficiently download images from the remote cloud or load images from other edge nodes.

[0061] The LECU algorithm used in the present invention consists of three core modules: agent, cache and model. In the training phase, the agent uses the data in the cache to train the model; in the prediction phase, the agent loads the model to make update decisions and calls the Docker client to download the new version of the image. However, ensuring the accuracy of the model in a dynamic environment is a major challenge. To this end, the present invention introduces online learning and regular retraining mechanisms to enable the model to adapt to changing conditions. In addition, the RBA algorithm receives tasks from the task scheduling queue, evaluates edge node resources, sorts nodes according to scores, and assigns tasks to the nodes with the highest scores through the Docker service. If the resources of all edge nodes are insufficient to meet the task requirements, the task will be uploaded to the cloud server.

[0062] The container and layer data used in the experiment of this invention are from the Docker repository, including 23 images and 609 image layers. Each image has multiple versions, totaling 151 versions. The task data comes from cluster tracking data. After preprocessing to remove missing values ​​and outliers, 156,456 tasks are finally retained, each of which requires an average of 3.93 CPU cores and 4.21 GB of memory, and its release time is randomly generated.

[0063] The algorithm of the present invention is implemented on a small-scale edge system to verify its practicality and applicability. The system consists of a remote cloud and multiple edge nodes. The container update process is completed by pulling images from the Docker repository through Docker. The system collects state data and uses NVIDIA GPU to train the reinforcement learning (RL) policy network. Once the policy network is trained, it will be deployed to the edge system. When a container update request is received, the algorithm will make the optimal update decision based on the current system state. In addition, the present invention also conducted larger-scale experiments to evaluate the scalability of the algorithm. The experimental results show that the proposed algorithm significantly outperforms all baseline algorithms in performance.

[0064] In order to verify the effectiveness of the LECU algorithm proposed in this invention, this invention compares it with several baseline algorithms (including RU, RULS, LS and FB): 1. RU: The Rolling Update (RU) algorithm takes out a portion of the nodes to stop service, perform updates, and put them back into service. As with the default settings of Kubernetes (Kubernetes is an open source application for managing containerized applications on multiple hosts in a cloud platform), the update ratio is 25%. 2. RULS (Rolling Update with layersharing): RU algorithm with layer sharing. 3. LS: The Local Search (LS) algorithm is a heuristic method that optimizes software updates for smart vehicles, focusing on update time-aware strategies. 4. FB: The Fog Computing Based Update (FB) algorithm aims to save computing resources through resource-aware update strategies. The final experimental results are as follows: like Figure 6 As shown in, it is the overhead when the number of nodes is different; Figure 7 As shown in, it is the overhead when the bandwidth is different; Figure 8 The figure shows the convergence process of the algorithm.

[0065] Beneficial effects of the present invention: 1. This paper introduces the hierarchical structure of container images into the container update of edge computing for the first time, uses the hierarchical sharing mechanism to reduce the number of layers downloaded repeatedly, thereby reducing the update overhead, and proposes a hierarchical-aware edge-cloud collaborative container update problem model, with the goal of minimizing container update time and task interruption.

[0066] 2. Based on the Soft Actor-Critic (SAC) reinforcement learning algorithm, the container update strategy is dynamically decided, and the long-term benefits, the impact of layer sharing, and the optimization effect of edge-cloud collaboration are comprehensively considered through the reward function.

[0067] 3. A resource balancing allocation algorithm is proposed to dynamically schedule tasks during the container update process to reduce task interruptions caused by updates. Through real-time evaluation of edge node resources, tasks are preferentially allocated to low-load nodes and tasks are uploaded to the cloud when necessary.

[0068] 4. A two-time-scale container update framework is proposed. When a new version of the container is released, the LECU algorithm is called to make container update decisions; when the user device unloads a task, the RBA algorithm is called to schedule the task. This framework comprehensively considers the mutual influence of container updates and task scheduling and optimizes the overall performance.

[0069] 5. The above algorithm is implemented in a real edge computing system, and its effectiveness and scalability are verified through real data sets and large-scale simulations.

[0070] In addition, the present invention can also adopt an alternative hierarchical sharing mechanism: use image block technology to replace the hierarchical sharing mechanism, divide the container image into blocks of fixed size, and reduce the amount of transmitted data through block-level deduplication. Block-level deduplication may be more refined than layer-level deduplication, further reducing the amount of transmitted data, but requiring additional computing resources for block division and hash calculation.

[0071] The present invention can also replace the reinforcement learning algorithm with a traditional heuristic algorithm or other machine learning algorithm. Use a heuristic algorithm (such as a greedy algorithm or a genetic algorithm) to optimize the container update order and task scheduling. The implementation is simple and the computational overhead is low, but the long-term benefits may not be fully considered and the performance may not be as good as the reinforcement learning algorithm.

[0072] Furthermore, if Fig. 9 As shown, based on the above-mentioned layer-aware container update method, the present invention also provides a layer-aware container update system, wherein the layer-aware container update system includes: The container initialization processing module 51 is used to obtain the new layer size and image download delay required by the container to be updated in the target edge node, and perform container initialization processing according to the new layer size to obtain the initialization delay; An update time calculation module 52, configured to calculate a total update delay according to the image download delay and the initialization delay, and obtain an update start time and an update end time of the container to be updated according to the total update delay; A task end time calculation module 53 is used to determine the intensive task on the target edge node, calculate the communication delay of the intensive task on the target edge node and the running delay in the container to be updated, and calculate the task end time of the intensive task according to the communication delay and the running delay; A model building module 54 is used to build a model according to the update start time, the update end time of the container to be updated, and the task end time of the intensive task to obtain a container update and task scheduling overhead model; The model solving module 55 is used to solve the container update and task scheduling overhead model using a reinforcement learning algorithm to obtain a container update decision and a task scheduling result.

[0073] Furthermore, if Fig.10 As shown, based on the above-mentioned layer-aware container update method and system, the present invention also provides a terminal accordingly, and the terminal includes a processor 10, a memory 20 and a display 30. Fig.10 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0074] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Furthermore, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 20 stores an update program 40 of a layer perception container, and the update program 40 of the layer perception container can be executed by the processor 10, thereby realizing the update method of the layer perception container in the present application.

[0075] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the update method of the layer-aware container.

[0076] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface.

[0077] In one embodiment, when the processor 10 executes the layer-aware container update program 40 in the memory 20 , the steps of the layer-aware container update method described above are implemented.

[0078] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores an update program for a layer-aware container, and when the update program for the layer-aware container is executed by a processor, the steps of the layer-aware container update method as described above are implemented.

[0079] In summary, the present invention provides a layer-aware container update method, system, terminal and computer-readable storage medium, the method comprising: obtaining a new layer size and an image download delay required for a container to be updated in a target edge node, and performing container initialization processing according to the new layer size to obtain an initialization delay; calculating a total update delay according to the image download delay and the initialization delay, and obtaining an update start time and an update end time of the container to be updated according to the total update delay; determining an intensive task on the target edge node, calculating a communication delay of the intensive task on the target edge node and an operation delay in the container to be updated, and obtaining a task end time of the intensive task according to the communication delay and the operation delay; modeling is performed according to the update start time, the update end time and the task end time of the container to be updated to obtain a container update and task scheduling overhead model; solving the container update and task scheduling overhead model using a reinforcement learning algorithm to obtain a container update decision and a task scheduling result. The present invention calculates the update start time and update end time of the container to be updated and the task end time of the intensive task, and then constructs a container update and task scheduling overhead model, and adopts a reinforcement learning algorithm to solve it, so as to obtain the container update decision and task scheduling results. It can dynamically schedule tasks during the container update process, thereby reducing task interruptions caused by container updates, effectively improving the update efficiency of the container, and reducing the update overhead of the container.

[0080] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, method, article or terminal including the element.

[0081] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.

[0082] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A layer-aware container update method, characterized in that: The updating method of the layer-aware container includes: Obtaining a new layer size and an image download delay required by the container to be updated in the target edge node, and performing container initialization processing according to the new layer size to obtain an initialization delay; Calculate a total update delay according to the image download delay and the initialization delay, and calculate an update start time and an update end time of the container to be updated according to the total update delay; Determine an intensive task on the target edge node, calculate a communication delay of the intensive task on the target edge node and an operation delay in the container to be updated, and calculate a task end time of the intensive task according to the communication delay and the operation delay; Modeling is performed according to the update start time, the update end time of the container to be updated, and the task end time of the intensive task to obtain a container update and task scheduling overhead model; A reinforcement learning algorithm is used to solve the container update and task scheduling overhead model to obtain container update decisions and task scheduling results.

2. The method for updating a layer-aware container according to claim 1, characterized in that: The obtaining of the new layer size and the image download delay required by the to-be-updated container in the target edge node, and performing container initialization processing according to the new layer size to obtain the initialization delay, specifically includes: When a container update request is received, obtaining a new layer size and an image download delay required for the container to be updated in the target edge node according to the container update request; Among them, the expression of the new layer size is: ; in, is the new layer size, For the container to be updated, is the collection of containers to be updated. For layers, is a collection of layers, The container to be updated contains or does not contain situation, for In time Is it stored in the target edge node? The above situation, For Layer size; The expression of the image download delay is: ; in, Delayed download of mirrors, For other edge nodes, is the set of edge nodes, is the cloud bandwidth, for and The transmission rate between For Time layer Whether to store on the target edge node The above situation; The CPU frequency of the target edge node is obtained, and container initialization processing is performed according to the CPU frequency and the new layer size to obtain an initialization delay.

3. The method for updating a layer-aware container according to claim 2, characterized in that: The expression of the initialization delay is: ; in, For initialization delay, is a constant, is the CPU frequency of the target edge node.

4. The method for updating a layer-aware container according to claim 3, characterized in that: The expression of the total update delay is: ; in, is the total update delay; The expression of the update start time is: ; in, is the update start time of the container to be updated. The target edge node Containers to be updated on The start time of The expression of the update end time is: ; in, The update end time of the container to be updated.

5. The method for updating a layer-aware container according to claim 1, characterized in that: The determining of the intensive task on the target edge node, calculating the communication delay of the intensive task on the target edge node and the running delay in the container to be updated, and calculating the task end time of the intensive task according to the communication delay and the running delay, specifically includes: Determine an intensive task to be executed on the target edge node, and calculate an uplink wireless transmission rate of the intensive task on the target edge node; Calculate the communication delay of transmitting the intensive task to the target edge node according to the uplink wireless transmission rate; Calculating the running delay of the intensive task when it is executed in the container to be updated, and calculating the total execution delay of the intensive task when it is executed on the target edge node according to the running delay and the communication delay; The task release time of the intensive task is obtained, and the task end time of the intensive task is obtained according to the task release time and the total execution delay.

6. The method for updating a layer-aware container according to claim 4, characterized in that: The modeling is performed according to the update start time, the update end time of the container to be updated, and the task end time of the intensive task to obtain a container update and task scheduling overhead model, specifically including: Calculating the current task status of the intensive task according to the task end time; Modeling is performed according to the update start time, the update end time and the current task state of the container to be updated to obtain a container update and task scheduling overhead model; The expression of the container update and task scheduling overhead model is: ; in, Updating and scheduling overhead models for containers, To balance the weight of container update and task scheduling overhead, To indicate the task, is a set of indicating tasks, is the current task status of the container to be updated.

7. The method for updating a layer-aware container according to claim 1, characterized in that: The reinforcement learning algorithm includes a perception edge cloud collaboration container update algorithm and a task scheduling algorithm; The reinforcement learning algorithm is used to solve the container update and task scheduling overhead model to obtain the container update decision and task scheduling result, which specifically includes: Obtaining the node status of the target edge node, the container update status of the container to be updated, and the layer status of the layer to be updated in the container to be updated, and using the edge-cloud collaborative container update algorithm to obtain the container priority and the container update ratio according to the node status, the container update status, and the layer status; Solving the container update and task scheduling overhead model according to the container priority and the container update ratio to obtain a container update decision; The node remaining resources of the target edge node are obtained, and the container update and task scheduling overhead model is solved according to the node remaining resources by using a task scheduling algorithm to obtain a task scheduling result.

8. A layer-aware container update system, characterized in that: The update system of the layer-aware container includes: A container initialization processing module is used to obtain the new layer size and image download delay required by the container to be updated in the target edge node, and perform container initialization processing according to the new layer size to obtain the initialization delay; An update time calculation module, used to calculate a total update delay according to the image download delay and the initialization delay, and obtain an update start time and an update end time of the container to be updated according to the total update delay; A task end time calculation module, used to determine the intensive task on the target edge node, calculate the communication delay of the intensive task on the target edge node and the running delay in the container to be updated, and calculate the task end time of the intensive task according to the communication delay and the running delay; A model building module, used to build a model according to the update start time and the update end time of the container to be updated and the task end time of the intensive task, so as to obtain a container update and task scheduling overhead model; The model solving module is used to solve the container update and task scheduling overhead model by using a reinforcement learning algorithm to obtain a container update decision and a task scheduling result.

9. A terminal, characterized in that: The terminal includes: a memory, a processor, and an update program for a layer-aware container stored in the memory and executable on the processor. When the update program for the layer-aware container is executed by the processor, the steps of the layer-aware container update method as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an update program for a layer-aware container, and when the update program for the layer-aware container is executed by a processor, the steps of the method for updating a layer-aware container according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Container mirror image preheating and distributing method for edge computing scene

    CN116614517A

  • Job scheduling method, computing device and system

    CN118409855A

  • Multi-user-layer sensing container scheduling method and terminal in edge-assisted vehicle-mounted network

    CN118502920A

  • Delay-aware container scheduling method, system and terminal for cluster upgrade

    CN118502967A

  • Method for optimizing the load balance in the cluster and framework thereof

    US20220091874A1