Task scheduling method in edge computing environment, apparatus, device, and medium
By defining information binding hash tables and idle queue mechanisms in the edge computing environment, matching and allocation are performed based on the resource usage of edge nodes and task types, which solves the problem of difficulty in perceiving the resource characteristics of heterogeneous nodes and improves the efficiency of task scheduling. and real-time.
Patent Information
- Application Number
- PCT/CN2024/085007
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-20
- Filing Date
- 2024-03-29
- Publication Date
- 2024-08-29
AI Technical Summary
In the edge computing environment, the resource characteristics of heterogeneous edge nodes are difficult to accurately perceive, resulting in mismatch in task scheduling, resulting in high latency, low efficiency, and inability to meet real-time requirements.
By defining an information binding hash table in the central node, we can obtain the average usage of CPU, memory, disk and network IO of edge nodes, determine the node type, add the node to the corresponding idle queue, and select appropriate queue allocation according to the task type. Task, ensure that the task is assigned to the most matching node.
It achieves efficient task allocation, improves the real-time and efficiency of the computing process, and ensures that each node performs optimal tasks.
Smart Images

Figure CN2024085007_29082024_PF_FP_ABST
Abstract
Description
A task scheduling method, device, equipment and medium in an edge computing environment Technical Field
[0001] The present invention belongs to the field of data processing technology, and specifically relates to a task scheduling method, device, equipment and medium in an edge computing environment. Background Art
[0002] Edge computing is a means of extending intelligence with higher processing and storage capabilities to the edge of the network, thereby reducing network congestion, improving resource optimization, user experience, and overall network performance. Edge computing distributes tasks to nearby edge node terminals where they can be assigned. Edge nodes carry the computing and storage capabilities of the edge and are composed of heterogeneous physical devices and hardware resources. However, during the task offloading process in edge computing, the resource characteristics and performance of heterogeneous edge nodes are difficult to accurately perceive, and there is a lack of methods to detect the type of heterogeneous edge nodes in real working environments. For edge computing, task scheduling and execution are key factors affecting performance. The lack of performance characteristics of edge node resources has become a significant factor limiting the development of edge node task scheduling algorithms and the improvement of edge computing performance. Technical issues
[0003] Currently, little research exists on task scheduling for edge nodes in edge computing. In heterogeneous environments, each edge node has varying capabilities for handling different types of tasks. Without a dedicated task scheduling method, network-critical tasks can be dispatched to edge nodes with poor network connectivity, or computational tasks can be dispatched to edge nodes with low disk usage, creating a mismatch between the edge node and the task type. This inability to assign specific edge nodes to handle the same type of tasks can lead to high latency, slow processing speeds, and low efficiency throughout the computing process, making it difficult to meet real-time requirements and the business needs of some enterprises. Technical Solutions
[0004] The purpose of the present invention is to provide a task scheduling method, device, equipment and medium in an edge computing environment to solve the problem in the prior art that there are differences in computing processing capabilities among edge nodes, and random allocation can easily assign tasks requiring specific resource processing to mismatched edge nodes, thereby reducing the processing capability and efficiency of the entire business.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A first aspect of the present invention provides a task scheduling method in an edge computing environment, comprising the following steps:
[0007] An information binding hash table InfoBindMap is defined in the central node NodeCenter; wherein the key of the information binding hash table InfoBindMap is the edge node node i IP address IPKey i , the value is the node type set typeList i ;
[0008] Determine the edge node i Average CPU usage averageCpu i 、Average memory usage averageMemory i , average disk usage averageDisk i and the average network IO speed averageNetIO i ;
[0009] Based on edge node i Average CPU usage averageCpu i 、Average memory usage averageMemory i , average disk usage averageDisk i and the average network IO speed averageNetIO i Determine the edge node by comparing the size relationship with the preset standard i Type, and edge node node i The type is added to the edge node node i Node type collection typeList i middle;
[0010] Based on the node type set typeList i The type in the edge node i Add them to the idle queue of the corresponding edge node type respectively;
[0011] Get the set of tasks to be assigned, and assign each task in the set of tasks to be assigned i Classify; among them, the tasks to be assigned i Types include CPU tasks cpuTask, memory tasks memoryTask, disk tasks diskTask, and network IO tasks netIOTask;
[0012] Calculate each task to be assigned i priorityLevel i , tasks to be assigned iThe allocation order is based on priority priorityLevel i Order from largest to smallest;
[0013] Based on the task to be assigned i Type, select the corresponding type of idle queue, dequeue the idle node at the head of the selected idle queue, record the idle node after dequeue as the working node taskNode, and assign the task task i Assign to the working node taskNode, and put the working node taskNode that has been assigned tasks into the queue at the end of the idle queue.
[0014] Furthermore, when assigning the task i Before the step of allocating to the working node taskNode, the following steps are also included:
[0015] At each edge node i Define the priority execution queue priorityQueue i ;
[0016] Get the priority execution queue priorityQueue in the working node taskNode i The size of the priority execution queue priorityQueue i Includes tasks that have been assigned to the working node taskNode;
[0017] When the priority execution queue priorityQueue in the work node taskNode i When the size of the queue is greater than or equal to the preset priority execution queue size threshold sizeLimit, the task is to be assigned task task i Reallocate other idle nodes in the idle queue.
[0018] Furthermore, when assigning the task i After the step of allocating to the working node taskNode, the following steps are also included:
[0019] The tasks assigned to the working node taskNode are queued in priority execution queue priorityQueue i , and synchronously record the entry into the priority execution queue priorityQueue i Time; among them, the priority execution queue priorityQueue i The order of tasks is based on the priority level of the task i Arrange from largest to smallest;
[0020] Computation priority execution queue priorityQueue i The waiting time waitTime of the tasks in i , when the waiting time waitTime i is greater than the execution deadline time timeLimit, the task is removed from the priority execution queue priorityQueue i and other idle nodes in the idle queue are allocated to the task.
[0021] Furthermore, according to the average CPU utilization rate averageCpu i of the edge node node i , the average memory utilization rate averageMemory i , the average disk utilization rate averageDisk i and the average network IO speed averageNetIO i respectively compared with the preset standards, determine the type of the edge node node i , and add the type of the edge node node i to the node type set typeList of this edge node node i , the steps are as follows: i Specifically include:
[0022] The preset standards include the CPU utilization rate threshold limitCPU, the memory utilization rate threshold limitMemory, the disk read / write threshold limitDisk, and the network IO speed threshold limitNetIO;
[0023] If the average CPU utilization rate averageCpu i < CPU utilization rate threshold limitCPU, record the edge node node i as a CPU idle node cpuIdleNode, and add the CPU idle node cpuIdleNode to the node type set typeList i ;
[0024] If the average memory utilization rate averageMemory i < memory utilization rate threshold limitMemory, record the edge node node i as a memory idle node memoryIdleNode, and add the memory idle node memoryIdleNode to the node type set typeList i ;
[0025] If the average disk utilization rate averageDisk i<disk read / write threshold limitDisk, then record the edge node node i Create a disk idle node diskIdleNode and add the disk idle node diskIdleNode to the node type set typeList i ;
[0026] If the average network IO speed is averageNetIO i >Network IO speed threshold limitNetIO, then record the edge node node i It is the network IO idle node netIOIdleNode, and the network IO idle node netIOIdleNode is added to the node type set typeList i .
[0027] Further, according to the node type set typeList i The type in the edge node i The steps of adding nodes to the idle queue of the corresponding edge node type include:
[0028] Idle queues include CPU idle node queue cpuIdleQueue, memory idle node queue memoryIdleQueue, disk idle node queue diskIdleQueue and network IO idle node queue netIOIdleQueue;
[0029] Traverse the node type collection typeList i ;
[0030] If the node type set typeList i If there is a CPU idle node cpuIdleNode, add the CPU idle node cpuIdleNode to the CPU idle node queue cpuIdleQueue;
[0031] If the node type set typeList i If there is a memory idle node memoryIdleNode, then add the memory idle node memoryIdleNode to the memory idle node queue memoryIdleQueue;
[0032] If the node type set typeList i If there is a disk idle node diskIdleNode, then add the disk idle node diskIdleNode to the disk idle node queue diskIdleQueue;
[0033] If the node type set typeListi If there is a network IO idle node netIOIdleNode, the network IO idle node netIOIdleNode is added to the network IO idle node queue netIOIdleQueue.
[0034] Further, calculate each task to be assigned i priorityLevel i In the step, the task to be assigned is task i priorityLevel i Calculate according to the following formula:
[0035]
[0036] in, Task to be assigned i The priority of the task is α=0.4, β=0.3, γ=0.2, δ=0.1; cpuNeed represents the task to be assigned. i Required CPU utilization; memoryNeed indicates the task to be assigned i Required memory utilization; ioNeed indicates the task to be assigned i Required network IO speed netIOSpeed j ; diskNeed indicates the task to be assigned i Required disk utilization.
[0037] Furthermore, based on the task to be assigned i Type, select the corresponding type of idle queue, dequeue the idle node at the head of the selected idle queue, record the idle node after dequeue as the working node taskNode, and assign the task task i The steps for allocating to the working node taskNode include:
[0038] If the task to be assigned is i For a CPU task cpuTask, the first CPU idle node queue cpuIdleQueue is dequeued to obtain the CPU idle node cpuIdleNode, and the CPU idle node cpuIdleNode is recorded as the working node taskNode and the task is assigned to the working node taskNode;
[0039] If the task to be assigned is iFor a memory task memoryTask, the first one in the memory idle node queue memoryIdleQueue is dequeued to obtain the memory idle node memoryIdleNode, and the memory idle node memoryIdleNode is recorded as the working node taskNode and the task is assigned to the working node taskNode;
[0040] If the task to be assigned is i For a disk-type task diskTask, the first disk idle node in the disk idle node queue diskIdleQueue is dequeued to obtain the disk idle node diskIdleNode, and the disk idle node diskIdleNode is recorded as the working node taskNode and the task is assigned to the working node taskNode;
[0041] If the task to be assigned is i For a network IO type task netIOTask, the first one in the network IO idle node queue netIOIdleQueue is dequeued to obtain the network IO idle node netIOIdleNode, and the network IO idle node netIOIdleNode is recorded as the working node taskNode and the task is assigned to the working node taskNode.
[0042] A second aspect of the present invention provides a task scheduling device in an edge computing environment, comprising:
[0043] The information binding module is used to define an information binding hash table InfoBindMap in the central node NodeCenter; wherein the key of the information binding hash table InfoBindMap is the edge node node i The IP address of the node, the value is the node type set typeList i ;
[0044] The first acquisition module is used to determine the edge node i Average CPU usage averageCpu i 、Average memory usage averageMemory i , average disk usage averageDisk i and the average network IO speed averageNetIO i ;
[0045] The first calculation module is used to calculate the edge node i Average CPU usage averageCpu i 、Average memory usage averageMemory i, average disk usage averageDisk i and the average network IO speed averageNetIO i Determine the edge node by comparing the size relationship with the preset standard i Type, and edge node node i Add to the node type collection typeList i middle;
[0046] Queue generation module, used to set node type typeList i edge node in i Add them to the idle queue of the corresponding edge node type respectively;
[0047] The task classification module is used to obtain the set of tasks to be assigned, and to classify each task to be assigned in the set of tasks to be assigned. i Classify; among them, the tasks to be assigned i Types include CPU tasks cpuTask, memory tasks memoryTask, disk tasks diskTask, and network IO tasks netIOTask;
[0048] The second calculation module is used to calculate each task to be assigned i priorityLevel i , tasks to be assigned i The allocation order is based on priority priorityLevel i Order from largest to smallest;
[0049] Task allocation module, used to allocate tasks based on the task to be assigned i Type, select the corresponding type of idle queue, dequeue the idle node at the head of the selected idle queue, record the idle node after dequeue as the working node taskNode, and assign the task task i Assign to the working node taskNode, and put the working node taskNode that has been assigned tasks into the queue at the end of the idle queue.
[0050] In a third aspect of the present invention, an electronic device is provided, comprising a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the above-mentioned task scheduling method in the edge computing environment.
[0051] In a fourth aspect of the present invention, a computer-readable storage medium is provided, which stores at least one instruction. When the at least one instruction is executed by a processor, the task scheduling method in the above-mentioned edge computing environment is implemented. Beneficial effects
[0052] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0053] The task scheduling method provided by the present invention in an edge computing environment binds information between a central node and an edge node, obtains relevant resource information of the edge node, calculates the average resource utilization rate of each edge node, then determines the type of the edge node, stores the edge node in an idle queue corresponding to the determination result, and waits for task assignment. The task to be processed is then classified and scheduled to the edge node in the idle queue corresponding to the classification result. The central node is able to synchronously understand the status of the edge node, classify the task, match the task type with the edge node, and enable each edge node to execute the task, thereby completing the entire computing process in the most optimal manner possible, with strong real-time performance, high execution efficiency, and strong adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are intended to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings:
[0055] FIG1 is a flowchart of a task scheduling method in an edge computing environment according to an embodiment of the present invention;
[0056] FIG2 is a structural block diagram of a task scheduling device in an edge computing environment according to an embodiment of the present invention;
[0057] FIG3 is a structural block diagram of an electronic device according to an embodiment of the present invention. Best Mode for Carrying Out the Invention
[0058] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of the present application can be combined with each other.
[0059] The following detailed description is an exemplary description, which is intended to provide further detailed description of the present invention. Unless otherwise indicated, all technical terms used in the present invention have the same meaning as those generally understood by those skilled in the art. The terms used in the present invention are only for describing specific embodiments, and are not intended to limit the exemplary embodiments according to the present invention.
[0060] Example 1
[0061] As shown in Figure 1, a task scheduling method in an edge computing environment includes the following steps:
[0062] S1. Define an information binding hash table InfoBindMap in the central node NodeCenter; wherein the key of the information binding hash table InfoBindMap is the edge node node i IP address IPKey i , the value is the node type set typeList i .
[0063] Specifically, in this solution, the central node is defined as NodeCenter, and the edge nodes of the central node NodeCenter are defined as node i The information binding hash table InfoBindMap is used to bind information between the central node and the edge node.
[0064] S2. Get edge node i Average CPU usage averageCpu i 、Average memory usage averageMemory i , average disk usage averageDisk i and the average network IO speed averageNetIO i .
[0065] Specifically, first get the edge node node i Related resource information includes CPU related information, memory related information, disk related information and the amount of read and write data of the network port. Then, based on the edge node i Related resource information, computing edge node node i CPU usage cpuUsage j , memory usage memoryUsage j , disk usage diskUsage j and network IO speed netIOSpeed j ; Then S4, based on edge node i CPU usage cpuUsage j , memory usage memoryUsage j , disk usage diskUsage j and network IO speed netIOSpeed j , calculate the edge node node i Average CPU usage averageCpu i 、Average memory usage averageMemory i , average disk usage averageDiski and the average network I / O speed averageNetIO i .
[0066] S3. Obtain the set of node types typeList corresponding to the IP address of the key for the edge node node in the information binding hash table InfoBindMap i ; where the set of node types typeList i stores the type information of this edge node. According to the average CPU usage rate averageCpu i of the edge node node i , the average memory usage rate averageMemory i , the average disk usage rate averageDisk i , and the average network I / O speed averageNetIO i respectively determine the type of the edge node node i based on their size relationships with the preset standards, and add the type of the edge node node i to the set of node types typeList of this edge node node i ; where the preset standards include the CPU usage rate threshold limitCPU, the memory usage rate threshold limitMemory, the disk read / write threshold limitDisk, and the network I / O speed threshold limitNetIO.
[0067] Specifically, if the average CPU usage rate averageCpuCreate a disk idle node diskIdleNode and add the disk idle node diskIdleNode to the node type set typeList i ; If the average network IO speed is averageNetIO i >Network IO speed threshold limitNetIO, then record the edge node node i It is the network IO idle node netIOIdleNode, and the network IO idle node netIOIdleNode is added to the node type set typeList i .
[0068] S4, based on the node type set typeList i The type in the edge node i Add them to the idle queue of the corresponding edge node type respectively.
[0069] Specifically, the idle queues include the CPU idle node queue cpuIdleQueue, the memory idle node queue memoryIdleQueue, the disk idle node queue diskIdleQueue, and the network IO idle node queue netIOIdleQueue;
[0070] Specifically, traverse the node type set typeList i ; If the node type set typeList i If there is a CPU idle node cpuIdleNode, then the CPU idle node cpuIdleNode is added to the CPU idle node queue cpuIdleQueue; if the node type set typeList i If there is a memory idle node memoryIdleNode in the memory, then the memory idle node memoryIdleNode is added to the memory idle node queue memoryIdleQueue; if the node type set typeList i If there is a disk idle node diskIdleNode, then the disk idle node diskIdleNode is added to the disk idle node queue diskIdleQueue; if the node type set typeList i If there is a network IO idle node netIOIdleNode, the network IO idle node netIOIdleNode is added to the network IO idle node queue netIOIdleQueue.
[0071] S5. Get the set of tasks to be assigned, and assign each task in the set of tasks to be assigned. i to classify.
[0072] Specific tasks to be assigned i Types include CPU tasks cpuTask, memory tasks memoryTask, disk tasks diskTask, and network IO tasks netIOTask;
[0073] S6. Calculate each task to be assigned i priorityLevel i , tasks to be assigned i The allocation order is based on priority priorityLevel i Order from largest to smallest;
[0074] Specific tasks to be assigned i priorityLevel i Calculate according to the following formula:
[0075]
[0076] in, Task to be assigned i The priority of the task is α=0.4, β=0.3, γ=0.2, δ=0.1; cpuNeed represents the task to be assigned. i Required CPU utilization; memoryNeed indicates the task to be assigned i Required memory utilization; ioNeed indicates the task to be assigned i Required network IO speed netIOSpeed j ; diskNeed indicates the task to be assigned i Required disk utilization.
[0077] S7, based on the task to be assigned i Type, select the corresponding type of idle queue, dequeue the idle node at the head of the selected idle queue, record the idle node after dequeue as the working node taskNode, and assign the task task i Assign to the working node taskNode, and put the working node taskNode that has been assigned tasks into the queue at the end of the idle queue.
[0078] Specifically, if the task to be assigned is iFor a CPU task cpuTask, the first CPU idle node queue cpuIdleQueue is dequeued to obtain the CPU idle node cpuIdleNode, and the CPU idle node cpuIdleNode is recorded as the working node taskNode. The task is assigned to the CPU idle node cpuIdleNode recorded as the working node taskNode; if the task to be assigned is task i If it is a memory task memoryTask, the first one in the memory idle node queue memoryIdleQueue is dequeued to get the memory idle node memoryIdleNode, and the memory idle node memoryIdleNode is recorded as the working node taskNode. The task is assigned to the memory idle node memoryIdleNode recorded as the working node taskNode; if the task to be assigned task i For disk-type tasks diskTask, the first queue of the disk idle node queue diskIdleQueue is dequeued to obtain the disk idle node diskIdleNode, and the disk idle node diskIdleNode is recorded as the working node taskNode, and the task is assigned to the disk idle node diskIdleNode recorded as the working node taskNode; if the task to be assigned task i For a network IO type task netIOTask, the first node in the network IO idle node queue netIOIdleQueue is dequeued to obtain the network IO idle node netIOIdleNode, and the network IO idle node netIOIdleNode is recorded as the working node taskNode, and the task is assigned to the network IO idle node netIOIdleNode recorded as the working node taskNode.
[0079] In some other embodiments, when the task to be assigned is i Before the step of assigning to the working node taskNode, the following steps are also included: i Define the priority execution queue priorityQueue i ; Get the priority execution queue priorityQueue in the working node taskNode i The size of the priority execution queue priorityQueue i Includes tasks that have been assigned to the work node taskNode; when the priority execution queue priorityQueue in the work node taskNode i When the size of the queue is greater than or equal to the preset priority execution queue size threshold sizeLimit, the task is to be assigned task taski Reallocate other idle nodes in the idle queue.
[0080] In the task to be assigned i After the step of assigning to the working node taskNode, the step further includes: sequentially enqueuing the tasks assigned to the working node taskNode into the priority execution queue priorityQueue i , and synchronously record the entry into the priority execution queue priorityQueue i Time; among them, the priority execution queue priorityQueue i The order of tasks is based on the priority level of the task i Arrange from large to small; calculate the priority execution queue priorityQueue i The waiting time of the task in waitTime i , when the waiting time waitTime i When the execution time is greater than timeLimit, the task will be removed from the priority execution queue priorityQueue i And allocate other idle nodes in the idle queue to the task.
[0081] Example 2
[0082] The following example illustrates a task scheduling method in an edge computing environment provided by an embodiment of the present invention.
[0083] Step 1: Traverse each edge node and record it as node i , define an information binding hash table InfoBindMap in the central node NodeCenter, where the key is the edge node node i IP address IPKey i , the value is the node type set typeList i Define the CPU usage threshold limitCPU, memory usage threshold limitMemory, disk read / write threshold limitDisk, network IO speed threshold limitNetIO, and detection counter detectCounter, with an initial value of 0.
[0084] Step 2: In node i Get the edge node node through the command in the node i The CPU related information in the CPU is used to solve the CPU usage of the node using formula (1), which is recorded as cpuUsage j, saved in the CPU usage queue cpuRateQueue. If the size of the CPU usage queue cpuRateQueue exceeds 15, the head of the queue will be dequeued.
[0085]
[0086] Among them, user represents the user-mode CPU time of the system from the boot time to the detection time; nice represents the CPU time occupied by processes with negative nice values from the boot time to the detection time; system represents the system mode running time from the boot time to the detection time; idle represents the waiting time of the system from the boot time to the detection time excluding disk IO and network IO; iowait represents the waiting time of disk IO and network IO from the boot time to the detection time; irq represents the hardware interrupt time of the system from the boot time to the detection time; softirq represents the software interrupt time of the system from the boot time to the detection time; totalCpuTime represents the total CPU time.
[0087] Step 3: In node i Get the edge node node through the command in the node i Memory related information in the node, and use formula (2) to solve the memory usage of the node, recorded as memoryUsage j , saved in the memory usage queue memoryRateQueue. If the size of the memory usage queue memoryRateQueue exceeds 15, the head of the queue will be dequeued.
[0088]
[0089] MemTotal represents the total system memory; MemFree represents the amount of free memory; Buffers represents the memory buffer, which is used to cache files or system constants; Cached represents the high-speed buffer, which is the memory used by the system's high-speed storage.
[0090] Step 4: In node i Get the edge node node through the command in the node i Disk related information in the node, and use formula (3) to solve the disk usage of the node diskUsage j , saved in the disk usage queue diskRateQueue. If the size of the disk usage queue diskRateQueue exceeds 15, the head of the queue will be removed from the queue.
[0091]
[0092] Where operateTime represents the number of milliseconds spent on the input / output operation; time represents the system time for viewing the information.
[0093] Step 5: Use the network speed detection tool to detect edge nodes i The amount of data read and written by a port is calculated using formula (4) to obtain the network IO speed, which is recorded as netIOSpeed j , saved in the network IO speed queue netIORateQueue. If the size of the network IO speed queue netIORateQueue exceeds 15, the head of the queue will be removed from the queue.
[0094]
[0095] Where receive i Indicates the tth i The number of bytes received by the network port at the moment; send i Indicates the tth i The number of bytes sent by the network port at time t i Indicates the recorded system time.
[0096] Step 6: The detection counter detectCounter is incremented by 1. If detectCounter < 10, jump to step 2, otherwise reset detectCounter to 0. Then traverse the CPU usage queue cpuRateQueue, memory usage queue memoryRateQueue, disk usage queue diskRateQueue, and network IO speed queue netIORateQueue respectively, and use formula (5) to obtain node i Average CPU usage averageCpu i , average memory usage averageMemory i , average disk usage averageDisk i , average network IO speed averageNetIO i .
[0097]
[0098] Where cpuUsage k is the kth CPU usage recorded in the CPU usage queue cpuRateQueue; cpuRateQueue.size is the size of cpuRateQueue; averageUsage kis the k-th CPU usage rate recorded in the memory usage rate queue memoryRateQueue; memoryRateQueue.size is the size of cpuRateQueue; diskUsage k is the k-th disk usage rate recorded in the disk rate queue diskRateQueue; diskRateQueue.size is the size of diskRateQueue; netIOUsage k is the k-th network IO speed recorded in the network IO rate queue netIORateQueue; netIORateQueue.size is the size of cpuRateQueue.
[0099] Step 7: According to the i ip of the node i address, obtain the set of node types typeList with the key as ip i in the information binding hash table InfoBindMap. If the average CPU usage rate averageCpu i < CPU usage rate threshold limitCPU, then mark the node i node as a CPU idle node cpuIdleNode, and add cpuIdleNode to typeList i ; if the average memory usage rate averageMemory i < memory usage rate threshold limitMemory, then mark it as a memory idle node memoryIdleNode, and add memoryIdleNode to typeList i ; if the average disk usage rate averageDisk i < disk read / write threshold limitDisk, then mark it as a disk idle node diskIdleNode, and add diskIdleNode to typeList i ; if the average network IO speed averageNetIO i > network IO speed threshold limitNetIO, then mark it as a network IO idle node netIOIdleNode, and add netIOIdleNode to typeList i ; i
[0100] Step 8: Define the CPU idle node queue cpuIdleQueue, memory idle node queue memoryIdleQueue, disk idle node queue diskIdleQueue, network IO idle node queue netIOIdleQueue. Traverse the information binding hash table InfoBindMap in the central node NodeCenter to obtain each edge node node i Corresponding value node type set typeList i , and traverse the node type collection typeList i If there is a CPU idle node cpuIdleNode in the set, then add the node to cpuIdleQueue; if there is a memory idle node memoryIdleNode, then add the node to memoryIdleQueue; if there is a disk idle node diskIdleNode, then add the node to diskIdleQueue; if there is a network IO idle node netIOIdleNode, then add the node to netIOIdleQueue.
[0101] Step 9: Start a helper thread. The main thread pauses for 2 seconds and then jumps to step 2. The helper thread jumps to step 10.
[0102] Step 10: Use the Linux performance testing software phoronix-test-suite to treat each task in the task set Task in turn i Classify and get task i The relevant information parameters of the task are classified into CPU type task cpuTask, memory type task memoryTask, disk type task diskTask and network IO type netIOTask. Formula (6) is used to obtain the task of each task i priorityLevel i , priorityLevel i The larger ones are executed first.
[0103]
[0104] Among them, α=0.4, β=0.3, γ=0.2, δ=0.1; cpuNeed represents the task to be assigned i Required CPU utilization; memoryNeed indicates the task to be assigned i Required memory utilization; ioNeed indicates the task to be assigned i Required network IO speed; diskNeed indicates the task to be assigned.i Required disk utilization.
[0105] Step 11: If the task to be assigned i If it is cpuTask, the CPU idle node queue cpuIdleQueue will be dequeued to get the CPU idle node cpuIdleNode, which is recorded as the working node taskNode. i Assign it to taskNode, and then put taskNode into the end of cpuIdleQueue. i If it is memoryTask, the first node in the memory idle node queue memoryIdleQueue is dequeued to get the memory idle node memoryIdleNode, which is recorded as the working node taskNode. i Assign to taskNode, and then put taskNode into the end of memoryIdleQueue. i If it is diskTask, the first node in the disk idle node queue diskIdleQueue is dequeued to get the disk idle node diskIdleNode, which is recorded as the working node taskNode. i Assign to taskNode, and then put taskNode into the end of diskIdleQueue. i If it is netIOTask, the first node in the network IO idle node queue netIOIdleQueue is dequeued to get the network IO idle node netIOIdleNode, which is recorded as the working node taskNode. i Assign it to taskNode, and then put taskNode into the end of netIOIdleQueue.
[0106] Step 12: At each node i Define the priority execution queue priorityQueue i , priority execution queue size threshold sizeLimit and execution deadline timeLimit. Get the priorityQueue in the work node taskNode i The priority execution queue size is size. If size ≥ sizeLimit, jump to step 11 to reallocate idle nodes; otherwise, continue to step 13.
[0107] Step 13: Assign the task to the taskNode iSequentially enter the priority execution queue priorityQueue i , and record the task synchronously i Entering the priorityQueue i startTime i , in priorityQueue i Internally, by default, each task i priorityLevel i Arrange from largest to smallest.
[0108] Step 14: Traverse the priority execution queue priorityQueue i , use formula (7) to obtain the priorityQueue i Tasks in task i Waiting time waitTime i , if there is a task task i Waiting time waitTime i >If the execution deadline timeLimit is reached, the task will be dequeued and the process will jump to step 11 to reallocate idle nodes.
[0109]
[0110] Where currentTime is the current system time.
[0111] Example 3
[0112] As shown in FIG2 , based on the same inventive concept as the above embodiment, the present invention further provides a task scheduling device in an edge computing environment, comprising:
[0113] The information binding module is used to define an information binding hash table InfoBindMap in the central node NodeCenter; wherein the key of the information binding hash table InfoBindMap is the edge node node i The IP address of the node, the value is the node type set typeList i ;
[0114] The first acquisition module is used to obtain the edge node node i Average CPU usage averageCpu i 、Average memory usage averageMemory i , average disk usage averageDisk i and the average network IO speed averageNetIO i ;
[0115] The first calculation module is used to calculate the edge node i Average CPU usage averageCpu i 、Average memory usage averageMemory i , average disk usage averageDisk i and the average network IO speed averageNetIO i Determine the edge node by comparing the size relationship with the preset standard i Type, and edge node node i The type is added to the edge node node i Node type collection typeList i middle;
[0116] Queue generation module, used to generate queues based on the node type set typeList i The type in the edge node i Add them to the idle queue of the corresponding edge node type respectively;
[0117] The task classification module is used to obtain the set of tasks to be assigned, and to classify each task to be assigned in the set of tasks to be assigned. i Classify; among them, the tasks to be assigned i Types include CPU tasks cpuTask, memory tasks memoryTask, disk tasks diskTask, and network IO tasks netIOTask;
[0118] The second calculation module is used to calculate each task to be assigned i priorityLevel i , tasks to be assigned i The allocation order is based on priority priorityLevel i Order from largest to smallest;
[0119] Task allocation module, used to allocate tasks based on the task to be assigned i Type, select the corresponding type of idle queue, dequeue the idle node at the head of the selected idle queue, record the idle node after dequeue as the working node taskNode, and assign the task task i Assign to the working node taskNode, and put the working node taskNode that has been assigned tasks into the queue at the end of the idle queue.
[0120] In a preferred embodiment, it further includes a first verification module and a second verification module.
[0121] The first verification module is specifically used to assign the task to task i Before being assigned to the work node taskNode, at each edge node i Define the priority execution queue priorityQueue i ;
[0122] Get the priority execution queue priorityQueue in the working node taskNode i The size of the priority execution queue priorityQueue i Includes tasks that have been assigned to the working node taskNode;
[0123] When the priority execution queue priorityQueue in the work node taskNode i When the size of the queue is greater than or equal to the preset priority execution queue size threshold sizeLimit, the task is to be assigned task task i Reallocate other idle nodes in the idle queue.
[0124] The second verification module is specifically used to assign the task to task i After being assigned to the work node taskNode, the tasks assigned to the work node taskNode are queued in priority execution queue priorityQueue in sequence i , and synchronously record the entry into the priority execution queue priorityQueue i Time; among them, the priority execution queue priorityQueue i The order of tasks is based on the priority level of the task i Arrange from large to small; calculate the priority execution queue priorityQueue i The waiting time of the task in waitTime i , when the waiting time waitTime i When the execution time is greater than timeLimit, the task will be removed from the priority execution queue priorityQueue i And allocate other idle nodes in the idle queue to the task.
[0125] Example 4
[0126] As shown in Figure 3, based on the same inventive concept as the above embodiment, the present invention also provides an electronic device 100 for implementing the task scheduling method in the edge computing environment in the above embodiment; the electronic device 100 includes a memory 101, at least one processor 102, a computer program 103 stored in the memory 101 and executable on the at least one processor 102, and at least one communication bus 104. The memory 101 can be used to store the computer program 103, and the processor 102 implements the steps of the task scheduling method in the edge computing environment in the above embodiment by running or executing the computer program stored in the memory 101 and calling the data stored in the memory 101.
[0127] The memory 101 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data (such as audio data) created according to the use of the electronic device 100. In addition, the memory 101 may include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device.
[0128] The at least one processor 102 may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 102 may be a microprocessor or any conventional processor. The processor 102 is the control center of the electronic device 100 and connects various parts of the entire electronic device 100 using various interfaces and lines.
[0129] The memory 101 in the electronic device 100 stores multiple instructions to implement a task scheduling method in an edge computing environment. The processor 102 can execute the multiple instructions to implement:
[0130] An information binding hash table InfoBindMap is defined in the central node NodeCenter; wherein the key of the information binding hash table InfoBindMap is the edge node node i IP address IPKey i , the value is the node type set typeList i ;
[0131] Get edge node i Average CPU usage averageCpu i 、Average memory usage averageMemory i , average disk usage averageDisk i and the average network IO speed averageNetIO i ;
[0132] Based on edge node i Average CPU usage averageCpu i 、Average memory usage averageMemory i , average disk usage averageDisk i and the average network IO speed averageNetIO i Determine the edge node by comparing the size relationship with the preset standard i Type, and edge node node i The type is added to the edge node node i Node type collection typeList i middle;
[0133] Based on the node type set typeList i The type in the edge node i Add them to the idle queue of the corresponding edge node type respectively;
[0134] Get the set of tasks to be assigned, and assign each task in the set of tasks to be assigned i to classify;
[0135] Calculate each task to be assigned i priorityLevel i , tasks to be assigned i The allocation order is based on priority priorityLevel i Order from largest to smallest;
[0136] Based on the task to be assignedi Type and order of assignment, select the corresponding task to be assigned i Type of idle queue, the idle node at the head of the selected idle queue is dequeued, and the idle node after dequeuing is recorded as the working node taskNode, and the task to be assigned task is i Assign to the working node taskNode, and put the working node taskNode that has been assigned tasks into the queue at the end of the idle queue.
[0137] Example 5
[0138] If the module / unit integrated in the electronic device 100 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. Computer-readable media may include: any entity or device that can carry computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory and read-only memory (ROM, Read-Only Memory).
[0139] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0140] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, such that execution of the instructions by the processor of the computer or other programmable data processing device produces means for implementing the functions specified in one or more processes in the flowcharts and / or one or more blocks in the block diagrams.
[0141] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0142] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. A task scheduling method in an edge computing environment, characterized in that: The steps include: An information binding hash table InfoBindMap is defined in the central node NodeCenter; wherein the key of the information binding hash table InfoBindMap is the edge node node i IP address IPKey i , the value is the node type collection typeList i ; Determine the edge node node i Average CPU usage averageCpu i 、Average memory usage averageMemory i 、Average disk usage averageDisk i and the average network IO speed averageNetIO i ; According to the edge node i Average CPU usage averageCpu i 、Average memory usage averageMemory i 、Average disk usage averageDisk i and the average network IO speed averageNetIO i The size relationship with the preset standard is respectively used to determine the edge node node i The type of the edge node i The type is added to the edge node node i The node type collection typeList i middle; According to the node type set typeList i The type in the edge node node i Add them to the idle queue of the corresponding edge node type respectively; Get the set of tasks to be assigned, and for each task in the set of tasks to be assigned i To classify; Calculate each task to be assigned i priorityLevel i , the task to be assigned task i The allocation order is based on the priority priorityLevel i Order from largest to smallest; Based on the task to be assigned i Type and order of assignment, select the corresponding task to be assigned i The idle node at the head of the idle queue is removed from the queue, and the idle node after removal is recorded as the working node taskNode. i Assign to the working node taskNode, and put the working node taskNode to which the task has been assigned to the end of the idle queue.
2. The task scheduling method in the edge computing environment according to claim 1 is characterized in that: In assigning the task to be assigned i Before the step of allocating to the working node taskNode, the step further includes: At each of the edge nodes i Define the priority execution queue priorityQueue in i ; Get the priority execution queue priorityQueue in the working node taskNode i The size of the priority execution queue priorityQueue i Includes tasks that have been assigned to the working node taskNode; When the priority execution queue priorityQueue in the work node taskNode i When the size of the priority execution queue is greater than or equal to the preset priority execution queue size threshold sizeLimit, the task to be assigned task i Reallocate other idle nodes in the idle queue.
3. The task scheduling method in the edge computing environment according to claim 1 is characterized in that: In assigning the task to be assigned i After the step of allocating to the working node taskNode, the following steps are also included: The tasks assigned to the working node taskNode are queued into the priority execution queue priorityQueue in sequence i , and synchronously record the entry into the priority execution queue priorityQueue i time; wherein, the priority execution queue priorityQueue i The order of tasks in the task is based on the priority level of the task. i Arrange from largest to smallest; Calculate the priority execution queue priorityQueue i The waiting time of the task in waitTime i , when the waiting time waitTime i When the execution time is greater than timeLimit, the task will be removed from the priority execution queue priorityQueue i And other idle nodes in the idle queue are allocated to the task.
4. The task scheduling method in the edge computing environment according to claim 1 is characterized in that: The edge node node i Average CPU usage averageCpu i 、Average memory usage averageMemory i 、Average disk usage averageDisk i and the average network IO speed averageNetIO i The size relationship with the preset standard is respectively used to determine the edge node node i The type of the edge node i The type is added to the edge node node i The node type collection typeList i The steps in the above example include: The preset standards include a CPU usage threshold limitCPU, a memory usage threshold limitMemory, a disk read / write threshold limitDisk, and a network IO speed threshold limitNetIO; If the average CPU usage averageCpu i <is less than the CPU usage threshold limitCPU, then mark the edge node node i as a CPU idle node cpuIdleNode, and add the CPU idle node cpuIdleNode to the node type set typeList i ; If the average memory usage is averageMemory i < memory usage threshold limitMemory, then the edge node node i The memory idle node is memoryIdleNode, and the memory idle node memoryIdleNode is added to the node type set typeList i ; If the average disk usage is averageDisk i <disk read / write threshold limitDisk, then record the edge node node i The disk idle node diskIdleNode is added to the node type set typeList i ; If the average network IO speed is averageNetIO i >Network IO speed threshold limitNetIO, then record the edge node node i It is the network IO idle node netIOIdleNode, and the network IO idle node netIOIdleNode is added to the node type set typeList i .
5. The task scheduling method in the edge computing environment according to claim 1 is characterized in that: The node type set typeList i The type in the edge node node i The steps of adding the nodes to the idle queue of the corresponding edge node type include: The idle queues include a CPU idle node queue cpuIdleQueue, a memory idle node queue memoryIdleQueue, a disk idle node queue diskIdleQueue, and a network IO idle node queue netIOIdleQueue; Traverse the node type set typeList i ; If the node type set typeList i If there is a CPU idle node cpuIdleNode, add the CPU idle node cpuIdleNode to the CPU idle node queue cpuIdleQueue; If the node type set typeList i If there is a memory idle node memoryIdleNode in the memory, add the memory idle node memoryIdleNode to the memory idle node queue memoryIdleQueue; If the node type set typeList i If there is a disk idle node diskIdleNode in the disk, add the disk idle node diskIdleNode to the disk idle node queue diskIdleQueue; If the node type set typeList i If there is a network IO idle node netIOIdleNode, the network IO idle node netIOIdleNode is added to the network IO idle node queue netIOIdleQueue.
6. The task scheduling method in the edge computing environment according to claim 1 is characterized in that: The calculation of each task to be assigned i priorityLevel i In the step, the task to be assigned is i priorityLevel i Calculate according to the following formula: in, To be assigned task i The priority of the task is α=0.4, β=0.3, γ=0.2, δ=0.1; cpuNeed indicates the task to be assigned. i Required CPU utilization; memoryNeed indicates the task to be assigned i Required memory utilization; ioNeed indicates the task to be assigned i Required network IO speed netIOSpeed j ; diskNeed indicates the task to be assigned i Required disk utilization.
7. The task scheduling method in the edge computing environment according to claim 1 is characterized in that: The task to be assigned based on i type, select the idle queue of the corresponding type, dequeue the idle node at the head of the selected idle queue, record the idle node after dequeue as the working node taskNode, and record the task to be assigned task i The step of allocating to the working node taskNode specifically includes: The task to be assigned i The types include CPU tasks cpuTask, memory tasks memoryTask, disk tasks diskTask, and network IO tasks netIOTask; If the task to be assigned is i For a CPU task cpuTask, the first CPU idle node queue cpuIdleQueue is dequeued to obtain the CPU idle node cpuIdleNode, and the CPU idle node cpuIdleNode is recorded as the working node taskNode and the task is assigned to the working node taskNode; If the task to be assigned is i For a memory task memoryTask, the first queue of the memory idle node queue memoryIdleQueue is dequeued to obtain the memory idle node memoryIdleNode, and the memory idle node memoryIdleNode is recorded as the working node taskNode and the task is assigned to the working node taskNode; If the task to be assigned is i For a disk-type task diskTask, the first queue of the disk idle node queue diskIdleQueue is dequeued to obtain the disk idle node diskIdleNode, and the disk idle node diskIdleNode is recorded as the working node taskNode and the task is assigned to the working node taskNode; If the task to be assigned is i If it is a network IO type task netIOTask, the first queue of the network IO idle node queue netIOIdleQueue is dequeued to obtain the network IO idle node netIOIdleNode, and the network IO idle node netIOIdleNode is recorded as the working node taskNode and the task is assigned to the working node taskNode.
8. A task scheduling device in an edge computing environment, characterized in that: include: The information binding module is used to define an information binding hash table InfoBindMap in the central node NodeCenter; wherein the key of the information binding hash table InfoBindMap is the edge node node i The IP address of the node, the value is the node type set typeList i ; The first acquisition module is used to determine the edge node node i Average CPU usage averageCpu i 、Average memory usage averageMemory i 、Average disk usage averageDisk i and the average network IO speed averageNetIO i ; The first computing module is used to calculate the edge node node i Average CPU usage averageCpu i 、Average memory usage averageMemory i 、Average disk usage averageDisk i and the average network IO speed averageNetIO i The size relationship with the preset standard is respectively used to determine the edge node node i The type of the edge node i The type is added to the edge node node i The node type collection typeList i middle; A queue generation module is used to generate a queue based on the node type set typeList i The type in the edge node node i Add them to the idle queue of the corresponding edge node type respectively; The task classification module is used to obtain a set of tasks to be assigned, and for each task to be assigned in the set of tasks to be assigned, i Classify; wherein the task to be assigned task i The types include CPU tasks cpuTask, memory tasks memoryTask, disk tasks diskTask, and network IO tasks netIOTask; The second calculation module is used to calculate each of the tasks to be assigned. i priorityLevel i , the task to be assigned task i The allocation order is based on the priority priorityLevel i Order from largest to smallest; A task allocation module is used to allocate tasks based on the task to be allocated. i type, select the idle queue of the corresponding type, dequeue the idle node at the head of the selected idle queue, record the idle node after dequeue as the working node taskNode, and record the task to be assigned task i Assign to the working node taskNode, and put the working node taskNode to which the task has been assigned to the end of the idle queue.
9. An electronic device, characterized in that: It includes a processor and a memory, and the processor is used to execute a computer program stored in the memory to implement the task scheduling method in an edge computing environment as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by the processor, it implements the task scheduling method in the edge computing environment as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-copy-based task scheduling method and system for edge computing environment
CN111381950A
Node load balancing scheduling method for edge computing environment
CN112887345A
Edge node task scheduling method and device, computer equipment and storage medium
CN114528092A
Task scheduling method and device, computer readable storage medium and electronic equipment
CN114610499A
Hybrid weight task scheduling method and system for edge heterogeneous equipment
CN115237568A
Cited By
Industrial defect detection task scheduling method and device, equipment and medium
CN120780489A
Multi-unmanned aerial vehicle subsystem real-time integrated control method and system based on edge calculation
CN121477982A
