Task partition real-time power consumption scheduling method based on correlation in edge computing environment

By adopting task-dependent partition scheduling and dual-speed energy-saving scheduling algorithms in an edge computing environment, combined with DVFS technology, the blockage and energy consumption problems caused by real-time task multi-resource access in a multi-core processor system are solved, and efficient real-time task scheduling is achieved and low-energy system operation.

CN119396590APending Publication Date: 2025-02-07CHINA THREE GORGES TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411538879.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In a multi-core processor system, multi-resource access to real-time tasks leads to blocking and priority reversal, affecting the time limit guarantee and scheduling performance of real-time tasks, while increasing energy consumption.

Method used

Using a task partition real-time power consumption scheduling method based on edge computing environment, the task-dependent partition scheduling algorithm and dual-speed energy-saving scheduling algorithm are optimized for the allocation and execution of tasks on multi-core processors. speed.

Benefits of technology

It effectively reduces blockage and priority reversal between tasks, improves the scheduling efficiency and energy efficiency of multi-core systems, and ensures the time limit of real-time tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396590A_ABST
    Figure CN119396590A_ABST
Patent Text Reader

Abstract

A task partition real-time power consumption scheduling method based on correlation in an edge computing environment is characterized in that in an embedded real-time system, an edge intelligent technology is still in the key research field of task timeliness, efficiency improvement, energy consumption reduction and system blockage, the task scheduling problem of a homogeneous multi-core system is solved, and the task partition real-time power consumption scheduling method based on correlation in the edge computing environment is solved by deeply analyzing the dependency relationship between tasks. Optimal processors are allocated for them, and resource contention and congestion are reduced. In order to realize efficient concurrent access, a multiprocessor stack resource protocol MSRP and a high-performance partition earliest cut-off priority scheduling algorithm P-EDF are adopted; meanwhile, a double-speed energy-saving mechanism is introduced into the CBTP, and the execution speed of a task is flexibly adjusted by combining dynamic voltage and frequency adjustment DVFS. The CBTP strategy is obviously superior to a traditional method, system blockage and energy consumption are remarkably reduced, and the superiority and effectiveness of the CBTP strategy in a homogeneous multi-core system are verified. The scheduling performance of a real-time system is improved in an edge computing environment, and the energy efficiency of scheduling is improved at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of processor algorithms and scheduling technologies, and relates to a real-time power consumption scheduling method for task partitioning based on correlation in an edge computing environment. Background Art

[0002] Multicore processors have become the main computing engines in edge intelligent systems, especially in the field of embedded real-time systems. These processors provide efficient task distribution and large-scale real-time computing capabilities, which enhances performance while maintaining correctness and optimal functionality of the system. They play an important role in meeting the strict deadline requirements of real-time tasks. In addition, they have been widely adopted in various application areas of real-time systems, including video object tracking, mobile devices, and advanced driver assistance systems.

[0003] Although the scheduling theory of real-time systems has been studied for many years and many effective real-time scheduling algorithms have been developed, most of these studies focus on single-core processors. The earliest earliest deadline first (EDF) scheduling algorithm and the classic rate monotonic scheduling algorithm (RMS) are both efficient single-core scheduling algorithms and have been studied in depth. However, scheduling algorithms for multi-resource access scenarios of real-time tasks in multi-core systems have not been widely studied. Energy consumption in multi-core systems and blocking of tasks when accessing shared resources have become bottlenecks in scheduling, especially as the complexity of multi-core systems continues to increase, which will inevitably lead to increased energy consumption. At the same time, in real-time multi-core systems, the challenge of ensuring that tasks are completed before their respective deadlines must be overcome, even if these tasks may need exclusive access to shared resources, such as data or files. Competition between tasks for shared resources may lead to widespread task blocking and priority inversion, which will directly affect the deadline guarantee and task scheduling of real-time tasks. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a real-time power consumption scheduling method for task partitioning based on correlation in an edge computing environment, so as to improve the scheduling performance of the real-time system in the edge computing environment and improve the energy efficiency of the scheduling.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: a task partitioning real-time power consumption scheduling method based on correlation in an edge computing environment, which is characterized by comprising the following steps:

[0006] S1, task model, the task set T consists of n real-time tasks, T = {T1, T2, ..., T n}, each task is periodic, preemptible, and interdependent; when tasks involve access to shared resources, mutual exclusion and synchronization are ensured;

[0007] S2, processor model, the processor platform is a multi-core processor system Π consisting of m ≥ 2 identical multi-processors, that is, Π = {P1, P2, ..., P m}; Multi-core processor systems support dynamic DVFS functionality, which operates at a speed proportional to the supply voltage;

