A delay-aware container scheduling method, system and terminal for cluster upgrade

Through the delay-aware container scheduling method, a task scheduling model is built and tasks are scheduled to the unupgraded edge node, which solves the problem of poor scheduling during edge cluster upgrade and achieves efficient scheduling and performance improvement of edge computing systems.

CN118502967BActive Publication Date: 2024-11-12BEIJING NORMAL UNIV AT ZHUHAI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410954569.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-11-12
Estimated Expiration
2044-07-17

AI Technical Summary

Technical Problem

The prior art is unable to adapt to the rapid changes in computing power and network resources during edge cluster upgrades, resulting in poor container scheduling and affecting the optimal scheduling of tasks.

Method used

Using the delay-aware container scheduling method, by building a task scheduling model including environment module, critic module and actor module, obtain edge node status and task status, calculate the advantageous function and schedule tasks to unupgraded edge nodes, and adjust network parameters to optimize Scheduling.

Benefits of technology

The optimal scheduling of tasks is achieved in a dynamically changing edge environment, reducing total latency and improving the performance and user experience of edge computing systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118502967B_ABST
    Figure CN118502967B_ABST
Patent Text Reader

Abstract

The present invention discloses a delay-aware container scheduling method, system and terminal for cluster upgrade, the method comprising: modeling the composition of the cluster and the tasks to be assigned to obtain target parameters; constructing a task scheduling model, calculating the edge node state and task state of the cluster according to the target parameters and the tasks to be assigned, and obtaining the location state of the cluster, inputting the edge node state, task state and location state into the task scheduling model for splicing and integration to obtain the target state; obtaining an advantage function according to the target state, obtaining an action according to the advantage function and the target state, and scheduling the tasks to be assigned to the non-upgraded edge nodes in the cluster according to the action; and obtaining the task execution time to calculate the reward, adjusting the network parameters according to the reward, until all edge nodes in the cluster are upgraded. The present invention can fully consider the upgrade state of the edge nodes and realize the optimal scheduling of tasks in a dynamically changing edge environment.
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 scheduling, and in particular to a delay-aware container scheduling method, system, terminal and computer-readable storage medium for cluster upgrade. Background Art

[0002] In the era of the Internet of Things, Mobile Edge Computing (MEC) technology has become an important trend. It brings computing and data storage closer to IoT devices, significantly reducing the latency and bandwidth consumption of communications with data centers. Containers and Kubernetes (K8S, a new distributed architecture solution based on container technology) technologies are widely used in MEC for service deployment. The lightweight and portable features of containers are very suitable for MEC environments, and edge cluster upgrades are the key to maintaining efficient and secure operation of edge clusters.

[0003] However, the geographical distribution and resource constraints of edge clusters make traditional cloud cluster scheduling methods ineffective in edge environments. Especially during edge cluster upgrades, due to geographical distribution and limited resources, upgrades may have a negative impact on running containers, resulting in task interruptions or delays. Existing task scheduling and container deployment methods in edge computing are all traditional scheduling methods. Traditional container scheduling methods usually rely on predefined rules, while in MEC, computing power and network resources may change rapidly, making traditional scheduling algorithms unable to adapt to these changes. In addition, traditional resource scheduling strategies fail to fully consider the upgrade of edge nodes and ignore the impact of edge node upgrades on their availability, making it difficult to achieve optimal scheduling in dynamically changing edge environments.

