Update method, system, terminal and storage medium for a layer perception container
The layer-aware container update method using reinforcement learning optimizes container updates and task scheduling in edge computing environments, addressing inefficiencies and interruptions by leveraging container layer structures and edge-cloud collaboration.
Patent Information
- Application Number
- CN202510457682.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-04-14
AI Technical Summary
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 high update overhead.
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, perform container initialization processing, calculate the total update delay and update time, and use reinforcement learning algorithms to optimize container updates and task scheduling, dynamically adjust the update ratio and order, and reduce task interruptions.
It effectively improves container update efficiency, reduces update overhead, reduces task interruption, optimizes resource utilization, and is suitable for edge-cloud collaboration networks.
Smart Images

Figure CN119988036B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of container update, and in particular to an update method, system, terminal and computer-readable storage medium for layer-aware containers. Background Art
[0002] With the rapid development of edge computing and cloud computing, container technology has become the core tool for application deployment and management in modern distributed systems. Due to its lightweight and efficient characteristics, containers are widely used in the collaboration scenarios between edge nodes and the cloud. However, the version update of containers is a complex and critical process. Especially in the edge-cloud collaboration network, container update usually involves operations such as downloading of image layers, stopping and starting of containers, and these operations will have a significant impact on the task scheduling and resource utilization of the system.
[0003] However, in the edge computing scenario of the prior art, resources (such as CPU, memory, and bandwidth, etc.) are usually limited, and the network transmission rates between edge nodes are uneven, resulting in low container update efficiency and large 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 an update method, system, terminal and computer-readable storage medium for layer-aware containers, aiming to solve the problem that in the edge computing scenario of the prior art, resources (such as CPU, memory, and bandwidth, etc.) are usually limited, and the network transmission rates between edge nodes are uneven, resulting in low container update efficiency and large update overhead.
[0006] To achieve the above purpose, the present invention provides an update method for layer-aware containers, and the update method for layer-aware containers includes the following steps:
[0007] Obtain the size of the new layer required by the container to be updated in the target edge node and the image download delay, and perform container initialization processing according to the size of the new layer to obtain the initialization delay;
[0008] Calculate the total update delay according to the image download delay and the initialization delay, and calculate the update start time and update end time of the container to be updated according to the total update delay;
[0009] Determine the intensive tasks on the target edge node, calculate the communication delay of the intensive tasks on the target edge node and the running delay in the container to be updated, and calculate the task end time of the intensive tasks according to the communication delay and the running delay;
[0010] 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;
[0011] 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.
[0012] Optionally, for the update method of the layer-aware container, where obtaining the size of the new layer required for the container to be updated in the target edge node and the mirror download delay, and performing container initialization processing according to the size of the new layer to obtain an initialization delay specifically includes:
[0013] When receiving a container update request, obtain the size of the new layer required for the container to be updated in the target edge node and the mirror download delay according to the container update request;
[0014] Among them, the expression for the size of the new layer is:
[0015] ;
[0016] Among them, is the size of the new layer, is the container to be updated, is the set of containers to be updated, is the layer, is the set of layers, is whether the container to be updated contains or does not contain in the case, is whether it is stored on the target edge node at time in the case, is the layer size;
[0017] The expression for the mirror download delay is:
[0018] ;
[0019] Among them, is the mirror download delay, is other edge nodes, is the set of edge nodes, is the cloud bandwidth, is and the transmission rate between, is at time the layer whether it is stored on the target edge node The situation on
[0020] Obtain the CPU frequency of the target edge node, and perform container initialization processing according to the CPU frequency and the new layer size to obtain the initialization delay.
[0021] Optionally, in the method for updating the layer-aware container, the expression of the initialization delay is:
[0022] ;
[0023] Where is the initialization delay, is a constant, is the CPU frequency of the target edge node.
[0024] Optionally, in the method for updating the layer-aware container, the expression of the total update delay is:
[0025] ;
[0026] Where is the total update delay;
[0027] The expression of the update start time is:
[0028] ;
[0029] Where is the update start time of the container to be updated, is the target edge node The container to be updated on The start time;
[0030] The expression of the update end time is:
[0031] ;
[0032] Where is the update end time of the container to be updated.
[0033] Optionally, in the method for updating the layer-aware container, determining the intensive tasks on the target edge node, calculating the communication delay of the intensive tasks on the target edge node and the running delay in the container to be updated, and calculating the task end time of the intensive tasks according to the communication delay and the running delay specifically includes:
[0034] Determine the intensive tasks that need to be executed on the target edge node, and calculate the uplink wireless transmission rate of the intensive tasks on the target edge node;
[0035] Calculate the communication delay for transmitting the intensive task to the target edge node according to the uplink wireless transmission rate;
[0036] Calculate the running delay when the intensive task is executed in the container to be updated, and calculate the total execution delay when the intensive task is executed on the target edge node according to the running delay and the communication delay;
[0037] 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.
[0038] Optionally, for the method for updating the layer-aware container, wherein, modeling 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:
[0039] Calculate the current task state of the intensive task according to the task end time;
[0040] Model according to the update start time, the update end time of the container to be updated, and the current task state to obtain a container update and task scheduling overhead model;
[0041] Wherein, the expression of the container update and task scheduling overhead model is:
[0042] ;
[0043] Wherein, is the container update and task scheduling overhead model, is the weight for balancing container update and task scheduling overhead, is an indication task, is a set of indication tasks, is the current task state of the container to be updated.
[0044] Optionally, for the method for updating the layer-aware container, wherein, the reinforcement learning algorithm includes a perception edge cloud collaboration container update algorithm and a task scheduling algorithm;
[0045] The method for solving the container update and task scheduling overhead model by using the reinforcement learning algorithm to obtain a container update decision and a task scheduling result specifically includes:
[0046] Obtain 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 use the perception 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;
[0047] Solve the container update and task scheduling overhead model according to the container priority and the container update ratio to obtain a container update decision;
[0048] Obtain the remaining resources of the node of the target edge node, and use the task scheduling algorithm to solve the container update and task scheduling overhead model according to the remaining resources of the node to obtain a task scheduling result.
[0049] In addition, to achieve the above object, the present invention also provides a layer-aware container update system, wherein the layer-aware container update system includes:
[0050] A container initialization processing module, configured to obtain the size of the new layer required by the container to be updated in the target edge node and the mirror download delay, and perform container initialization processing according to the size of the new layer to obtain an initialization delay;
[0051] An update time calculation module, configured to calculate the total update delay according to the mirror download delay and the initialization delay, and calculate the update start time and the update end time of the container to be updated according to the total update delay;
[0052] A task end time calculation module, configured to determine intensive tasks on the target edge node, calculate the communication delay of the intensive tasks on the target edge node and the running delay in the container to be updated, and calculate the task end time of the intensive tasks according to the communication delay and the running delay;
[0053] A model construction module, configured to perform modeling according to the update start time, the update end time of the container to be updated, and the task end time of the intensive tasks to obtain a container update and task scheduling overhead model;
[0054] A model solving module, configured 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.
[0055] In addition, to achieve the above object, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a layer-aware container update program stored on the memory and executable on the processor, and when the layer-aware container update program is executed by the processor, the steps of the layer-aware container update method described above are implemented.
[0056] In addition, to achieve the above object, the present invention further 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 update method for the layer-aware container as described above are implemented.
[0057] In the present invention, the new layer size required for the container to be updated in the target edge node and the mirror download delay are obtained, and container initialization processing is performed according to the new layer size to obtain an initialization delay; the total update delay is calculated according to the mirror download delay and the initialization delay, and the update start time and update end time of the container to be updated are calculated according to the total update delay; the intensive tasks on the target edge node are determined, the communication delay of the intensive tasks 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 tasks is calculated according to the communication delay and the running 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 tasks 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 a container update decision and a task scheduling result. By calculating the update start time and update end time of the container to be updated and the task end time of the intensive tasks, the present invention further constructs a container update and task scheduling overhead model and uses a reinforcement learning algorithm to solve it, thereby obtaining a container update decision and a task scheduling result, which can dynamically schedule tasks during the container update process, thereby reducing task interruption caused by container update, effectively improving the container update efficiency, and reducing the container update overhead. Description of the Drawings
[0058] Figure 1 is a flowchart of a preferred embodiment of the update method for the layer-aware container of the present invention;
[0059] Figure 2 is a schematic diagram of container update of layer sharing and edge cloud cooperation in edge computing of a preferred embodiment of the update method for the layer-aware container of the present invention;
[0060] Figure 3 is a schematic diagram of a dual-time-scale container update framework of a preferred embodiment of the update method for the layer-aware container of the present invention;
[0061] Figure 4 is a schematic diagram of the LECU algorithm structure of a preferred embodiment of the update method for the layer-aware container of the present invention;
[0062] Figure 5It is a schematic diagram of the edge system architecture of a preferred embodiment of the method for updating the layer-aware container of the present invention;
[0063] Figure 6 It is a schematic diagram of the overhead when the number of nodes in a preferred embodiment of the method for updating the layer-aware container of the present invention is different;
[0064] Figure 7 It is a schematic diagram of the overhead when the bandwidth is different in a preferred embodiment of the method for updating the layer-aware container of the present invention;
[0065] Figure 8 It is a schematic diagram of the algorithm convergence process in a preferred embodiment of the method for updating the layer-aware container of the present invention;
[0066] Figure 9 It is a structural diagram of a preferred embodiment of the update system of the layer-aware container of the present invention;
[0067] Figure 10 It is a structural diagram of a preferred embodiment of the terminal of the present invention. Detailed implementation manners
[0068] To make the objectives, technical solutions and advantages of the present invention clearer and more definite, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific examples described herein are only used to explain the present invention and are not used to limit the present invention.
[0069] With the rapid development of edge computing and cloud computing, container technology has become the core tool for application deployment and management in modern distributed systems. Containers are widely used in the collaboration scenarios between edge nodes and the cloud due to their lightweight and high efficiency. However, the version update of containers is a complex and critical process, especially in edge-cloud collaboration networks. Container updates usually involve operations such as downloading image layers, stopping and starting containers, which have a significant impact on the task scheduling and resource utilization of the system.
[0070] In edge computing scenarios, resources (such as CPU, memory, bandwidth, etc.) are usually limited, and the network transmission rates between edge nodes are uneven. Container updates need to minimize the interruption of tasks and waste of resources during the update while ensuring the task execution efficiency. Therefore, how to efficiently update containers in an edge-cloud collaboration environment and optimize task scheduling has become an important research goal.
[0071] Currently, the existing technologies have made some progress in container update and task scheduling in edge computing scenarios. First, the layered sharing technology utilizes the layered structure of container images to reduce duplicate downloads by sharing read-only layers, thereby reducing the mirror transmission overhead. For example, research has proposed methods for optimizing container migration and startup based on layered storage. In addition, the rolling update strategy avoids a complete system outage by gradually updating some nodes and is suitable for resource-constrained scenarios. In recent years, reinforcement learning (RL) algorithms have been widely applied to optimize container update and task scheduling problems. For example, the reward function comprehensively considers the long-term benefits, layer sharing, and the impact of edge-cloud collaboration. 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 tasks to tasks through a task scheduling algorithm. Experiments show that the LECU algorithm is superior to traditional methods in terms of update overhead and task scheduling overhead.
[0072] Although the existing technologies have achieved certain results in container update efficiency and task scheduling optimization, there are still deficiencies. First, the traditional rolling update strategy fails to dynamically adjust the update ratio, resulting in low update efficiency or a high task interruption rate. Second, although the layered sharing technology reduces the amount of mirror downloads, it does not fully consider the dynamics of layer sharing during the container update process and the differences in network conditions between nodes. In addition, existing research usually treats container update and task scheduling as independent problems, ignoring the mutual influence between the two, and it is difficult to achieve global optimization. Although reinforcement learning algorithms can dynamically optimize update strategies, their training process is complex. Especially in large-scale edge-cloud collaboration scenarios, they may face problems such as slow convergence speed and large computational overhead. Therefore, the existing technologies still need to be further improved in resource-constrained and task-sensitive edge computing scenarios to achieve more efficient container update and task scheduling.
[0073] It can be seen that container technology is widely popular in edge computing (EC, Edge Computing) because of its characteristics of continuous integration and convenient deployment, 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 frontier applications such as large language models and digital twins. Traditional container update methods usually bring 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 layered structure of container images. By utilizing this layered structure, duplicate downloads can be effectively reduced, and the update time can be further shortened by transmitting different image layers from other edge nodes.
[0074] 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 collaboration container update algorithm based on reinforcement learning for optimizing container update decisions. In addition, a heuristic task scheduling algorithm is designed to schedule the tasks affected by the container update to other edge nodes, thereby minimizing the impact of task interruption. 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.
[0075] The update method of the layer-aware container according to the preferred embodiment of the present invention is as Figure 1 shown, and the update method of the layer-aware container includes the following steps:
[0076] Step S10: Obtain the size of the new layer required by the container to be updated in the target edge node and the mirror download delay, and perform container initialization processing according to the size of the new layer to obtain the initialization delay.
[0077] Currently, large language models and digital twin technologies can be easily deployed to edge clusters through containerization technology. However, these applications need to be updated frequently to more efficiently meet user needs. At the same time, regular updates are also crucial, as they can not only add new functions but also enhance security and fix potential vulnerabilities. The process of container update usually includes downloading a new image version from the cloud, stopping the old container, and starting the new container. However, although the container itself is relatively lightweight, due to the limited bandwidth for mirror download in the edge computing (EC) environment, container update may become very slow in actual operation. In addition, the download of a large number of mirrors may also impose a heavy burden on the remote cloud. Therefore, exploring a fast and efficient container update method is crucial for the edge computing environment.
[0078] Currently, a variety of container update strategies have been proposed. However, existing research often ignores two key issues. First, a mirror is composed of multiple layers that can be shared. Since the old and new mirrors usually share many identical layers, container update actually only needs to download those layers that have changed. For example, as Figure 2 shown, two versions of the Golang mirror (Golang1.21.7 and Golang1.22.0, the Golang mirror is used to provide the Golang programming environment) are presented, but only two layers are different.
[0079] Second, the distributed file system can share layers across different nodes. If a node lacks a specific layer, it can load it from other nodes or download it from a remote cloud, as Figure 2 shown ( Figure 2 in , all represent containers in the edge node, represents the current container, is the updated container, , , , , all represent the layers in the container), indicating that edge node 2 and edge node 3 need the layers of edge node 1 to update the container . By loading the layer from edge node 1 instead of through the remote cloud, the burden on the remote cloud can be reduced. Therefore, layer sharing and edge cloud collaboration can achieve more efficient container updates.
[0080] As Figure 3 shown, the present invention studies the layer-aware container update problem in the edge cloud network. The proposed container update framework adopts a layer-aware edge-cloud collaborative container update algorithm (LECU, Layer-aware Edge-cloud Collaborative Container Update) to handle the container update of the new version. 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, the RBA algorithm, to balance the resource consumption of all edge nodes. When the user equipment (UE, User Equipment) offloads tasks to the edge node, the resource balance allocation algorithm (RBA, Resource Balance Allocation) is used for task scheduling.
[0081] Specifically, when receiving a container update request, obtain the size of the new layer required for the container to be updated in the target edge node and the mirror download delay according to the container update request; wherein, the expression of the size of the new layer is: ; wherein, is the size of the new layer, is the container to be updated, is the set of containers to be updated, is the layer, is the set of layers, is whether the container to be updated contains or does not contain in the case, is at time Whether it is stored in the target edge node at in the case of, for layer size;
[0082] The expression of the mirror download delay is: ; where, is the mirror download delay, is other edge nodes, is the set of edge nodes, is the cloud bandwidth, is and the transmission rate between, is at time layer whether it is stored in the target edge node in the case of;
[0083] Obtain the CPU frequency of the target edge node, and perform container initialization processing according to the CPU frequency and the new layer size to obtain the initialization delay. The expression of the initialization delay is: ; where, is the initialization delay, is a constant, is the CPU frequency of the target edge node.
[0084] The present invention first models the edge computing system, and the edge node set is defined as where, is the first edge node, is the second edge node, represents the number of elements in the set. For example, represents the number of edge nodes. The remaining CPU and memory resources in the target edge node can be represented by and ( is the remaining CPU in the target edge node , is the remaining memory resource in the target edge node ). is the upgrade status of the target edge node . In addition, the CPU frequency of the target edge node is expressed as , and the bandwidth is defined as . In addition, the number of mirrors stored on the edge node is also limited by the storage capacity of the edge node (the storage capacity can be represented by ).
[0085] A set of tasks unloaded from different Internet of Things devices to the edge node is , where is the 1st task, is the 2nd task, is the number of tasks in the task set. At the same time, the present invention assumes that the resources required by the tasks are the same as those occupied by the containers. The CPU and memory resources required by task are and ( is the CPU required by task , is the memory resource required by task ). In addition, the data size of task is , the release time of task is .
[0086] This set of containers is represented as , is the 1st container, is the 2nd container, is the number of containers in the container set. A set of images is represented as , is the 1st image, is the 2nd image, is the number of images in the image set, and each image is associated with a container. The difference between a container and an image is only the writable container layer, so requesting a container is equivalent to requesting the corresponding image. The writable container layer is represented as , is the 1st container layer, is the 2nd container layer, is the number of container layers in the writable container layer, and the size of layer is represented by . With the above definitions, the container update overhead and the task scheduling and execution overhead can be calculated.
[0087] The calculation process of the container update overhead is as follows:
[0088] 1. Image download: Layers can be shared between different images, so only the changed layers in the new image need to be downloaded. The size of the new layers required for the container in the target edge node is: , where indicates whether the container contains layer ( ) or does not belong to ( ). represents layer Whether at a time ( ) is stored on the edge node above ( ). Further, the edge node updates the container by downloading an image from a remote cloud or loading an image from other edge nodes through a distributed file system, where the image download latency can be expressed as: .
[0089] 2. Container initialization: The container initialization latency is affected by the CPU frequency of the target edge node and can be obtained by the following method: .
[0090] Step S20: Calculate the total update latency according to the image download latency and the initialization latency, and calculate the update start time and the update end time of the container to be updated according to the total update latency.
[0091] Specifically, the expression of the total update latency is: ; where is the total update latency; the expression of the update start time is: ; where is the update start time of the container to be updated, is the target edge node above the container to be updated start time; the expression of the update end time is: ; where is the update end time of the container to be updated.
[0092] Given that the update start time of the container to be updated on the target edge node is , the start time and the end time of the container update are:
[0093] ; .
[0094] Step S30: Determine the intensive tasks on the target edge node, calculate the communication latency of the intensive tasks on the target edge node and the running latency in the container to be updated, and calculate the task end time of the intensive tasks according to the communication latency and the running latency.
[0095] Specifically, determine the intensive tasks to be executed on the target edge node, and calculate the uplink wireless transmission rate of the intensive tasks on the target edge node; calculate the communication delay for transmitting the intensive tasks to the target edge node based on the uplink wireless transmission rate; calculate the running delay when the intensive tasks are executed in the to-be-updated container, and calculate the total execution delay of the intensive tasks when executed on the target edge node based on the running delay and the communication delay; obtain the task release time of the intensive tasks, and obtain the task end time of the intensive tasks based on the task release time and the total execution delay.
[0096] The specific calculation process of task scheduling and execution is as follows:
[0097] The UE (User Equipment) offloads compute-intensive tasks to the edge node for execution. At time From task To the target edge node The uplink wireless transmission rate Is expressed as: ; where Represents the bandwidth of the target edge node Of, Represents at time Transmitted to the target edge node The number of tasks, Is the transmission power, Is the time The channel gain between the UE and the target edge node, Represents the power of Gaussian white noise. Transmit the task To the target edge node The communication delay can be expressed as: ; where Represents the data size required to execute the task. Usually, the return communication delay of the result is considered negligible and is therefore omitted.
[0098] The tasks are executed concurrently in a separate container, and the calculation delay can be defined as follows: ; where Is the task The central processing unit frequency requested, Is the target edge node Of the central processing unit frequency. In addition, the load of the target edge node At time Is defined as . In summary, on the target edge node Execute the task The total delay is: ; Task The release time of is expressed as , so the completion time can be expressed as:
[0099] Step S40: 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.
[0100] Specifically, calculate the current task status of the intensive task according to the task end time; model according to the update start time, the update end time of the container to be updated, and the current task status, to obtain a container update and task scheduling overhead model; where, the expression of the container update and task scheduling overhead model is: ; where is the container update and task scheduling overhead model, is the weight for balancing the container update and task scheduling overhead, is the indicator task, is the set of indicator tasks, is the current task status of the container to be updated.
[0101] The present invention assumes that the start time of the update on the target edge node is , and the end time of the update on the target edge node is . If the task is interrupted by an update during execution, the task will fail. The status of task can be expressed as: , where is the Iverson bracket, which is equal to 1 if the condition is satisfied; otherwise, it is equal to 0. represents whether task is scheduled to the target edge node ( ) or not satisfied ( ).
[0102] The objective of the present invention is to dynamically adjust the proportion and order of container updates, minimize the update time and reduce task interruptions caused by updates. The weight balances the container update and task scheduling overhead, and the problem is formulated as: .
[0103] Step S50: 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. Wherein, the reinforcement learning algorithm includes a perception edge-cloud cooperation container update algorithm and a task scheduling algorithm.
[0104] As a complex variant of the bin-packing problem, traditional algorithms may not be able to effectively solve this problem within a reasonable time. By modeling it as a Markov decision process (MDP), RL (Reinforcement Learning) can effectively address the complexity and provide better solutions.
[0105] After modeling the above problem, the present invention uses a reinforcement learning algorithm to solve the problem. Reinforcement learning mainly includes aspects such as the state space, action space, and reward function.
[0106] Specifically, obtain the node state of the target edge node, the container update state of the container to be updated, and the layer state of the layer to be updated in the container to be updated, and use the layer-aware edge-cloud collaborative container update algorithm to obtain the container priority and container update ratio according to the node state, the container update state, and the layer state; solve the container update and task scheduling overhead model according to the container priority and the container update ratio to obtain a container update decision; obtain the remaining resources of the target edge node, and use the task scheduling algorithm to solve the container update and task scheduling overhead model according to the remaining resources of the node to obtain a task scheduling result.
[0107] Among them, the state space: the state contains information about multiple parties, and the state at time includes the node state , the container update state , and the layer state . In summary, the state at time is defined as:
[0108] The action space: When a container needs to be updated, the LECU algorithm (Layer-aware Edge-cloud Collaborative Container Update) determines the proportion and update order of the containers to be updated simultaneously. The operation at time is defined as , where is the proportion of the containers to be updated simultaneously, and is the update priority of each container. Here, specifies the priority of the containers on the target edge node . If the container update ratio does not reach , then an edge node with a higher priority is selected for update.
[0109] Reward function: The goal of the present invention is to minimize the update time and reduce task interruption caused by updates. The reward can be expressed as: .
[0110] As shown in Table 1 below, the RBA algorithm (Resource Balance Allocation, a resource balance allocation algorithm and an efficient task scheduling algorithm) is presented in detail in Algorithm 1 of Table 1. Its input includes the set of edge nodes and their available resources. As shown in lines 1 to 3, the algorithm scores according to the remaining resources of each node. Subsequently, the edge nodes are sorted according to the scores (line 4). In lines 5 to 12, the algorithm verifies one by one whether each node has enough resources to execute the task. If a node meets the conditions, the task will be assigned to this node and the loop will terminate. Finally, if all edge nodes cannot meet the scheduling requirements, the task will be assigned to the remote cloud (lines 13 to 14).
[0111] Table 1: Task Allocation Process Based on RBA Algorithm
[0112]
[0113] As Figure 4 shown, it is the framework of the LECU algorithm. By observing the states of nodes, containers, and layers from the environment. Then, these states are embedded, connected, and input into the policy network, and the policy network makes update decisions. Then, rewards are obtained from the actions taken. As shown in Table 2 below, in Algorithm 2 of Table 2, first, the update sequence queue and the task scheduling queue are obtained. Stores all containers that need to be updated. The present invention takes out the containers from according to the update priority . In addition, stores all tasks that need to be scheduled. The present invention takes out the tasks from according to the arranged time sequence. As shown in lines 2 to 6, if the number of containers being updated is less than the number determined by the algorithm, edge nodes are retrieved from to update the containers. Then, as shown in lines 7 to 12, tasks are taken out from . If the current time is greater than the release time of task , Algorithm 1 is called to schedule this task; otherwise, it is put back into .
[0114] Table 2: Container Update Process Based on LECU Algorithm
[0115]
[0116] As Figure 5 shown ( Figure 5 In the RBA algorithm, Reservation-Based Algorithm, which is a reservation-based algorithm mainly used in fields such as resource allocation and scheduling, optimizes the system's performance and efficiency by reserving resources in advance. AWS and MySQL are different types of repositories), it is the edge system architecture of the present invention, and this system 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 of memory, and 1024 GB of disk, running Ubuntu 20.04 with a Linux 5.4.0 kernel. Each edge node runs in an independent virtual machine (VM), configured with a 4-core CPU, 8 GB of memory, and 40 GB of disk, and the operating system is Ubuntu 22.04 with a Linux 5.15.38 kernel. The algorithm of the present invention is trained and inferred on an NVIDIA RTX 4070 Super GPU. In addition, to simulate the task offloading of user equipment (UE), the present invention develops a task generator and a version generator for releasing new image versions.
[0117] Remote cloud: Set 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 applications and dependent packages into a portable image and then publish it to any machine with a popular Linux or Windows operating system). Usually, the required images are downloaded from the official Docker Hub repository. However, this method may be affected by network fluctuations, resulting in failed image downloads or incomplete updates. To solve this problem, the present invention deploys a private Docker registry to host all the images used in the experiment. When a new version of the container is released, the edge node initiates the container update process.
[0118] Edge node: Docker is installed on the edge node and is responsible for container updates. The update process starts with Docker's inspection operation to retrieve all image layers. Subsequently, the edge node uses an image sharing mechanism to only check and download the image layers that are not yet available locally. However, in a distributed environment, efficient layer transfer is a key challenge. For this reason, the present invention uses a peer-to-peer (P2P) protocol to establish a distributed network to improve the stability and reliability of the transfer. This method performs particularly well in the layer transfer process of edge-cloud collaboration and can more efficiently download images from the remote cloud or load images from other edge nodes.
[0119] The LECU algorithm adopted in the present invention consists of three core modules: an agent, a cache, and a model. During the training phase, the agent uses the data in the cache to train the model; during the prediction phase, the agent loads the model to make updated 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 an online learning and regular retraining mechanism to enable the model to adapt to changing conditions. In addition, the RBA algorithm receives tasks from the task scheduling queue, evaluates the resources of edge nodes, sorts the nodes according to the scores, and assigns tasks to the node with the highest score 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.
[0120] The container and layer data used in the experiments of the present invention are sourced 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 trace data. After preprocessing to remove missing values and outliers, 156,456 tasks are finally retained. Each task requires an average of 3.93 CPU cores and 4.21 GB of memory, and its release time is randomly generated.
[0121] 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 status data and uses the 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 makes an optimal update decision based on the current system state. In addition, the present invention also conducts larger-scale experiments to evaluate the scalability of the algorithm. The experimental results show that the proposed algorithm significantly outperforms all baseline algorithms in terms of performance.
[0122] To verify the effectiveness of the LECU algorithm proposed in the present invention, the present invention compares it with several baseline algorithms (including RU, RULS, LS, and FB):
[0123] 1. RU (Rolling Update): The RU (Rolling Update) algorithm takes out a part of the nodes to stop the service, perform updates, and put them back into use. Similar to the default settings of Kubernetes (Kubernetes is an open-source platform for managing containerized applications on multiple hosts in a cloud environment), the update ratio is 25%. 2. RULS (Rolling Update with layersharing): The RU algorithm with layer sharing. 3. LS (Local Search): The LS (Local Search) algorithm is a heuristic method that can optimize the software updates of intelligent vehicles, focusing on update time-aware strategies. 4. FB (Fog Computing Based Update): The FB (Fog Computing Based Update) algorithm aims to save computing resources through resource-aware update strategies. The final experimental results are as follows:
[0124] As Figure 6 shown, it is the overhead when the number of nodes is different; as Figure 7 shown, it is the overhead when the bandwidth is different; as Figure 8 shown, it is the algorithm convergence process.
[0125] Advantages of the present invention:
[0126] 1. The present invention first introduces the hierarchical structure of container images into container updates in edge computing, uses the layer sharing mechanism to reduce the layers of repeated downloads, 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.
[0127] 2. Based on the Soft Actor-Critic (SAC) reinforcement learning algorithm, dynamically decide the container update strategy, and comprehensively consider the long-term benefits, the impact of layer sharing, and the optimization effect of edge-cloud collaboration through the reward function.
[0128] 3. Propose a resource balanced allocation algorithm, dynamically schedule tasks during container updates, reduce task interruption caused by updates, and preferentially allocate tasks to low-load nodes through real-time evaluation of edge node resources, and upload tasks to the cloud when necessary.
[0129] 4. Propose a two-time-scale container update framework. When a new version of the container is released, call the LECU algorithm to make container update decisions; when user devices unload tasks, call the RBA algorithm to perform task scheduling. This framework comprehensively considers the mutual influence of container updates and task scheduling, and optimizes the overall performance.
[0130] 5. The above algorithm was implemented in a real edge computing system, and its effectiveness and scalability were verified through real datasets and large-scale simulations.
[0131] In addition, the present invention can also adopt an alternative hierarchical sharing mechanism: using the mirror chunking technique to replace the hierarchical sharing mechanism, dividing the container image into fixed-size chunks, and reducing the amount of data transferred through block-level deduplication. Block-level deduplication may be more refined than layer-level deduplication, further reducing the amount of data transferred, but additional computing resources are required for block partitioning and hash calculation.
[0132] The present invention can also use traditional heuristic algorithms or other machine learning algorithms to replace the reinforcement learning algorithm. Use heuristic algorithms (such as greedy algorithms or genetic algorithms) to optimize the container update order and task scheduling. It is simple to implement and has low computational overhead, but it may not fully consider long-term benefits, and the performance may be inferior to the reinforcement learning algorithm.
[0133] Furthermore, as Figure 9 shown, based on the above method for updating layer-aware containers, the present invention also correspondingly provides a system for updating layer-aware containers, wherein the system for updating layer-aware containers includes:
[0134] A container initialization processing module 51, configured to obtain the size of the new layer required for the container to be updated in the target edge node and the mirror download delay, and perform container initialization processing according to the size of the new layer to obtain the initialization delay;
[0135] An update time calculation module 52, configured to calculate the total update delay according to the mirror download delay and the initialization delay, and calculate the update start time and update end time of the container to be updated according to the total update delay;
[0136] A task end time calculation module 53, configured to determine intensive tasks on the target edge node, calculate the communication delay of the intensive tasks on the target edge node and the running delay in the container to be updated, and calculate the task end time of the intensive tasks according to the communication delay and the running delay;
[0137] A model construction module 54, configured to perform modeling according to the update start time, the update end time of the container to be updated, and the task end time of the intensive tasks to obtain a container update and task scheduling overhead model;
[0138] A model solving module 55, configured 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.
[0139] Furthermore, as Figure 10As shown, based on the above method and system for updating layer-aware containers, the present invention also correspondingly provides a terminal, which includes a processor 10, a memory 20, and a display 30. Figure 10 Only some components of the terminal are shown, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented.
[0140] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as the hard disk or memory of the terminal. In some other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk equipped on the terminal, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 20 may also include both the internal storage unit and the external storage device of the terminal. The memory 20 is used to store application software installed on the terminal and various types of data, such as the program code for installing the terminal. The memory 20 may also be used to temporarily store data that has been output or will be output. In one embodiment, an update program 40 for layer-aware containers is stored on the memory 20, and this update program 40 for layer-aware containers can be executed by the processor 10, thereby implementing the method for updating layer-aware containers in this application.
[0141] In some embodiments, the processor 10 may be a Central Processing Unit (CPU), a microprocessor, or other data processing chips, and is used to run the program code stored in the memory 20 or process data, such as executing the method for updating layer-aware containers, etc.
[0142] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) toucher, etc. The display 30 is used to display information on the terminal and to display a visual user interface.
[0143] In one embodiment, when the processor 10 executes the update program 40 for layer-aware containers in the memory 20, the steps of the method for updating layer-aware containers as described above are implemented.
[0144] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores an update program for layer-aware containers, and when the update program for layer-aware containers is executed by a processor, the steps of the method for updating layer-aware containers as described above are implemented.
[0145] In summary, the present invention provides a method, a system, a terminal, and a computer-readable storage medium for updating a layer-aware container. The method includes: obtaining the size of a new layer required for a container to be updated in a target edge node and the mirror download delay, and performing container initialization processing according to the size of the new layer to obtain an initialization delay; calculating a total update delay according to the mirror download delay and the initialization delay, and calculating an update start time and an update end time of the container to be updated according to the total update delay; determining intensive tasks on the target edge node, calculating a communication delay of the intensive tasks on the target edge node and a running delay in the container to be updated, and calculating a task end time of the intensive tasks according to the communication delay and the running delay; modeling according to the update start time, the update end time of the container to be updated, and the task end time of the intensive tasks to obtain a container update and task scheduling overhead model; and using 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. By calculating the update start time and the update end time of the container to be updated and the task end time of the intensive tasks, the present invention further constructs a container update and task scheduling overhead model, and uses a reinforcement learning algorithm to solve it, so as to obtain a container update decision and a task scheduling result, which can dynamically schedule tasks during the container update process, thereby reducing task interruption caused by container update, effectively improving the update efficiency of the container, and reducing the update overhead of the container.
[0146] It should be noted that in this article, the terms "including", "comprising", or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or terminal including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article, or terminal. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article, or terminal including that element.
[0147] Certainly, those of ordinary skill in the art can understand that all or part of the processes of implementing the above method embodiments can be completed by instructing relevant hardware (such as a processor, a controller, etc.) through a computer program. The program can be stored in a computer-readable storage medium readable by a computer. When the program is executed, it can include the processes of the above method embodiments. The computer-readable storage medium can be a memory, a magnetic disk, an optical disk, etc.
[0148] It should be understood that the application of the present invention is not limited to the above examples. For those of ordinary skill in the art, improvements or transformations can be made according to the above description, and all such improvements and transformations should fall within the protection scope of the appended claims of the present invention.
Claims
1. A method for updating a layer-aware container, characterized in that, The update method of the layer-aware container includes: Obtain the new layer size and mirror download delay required for 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; Calculate the total update delay according to the mirror download delay and the initialization delay, and calculate the update start time and update end time of the container to be updated according to the total update delay; Determine the intensive tasks on the target edge node, calculate the communication delay of the intensive tasks on the target edge node and the running delay in the container to be updated, and calculate the task end time of the intensive tasks according to the communication delay and the running delay; Perform modeling according to the update start time, the update end time of the container to be updated, and the task end time of the intensive tasks to obtain a container update and task scheduling overhead model; The performing modeling according to the update start time, the update end time of the container to be updated, and the task end time of the intensive tasks to obtain a container update and task scheduling overhead model specifically includes: Calculate the current task state of the intensive tasks according to the task end time; Perform modeling according to the update start time, the update end time of the container to be updated, and the current task state to obtain a container update and task scheduling overhead model; Among them, the expression of the container update and task scheduling overhead model is: ; Among them, is the container update and task scheduling overhead model, is the weight for balancing container update and task scheduling overhead, is the indication task, is the set of indication tasks, is the current task status of the container to be updated, is the container to be updated, is the set of containers to be updated, is the update start time of the container to be updated, is the update end time of the container to be updated; 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 perception edge-cloud collaborative container update algorithm and a task scheduling algorithm; The using 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 specifically includes: Obtain the node state of the target edge node, the container update state of the container to be updated, and the layer state of the layer to be updated in the container to be updated, and use the perception edge-cloud collaborative container update algorithm to obtain the container priority and container update ratio according to the node state, the container update state, and the layer state; Solve the container update and task scheduling overhead model according to the container priority and the container update ratio to obtain a container update decision; Obtain the remaining resources of the target edge node, and use the task scheduling algorithm to solve the container update and task scheduling overhead model according to the remaining resources of the node to obtain a task scheduling result.
2. The update method of the layer-aware container according to claim 1, wherein The obtaining the new layer size and mirror 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 receiving a container update request, obtain the new layer size and mirror 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: ; Wherein, is the new layer size, is the container to be updated, is the set of containers to be updated, is the layer, is the set of layers, is the situation where the container to be updated contains or does not contain ; is the situation of whether it is stored on the target edge node at time ; is the layer size; The expression of the mirror download delay is: ; Among them, is the mirror download delay, is other edge nodes, is the set of edge nodes, is the cloud bandwidth, is and the transmission rate between, is at time layer whether it is stored on other edge nodes the situation; Obtain the CPU frequency of the target edge node, and perform container initialization processing according to the CPU frequency and the new layer size to obtain the initialization delay.
3. The update method of the layer-aware container according to claim 2, wherein The expression of the initialization delay is: ; Among them, is the initialization delay, is a constant, is the CPU frequency of the target edge node.
4. The method for updating the layer-aware container according to claim 3, wherein The expression of the total update delay is: ; wherein, is the total update delay; The expression of the update start time is: ; Among them, is the start time of the update of the container to be updated, is the target edge node where the container to be updated is located is the start time; The expression of the update end time is: ; Among them, is the update end time of the container to be updated.
5. The method for updating a layer-aware container according to claim 1, wherein Determine the intensive tasks on the target edge node, calculate the communication delay of the intensive tasks on the target edge node and the running delay in the container to be updated, and calculate the task end time of the intensive tasks according to the communication delay and the running delay. Specifically, it includes: Determine the intensive tasks to be executed on the target edge node, and calculate the uplink wireless transmission rate of the intensive tasks on the target edge node; Calculate the communication delay for transmitting the intensive tasks to the target edge node according to the uplink wireless transmission rate; Calculate the running delay when the intensive tasks are executed in the container to be updated, and calculate the total execution delay of the intensive tasks when executed on the target edge node according to the running delay and the communication delay; Obtain the task release time of the intensive tasks, and obtain the task end time of the intensive tasks according to the task release time and the total execution delay.
6. A system for updating a layer-aware container, characterized in that The update system of the layer-aware container is applied to the update method of the layer-aware container according to any one of claims 1-5. The update system of the layer-aware container includes: A container initialization processing module, configured to obtain the new layer size and the mirror download delay required for 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, configured to calculate the total update delay according to the mirror download delay and the initialization delay, and calculate the update start time and the update end time of the container to be updated according to the total update delay; A task end time calculation module, configured to determine the intensive tasks on the target edge node, calculate the communication delay of the intensive tasks on the target edge node and the running delay in the container to be updated, and calculate the task end time of the intensive tasks according to the communication delay and the running delay; A model construction module, configured to perform modeling according to the update start time, the update end time of the container to be updated, and the task end time of the intensive tasks to obtain a container update and task scheduling overhead model; A model solving module, configured 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.
7. A terminal, characterized in that, The terminal includes: a memory, a processor, and an update program of the layer-aware container stored on the memory and executable on the processor. When the update program of the layer-aware container is executed by the processor, the steps of the update method of the layer-aware container according to any one of claims 1-5 are implemented.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an update program for a layer-aware container. When the update program for the layer-aware container is executed by a processor, it implements the steps of the update method for the layer-aware container according to any one of claims 1-5.
Citation Information
Patent Citations
Job scheduling method, computing device and system
CN118409855A
Delay-aware container scheduling method, system and terminal for cluster upgrade
CN118502967A