[0008] S3, access and synchronization, assuming that the shared resources that tasks need to access in the system are represented by R, and multiple tasks are not allowed to access the same shared resource at the same time, that is, tasks need to access in a mutually exclusive manner, and use the MSRP protocol to maintain synchronous access of tasks;

[0009] S4, task partition energy-saving scheduling, energy-saving partition scheduling algorithm based on task correlation, defines the absolute value of the difference in cost functions between tasks as correlation, and the algorithm allocates tasks with high correlation to the shared resource partition of the same processor; Dual-Speed ​​energy-saving scheduling algorithm based on DVFS technology is used to execute tasks at low speed and then switch to high speed immediately when the task is blocked;

[0010] The partition scheduling algorithm consists of two steps:

[0011] S4-1, divides the task set into corresponding partitions according to the characteristics or deadlines of the tasks, and maps them to processors according to their priorities;

[0012] S4-2, under the premise of meeting the system performance requirements, arrange the divided tasks on each processor according to the existing scheduling algorithm;

[0013] S5, the associated task partition scheduling algorithm, calculates the ideal optimal utilization of tasks based on the CBTP algorithm Where m represents the number of processor cores. Tasks with high correlation are assigned to the same processor, and the total utilization of the tasks does not exceed 1.

[0014] S6, processor speed allocation, after the tasks are assigned, the processor is assigned an appropriate execution speed to reduce energy consumption; a dual-speed algorithm is introduced to allow the processor to run at the initial speed and switch to high-speed execution only when there is a task that blocks access to shared resources; the partitioned EDF algorithm is used to schedule tasks, and the derivation of the initial speed SL is based on the feasibility analysis of the EDF algorithm;

[0015] S7, the dual-speed scheduling algorithm, sets the processor speed to SL and processes the released tasks according to their priorities; when task J i Block high priority jobs τ iWhen τ is reached, not only the currently blocked job is delayed, but also the subsequent high-priority jobs are indirectly delayed. When blocking occurs, the processor runs at high-speed SH to ensure the timeliness of these delayed high-priority jobs. i That is, the blocked task reaches the deadline or the processor P m idle.

[0016] In S1, each task τ i The properties of T are defined by the five-tuple: i ={e i , f i , t i , p i , d i}; where e i represents the worst execution time WCET of the task; f i is the frequency of execution of the task when accessing shared resources, that is, the number of executions; t i represents the time required for a task to access shared resources during the entire execution period; p i Indicates the minimum time interval for task execution, that is, the cycle; d i It's a task i deadline.

[0017] In S2, the maximum and minimum available voltages in the system are given by V max and V min Indicates that the corresponding processor execution speeds are S max and S min ; The processor supports K discrete available speeds; processor power (P), supply voltage (V s The relationship between ) and the clock frequency (f) can be described by the following formula:

[0018] P=C*f*V s ; (1)

[0019] Where C is the switch capacitance and the operating frequency f is similar to the processor speed and is roughly proportional to V s Proportional to the supply voltage.

[0020] In S3, the synchronization access principles include:

[0021] When the core P m The current task τ on i When sending an access request to resource R, if the shared resource R is in an idle state, task τ i The shared resource R will be locked and then accessed non-preemptively; otherwise, if the shared resource R is currently occupied and accessed by tasks in other cores, task τ i will be added to the FIFO access queue of resource R and enter core Pm The waiting state on the local blocking state B i local ;

[0022] Once the task τ i Complete the access to the shared resource R, it will unlock the resource R, making R preemptible again; if the current shared resource FIFO queue is not empty, that is, when task τ i When accessing shared resource R, task τ i The shared resource R is also needed, causing the system to be in a global blocking state B i glocal , the head task in the queue τ i Will dequeue and lock resource R for access.

[0023] In S5, the EDF algorithm is given a set of n independent periodic tasks. If the following conditions are met, EDF can schedule them to make them feasible:

[0024]

[0025] According to the task i The worst case execution time is at the maximum processor speed S max = 1; when the processor is running at speed S i Execute task τ i When , its execution time becomes e i / S i , we can draw the following conclusion: given a set of processors with speed S i If the following conditions are met for n independent periodic tasks to be executed, EDF can perform scheduling:

[0026] According to (2) and (3), it can be obtained that the static processor execution speed of the task can be calculated when no blocking occurs and the energy consumption can be reduced without violating the deadline.

[0027] In S5, given a set of n independent periodic tasks, if they can be processed at the maximum processor speed S max = 1, then they can be scheduled at the initial speed SL of the processor, where:

[0028]

[0029] Equation (4) derives the initial speed of the processor without considering the impact of task blocking. When tasks in the system access shared resources, the task blocking effect caused by task synchronization and exclusive access to shared resources must be considered. When a task is not blocked, it is assigned an execution speed: SL. When τi By lower priority tasks τ j When blocked, the task τ needs to be derived dynamically i High speed SH.

[0030] The main beneficial effects of the present invention are:

[0031] For tasks to access multiple resources, the resource access protocol MSRP must be used to synchronize tasks' access to shared resources, thereby reducing remote blocking in the system and improving scheduling efficiency.

[0032] Arrange multiple tasks on the same processor to run non-concurrently in a shared resource partition, thereby reducing the required shared resource size, effectively utilizing the parallelism of tasks in a multi-core system, balancing the workload in a multi-core system, and reducing congestion in the system. Combined with the partitioned EDF scheduling scheme, tasks can be flexibly allocated with execution speed to reduce the total energy consumption of the system.

[0033] By deeply analyzing the dependencies between tasks, the optimal processor is allocated to them, reducing resource contention and blocking.

[0034] The multi-processor stack resource protocol MSRP and the high-performance partitioned earliest deadline first scheduling algorithm P-EDF are adopted to achieve efficient concurrent access.

[0035] CBTP introduces a dual-speed energy-saving mechanism, combined with dynamic voltage and frequency adjustment DVFS to flexibly adjust the execution speed of tasks. The CBTP strategy is significantly better than traditional methods, significantly reducing system congestion and energy consumption, and verifies its excellence and effectiveness in homogeneous multi-core systems. In the edge computing environment, it improves the scheduling performance of real-time systems while improving the energy efficiency of scheduling. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0037] Figure 1 This is a process diagram of task resource access and synchronization during the CBTP algorithm scheduling process of the present invention.

[0038] Figure 2 This is a capability analysis diagram of the static speed algorithm of the present invention.

[0039] Figure 3 This is a capability analysis diagram of the dual-speed energy-saving algorithm of the present invention. DETAILED DESCRIPTION

[0040] like Figure 1 to Figure 3 A method for real-time power consumption scheduling of task partitions based on correlation in an edge computing environment is provided, characterized in that it includes the following steps:

[0041] S1, task model, the task set T consists of n real-time tasks, T = {T1, T2, ..., T n}, each task is periodic, preemptible, and interdependent; when tasks involve access to shared resources, mutual exclusion and synchronization are ensured;

[0042] Preferably, since a task may access the same shared resource multiple times, this means that a task's access to the shared resource may consist of one or more consecutive operations.

[0043] Preferably, because the tasks in the task set need to be executed on the local processor and shared resources, each task can access two types of resources, namely local resources and global shared resources, so the multi-resource scheduling problem of tasks must be considered. In other words, tasks assigned to different cores can access global resources, while cores on the same processor can only access local resources. Therefore, when tasks access resources, there will be two types of blocking, namely local blocking: B i local , and global blocking: B i global Therefore, for tasks' multi-resource access, the resource access protocol MSRP must be used to synchronize tasks' access to shared resources, thereby reducing remote blocking in the system and improving scheduling efficiency.

[0044] S2, processor model, the processor platform is a multi-core processor system Π consisting of m ≥ 2 identical multi-processors, that is, Π = {P1, P2, ..., P m}; Multi-core processor systems support dynamic DVFS functionality, which operates at a speed proportional to the supply voltage;

[0045] Preferably, we assume that the maximum speed of the processor is 1, and all other speeds are relative to the maximum speed. We further assume that voltage switching delays and costs are negligible, and that voltages can be adjusted at any time, both within and outside of a blocking segment, which means that the processor can be assigned different execution speeds depending on the execution state of the task.

[0046] Preferably, since the processor may not be fully utilized all the time, the dynamic voltage frequency scaling DVFS of the processor allows the processor to run at a lower speed when the system load is low, which has been proven to be an effective way to reduce power consumption. Basically, voltage scaling changes the speed of the processor by changing the supply voltage of the processor.

[0047] S3, access and synchronization, assuming that the shared resources that tasks need to access in the system are represented by R, and multiple tasks are not allowed to access the same shared resource at the same time, that is, tasks need to access in a mutually exclusive manner, and use the MSRP protocol to maintain synchronous access of tasks;