[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 delay-aware container scheduling method, system, terminal and computer-readable storage medium for cluster upgrades, aiming to solve the problem in the prior art that during edge cluster upgrades, the existing container scheduling algorithm cannot adapt to the rapidly changing computing power and network resources, making it difficult for the container to achieve optimal scheduling of tasks.

[0006] To achieve the above object, the present invention provides a delay-aware container scheduling method for cluster upgrade, and the delay-aware container scheduling method for cluster upgrade comprises the following steps:

[0007] Obtaining tasks to be assigned, modeling the composition of the cluster and the tasks to be assigned, and obtaining target parameters;

[0008] Constructing a task scheduling model, wherein the task scheduling model includes: an environment module, a critic module and an actor module;

[0009] Calculate the edge node state and task state of the cluster according to the target parameters and the tasks to be assigned, obtain the location state of the cluster, input the edge node state, the task state and the location state into the environment module for splicing and integration, and obtain the target state;

[0010] Input the target state to the critic module to calculate the advantage function, input the advantage function and the target state to the actor module for calculation to obtain an action, and schedule the task to be assigned to the non-upgraded edge node in the cluster according to the action;

[0011] The task execution time of the task to be assigned in the edge node is obtained, a reward is calculated according to the execution time, and the network parameters of the critic module and the actor module are adjusted according to the reward until all edge nodes in the cluster are upgraded.

[0012] Optionally, in the delay-aware container scheduling method for cluster upgrade, the target parameter includes a first target parameter and a second target parameter;

[0013] The step of obtaining the tasks to be assigned, modeling the composition of the cluster and the tasks to be assigned, and obtaining target parameters specifically includes:

[0014] Acquire the tasks to be assigned, model the tasks to be assigned, and obtain first target parameters, where the first target parameters include: a task set, a CPU required by the task, a memory resource required by the task, a data size of the task, a release time of the task, a CPU frequency requested by the task, and a requested image of the task;

[0015] The edge computing cluster is modeled to obtain second target parameters, where the second target parameters include: an edge node set, a remaining CPU of the edge node, a remaining memory resource of the edge node, an upgrade status of the edge node, a CPU frequency of the edge node, a bandwidth of the edge node, and a storage capacity of the edge node.

[0016] Optionally, the delay-aware container scheduling method for cluster upgrade, wherein the step of calculating the edge node status and the task status of the cluster according to the target parameters and the tasks to be assigned, specifically includes:

[0017] Obtaining a resource status of the edge node status according to a remaining CPU of the edge node, a remaining memory resource of the edge node, a storage capacity of the edge node, a CPU frequency of the edge node, and a bandwidth of the edge node;

[0018] Obtaining an upgrade status of an edge node status according to an upgrade status of the edge node, and combining the resource status and the upgrade status to obtain an edge node status;

[0019] The resource request and mirror status of the task status are obtained according to the task set, the CPU required by the task, the memory resources required by the task, the data size of the task, the CPU frequency requested by the task, the release time of the task and the requested mirror of the task, and the resource request and the mirror status are combined to obtain the task status.

[0020] Optionally, in the delay-aware container scheduling method for cluster upgrade, the step of obtaining the location status of the cluster specifically includes:

[0021] The cluster is extracted by a visual transformer to obtain the position feature of the cluster, wherein the position feature is a two-dimensional matrix, where the position where the edge node exists is 2, the position where the task to be assigned exists is 1, and the rest of the positions are 0;

[0022] The position features are divided to obtain a plurality of feature maps, and the plurality of feature maps are used as the position states of the cluster.

[0023] Optionally, the delay-aware container scheduling method for cluster upgrade, wherein the step of inputting the target state into the critic module to calculate an advantage function, and inputting the advantage function and the target state into the actor module to calculate an action, specifically includes:

[0024] Inputting the target state into the first fully connected layer of the critic module, calculating a value function, and calculating an advantage function based on the value function through a generalized advantage estimator;

[0025] The advantage function and the target state are input into the second fully connected layer of the actor module to calculate an action, where the action is used to determine the scheduling edge node of the task to be assigned.

[0026] Optionally, the delay-aware container scheduling method for cluster upgrade, wherein the task execution time of the task to be assigned in the edge node is obtained, further comprising:

[0027] Obtaining a minimum frequency among the CPU frequencies of the edge nodes, and calculating an expected total delay of the task according to the CPU frequency requested by the task and the minimum frequency;

[0028] Obtain the number of tasks transmitted to the edge node simultaneously, the transmission power of the tasks, the channel benefit between the IoT device and the edge node, the image situation on the edge node, the image size required to process the task, and the time to queue for image download on the edge node.

[0029] Optionally, the delay-aware container scheduling method for cluster upgrade, wherein the step of obtaining the task execution time of the task to be assigned in the edge node and calculating the reward according to the execution time specifically includes:

[0030] The communication delay is calculated according to the bandwidth of the edge node, the number of tasks simultaneously transmitted to the edge node, the transmission power of the task, and the channel benefit between the IoT device and the edge node;

[0031] The download delay is calculated according to the image status on the edge node, the bandwidth of the edge node, the image size required for the processing task, and the time of queuing for downloading the image on the edge node;

[0032] Calculating a calculation delay according to the CPU frequency of the task request and the CPU frequency of the edge node, and obtaining a task execution time on the edge node according to the communication delay, the download delay and the calculation delay;

[0033] The reward is calculated by a preset reward function according to the expected total delay of the task and the task execution time on the edge node.

[0034] In addition, to achieve the above-mentioned purpose, the present invention also provides a delay-aware container scheduling system for cluster upgrade, wherein the delay-aware container scheduling system for cluster upgrade includes:

[0035] A data modeling module is used to obtain tasks to be assigned, model the composition of the cluster and the tasks to be assigned, and obtain target parameters;

[0036] A scheduling model building module, used to build a task scheduling model, wherein the task scheduling model includes: an environment module, a critic module and an actor module;

[0037] A target state acquisition module, used to calculate the edge node state and task state of the cluster according to the target parameters and the tasks to be assigned, and to obtain the location state of the cluster, and input the edge node state, the task state and the location state into the environment module for splicing and integration to obtain the target state;

[0038] A task scheduling module, used for inputting the target state into the critic module to calculate the advantage function, inputting the advantage function and the target state into the actor module for calculation to obtain an action, and scheduling the to-be-assigned task to the non-upgraded edge node in the cluster according to the action;

[0039] The model training update module is used to obtain the task execution time of the task to be assigned in the edge node, calculate the reward according to the execution time, and adjust the network parameters of the critic module and the actor module according to the reward until all edge nodes in the cluster are upgraded.

[0040] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a delay-aware container scheduler for cluster upgrade stored in the memory and run on the processor, and when the delay-aware container scheduler for cluster upgrade is executed by the processor, the steps of the delay-aware container scheduling method for cluster upgrade as described above are implemented.

[0041] 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 a delay-aware container scheduler for cluster upgrade, and when the delay-aware container scheduler for cluster upgrade is executed by a processor, the steps of the delay-aware container scheduling method for cluster upgrade as described above are implemented.

[0042] In the present invention, the composition of the cluster and the tasks to be assigned are modeled to obtain target parameters;

[0043] A task scheduling model is constructed, and the edge node state and task state of the cluster are calculated according to the target parameters and the tasks to be assigned, and the location state of the cluster is obtained. The edge node state, task state and location state are input into the task scheduling model for splicing and integration to obtain the target state; the advantage function is obtained according to the target state, and the action is obtained according to the advantage function and the target state, and the task to be assigned is scheduled to the non-upgraded edge node in the cluster according to the action; and the task execution time is obtained to calculate the reward, and the network parameters are adjusted according to the reward until all edge nodes in the cluster are upgraded. The present invention can fully consider the upgrade state of the edge node and realize the optimal scheduling of tasks in a dynamically changing edge environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a flow chart of a preferred embodiment of the delay-aware container scheduling method for cluster upgrade of the present invention;

[0045] Figure 2 It is an example diagram of the edge cluster upgrade process in the delay-aware container scheduling method for cluster upgrade of the present invention;

[0046] Figure 3 It is an overall architecture diagram of the task scheduling model in the delay-aware container scheduling method for cluster upgrade of the present invention;

[0047] Figure 4 It is a schematic diagram of an online container scheduling algorithm in a delay-aware container scheduling method for cluster upgrade of the present invention;

[0048] Figure 5 It is a performance comparison chart of different algorithms in the delay-aware container scheduling method for cluster upgrade of the present invention when the number of nodes is different;

[0049] Figure 6 It is a performance comparison chart of different algorithms in the delay-aware container scheduling method for cluster upgrade of the present invention when the number of tasks is different;

[0050] Figure 7 It is a performance comparison chart of different algorithms in the delay-aware container scheduling method for cluster upgrade of the present invention at different bandwidths;

[0051] Figure 8 It is a performance comparison chart of different algorithms in the delay-aware container scheduling method for cluster upgrade of the present invention at different CPU frequencies;

[0052] Fig. 9 It is a schematic diagram of the principle of a preferred embodiment of a delay-aware container scheduling system for cluster upgrade of the present invention;

[0053] Fig.10 Schematic diagram of the operating environment of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION

[0054] The present application provides a delay-aware container scheduling method and related devices for cluster upgrade. In order to make the purpose, technical solution and effect of the present application clearer and more specific, the present application is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.

[0055] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.

[0056] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0057] The delay-aware container scheduling method for cluster upgrade described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the delay-aware container scheduling method for cluster upgrade includes the following steps:

[0058] Step S10: Obtain tasks to be assigned, model the composition of the cluster and the tasks to be assigned, and obtain target parameters.

[0059] like Figure 2 As shown, the computationally intensive tasks of IoT devices are offloaded to edge nodes, where they are processed and the results are returned. The access point and edge server form an edge node, and the container runs in the edge server and does not participate in the formation of the edge node. The task is executed in the container, which requires the corresponding image to be extracted locally before execution. Due to security patches, bug fixes, etc., upgrades may be made periodically. All edge nodes in the cluster are upgraded in sequence, with green being the edge nodes being upgraded and blue being the edge nodes that have not been upgraded. To ensure uninterrupted service, all containers on the edge nodes must be scheduled to another node before the upgrade. During the upgrade, new tasks are continuously offloaded to the edge nodes, and it is necessary to decide which node they are scheduled on. At the same time, the resources (i.e., CPU, memory, etc.) on the edge nodes are limited, and containers cannot be scheduled on nodes that do not meet the resource requirements. In addition, the nodes being upgraded are set to be unschedulable. Various tasks may require different container images and resource quotas, so the present invention proposes an online container scheduling algorithm (OCS, Online Container Scheduling) to implement the delay-aware container scheduling method for cluster upgrades in this application.

[0060] In this embodiment, the tasks to be assigned and the cluster system for processing the tasks are obtained, and the composition of the cluster system and the tasks to be assigned are modeled.

[0061] Obtain the tasks to be assigned, model the tasks to be assigned, and obtain first target parameters, where the first target parameters include: a task set, a CPU required by the task, a memory resource required by the task, a data size of the task, a release time of the task, a CPU frequency requested by the task, and a requested image of the task.

[0062] The edge computing cluster is modeled to obtain second target parameters, where the second target parameters include: an edge node set, a remaining CPU of the edge node, a remaining memory resource of the edge node, an upgrade status of the edge node, a CPU frequency of the edge node, a bandwidth of the edge node, and a storage capacity of the edge node.

[0063] Specifically, a set of tasks offloaded to edge nodes by different IoT devices is represented as , Represents the number of elements in the task set; a task in the task set The required CPU and memory resources are expressed as and ;Task The data size is ,Task The release time is , the CPU frequency requested by the task is ,Task The request image is .

[0064] It should be noted that, in this embodiment, it is assumed that the resources required by the task are the same as the resources occupied by the container.

[0065] Furthermore, to model the edge computing cluster, the set of edge nodes is defined as ,in Indicates the number of elements in the edge node set. The remaining CPU and memory resources in and express. It is an edge node In addition, edge nodes The CPU frequency is expressed as , the bandwidth is defined as , the storage capacity of the edge node is expressed as , the number of images stored on edge nodes is also affected by restrictions.

[0066] Step S20: construct a task scheduling model, wherein the task scheduling model includes: an environment module, a critic module and an actor module.

[0067] like Figure 3 As shown, the task scheduling model (OCS) includes: an environment module, a critic module and an actor module, wherein the environment module is used to observe the node state, task state and position state from the environment, and embed and splice the node state, the task state and the position state. The critic module and the actor module are used to receive the spliced ​​target state to make corresponding scheduling decisions. Then rewards are obtained from the actions taken. Finally, the policy gradient-based algorithm updates the policy network and value function.

[0068] Step S30, calculate the edge node status and task status of the cluster according to the target parameters and the tasks to be assigned, and obtain the location status of the cluster, input the edge node status, the task status and the location status into the environment module for splicing and integration to obtain the target state.

[0069] Specifically, the resource status of the edge node status is obtained according to the remaining CPU of the edge node, the remaining memory resources of the edge node, the storage capacity of the edge node, the CPU frequency of the edge node, and the bandwidth of the edge node.

[0070] The upgrade status of the edge node status is obtained according to the upgrade status of the edge node, and the resource status and the upgrade status are combined to obtain the edge node status.

[0071] It is understandable that the upgrade process involves multiple time slots. The target state includes node state, task state and location state; wherein the node state includes resource state and upgrade state; according to the remaining CPU of the edge node , the remaining memory resources of the edge node , the storage capacity of the edge node , the CPU frequency of the edge node and the bandwidth of the edge node Get the resource status of the edge node status, so, Resource status at the moment Defined as:

[0072] ;

[0073] in, express The remaining CPU of each edge node at this moment, express The remaining memory resources of each edge node at this moment , express The storage capacity of each edge node at the moment, and Represent the CPU frequency and bandwidth of each edge node respectively.

[0074] At the same time, edge nodes In time The upgrade status is determined by the variable express, Represents an edge node In time Not upgraded. Represents an edge node In time Upgraded, and Represents an edge node In time The upgrade has been completed. Therefore, the edge nodes Upgrade status at the moment It can be expressed as:

[0075] ;in, Indicates N The edge nodes are The upgrade status at the moment.

[0076] Finally, the resource status and the upgrade status Combined to get the edge node status :

[0077] .

[0078] Furthermore, the resource request and mirror status of the task status are obtained according to the task set, the CPU required by the task, the memory resources required by the task, the data size of the task, the CPU frequency requested by the task, the release time of the task and the requested mirror of the task, and the resource request and the mirror status are combined to obtain the task status.

[0079] It is understood that the task status includes resource requests and image status of requests to execute tasks on each edge node; according to the task set, the CPU required by the task , the memory resources required by the task , CPU frequency requested by the task ,Task Data size ,Task Request mirror Get resource request , which can be expressed as:

[0080] ;

[0081] in, Indicates a task Required CPU, Indicates a task Memory resources requested.

[0082] Get the task according to the release time of the task Request mirror At the edge node The remaining download time on the mirror is based on the requested At the edge node The remaining download time and the requested image of the task are obtained to obtain the image status of the task executed on each edge node. , which can be expressed as:

[0083] ;

[0084] in, Indicates the task Request mirror Is it on the edge node? Up (edge ​​node ), if so, then , if not, then ; Representation Task Request mirror At the edge node The remaining download time.

[0085] Finally, the resource request and the image status are combined to obtain the task status , which can be expressed as:

[0086] .

[0087] Furthermore, after obtaining the edge node status and task status Afterwards, the location status of the cluster is obtained, specifically including:

[0088] The cluster is extracted by a visual transformer to obtain the position feature of the cluster, wherein the position feature is a two-dimensional matrix, where the position where the edge node exists is 2, the position where the task to be assigned exists is 1, and the rest of the positions are 0;

[0089] The position features are divided to obtain multiple feature maps (such as Figure 3 , as shown in the four feature maps below the position encoding), multiple feature maps are used as the position state of the cluster .

[0090] It is understandable that, considering the uniqueness of geographical location in edge computing, the present invention extracts the location features of the nodes. The location feature is a two-dimensional matrix that can be interpreted as a single-channel image. Although convolutional neural networks are traditionally used to process images, they lack a comprehensive grasp of images. Application of visual transformer architecture in the field of computer vision. The visual transformer can directly capture the global dependencies between different regions of the image through a self-attention mechanism, thereby obtaining the positional relationship between individual nodes and between nodes and tasks. Therefore, the function of encoding the positioning function based on a self-attention network is realized.

[0091] Furthermore, the edge node state, the task state and the location state are input into the environment module for splicing and integration to obtain the target state. , expressed as:

[0092] .

[0093] Step S40: input the target state into the critic module to calculate the advantage function, input the advantage function and the target state into the actor module for calculation to obtain an action, and schedule the task to be assigned to the non-upgraded edge node in the cluster according to the action.

[0094] like Figure 3 As shown, specifically, the target state is input into the first fully connected layer of the critic module, the value function is calculated, and the advantage function is calculated based on the value function through the generalized advantage estimator.

[0095] It can be understood that the critic module includes a first fully connected layer, which is composed of two fully connected layers. The target state is input into the first fully connected layer for calculation to obtain the value function , the value function Input to the generalized advantage estimator to get the advantage function , expressed as:

[0096] ;

[0097] in, is the penalty factor, is the generalized advantage estimator parameter, yes The value function at the moment, is the total time.

[0098] Furthermore, the advantage function and the target state are input into the second fully connected layer of the actor module to calculate an action, and the action is used to determine the scheduling edge node of the task to be assigned.

[0099] It can be understood that the second fully connected layer (strategy network) of the actor module is also composed of two fully connected layers. The advantage function and the target state are input into the second fully connected layer for calculation, and the action space is output. The action space includes The actions that each task should perform at this moment are expressed as: ;in, represents the action space, express The actions that each task should perform at the moment. The to-be-allocated tasks are scheduled to non-upgraded edge nodes in the cluster.

[0100] Step S50: Obtain the task execution time of the task to be assigned in the edge node, calculate the reward according to the execution time, and adjust the network parameters of the critic module and the actor module according to the reward until all edge nodes in the cluster are upgraded.

[0101] The step of obtaining the task execution time of the task to be assigned in the edge node also includes:

[0102] The minimum frequency among the CPU frequencies of the edge nodes is obtained, and the expected total delay of the task is calculated according to the CPU frequency requested by the task and the minimum frequency.

[0103] In this embodiment, the CPU frequency of the edge node Select the minimum frequency , according to the CPU frequency requested by the task The expected total delay of the task is calculated by the minimum frequency , which can be expressed as: .

[0104] Obtain the number of tasks transmitted to the edge node simultaneously, the transmission power of the tasks, the channel benefit between the IoT device and the edge node, the image situation on the edge node, the image size required to process the task, and the time to queue for image download on the edge node.

[0105] Furthermore, the communication delay is calculated according to the bandwidth of the edge node, the number of tasks simultaneously transmitted to the edge node, the transmission power of the task, and the channel gain between the IoT device and the edge node.

[0106] In this embodiment, the task To Node Uplink wireless transmission rate Defined as: , therefore, transmitted to the edge node Mission Communication delay It can be expressed as:

[0107] ;

[0108] in, Indicates the number of tasks transmitted to the edge node simultaneously, Representation Task The transmission power, represents the channel benefit between IoT devices and edge nodes, is the power of Gaussian white noise.

[0109] The download delay is calculated according to the image situation on the edge node, the bandwidth of the edge node, the image size required for the processing task, and the time for queuing to download the image on the edge node.

[0110] In this embodiment, the download delay refers to the image download delay. It can be obtained by the following formula:

[0111] ;

[0112] in, Represents an edge node The mirror image on Indicates the image size required to process the task. Indicates the time for queuing to download the image on the edge node.

[0113] The calculation delay is calculated according to the CPU frequency of the task request and the CPU frequency of the edge node, and the task execution time on the edge node is obtained according to the communication delay, the download delay and the calculation delay.

[0114] In this embodiment, different tasks are executed in different containers, and all tasks are executed in parallel, so the CPU frequency requested by the task and the CPU frequency of the edge node Get the calculation delay , expressed as:

[0115] ;

[0116] In summary, the task execution time on the edge node is obtained according to the communication delay, the download delay and the calculation delay (at the node Execute tasks on The total waiting time) can be expressed as:

[0117] .

[0118] Furthermore, a reward is calculated using a preset reward function according to the expected total delay of the task and the task execution time on the edge node.

[0119] It is understandable that since different tasks require different computing power, the completion time of the tasks may be of different orders of magnitude. Therefore, considering only the total delay in the reward may lead to large differences in the reward values ​​obtained by different tasks, resulting in instability in the training process. Therefore, in order to improve the stability and effectiveness of the policy gradient algorithm, the expected delay (the expected total delay of the task) and the actual delay (the task execution time on the edge node) of the task are considered in the reward, thereby obtaining the reward , expressed as:

[0120] .

[0121] A reward is calculated according to the execution time, and network parameters of the critic module and the actor module are adjusted according to the reward until all edge nodes in the cluster are upgraded.

[0122] Furthermore, if Figure 4 As shown in FIG. 1 , the entire algorithm process of the present invention is as follows: In each time period, if the IoT device offloads the task to the edge cluster, it is necessary to determine its planning node and replay the memory First, initialize each episode. For each time slot , first get the current time slot The observation status , and then select actions based on the policy , and calculate the reward In addition, when selecting an operation, it is necessary to filter out nodes that do not meet the scheduling requirements, such as upgrading or insufficient resources. After that, get the next state Finally, the transition is stored in the replay memory For each training step , advantage estimate First, we calculate the policy from a set of collected trajectories. Then, we use the stochastic gradient ascent algorithm to maximize the objective function of the updated policy.

[0123] Furthermore, the online container scheduling algorithm (OCS) proposed in the present invention is compared with several baseline algorithms (EQ, RB, LA, IL and DRL) to demonstrate the effectiveness of the present invention.

[0124] Among them, the EQ algorithm (Equal Priority) sets the weight of all nodes to 1, treating them as having the same priority for scheduling tasks. It does not consider any specific characteristics of the nodes, such as resource availability or mirror distribution.

[0125] RB algorithm (ResourcesBalanced, resource balancing algorithm), which prioritizes balancing the resource usage of each node. It aims to evenly distribute tasks among nodes based on available resources and prevent any single node from becoming a bottleneck.

[0126] LA algorithm (Least Allocated) is a scheduling strategy related to node resource usage. It selects the node with the least resource allocation to schedule tasks, ensuring that nodes with more available resources are given priority to process new tasks.

[0127] IL algorithm (Image Locality) takes into account the local existence of the image requested by the task. It prefers to schedule tasks on nodes that already have the required image, thereby reducing download delays.

[0128] DRL algorithm (Deep Reinforcement Learning) is an algorithm based on the actor-critic framework and does not contain position information.

[0129] Specifically, Figure 4 and Figure 5 As shown, when the number of nodes and the number of tasks are different, the total delay caused by the OCS algorithm in the present invention is significantly lower than that of other algorithms, that is, the performance of the OCS algorithm in the present invention is higher than that of other algorithms.

[0130] like Figure 6 and Figure 7 As shown, when the bandwidth and CPU frequency are different, the total delay caused by the OCS algorithm in the present invention is also significantly lower than that of other algorithms, that is, the performance of the OCS algorithm in the present invention is higher than that of other algorithms.

[0131] The present invention has the following beneficial effects:

[0132] (1) This paper models the delay-aware container scheduling problem in the edge cluster upgrade scenario for the first time to minimize the total task delay, including communication delay, download delay, and computation delay.