[0048] S4, task partition energy-saving scheduling, energy-saving partition scheduling algorithm based on task correlation, defines the absolute value of the difference in cost functions between tasks as correlation, and the algorithm allocates tasks with high correlation to the shared resource partition of the same processor; Dual-Speed ​​energy-saving scheduling algorithm based on DVFS technology is used to execute tasks at low speed and then switch to high speed immediately when the task is blocked;

[0049] The partition scheduling algorithm consists of two steps:

[0050] S4-1, divides the task set into corresponding partitions according to the characteristics or deadlines of the tasks, and maps them to processors according to their priorities;

[0051] S4-2, under the premise of meeting the system performance requirements, arrange the divided tasks on each processor according to the existing scheduling algorithm;

[0052] Preferably, because multiple tasks can be arranged on the same processor to run non-concurrently within a shared resource partition, the required shared resource size can be reduced. It can effectively utilize the parallelism of tasks in a multi-core system, balance the workload in a multi-core system, and reduce congestion in the system. Combined with the partitioned EDF scheduling scheme, tasks can be flexibly allocated to execute at a speed to reduce the total energy consumption of the system.

[0053] S5, the associated task partition scheduling algorithm, calculates the ideal optimal utilization of tasks based on the CBTP algorithm Where m represents the number of processor cores. Tasks with high correlation are assigned to the same processor, and the total utilization of the tasks does not exceed 1.

[0054] Embodiment 1,

[0055] Initially, a task-to-core allocation function div(τ i ), and set its initial value to false, indicating that the current task has no processor core assigned, as shown in line 2. In addition, a cost function cost(τ i ) is used as the criterion for calculating the correlation between tasks, as shown in line 3. Then, the cost function cost(τ) of all tasks that need to access shared resources is calculated through a for loop. i ), as shown in lines 4-6. The cost function cost(τ i ) is specified in line 5, including a computational cost formula related to the maximum frequency and duration of a given task or operation. In this equation: cost(τ i ) represents the task or operation τ i The associated computational cost, fi,max represents the maximum frequency (clock rate) at which task i can execute, t i Indicates the completion of task τi 所 The duration required. Lines 7-16 calculate the correlation between tasks and divide the task τ i and τ j The absolute value of the difference between the cost functions of is defined as the task correlation, denoted as Correlation( i,j ). If Correlation( i,j ) is 0, which means that task τ i and τ j When accessing the same shared resource, the correlation between them is the largest, and the value is max. In other words, the correlation between tasks is similar to Correlation( i,j ) is inversely proportional to the value of .

[0056] Correlation-based task partitioning algorithm,

[0057] Input1: a set of taskT={T1,...,Tn};

[0058] Input2: a series of processorsΠ={P1, P2,...,Pm} Output1: set of tasks assigned to different processorsTP={T1,...,Tn}. 1:

[0059] 2: Set div(τi) = false,

[0060] 3: Set cost(τi) = 0;

[0061] 4:fori=1:ndo;

[0062] 5:cost(τi)=fi,max*ti;

[0063] 6:end for;

[0064] 7: for i = 1: m-1 do;

[0065] 8: for j = i + 1: m do;

[0066] 9:Correlation(i,j)=|cost(τi)-cost(τj)|;

[0067] 10:if |cost(τi) — cost(τj)| = 0 then;

[0068] 11:Correlation(i,j) = Max;

[0069] 12:else;

[0070] 13:Correlation(i,j) < Max;

[0071] 14:end if;

[0072] 15:end for;

[0073] 16:end for;

[0074] 17:for i = 1:m - 1 do;

[0075] 18:ui = 0;

[0076] 19:while ui < u′ do;

[0077] 20:if div(τi) = div(τj) = false then;

[0078] 21:div(i,j) = min(τi,τj∈T)Correlation(i,j);

[0079] 22:put τi and τi into TP;

[0080] 23:end if;

[0081] 24:Correlation(i,j) = -1;

[0082] 25:if Correlation(i,j) ≠ -1 then;

[0083] 26:ui = ui + ciτi + cjτj;

[0084] 27:div(τi) = div(τj) = true;

[0085] 28:end if;

[0086] 29:end while;

[0087] 30:end for.

[0088] Next, according to Correlation( i,j) value, partition the task set T and allocate it to the processors Π = {P1, P2,..., P m}. The first for loop is shown in lines 17 - 30, where ui represents the total utilization assigned to core Pi. Initially, the value of ui is set to 0, as shown in line 18. Then, find a set of tasks τ i and τ j that satisfy ui < u′ and have the highest correlation, and assign the tasks to the corresponding processors in non - decreasing order of the Correlation( i,j ) value, as shown in lines 19 - 22. In addition, after the task assignment is completed, the processor utilization u i will be updated accordingly, and the correlation value of the tasks assigned to the processor will be set to - 1 to avoid recalculation, as shown in lines 24 - 26. At the same time, set the values of div(τ i ) and div(τ j ) to true, indicating that both tasks are assigned to the same processor, as shown in line 27. At this time, all related tasks in the task set T will be assigned to the processors P1…P m . The correlation - based task partitioning scheduling algorithm is completed.