[0133] (2) This paper proposes an OCS algorithm for continuous online scheduling decision-making based on policy gradient reinforcement learning, while taking into account the node upgrade status and the distribution of images.

[0134] (3) The present invention designs a self-attention-based method to extract the location information of nodes and tasks in order to fully consider the changes in the locations of nodes and tasks and optimize the scheduling results as a whole.

[0135] (4) The present invention analyzes the specific situation of the edge computing system and sets a reward function that helps to select actions, which can effectively reduce the user task completion time in the entire edge computing system and improve the user experience.

[0136] (5) The present invention is tested based on real data sets and has strong generalization capabilities and can be applied to various heterogeneous edge computing environments.

[0137] Furthermore, if Figure 8 As shown, based on the above-mentioned delay-aware container scheduling method for cluster upgrade, the present invention also provides a delay-aware container scheduling system for cluster upgrade, wherein the delay-aware container scheduling system for cluster upgrade includes:

[0138] A data modeling module 51 is used to obtain tasks to be assigned, model the composition of the cluster and the tasks to be assigned, and obtain target parameters;

[0139] A scheduling model building module 52, used to build a task scheduling model, wherein the task scheduling model includes: an environment module, a critic module and an actor module;

[0140] A target state acquisition module 53 is used to calculate the edge node state and task state of the cluster according to the target parameters and the task to be assigned, and obtain the location state of the cluster, and input the edge node state, the task state and the location state into the environment module for splicing and integration to obtain the target state;

[0141] A task scheduling module 54 is used to input the target state into the critic module to calculate the advantage function, input the advantage function and the target state into the actor module for calculation to obtain an action, and schedule the to-be-assigned task to the non-upgraded edge node in the cluster according to the action;

[0142] The model training update module 55 is used to obtain the task execution time of the task to be assigned in the edge node, calculate the reward according to the execution time, and adjust the network parameters of the critic module and the actor module according to the reward until all edge nodes in the cluster are upgraded.

[0143] Furthermore, if Fig. 9As shown, based on the above-mentioned delay-aware container scheduling method and system for cluster upgrade, the present invention also provides a terminal accordingly, and the terminal includes a processor 10, a memory 20 and a display 30. Fig. 9 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.

[0144] 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. Further, 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, a delay-aware container scheduler 40 for cluster upgrade is stored on the memory 20, and the delay-aware container scheduler 40 for cluster upgrade can be executed by the processor 10, thereby realizing the delay-aware container scheduling method for cluster upgrade in the present application.

[0145] 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 delay-aware container scheduling method for cluster upgrade.

[0146] 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. The components 10-30 of the terminal communicate with each other via a system bus.

[0147] In one embodiment, when the processor 10 executes the latency-aware container scheduler 40 for cluster upgrade in the memory 20, the following steps are implemented:

[0148] Obtaining tasks to be assigned, modeling the composition of the cluster and the tasks to be assigned, and obtaining target parameters;

[0149] Constructing a task scheduling model, wherein the task scheduling model includes: an environment module, a critic module and an actor module;

[0150] Calculate the edge node state and task state of the cluster according to the target parameters and the tasks to be assigned, obtain the location state of the cluster, input the edge node state, the task state and the location state into the environment module for splicing and integration, and obtain the target state;

[0151] Input the target state to the critic module to calculate the advantage function, input the advantage function and the target state to the actor module for calculation to obtain an action, and schedule the task to be assigned to the non-upgraded edge node in the cluster according to the action;

[0152] The task execution time of the task to be assigned in the edge node is obtained, a reward is calculated according to the execution time, and the network parameters of the critic module and the actor module are adjusted according to the reward until all edge nodes in the cluster are upgraded.

[0153] Wherein, the target parameters include a first target parameter and a second target parameter;

[0154] The step of obtaining the tasks to be assigned, modeling the composition of the cluster and the tasks to be assigned, and obtaining target parameters specifically includes:

[0155] Acquire the tasks to be assigned, model the tasks to be assigned, and obtain first target parameters, where the first target parameters include: a task set, a CPU required by the task, a memory resource required by the task, a data size of the task, a release time of the task, a CPU frequency requested by the task, and a requested image of the task;

[0156] The edge computing cluster is modeled to obtain second target parameters, where the second target parameters include: an edge node set, a remaining CPU of the edge node, a remaining memory resource of the edge node, an upgrade status of the edge node, a CPU frequency of the edge node, a bandwidth of the edge node, and a storage capacity of the edge node.

[0157] The step of calculating the edge node status and the task status of the cluster according to the target parameters and the task to be assigned specifically includes:

[0158] Obtaining a resource status of the edge node status according to a remaining CPU of the edge node, a remaining memory resource of the edge node, a storage capacity of the edge node, a CPU frequency of the edge node, and a bandwidth of the edge node;

[0159] Obtaining an upgrade status of an edge node status according to an upgrade status of the edge node, and combining the resource status and the upgrade status to obtain an edge node status;

[0160] The resource request and mirror status of the task status are obtained according to the task set, the CPU required by the task, the memory resources required by the task, the data size of the task, the CPU frequency requested by the task, the release time of the task and the requested mirror of the task, and the resource request and the mirror status are combined to obtain the task status.

[0161] The obtaining of the location status of the cluster specifically includes:

[0162] The cluster is extracted by a visual transformer to obtain the position feature of the cluster, wherein the position feature is a two-dimensional matrix, where the position where the edge node exists is 2, the position where the task to be assigned exists is 1, and the rest of the positions are 0;

[0163] The position features are divided to obtain a plurality of feature maps, and the plurality of feature maps are used as the position states of the cluster.

[0164] The step of inputting the target state into the critic module to calculate an advantage function, and inputting the advantage function and the target state into the actor module to calculate an action specifically includes:

[0165] Inputting the target state into the first fully connected layer of the critic module, calculating a value function, and calculating an advantage function based on the value function through a generalized advantage estimator;

[0166] The advantage function and the target state are input into the second fully connected layer of the actor module to calculate an action, where the action is used to determine the scheduling edge node of the task to be assigned.

[0167] The step of obtaining the task execution time of the task to be assigned in the edge node also includes:

[0168] Obtaining a minimum frequency among the CPU frequencies of the edge nodes, and calculating an expected total delay of the task according to the CPU frequency requested by the task and the minimum frequency;

[0169] Obtain the number of tasks transmitted to the edge node simultaneously, the transmission power of the tasks, the channel benefit between the IoT device and the edge node, the image situation on the edge node, the image size required to process the task, and the time to queue for image download on the edge node.

[0170] The step of obtaining the task execution time of the task to be assigned in the edge node and calculating the reward according to the execution time specifically includes:

[0171] The communication delay is calculated according to the bandwidth of the edge node, the number of tasks simultaneously transmitted to the edge node, the transmission power of the task, and the channel benefit between the IoT device and the edge node;

[0172] The download delay is calculated according to the image status on the edge node, the bandwidth of the edge node, the image size required for the processing task, and the time of queuing for downloading the image on the edge node;

[0173] Calculating a calculation delay according to the CPU frequency of the task request and the CPU frequency of the edge node, and obtaining a task execution time on the edge node according to the communication delay, the download delay and the calculation delay;

[0174] The reward is calculated by a preset reward function according to the expected total delay of the task and the task execution time on the edge node.

[0175] In summary, the present invention provides a delay-aware container scheduling method, system and terminal for cluster upgrade, the method comprising: obtaining tasks to be assigned, modeling the composition of the cluster and the tasks to be assigned, and obtaining target parameters; constructing a task scheduling model, wherein the task scheduling model comprises: an environment module, a critic module and an actor module; calculating the edge node state and task state of the cluster according to the target parameters and the tasks to be assigned, and obtaining the location state of the cluster, inputting the edge node state, the task state and the location state into the environment module for splicing and integration, and obtaining the target state; inputting the target state into the critic module to calculate the advantage function, inputting the advantage function and the target state into the actor module for calculation, obtaining an action, and scheduling the tasks to be assigned to the non-upgraded edge nodes in the cluster according to the action; obtaining the task execution time of the tasks to be assigned in the edge nodes, calculating the reward according to the execution time, and adjusting the network parameters of the critic module and the actor module according to the reward until all edge nodes in the cluster are upgraded. The present invention can fully consider the upgrade state of edge nodes and realize the optimal scheduling of tasks in a dynamically changing edge environment.

[0176] 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 "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or terminal including the element.

[0177] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0178] 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 delay-aware container scheduling method for cluster upgrade, characterized in that: The delay-aware container scheduling method for cluster upgrade includes: Obtaining tasks to be assigned, modeling the composition of the cluster and the tasks to be assigned, and obtaining target parameters; The target parameters include a first target parameter and a second target parameter; The step of obtaining the tasks to be assigned, modeling the composition of the cluster and the tasks to be assigned, and obtaining target parameters specifically includes: Acquire the tasks to be assigned, model the tasks to be assigned, and obtain first target parameters, where the first target parameters include: a task set, a CPU required by the task, a memory resource required by the task, a data size of the task, a release time of the task, a CPU frequency requested by the task, and a requested image of the task; Modeling the edge computing cluster to obtain second target parameters, where the second target parameters include: an edge node set, a remaining CPU of the edge node, a remaining memory resource of the edge node, an upgrade status of the edge node, a CPU frequency of the edge node, a bandwidth of the edge node, and a storage capacity of the edge node; Constructing a task scheduling model, wherein the task scheduling model includes: an environment module, a critic module and an actor module; Calculate the edge node state and task state of the cluster according to the target parameters and the tasks to be assigned, obtain the location state of the cluster, input the edge node state, the task state and the location state into the environment module for splicing and integration, and obtain the target state; Input the target state to the critic module to calculate the advantage function, input the advantage function and the target state to the actor module for calculation to obtain an action, and schedule the task to be assigned to the non-upgraded edge node in the cluster according to the action; Obtaining a minimum frequency among the CPU frequencies of the edge nodes, and calculating an expected total delay of the task according to the CPU frequency requested by the task and the minimum frequency; Obtain the number of tasks transmitted to the edge node simultaneously, the transmission power of the tasks, the channel benefit between the IoT device and the edge node, the image status on the edge node, the image size required to process the task, and the time to queue for image download on the edge node; Obtaining the task execution time of the task to be assigned in the edge node, calculating the reward according to the execution time, and adjusting the network parameters of the critic module and the actor module according to the reward until all edge nodes in the cluster are upgraded; The obtaining of the task execution time of the task to be assigned in the edge node and calculating the reward according to the execution time specifically includes: The communication delay is calculated according to the bandwidth of the edge node, the number of tasks simultaneously transmitted to the edge node, the transmission power of the task, and the channel benefit between the IoT device and the edge node; The download delay is calculated according to the image status on the edge node, the bandwidth of the edge node, the image size required for the processing task, and the time of queuing for downloading the image on the edge node; Calculating a calculation delay according to the CPU frequency of the task request and the CPU frequency of the edge node, and obtaining a task execution time on the edge node according to the communication delay, the download delay and the calculation delay; The reward is calculated by a preset reward function according to the expected total delay of the task and the task execution time on the edge node.