[0089] S6, Processor speed allocation. After the tasks are assigned, allocate appropriate execution speeds to the processors to reduce energy consumption; introduce a two - speed algorithm that allows the processor to run at the initial speed and only switch to high - speed execution when there are tasks blocking access to shared resources; use the partitioned EDF algorithm to schedule tasks, and the derivation of the initial speed SL is based on the feasibility analysis of the EDF algorithm;

[0090] Preferably, in the task model, if a low - priority task is performing an operation on a critical - section shared resource, then the high - priority task will be blocked and unable to execute. This not only delays the currently blocked task but also indirectly delays subsequent high - priority tasks. Therefore, when a blockage occurs, the processor speed must be appropriately increased to ensure that these delayed high - priority tasks can be completed on time. Therefore, a two - speed algorithm is introduced that allows the processor to run at the initial speed and only switch to high - speed execution when there are tasks blocking access to shared resources. The reason is obvious: high speed is only used to guarantee the deadlines of blocked tasks, and when there are no blocked tasks, low speed is sufficient. When blockages occur rarely, this strategy will run the processor at low speed most of the time and save a large amount of energy.

[0091] The goal is to derive the task execution speed to minimize the system energy consumption while meeting the task deadline and feasibility. To achieve this goal, it is necessary to obtain the execution speed of two processors: the initial speed SL, which is the execution speed of the processor when there is no blocking in the system; and the high speed SH, which is the execution speed of the processor when the task is blocked.

[0092] S7, the dual-speed scheduling algorithm, sets the processor speed to SL and processes the released tasks according to their priorities; when task J i Block high priority jobs τ i When τ is reached, not only the currently blocked job is delayed, but also the subsequent high-priority jobs are indirectly delayed. When blocking occurs, the processor runs at high-speed SH to ensure the timeliness of these delayed high-priority jobs. i That is, the blocked task reaches the deadline or the processor P m idle.

[0093] In the preferred solution, in S1, each task τ i The properties of T are defined by the five-tuple: i ={e i , f i , t i , p i , d i}; where e i represents the worst execution time WCET of the task; f i is the frequency of execution of the task when accessing shared resources, that is, the number of executions; t i represents the time required for a task to access shared resources during the entire execution period; p i Indicates the minimum time interval for task execution, that is, the cycle; d i It's a task i deadline.

[0094] In the preferred solution, in S2, the maximum and minimum available voltages in the system are respectively V max and V min Indicates that the corresponding processor execution speeds are S max and S min ; The processor supports K discrete available speeds; processor power (P), supply voltage (V s The relationship between ) and the clock frequency (f) can be described by the following formula:

[0095] P=C*f*V s ; (1)

[0096] Where C is the switch capacitance and the operating frequency f is similar to the processor speed and is roughly proportional to V s Proportional to the supply voltage.

[0097] Preferably, the processor power is proportional to the cube of the supply voltage, and the proposed processor power consumption formula only involves the consumption of dynamic power, without considering the static power consumption from the internal leakage current of the electronic components. Usually, this omission is for the purpose of simplifying the dynamic power analysis. Static power consumption, often called leakage power consumption, originates from the inherent characteristics of semiconductor devices and exists even in the absence of active switching events. Although static power consumption is of great significance in low-power design and long idle time, in the current formula, the main focus is on dynamic power consumption considerations and static power consumption is not considered.

[0098] In the preferred solution, in S3, the synchronous access principles include:

[0099] When the core P m The current task τ on i When sending an access request to resource R, if the shared resource R is in an idle state, task τ i The shared resource R will be locked and then accessed non-preemptively; otherwise, if the shared resource R is currently occupied and accessed by tasks in other cores, task τ i will be added to the FIFO access queue of resource R and enter core P m The waiting state on the local blocking state B i local ;

[0100] Once the task τ i Complete the access to the shared resource R, it will unlock the resource R, making R preemptible again; if the current shared resource FIFO queue is not empty, that is, when task τ i When accessing shared resource R, task τ i The shared resource R is also needed, causing the system to be in a global blocking state B i glocal , the head task in the queue τ i Will dequeue and lock resource R for access.

[0101] Preferably, if Figure 1 In the figure, the process of task resource access and synchronization in the CBTP algorithm scheduling process is shown. Among them, the white rectangle indicates that the task is being executed on the local processor; the blue rectangle indicates that task τ1 is accessing the shared resource; the gray rectangle indicates that task τ2 is accessing the shared resource. The upper arrow indicates the task arrival time, and the lower arrow indicates the task resource access time. Taking tasks τ1 and τ2 as examples, this paper can clearly understand the resource access and synchronization process of tasks in the system. In addition, based on the MSRP protocol, the blocking of tasks in resource access can be greatly reduced and the scheduling efficiency of the system can be maximized.

[0102] In the preferred solution, in S5, the EDF algorithm is given a set of n independent periodic tasks, and EDF can schedule them to be feasible if the following conditions are met:

[0103]

[0104] According to the task i The worst case execution time is at the maximum processor speed S max = 1; when the processor is running at speed S i Execute taskτ i When , its execution time becomes e i / S i , we can draw the following conclusion: given a set of processors with speed S i If the following conditions are met for n independent periodic tasks to be executed, EDF can perform scheduling:

[0105] According to (2) and (3), it can be obtained that the static processor execution speed of the task can be calculated when no blocking occurs and the energy consumption can be reduced without violating the deadline.

[0106] In S5, given a set of n independent periodic tasks, if they can be processed at the maximum processor speed S max = 1, then they can be scheduled at the initial speed SL of the processor, where:

[0107]

[0108] Equation (4) derives the initial speed of the processor without considering the impact of task blocking. When tasks in the system access shared resources, the task blocking effect caused by task synchronization and exclusive access to shared resources must be considered. When a task is not blocked, it is assigned an execution speed: SL. When τ i By lower priority tasks τ j When blocked, the task τ needs to be derived dynamically i High speed SH.

[0109] Embodiment 2,

[0110] The following formula (9) gives the corresponding calculation method and explanation.

[0111] Since the system model in this paper uses the MSRP protocol to synchronize tasks’ access to shared resources, we need to derive the task τ iWhen implementing high-speed SH, the impact of task resource access protocols must be considered. As shown in Theorem 3, this paper prioritizes the schedulability of tasks executed on a single processor in the presence of blocking effects, and uses this to infer the schedulability and high-speed SH of tasks in multiprocessor systems. When tasks are executed on a single processor, Baker provides the following theorem: Theorem 3: A set of real-time tasks can be scheduled on a processor by EDF and the single-processor stack resource protocol SRP if the following conditions are met:

[0112]

[0113] Among them, B i is the task τ i The worst case blocking time of is. Because the tasks in the task set T can access two types of resources, namely local resources and global shared resources. Therefore, when a task accesses a resource, two types of blocking will occur, namely local blocking: B i local and global blocking: B i global When tasks are executed in a multiprocessor system, blocking interference from local and global tasks must be considered, which occurs when accessing shared resources. i global represents the maximum global waiting time for task τi to access all its resources, which is called global blocking. i global The value of can be calculated by the following formula:

[0114]

[0115] Among them, BW i,x Representative task τ i The maximum global waiting time for access to a resource R on a processor during its critical section, since each task may access a shared resource multiple times. i local is the maximum local waiting time spent by task τi, called local blocking. Considering the execution speed S of the processor x , we can get:

[0116]