2. The delay-aware container scheduling method for cluster upgrade according to claim 1, characterized in that: The calculating the edge node status and task status of the cluster according to the target parameter and the task to be assigned specifically includes: Obtaining a resource status of the edge node status according to a remaining CPU of the edge node, a remaining memory resource of the edge node, a storage capacity of the edge node, a CPU frequency of the edge node, and a bandwidth of the edge node; Obtaining an upgrade status of an edge node status according to an upgrade status of the edge node, and combining the resource status and the upgrade status to obtain an edge node status; The resource request and mirror status of the task status are obtained according to the task set, the CPU required by the task, the memory resources required by the task, the data size of the task, the CPU frequency requested by the task, the release time of the task and the requested mirror of the task, and the resource request and the mirror status are combined to obtain the task status.

3. The delay-aware container scheduling method for cluster upgrade according to claim 1, characterized in that: The obtaining of the location status of the cluster specifically includes: The cluster is extracted by a visual transformer to obtain the position feature of the cluster, wherein the position feature is a two-dimensional matrix, where the position where the edge node exists is 2, the position where the task to be assigned exists is 1, and the rest of the positions are 0; The position features are divided to obtain a plurality of feature maps, and the plurality of feature maps are used as the position states of the cluster.

4. The delay-aware container scheduling method for cluster upgrade according to claim 1, characterized in that: The step of inputting the target state into the critic module to calculate an advantage function, and inputting the advantage function and the target state into the actor module to calculate an action specifically includes: Inputting the target state into the first fully connected layer of the critic module, calculating a value function, and calculating an advantage function based on the value function through a generalized advantage estimator; The advantage function and the target state are input into the second fully connected layer of the actor module to calculate an action, where the action is used to determine a scheduling edge node for the task to be assigned.

5. A delay-aware container scheduling system for cluster upgrades, characterized in that: The delay-aware container scheduling system for cluster upgrade includes: A data modeling module is used to obtain tasks to be assigned, model the composition of the cluster and the tasks to be assigned, and obtain target parameters; The target parameters include a first target parameter and a second target parameter; The step of obtaining the tasks to be assigned, modeling the composition of the cluster and the tasks to be assigned, and obtaining target parameters specifically includes: Acquire the tasks to be assigned, model the tasks to be assigned, and obtain first target parameters, where the first target parameters include: a task set, a CPU required by the task, a memory resource required by the task, a data size of the task, a release time of the task, a CPU frequency requested by the task, and a requested image of the task; Modeling the edge computing cluster to obtain second target parameters, where the second target parameters include: an edge node set, a remaining CPU of the edge node, a remaining memory resource of the edge node, an upgrade status of the edge node, a CPU frequency of the edge node, a bandwidth of the edge node, and a storage capacity of the edge node; A scheduling model building module, used to build a task scheduling model, wherein the task scheduling model includes: an environment module, a critic module and an actor module; A target state acquisition module, used to calculate the edge node state and task state of the cluster according to the target parameters and the tasks to be assigned, and to obtain the location state of the cluster, and input the edge node state, the task state and the location state into the environment module for splicing and integration to obtain the target state; A task scheduling module, used for inputting the target state into the critic module to calculate the advantage function, inputting the advantage function and the target state into the actor module for calculation to obtain an action, and scheduling the to-be-assigned task to the non-upgraded edge node in the cluster according to the action; Obtaining a minimum frequency among the CPU frequencies of the edge nodes, and calculating an expected total delay of the task according to the CPU frequency requested by the task and the minimum frequency; Obtain the number of tasks transmitted to the edge node simultaneously, the transmission power of the tasks, the channel benefit between the IoT device and the edge node, the image status on the edge node, the image size required to process the task, and the time to queue for image download on the edge node; A model training and updating module, used for obtaining the task execution time of the task to be assigned in the edge node, calculating the reward according to the execution time, and adjusting the network parameters of the critic module and the actor module according to the reward until all edge nodes in the cluster are upgraded; The obtaining of the task execution time of the task to be assigned in the edge node and calculating the reward according to the execution time specifically includes: The communication delay is calculated according to the bandwidth of the edge node, the number of tasks simultaneously transmitted to the edge node, the transmission power of the task, and the channel benefit between the IoT device and the edge node; The download delay is calculated according to the image status on the edge node, the bandwidth of the edge node, the image size required for the processing task, and the time of queuing for downloading the image on the edge node; Calculating a calculation delay according to the CPU frequency of the task request and the CPU frequency of the edge node, and obtaining a task execution time on the edge node according to the communication delay, the download delay and the calculation delay; The reward is calculated by a preset reward function according to the expected total delay of the task and the task execution time on the edge node.

6. A terminal, characterized in that: The terminal includes: a memory, a processor, and a delay-aware container scheduler for cluster upgrade stored in the memory and executable on the processor. When the delay-aware container scheduler for cluster upgrade is executed by the processor, the steps of the delay-aware container scheduling method for cluster upgrade as described in any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a delay-aware container scheduler for cluster upgrade, and when the delay-aware container scheduler for cluster upgrade is executed by a processor, the steps of the delay-aware container scheduling method for cluster upgrade as described in any one of claims 1-4 are implemented.