[0117] Combining equations (5) and (6), we can derive the worst-case blocking time B of task τi in a multiprocessor system: i , it is B i local and B i local (Because B i local and B ilocal The maximum value between:

[0118]

[0119] Therefore, based on the above results, for each core Pm, it can be asserted that in a multi-core processor system, a set of n real-time tasks T can be scheduled and synchronized via P-EDF and MSRP if the following conditions are met:

[0120]

[0121] According to the above reasoning and schedulability analysis, when task τi is blocked by a lower priority task τj, the high-speed SH of task τi on the processor can be dynamically derived as follows:

[0122]

[0123] Where Bjgloball is the actual blocking time of task τj blocking task τi. It is worth noting that the initial task execution speed SL and high speed SH derived in this paper may be higher than the speed required for the actual execution of the task. This is because the processor considered in this paper is a non-ideal DVFS processor that supports K available discrete speeds. When the system considers a non-ideal DVFS processor, all methods will produce such a result that is higher than the speed required for the actual execution of the task.

[0124] Embodiment 3,

[0125] In the following algorithm, a dual-speed energy-saving algorithm is provided. At the beginning, a blocking function Block is initialized to determine whether there is a blocking situation in the system. When no task arrives at the processor, it is initially set to -1 to indicate that there is no blocking, and the initial speed of the processor is set to SL, as shown in lines 1-2. When the task arrives at the processor according to the priority, it is first determined whether the priority of the executing task τi is greater than the current task. If the priority is larger and the current task is successfully preempted, the task τi is executed at the initial low speed SL, as shown in lines 3-6. Otherwise, it means that the task τi is blocked. At this time, the processor speed is set to high speed SH, and the task τi is executed at this speed, as shown in lines 7-11. Note that when the execution time of task τi reaches the task deadline pi or the processor Pm is idle, its high-speed time interval ends, and task τi is re-executed at the initial speed SL, and the Block value is reset to -1, as shown in lines 14-17. Finally, the P-EDF algorithm is used to schedule tasks.

[0126] Algorithm 2: Dual-speed energy-saving scheduling algorithm.

[0127] 1:Initially theBlock==-1;

[0128] 2:Set processor_speed(SL);

[0129] 3: When Taskτiarrives;

[0130] 4:if priorityi>prioritycurrent then;

[0131] 5:if preempt current_task then;

[0132] 6:Executeτi at Speed(SL);

[0133] 7:else;

[0134] 8: τi is blocked;

[0135] 9:Block==1;

[0136] 10:Set processor_Speed(SL);

[0137] 11:ExecuteτiatSpeed(SH);

[0138] 12:end if;

[0139] 13:end if;

[0140] 14:whileτi=pi&&Pm==NULL do;

[0141] 15:Set processor_speed(SL);

[0142] 16:Executeτi at Speed(SL);

[0143] 17:Block==-1;

[0144] 18:end while;

[0145] 19:Use P-EDF algorithm scheduling task setT.

[0146] In addition, if Figure 2-Figure 3 As shown in Figure 1, an example is given to illustrate how the dual-speed energy-saving scheduling algorithm saves energy compared to the ordinary static speed algorithm. The upper arrow and the lower arrow represent the arrival time and deadline of the job, respectively. The white rectangle represents the execution time of the job, while the black rectangle represents the blocking time.

[0147] In this example, this paper uses the EDF algorithm to schedule tasks. Assume that both jobs in T1 need to complete one time unit of scheduling under the high speed SH, while the job in T2 needs four time units. In addition, the value of the initial speed SL is half of the high speed SH. Under the static speed algorithm, Figure 2 As shown in , the processor runs uniformly at high-speed SH in the entire time interval [0, 6]. In contrast, under the dual-speed energy-saving algorithm, Figure 3 As shown, the processor runs at high speed SH during the blocking time interval, and runs at the initial speed SL before the time point 4 before the blocking occurs and before the time point 7 after the blocking job is completed. According to formula (1), it can be seen that the dual-speed energy-saving algorithm can save about 36% of energy compared with the ordinary static speed algorithm.

[0148] The above-mentioned embodiments are only preferred technical solutions of the present invention and should not be regarded as limitations of the present invention. The embodiments and features in the embodiments of the present application can be arbitrarily combined with each other without conflict. The protection scope of the present invention shall be the technical solutions recorded in the claims, including the equivalent replacement solutions of the technical features in the technical solutions recorded in the claims. That is, equivalent replacement improvements within this scope are also within the protection scope of the present invention.

Claims

1. A task partitioning real-time power consumption scheduling method based on correlation in an edge computing environment, characterized in that: The steps include: S1, task model, the task set T consists of n real-time tasks, T = {T1, T2, ..., T n }, each task is periodic, preemptible, and interdependent; when tasks involve access to shared resources, mutual exclusion and synchronization are ensured; S2, processor model, the processor platform is a multi-core processor system Π consisting of m ≥ 2 identical multi-processors, that is, Π = {P1, P2, ..., P m }; Multi-core processor systems support dynamic DVFS functionality, which operates at a speed proportional to the supply voltage; S3, access and synchronization, assuming that the shared resources that tasks need to access in the system are represented by R, and multiple tasks are not allowed to access the same shared resource at the same time, that is, tasks need to access in a mutually exclusive manner, and use the MSRP protocol to maintain synchronous access of tasks; S4, task partition energy-saving scheduling, energy-saving partition scheduling algorithm based on task correlation, defines the absolute value of the difference in cost functions between tasks as correlation, and the algorithm allocates tasks with high correlation to the shared resource partition of the same processor; Dual-Speed ​​energy-saving scheduling algorithm based on DVFS technology is used to execute tasks at low speed and then switch to high speed immediately when the task is blocked; The partition scheduling algorithm consists of two steps: S4-1, divides the task set into corresponding partitions according to the characteristics or deadlines of the tasks, and maps them to processors according to their priorities; S4-2, under the premise of meeting the system performance requirements, arrange the divided tasks on each processor according to the existing scheduling algorithm; S5, the associated task partition scheduling algorithm, calculates the ideal optimal utilization of tasks based on the CBTP algorithm Where m represents the number of processor cores. Tasks with high correlation are assigned to the same processor, and the total utilization of the tasks does not exceed 1. S6, processor speed allocation, after the tasks are assigned, the processor is assigned an appropriate execution speed to reduce energy consumption; a dual-speed algorithm is introduced to allow the processor to run at the initial speed and switch to high-speed execution only when there is a task that blocks access to shared resources; the partitioned EDF algorithm is used to schedule tasks, and the derivation of the initial speed SL is based on the feasibility analysis of the EDF algorithm; S7, the dual-speed scheduling algorithm, sets the processor speed to SL and processes the released tasks according to their priorities; when task J i Block high priority jobs τ i When τ is reached, not only the currently blocked job is delayed, but also the subsequent high-priority jobs are indirectly delayed. When blocking occurs, the processor runs at high-speed SH to ensure the timeliness of these delayed high-priority jobs. i That is, the blocked task reaches the deadline or the processor P m idle.

2. According to the method for real-time power consumption scheduling of task partitions based on correlation in edge computing environment in claim 1, it is characterized in that: In S1, each task τ i The properties of T are defined by the five-tuple: i ={e i , f i , t i , p i , d i }; where e i represents the worst execution time WCET of the task; f i is the frequency of execution of the task when accessing shared resources, that is, the number of executions; t i represents the time required for a task to access shared resources during the entire execution period; p i Indicates the minimum time interval for task execution, that is, the cycle; d i It's a task i deadline.

3. The method for real-time power consumption scheduling of task partitions based on correlation in an edge computing environment according to claim 1 is characterized in that: In S2, the maximum and minimum available voltages in the system are given by V max and V min Indicates that the corresponding processor execution speeds are S max and S min ; The processor supports K discrete available speeds; processor power (P), supply voltage (V s The relationship between ) and the clock frequency (f) can be described by the following formula: P=C*f*V s ; (1) Where C is the switch capacitance and the operating frequency f is similar to the processor speed and is roughly proportional to V s Proportional to the supply voltage.

4. The method for real-time power consumption scheduling of task partitions based on correlation in an edge computing environment according to claim 1 is characterized in that: In S3, the synchronization access principles include: When the core P m The current task τ on i When sending an access request to resource R, if the shared resource R is in an idle state, task τ i The shared resource R will be locked and then accessed non-preemptively; otherwise, if the shared resource R is currently occupied and accessed by tasks in other cores, task τ i will be added to the FIFO access queue of resource R and enter core P m The waiting state on the local blocking state B i local ; Once the task τ i Complete the access to the shared resource R, it will unlock the resource R, making R preemptible again; if the current shared resource FIFO queue is not empty, that is, when task τ i When accessing shared resource R, task τ i The shared resource R is also needed, causing the system to be in a global blocking state B i glocal , the head task in the queue τ i Will dequeue and lock resource R for access.

5. The method for real-time power consumption scheduling of task partitions based on correlation in edge computing environment according to claim 1 is characterized in that: In S5, the EDF algorithm is given a set of n independent periodic tasks. If the following conditions are met, EDF can schedule them to make them feasible: According to the task i The worst case execution time is at the maximum processor speed S max = 1; when the processor is running at speed S i Execute task τ i When , its execution time becomes e i / S i , we can draw the following conclusion: given a set of processors with speed S i If the following conditions are met for n independent periodic tasks to be executed, EDF can perform scheduling: According to (2) and (3), it can be obtained that the static processor execution speed of the task can be calculated when no blocking occurs and the energy consumption can be reduced without violating the deadline.

6. The method for real-time power consumption scheduling of task partitions based on correlation in edge computing environment according to claim 5 is characterized in that: In S5, given a set of n independent periodic tasks, if they can be run at the maximum processor speed S max = 1, then they can be scheduled at the initial speed SL of the processor, where: Equation (4) derives the initial speed of the processor without considering the impact of task blocking. When tasks in the system access shared resources, the task blocking effect caused by task synchronization and exclusive access to shared resources must be considered. When a task is not blocked, it is assigned an execution speed: SL. When τ i By lower priority tasks τ j When blocked, the task τ needs to be derived dynamically i High speed SH.

Citation Information

Patent Citations

  • Probability-based task scheduling method for minimizing energy consumption in embedded system

    CN103455131A