
==== Front
Sensors (Basel)
Sensors (Basel)
sensors
Sensors (Basel, Switzerland)
1424-8220
MDPI

10.3390/s24175773
sensors-24-05773
Article
Enhanced Harmonic Partitioned Scheduling of Periodic Real-Time Tasks Based on Slack Analysis
https://orcid.org/0000-0001-6289-1513
Ren Jiankang Conceptualization Methodology Formal analysis Writing – original draft Writing – review & editing Supervision Project administration Funding acquisition 123
Zhang Jun Conceptualization Methodology Software Writing – original draft Writing – review & editing Supervision 4*
https://orcid.org/0000-0003-1029-8923
Li Xu Validation Formal analysis 3
Cao Wei Validation Funding acquisition 3
Li Shengyu Software Investigation 1
Chu Wenxin Investigation 3
Song Chengzhang Visualization 3
Wu Chase Academic Editor
1 School of Computer Science and Technology, Dalian University of Technology, Dalian 116024, China; rjk@dlut.edu.cn (J.R.); lsyanling@mail.dlut.edu.cn (S.L.)
2 Key Laboratory of Social Computing and Cognitive Intelligence, Ministry of Education, Dalian 116024, China
3 School of Computer Science and Technology, Xinjiang Normal University, Urumqi 830054, China; lixu@xjnu.edu.cn (X.L.); cwei@xjnu.edu.cn (W.C.); cwx12112024@163.com (W.C.); songchengzhang2024@163.com (C.S.)
4 Graduate School of Education, Dalian University of Technology, Dalian 116024, China
* Correspondence: junzhang@dlut.edu.cn; Tel.: +86-4118-470-6362
05 9 2024
9 2024
24 17 577301 8 2024
31 8 2024
04 9 2024
© 2024 by the authors.
2024
https://creativecommons.org/licenses/by/4.0/ Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
The adoption of multiprocessor platforms is growing commonplace in Internet of Things (IoT) applications to handle large volumes of sensor data while maintaining real-time performance at a reasonable cost and with low power consumption. Partitioned scheduling is a competitive approach to ensure the temporal constraints of real-time sensor data processing tasks on multiprocessor platforms. However, the problem of partitioning real-time sensor data processing tasks to individual processors is strongly NP-hard, making it crucial to develop efficient partitioning heuristics to achieve high real-time performance. This paper presents an enhanced harmonic partitioned multiprocessor scheduling method for periodic real-time sensor data processing tasks to improve system utilization over the state of the art. Specifically, we introduce a general harmonic index to effectively quantify the harmonicity of a periodic real-time task set. This index is derived by analyzing the variance between the worst-case slack time and the best-case slack time for the lowest-priority task in the task set. Leveraging this harmonic index, we propose two efficient partitioned scheduling methods to optimize the system utilization via strategically allocating the workload among processors by leveraging the task harmonic relationship. Experiments with randomly synthesized task sets demonstrate that our methods significantly surpass existing approaches in terms of schedulability.

Internet of Things
real-time scheduling
partitioned scheduling
multiprocessor systems
periodic real-time tasks
slack analysis
National Natural Science Foundation of China62072067 62466059 61602080 U1808206 61872052 61602084 Shandong Provincial Natural Science FoundationZR2023LZH016 Natural Science Foundation of Xinjiang Uygur Autonomous Region2022D01A228 Xinjiang Network Information Science and Technology Innovation Research Project12421604 Dalian Young Star of Science and Technology Project2021RQ055 Social Science Foundation of Liaoning ProvinceL17CTQ002 Fundamental Research Funds for the Central UniversitiesDUT21JC27 This research was funded by the National Natural Science Foundation of China under Grant Nos. 62072067, 62466059, 61602080, U1808206, 61872052 and 61602084, the Shandong Provincial Natural Science Foundation under Grant No. ZR2023LZH016, the Xinjiang Network Information Science and Technology Innovation Research Project under grant No. 12421604, the Natural Science Foundation of Xinjiang Uygur Autonomous Region under Grant No. 2022D01A228, the Dalian Young Star of Science and Technology Project under Grant No. 2021RQ055, the Social Science Foundation of Liaoning Province under Grant No. L17CTQ002, and the Fundamental Research Funds for the Central Universities under Grant No. DUT21JC27.
==== Body
pmc1. Introduction

In Internet of Things (IoT) applications, sensors are critical components that continuously monitor and collect data from the environment. Generally, the sensor data need to be processed in real time to enable timely responses and actions [1,2,3,4]. With the rapid advancement in multiprocessor technology, multiprocessor platforms have already been widely adopted in IoT applications to handle large volumes of sensor data while maintaining real-time performance at a reasonable cost and with low power consumption [5,6,7,8]. Conversely, partitioned scheduling statically assigns tasks to specific processors, where they execute without migration.In comparison to global scheduling, partitioned scheduling can effectively alleviate the unpredictability of system run-time behaviors through safe isolation between different processors [9]. In most cases, the partitioning approach is generally considered to be the most appropriate solution owing to its simplicity and efficiency when the task set is predetermined and known in advance. Consequently, partitioned scheduling has gained widespread adoption and support in a variety of commercial real-time operating systems for IoT applications [10].

Unfortunately, the task allocation problem in partitioned scheduling is similar to the bin-packing problem, which is recognized as strongly NP-hard [11]. To address the task allocation problem in partitioned scheduling, a rich literature has been developed, and a comprehensive survey can be found in [12,13]. Early research in partitioned multiprocessor scheduling often relied on combining different bin-packing heuristics with task ordering methods for the task allocation [12,13]. However, these approaches disregard the potential impact of some implicit relations among tasks on the schedulability of tasks assigned to a processor [14]. More recently, there has been an increased focus on optimizing processor utilization by exploiting the task period relationship during task partitioning. Much work in this direction is motivated by the observation that the utilization bound of a task set tends to rise as the task periods exhibit greater harmonicity [15]. To optimize the schedulability of the system with periodic real-time tasks by leveraging the task period harmonic relationships, Wang et al. [14] proposed two harmonic-aware partitioned approaches to group tasks with harmonic periods on the same processor. For probabilistic real-time systems, Wang et al. [16] presented four harmonic metrics and a harmonicity-aware partitioning method to optimize system utilization. Their main idea was to assign harmonic tasks to a single processor to enhance the system usage by exploring the harmonic relationship among tasks. Nonetheless, its performance deteriorates when the system includes some heavy-utilization tasks. The main cause of this is the lack of consideration for workload characteristics during task allocation, resulting in a fragmentation issue, where certain tasks cannot be assigned despite the overall processor capacity being relatively high [17]. To address this problem, Ren et al. [17] proposed a workload-aware harmonic partitioned scheduling method for probabilistic multiprocessor real-time systems. For constrained-deadline real-time tasks, Wang et al. [18] introduced two harmonic scheduling methods, GIM and HCM. However, neither GIM nor HCM adequately incorporate the impact of harmonicity and workload characteristic on the task allocation performance. To address this problem, Ren et al. [19] further refined this approach by designing grouping metrics that consider both harmonicity and workload characteristics. These investigations demonstrate that system schedulability can be substantially enhanced compared to traditional bin-packing approaches when task harmonic relationships are effectively utilized. However, these studies quantify the task set harmonicity by measuring the “distance” from an associated harmonic task set with respect to change in density or utilization, and they construct a harmonic counterpart of a task set by scaling periods or deadlines. This harmonicity metric is too tight to effectively quantify the harmonicity of some task sets, limiting the potential improvements in schedulability for some task sets using existing harmonic-partitioned scheduling methods.

In this paper, we propose a more general harmonicity characterization approach based on the slack variation to address the limitations of the existing methods mentioned above. In particular, we propose an exact analysis method for the worst-case slack time and the best-case slack time to derive the harmonic index based on slack variation. With the proposed harmonic index, we present two enhanced harmonic task partitioning algorithms. The first algorithm, named EHAP-SV, focuses on improving the system utilization by leveraging the task harmonic relationships. To tackle the “fragmentation” issue and further enhance the system schedulability, we also propose a workload-aware harmonic partitioning algorithm called WAHP-SV, incorporating both harmonicity and workload characteristics into the scheduling framework.

Contributions. The primary contributions of this work are as follows:A more general harmonic index based on slack variation to effectively quantify the harmonicity degree of a periodic real-time task set;

An exact analysis method for the worst-case slack time and the best-case slack time to derive the slack variation-based harmonic index;

An enhanced harmonic task partitioning scheme to optimize the system utilization by leveraging the harmonic relationships to allocate harmonic tasks to one processor;

A workload-aware harmonic task partitioning scheme by designing a metric integrating the exploration of harmonic relationships and workload characteristics to alleviate the “fragmentation” problem in the pure harmonic task partitioning method.

Experimental evaluation on randomly synthesized task systems demonstrates that our methods surpass existing partitioned scheduling approaches in terms of schedulability.

The remaining sections are structured as follows. Section 2 provides the system model and problem definition. In Section 3, we present the harmonic index based on slack variation and give its calculation method based on slack time analysis. Section 4 presents a detailed description of our proposed enhanced harmonic partitioned scheduling schemes. The experimental evaluation is given in Section 5, and we conclude the paper in Section 6.

2. System Model and Problem Definition

Before presenting the detailed system model, we summarize the major notations used in this paper in Table 1.

Sensors in IoT systems generally generate data at various rates to constantly track and measure some properties, and the processing tasks often have different periods and deadlines. In this paper, we focus on a real-time system in IoT with n independent periodic real-time sensor data processing tasks, represented by Γ = {τ1, …, τn}. These tasks are preemptively scheduled on a multiprocessor platform comprising m identical processors with unit-capacity, indicated as Π= {π1, …, πm}, according to the rate monotonic (RM) policy. We assume a discrete notion of real time t=xθ, x≥0, where θ is both the unit time and the smallest unit of preemption, and all timing values are specified as non-negative integers. For each task τi∈Γ, described by a triple τi=(Ci,Ti,Di), where:Ci represents the worst-case execution time (WCET) of τi;

Ti denotes the inter-arrival time (period) of τi;

Di represents the relative deadline of τi.

All tasks are considered to be implicit-deadline real-time tasks (i.e., Di=Ti). All tasks are assumed to be initially released simultaneously at time t=0. The job of τi is indicated by Ji,k, with its release time represented by ri,k. The WCETs of all tasks are assumed to be strictly positive. The worst-case response time (WCRT) of a task τi, represented by Ri, measures the maximum interval between a job’s release and its completion, taking into account potential interference from other tasks. A task set Γ is considered schedulable if the WCRT of every task τi∈Γ does not exceed the deadline. The hyperperiod of the task set Γ is indicated by HΓ, which is the least common multiple of periods of all tasks in Γ.

We characterize the workload of tasks by using the task utilization.

Definition 1.  The  utilization  of a real-time task τi=(Ci,Ti,Di), denoted as Ui, is expressed as (1) Ui=CiTi.

Definition 2.  The  total utilization  of a real-time task set Γ, indicated as UΓ, is expressed as (2) UΓ=∑τi∈ΓUi.

Definition 3.  Given a set of n independent periodic real-time sets Γ = {τ1, …, τn} and m identical processors Π= {π1, …, πm}, the goal of the  partitioned multiprocessor scheduling problem  is to assign each task in Γ to exactly one processor in Π such that all tasks meet their deadlines while minimizing the overall number of processors utilized.

Note that the task allocation problem in partitioned scheduling is similar to the bin-packing problem, which is recognized as strongly NP-hard [11].

Definition 4  ([11]). Given a bin capacity V and a set of n items x1, …, xn with sizes a1, …, an, the goal of the bin-packing optimization problem is to assign each item to a bin such that the number of bins is minimized and no bin exceeds its capacity V.

Theorem 1.  Given a set of n independent periodic real-time sets Γ = {τ1, …, τn} and m identical processors Π= {π1, …, πm}, the partitioned multiprocessor scheduling problem is NP-hard.

Proof.  To prove that the partitioned multiprocessor scheduling problem is NP-hard, we reduce an instance of the bin-packing problem to an instance of the partitioned multiprocessor scheduling problem.

For each item xi in the bin-packing problem, we create a corresponding task τi with WCET Ci=ai. Let us consider the period and deadline of each task τi to be bin capacity V (i.e., Ti=Di=V). This implies that each task must complete its execution within one period, which corresponds to the capacity of the bin. Each processor in the scheduling problem is considered as a bin in the bin-packing problem. Each processor has a capacity in terms of the total execution time it can handle within the period. Thus, if we can find a valid partitioned multiprocessor schedule for the tasks such that all tasks meet their deadlines, then this corresponds to a valid bin-packing solution, where the number of processors used is equivalent to the number of bins used.

According to [11], the bin-packing problem is NP-hard. Since we can reduce any instance of the bin-packing problem to an instance of the partitioned multiprocessor scheduling problem in polynomial time, and a solution to the scheduling problem would provide a solution to the bin-packing problem, it follows that the partitioned multiprocessor scheduling problem is also NP-hard.    □

To improve the performance of the partitioned scheduling via the harmonic relationship exploration based on the effective harmonicity quantification, we introduce a harmonic index based on slack variation to measure the harmonic characteristic among tasks. In the following, we provide some definitions of slack time.

Definition 5.  For a job Ji,k of a real-time task τi, its  slack time , indicated as Si,k, is defined as the amount of idle time during the interval [ri,k,ri,k+Ti) when all jobs of all tasks always experience worst-case execution times.

Definition 6.  The  worst-case slack time  of a real-time task τi, indicated as SiW, is defined as (3) SiW=infkSi,k.

Definition 7.  The  best-case slack time  of a real-time task τi, indicated as SiB, is expressed as (4) SiB=supkSi,k.

The primary aim of this research is to develop an efficient task partitioning method, ensuring that each processor’s assigned set of tasks is schedulable while minimizing the overall number of processors utilized. We analyze the drawbacks of the current harmonic index for harmonicity-aware partitioning schemes with an example, and introduce a novel harmonic index based on slack variation to guide the task partition. With the proposed harmonic index, we devise two efficient partitioned scheduling schemes to enhance system utilization through efficiently leveraging the task harmonic relationship.

3. Harmonicity Quantification Based on Slack Analysis

To enhance the performance of the partitioned scheduling via the harmonic relationship exploration based on the effective harmonicity quantification, we propose a slack variation-based harmonic index to guide the task partition. In this section, we first illustrate the motivation behind the slack variation-based harmonic index through an example to highlight the drawbacks of the utilization change-based harmonic index. We then provide a comprehensive explanation of our harmonic index based on slack variation. Additionally, we also present an exact analysis method to determine the worst-case and best-case slack times, which are utilized to calculate the harmonic index based on slack variation.

3.1. Motivations

In order to optimize task partition by exploring harmonic relationships, it is crucial to quantify the task set harmonicity degree, as not all tasks are strictly harmonic. Fan et  al. [14] presented a task set harmonic index through measuring the “distance” between a task set and the corresponding harmonic task set with regard to the total utilization change. However, such a harmonic index is too tight to effectively quantify the degree of harmonic for certain task sets, thereby limiting the potential improvement in the schedulability through the harmonic relationship exploration with this index. Here, we first discuss the shortcomings of the existing harmonic index, and then, introduce our proposed harmonic index based on slack variation.

Definition 8  ([14]). For a task set Γ={τ1,…,τn}, where τi=(Ci,Ti,Di), we define a new task set Γ′={τ1′,…,τn′}, where τi′=(Ci,Ti′,Di′), Ti′≤Ti, Di′=Ti′, and for any two tasks τi′ and τj′, if Ti′<Tj′, then Tj′ is an integer multiple of Ti′. This new task set Γ′ is referred to as a sub-harmonic task set of task set Γ.

Definition 9  ([14]). Given a sub-harmonic task set Γ′ of task set Γ, we define task set Γ′ as the primary harmonic task set of task set Γ when there is no other sub-harmonic task set Γ″, such that Ti′≤Ti″ for all i where 1≤i≤n.

According to [15], we can derive Theorem 2.

Theorem 2  ([15]). Given a primary harmonic task set Γ′ of task set Γ, Γ is schedulable on a uniprocessor under the RM policy when UΓ′≤1.

Definition 10  ([14]). For a task set Γ, let G(Γ) be all primary harmonic task sets of task set Γ. The utilization change-based harmonic index of task set Γ, indicated as Huc(Γ), is expressed as (5) Huc(Γ)=minΓ′∈G(Γ)UΓ′−UΓ.

From Equation (5), we can observe that Huc is characterized as the minimum “distance” between a task set and its primary harmonic task sets with regard to the change in total utilization. We can also see that a low value of Huc indicates a high harmonic relationship, and a task set Γ is strictly “harmonic” exactly when Huc(Γ)=0. For primary harmonic task sets, they can be obtained with the Sr or DCT algorithms in [15]. However, the original intention of the primary harmonic task set is to improve the schedulability analysis of the RM scheduling strategy, and it considers a task set to be strictly harmonic exactly when every pair of tasks in the task set are strictly harmonic. This leads to inaccurate quantification of the harmonicity of some task sets from the perspective of system resource utilization, and we illustrate this issue with an example.

Example 1.  Let us consider a task set Γ={τ1,τ2,τ3}, as given in Table 2, executed on a uniprocessor under the RM scheduling policy. Here, Ti′ represents the period of the task corresponding to task τi in a primary harmonic task set Γ′ of Γ, ensuring that UΓ′−UΓ is minimized. We can find that UΓ=1/2+1/3+1/6=1 and UΓ′=2/3+1/3+1/6=7/6, and thus, Huc(Γ)=7/6−1=1/6. Therefore, Γ is not strictly "harmonic" based on the definition of the harmonic index Huc. However, according to the simulation of the synchronous arrival sequence (SAS) for all tasks in Γ in Figure 1, it is evident that Γ is schedulable. Moreover, the utilization of Γ is 1, and thus, Γ can be regarded as strictly “harmonic” from the perspective of system resource utilization because the maximum utilization is achieved. Therefore, the harmonic index Huc is not able to effectively quantify the harmonicity degree of Γ due to its tight restriction. This leads to the harmonic partitioned scheduling method based on Huc not offering good performance for some task sets (see Example 3). In the following section, we give a more general harmonic index based on slack variation, which can effectively quantify the harmonicity of task set Γ (see Example 2).

3.2. Harmonic Index Based on Slack Variation

As indicated in Example 1, the utilization change-based harmonic index cannot effectively quantify the harmonicity of some task sets from the perspective of system resource utilization. Now, we first discuss the property of the schedulable task set that can achieve maximum utilization; thus, we can shed some light on the design of our proposed harmonic index based on slack variation.

Lemma 1.  Consider a schedulable task set Γ={τ1,…,τn} with UΓ=1 on a uniprocessor under the rate monotonic (RM) policy. Here, tasks in Γ are sorted in decreasing priority and their WCETs are greater than 0. Then, the WCRT Rn of τn equals its period Tn, that is, Rn=Tn.

Proof.  Since tasks in task set Γ are ordered in decreasing priority, task τn has the lowest priority and T1≤T2≤…≤Tn. Since UΓ=1, we can obtain (6) C1T1+C2T2+…+CnTn=1.

Thus, we can obtain (7) ∑1≤i≤n−1Tn∗CiTi+Cn=Tn.

Based on [20], the WCRT Rn satisfies the following equation: (8) Rn=∑1≤i≤n−1RnTi∗Ci+Cn.

Because the task set Γ is schedulable, we have Rn=Tn−δ, where δ≥0. Therefore, with Equations (7) and (8), we have (9) Tn−δ=∑1≤i≤n−1Tn−δTi∗Ci+Cn≥∑1≤i≤n−1Tn−δTi∗Ci+Cn=Tn−δ∗∑1≤i≤n−1CiTi.

By Equation (9), we have (10) δ∗1−∑1≤i≤n−1CiTi≤0.

With Equations (6) and (10), we have (11) δ∗CnTn≤0.

Since the WCETs of all tasks are greater than 0 and δ≥0, by Equation (11), we have δ=0. Therefore, the worst-case response time Rn is equal to its period Tn.    □

Based on Lemma 1, for a schedulable task set Γ={τ1,…,τn} with UΓ=1 on a uniprocessor under the RM policy, we can obtain the relationship between the period of task τn and the periods of tasks with higher priorities than task τn (i.e., Lemma 2).

Lemma 2.  Consider a schedulable task set Γ={τ1,…,τn} with UΓ=1 on a uniprocessor under the rate monotonic (RM) policy. Here, tasks in Γ are sorted in descending priority and their WCETs are greater than 0. Then, the period Tn of task τn is a common multiple of periods of all higher-priority tasks τi for 1≤i≤n−1.

Proof.  By Lemma 1 and Equation (8), we have (12) Tn=∑1≤i≤n−1TnTi∗Ci+Cn.

By Equations (7) and (12), we have (13) ∑1≤i≤n−1TnTi−TnTi∗Ci=0.

Since the WCETs of all tasks are greater than 0, by Equation (13), we have ⌈Tn/Ti⌉=Tn/Ti for each task τi. Therefore, the period Tn of task τn is a common multiple of periods of all higher-priority tasks τi for 1≤i≤n−1.   □

Theorem 3.  Consider a schedulable task set Γ={τ1,…,τn} with UΓ=1 on a uniprocessor under the rate monotonic (RM) policy. Here, tasks in Γ are sorted in decreasing priority and their WCETs are greater than 0. The worst-case slack time SnW of τn equals its best-case slack time SnB, i.e., SnW=SnS.

Proof.  According to Lemma 2, the period Tn of task τn is a common multiple of periods of all higher-priority tasks τi (1≤i≤n−1). Moreover, because task τn is the lowest-priority task in Γ, its period Tn equals the hyperperiod of Γ (i.e., Tn=HΓ). Since all tasks in Γ are initially released at the same time, each job Jn,k of task τn will be released concurrently with a job of every higher-priority task τi (1≤i≤n−1). Therefore, all jobs of task τn have the same slack times, and thus, the worst-case slack time SnW of τn equals its best-case slack time SnB.   □

From Theorem 3, we can find that for a schedulable task set under RM scheduling policy that achieves maximum utilization (i.e., 1), all jobs of the lowest-priority task share the same slack times (i.e., the worst-case slack time is equal to the best-case slack time). On the basis of this observation, we introduce the harmonic index based on the slack variation as follows.

Definition 11.  Consider a schedulable task set Γ={τ1,…,τn} on a uniprocessor under the rate monotonic (RM) policy. Here, tasks in Γ are sorted in decreasing priority. The  slack variation-based harmonic index  of the task set Γ, indicated as Hslack(Γ), is expressed as (14) Hslack(Γ)=SnB−SnWTn.

where SnB and SnW are the best-case and worst-case slack times of τn, respectively.

A low value of Hslack implies a high harmonicity degree, and the task set Γ is “harmonic” if Hslack(Γ)=0. When Hslack(Γ)>0, the index Hslack(Γ) can be viewed as a measure of processor resource waste when the lowest-priority task achieves the largest schedulable WCET, since the worst-case situation (i.e., the case where a job of the task experiences its WCET) should be considered for the schedulability analysis. Therefore, a higher utilization can be attained by assigning tasks with a lower slack variation-based harmonic index to the same processor to balance the slack time.

Example 2.  Let us consider task set Γ as depicted in Table 2 again. From Figure 1, we can find that the Γ is schedulable on a uniprocessor, and S3W=S3B=1 for the lowest-priority task τ3. Thus, we can obtain Hslack(Γ)=0. Therefore, Γ is strictly harmonic according to the slack variation-based harmonic index. Consider the sub-task set Γsub={τ1,τ2}⊂Γ. For the lowest-priority task τ2 in Γsub, S2W=1 and S2B=2, and thus, Hslack(Γsub)=(2−1)/3=1/3>0. Therefore, the task set Γsub is not harmonic according to the harmonic index based on slack variation. Note that for the task set Γsub, task τ2 achieves the largest schedulable WCET even though there is still some slack for some jobs (e.g., jobs J2,2 and J2,4), since the worst-case scenarios (i.e., jobs J2,1 and J2,3) should be considered for the schedulability analysis.

Corollary 1.  Consider a schedulable task set Γ={τ1,…,τn} on a uniprocessor under the rate monotonic (RM) policy, where the WCETs of all tasks are greater than 0. If the utilization change-based harmonic index Huc(Γ)=0, then the slack variation-based harmonic index Hslack(Γ)=0.

Proof.  Suppose that tasks in Γ are sorted in decreasing priority under the RM policy, and thus, T1≤T2≤…≤Tn. Since Huc(Γ)=0, Tj is an exact multiple of Ti for any two tasks τi and τj in the task set Γ if Ti≤Tj. Hence, Tn is divisible by Ti for any task τi∈Γ, and thus, Tn is a common multiple of periods of all higher-priority tasks τi for 1≤i≤n−1. Therefore, similar to the proof for Theorem 3, we can obtain that the worst-case slack time SnW of task τn equals its best-case slack time SnB. Thus, we can obtain Hslack(Γ)=0.    □

Note that a strictly harmonic task set (e.g., task set Γ depicted in Table 2) according to harmonic index Hslack may not be strictly harmonic according to the harmonic index Huc (see Examples 1 and 2). Thus, from Corollary 1, we can find that a strictly harmonic task set according to the harmonic index Huc is just a special case of a strictly harmonic task set according to the harmonic index Hslack. Therefore, the harmonic index Hslack is more general than the harmonic index Huc, and it can more effectively quantify the harmonicity.

3.3. Slack Time Analysis

In order to calculate the slack variation-based harmonic index Hslack for a task set Γ, we should analyze the worst-case and best-case slack times for the lowest-priority task in Γ. Now, we first identify the job of a task that experiences the worst-case slack time with Theorem 4.

Theorem 4.  A job of a task experiences the worst-case slack time when it is released simultaneously with the jobs of all higher-priority tasks.

Proof.  Consider a task set {τ1,…,τn} ordered in decreasing priority under the RM policy. Let Jn,k be a job of task τn that is released at t1 (i.e., rn,k=t1). As illustrated in Figure 2, we consider that the jobs of a higher-priority task τi (1≤i≤n−1) are released at t2,t2+Ti,t2+2Ti,…,t2+lTi during the interval [t1,t1+Tn). From Figure 2, we can find that shifting the instance release time t2 of task τi forward does not increase the slack time for job Jn,k until t2=t1. Therefore, the slack time for job Jn,k will be minimized when t2 coincides with t1. The theorem can be proved by repeating this argument for all higher-priority tasks τi (1≤i≤n−1).    □

Similarly, we can identify the job of a task that experiences the best-case slack time with the following theorem.

Theorem 5.  A job of a task experiences the best-case slack time whenever its succeeding job is released concurrently with the jobs of all tasks with higher priorities.

Proof.  Let {τ1,…,τn} be a task set ordered in decreasing priority under the RM policy. Consider a job Jn,k of τn that is released at t1−Tn and its succeeding job Jn,k+1 is released at t1 (i.e., rn,k=t1−Tn and rn,k+1=t1). As illustrated in Figure 3, we consider that the earliest job of a higher-priority task τi (1≤i≤n−1) released not before t1 is released at t2 (i.e., t1≤t2). From Figure 3, we can find that shifting the instance release time t2 of task τi forward does not reduce the slack time for job Jn,k until t2=t1. Therefore, the slack time for job Jn,k will be maximized when t2 coincides with t1. The theorem can be proved by repeating this argument successively for all higher-priority tasks τi (1≤i≤n−1).    □

Before giving the calculation method for the worst-case slack time and the best-case slack time, we first introduce some definitions about the level-i active period given in [21].

For a task τi, its pending load PLi(t) refers to the processing workload that must be finished by time t for the jobs with priorities equal to or higher than that of task τi that are activated before t. A level-i active period is defined as the time interval [ts,te) which meets the conditions PLi(ts)=0, PLi(te)=0, and PLi(t)>0 for every time t∈(ts,te). According to [21], for fixed-priority real-time systems, the worst-case duration WLi of a level-i active period is the minimum positive real number x∈R+ that satisfies the condition (15) x=∑1≤j≤ixTj∗Cj.

Note that we can obtain WLi through an iterative process for Equation (15), beginning with a lower bound.

Theorem 6.  Consider a schedulable task set Γ={τ1,…,τn} on a uniprocessor under the rate monotonic (RM) policy. Here, tasks in Γ are ordered in decreasing priority. Let JnW be a job of task τn released concurrently with the jobs of all tasks with higher priorities, and let rnW denote its release time. Let rnW+tend be the end time of the available slack for job JnW during the interval [rnW,rnW+Tn). Then, the amount of available slack time for JnW can be formulated as (16) SnW=tend−∑i<ntendTi∗Ci.

Proof.  Suppose that JnW is released concurrently with the jobs of all tasks with higher priorities at time t1. According to Theorem 4, job JnW will experience the worst-case slack time. Figure 4 shows the workload of higher-priority tasks τi (i<n) during [rnW,rnW+Tn). Since rnW+tend is the end time of the available slack for job JnW during the interval [rnW,rnW+Tn), from Figure 4, we can observe that all the higher-priority jobs released no later than rnW+tend are completed before rnW+tendW, and there is no available slack for JnW during the interval [rnW+tend,rnW+Tn). Furthermore, because job JnW is released concurrently with the jobs of all tasks with higher priorities, for each highest-priority task τi (i<n), the count of jobs that need to be executed during the interval [rnW,rnW+tendW) is ⌈tend/Ti⌉. Thus, the workload of tasks with higher priorities during the interval [rnW,rnW+tendW) is ∑i<n⌈tend/Ti⌉∗Ci. Therefore, the amount of available slack for job JnW can be obtained with Equation (16).   □

According to Theorem 6, we can obtain the worst-case slack time of τn through searching time tend for job JnW. Since all tasks are released at the same time t=0 in the beginning, we can consider rnW=0 for job JnW. Given the worst-case length WLn−1 of a level-n−1 active period, there must be some slack for job JnW during the interval [Tn−WLn−1,Tn). Therefore, tend for job JnW can be expressed as follows:(17) tend=argmaxt∈[Tn−WLn−1,Tn]t−∑i<ntTi∗Ci.

Since tend is the end time of the last available slack for job JnW with rnW=0 during the interval [0,Tn), a higher-priority task must be invoked at time tend. Therefore, the search space for tend can be reduced to the invoking points of higher-priority tasks during the interval [Tn−WLn−1,Tn). Let VnW denote the search space for tend; it can be expressed as follows:(18) VnW=∪i<nTn−l∗Tifor allTn−WLn−1Ti≤l≤TnTi.

By Equations (17) and (18), the worst-case slack time SnW of τn can be obtained by (19) SnW=maxt∈VnWt−∑i<ntTi∗Ci.

Based on Equation (18), the exact worst-case slack time of the lowest-priority task in a task set can be obtained in pseud-polynomial complexity with Equation (19), i.e., Lemma 3.

Lemma 3.  Consider a schedulable task set Γ={τ1,…,τn} on a uniprocessor under the rate monotonic (RM) policy. Here, tasks in Γ are ordered in decreasing priority. We can obtain the exact worst-case slack time of task τn with the computational complexity O(n∗Tn/T1).

Theorem 7.  Consider a schedulable task set Γ={τ1,τ2,…,τn} on a uniprocessor under the rate monotonic (RM) policy. Here, tasks in Γ are ordered in decreasing priority. Let JnB be a job of task τn whose succeeding job is released concurrently with the jobs of all tasks with higher priorities, and the release time of job JnB is denoted as rnB. Let rnB−tend be the end time of the last available slack for job JnB not later than rnB. Then, the amount of available slack time for JnB can be expressed as follows: (20) SnB=Tn+tend−∑i<nTn+tendTi∗Ci.

Proof.  Suppose that JnB is released at time t1 and its succeeding job is released simultaneously with the jobs of all tasks with higher priorities at time t1+Tn. According to Theorem 5, job JnB will experience the best-case slack time for the task τn. Figure 5 gives the workload of higher-priority tasks τi (i<n) during [rnB−tend,rnB+Tn). Since rnB−tend is the end time of the last available slack for job JnB not later than rnB, from Figure 5, we can observe that the jobs of all tasks with higher priorities released not later than rnB−tend are finished before time rnB−tend and there is no available slack for JnB during the interval [rnB−tend,rnB). Moreover, because the succeeding job of JnB is released concurrently with the jobs of all tasks with higher priorities, for each higher-priority task τi (i<n), the number of jobs that need to be executed during the interval [rnB−tend,rnB+Tn) is ⌊(Tn+tend)/Ti⌋. Hence, the workload of the higher-priority tasks during [rnB,rnB+Tn) is ∑i<n⌊(Tn+tend)/Ti⌋∗Ci−tend. Therefore, the amount of available slack for JnB can be expressed with Equation (20).   □

Similar to the worst-case slack time analysis of τn, tend for job JnB can be expressed as (21) tend=argmint∈VnBTn+t−∑i<nTn+tTi∗Ci.

where VnB is the search space for tend of job JnB, and it can be expressed as (22) VnB=∪i<nl∗Ti−Tnfor allTnTi≤l≤Tn+WLn−1Ti.

From Equation (21), we can obtain the best-case slack time SnB for task τn as (23) SnB=mint∈VnBTn+t−∑i<nTn+tTi∗Ci.

Based on Equation (22), the exact best-case slack time for the lowest-priority task in a task set can be obtained in pseudo-polynomial complexity with Equation (23), i.e., Lemma 4.

Lemma 4.  Consider a schedulable task set Γ={τ1,…,τn} on a uniprocessor under the rate monotonic (RM) policy. Here, tasks in Γ are ordered in decreasing priority. We can obtain the exact best-case slack time of τn with the computational complexity O(n∗Tn/T1).

By the definition of the slack variation-based harmonic index (i.e., Equation (14)), we can derive Theorem 8 by using Lemmas 3 and 4.

Theorem 8.  Consider a schedulable task set Γ={τ1,…,τn} on a uniprocessor under rate monotonic (RM) policy. Here, tasks in Γ are ordered in decreasing priority. The slack variation-based harmonic index of Γ can be derived with the computational complexity O(n∗Tn/T1).

4. Enhanced Harmonic Task Partitioning

With the slack variation-based harmonic index, we propose two efficient partitioned scheduling algorithms to improve the system utilization via strategically allocating the workload among processors by leveraging the task harmonic relationship. In the following, we first introduce an algorithm (named EHAP-SV) to optimize the system usage by identifying tasks with high harmonicity and grouping them into a single processor. However, the EHAP-SV algorithm suffers from the “fragmentation” problem as it does not consider some workload characteristics in the task allocation. To address this issue, we present the WAHP-SV algorithm, a workload-aware harmonic partitioning method. WAHP-SV incorporates both harmonicity and workload characteristics into the scheduling approach to address the “fragmentation” issue in the EHAP-SV algorithm.

4.1. Harmonic Partitioning Based on Slack Analysis

Before presenting our harmonic-aware partitioning method, let us discuss the limitations of the current harmonicity-aware partitioning approach using an example. In [14], a harmonicity-aware task partitioning algorithm (named HAPS) is proposed. HAPS measures the harmonicity degree of a task set by using the utilization change-based harmonic index and allocates harmonic tasks to an identical processor. It has been demonstrated that HAPS outperforms traditional bin-packing approaches. However, HAPS cannot optimize the schedulability of certain task sets, since the harmonic index used by HAPS is too tight to effectively quantify the harmonicity of some task sets (see Example 1). In the following, we will illustrate the effect of the inaccurate harmonicity quantification on the harmonicity-aware task partitioning with an example.

Example 3.  Let us consider a task set Γ={τ1,τ2,τ3,τ4,τ5}, given in Table 3, to be executed on processors Π={π1,π2} under RM policy. When the HAPS strategy is employed to partition this task set, HAPS considers that tasks τ1, τ2, and τ3 are not harmonic, and it partitions all tasks into three groups, {τ1,τ4}, {τ3,τ5}, {τ2}, one by one. This implies that HAPS requires three processors to schedule Γ. Hence, HAPS fails to partition Γ for processors π1 and π2, even though a high overall capacity is still available on processors π1 and π2. This is primarily because the harmonic index used by HAPS is too tight to effectively quantify the harmonicity of task set {τ1,τ2,τ3} from the perspective of the system utilization. In the following, we propose a feasible partitioning method for Γ. This strategy considers the harmonicity characteristic through slack analysis during task deployment, thereby enhancing system utilization (refer to Example 4).

To enhance the processor utilization through efficient harmonic-aware partitioning based on effective harmonicity quantification, we propose an enhanced harmonic-aware partitioning algorithm using the slack variation-based harmonic index (named EHAP-SV). In EHAP-SV, some candidate subsets are generated first by identifying the harmonic tasks with the slack variation-based harmonic index. Then, the highest utilization subset is picked for assignment to a processor to enhance system utilization.

The EHAP-SV algorithm is given in Algorithm 1. It begins by initializing the required processor number k to zero, and then, proceeds to allocate tasks group by group by using the slack variation-based harmonic index (lines 3–42). Every task τi∈Γ is considered to be the host task in a sub-task set Γisub (line 5), and remaining tasks are picked to be added to Γisub until all feasible tasks have been exhausted (lines 6–30). To ensure the schedulability of the assigned task sets, a schedulability analysis can be performed using the efficient exact schedulability test approach proposed in [22]. During the generation of the sub-task set Γisub, the feasible task with the minimum harmonic index is selected first (lines 14–17). For multiple feasible tasks with a minimum harmonic index, the task with higher utilization is selected first (lines 18–20). After all subsets are generated, the subsets with the highest utilization are selected and assigned to a core (lines 32–40). Then, these tasks are deleted from Γ (line 41). This process is iterated for the remaining tasks in task set Γ until all tasks have been allocated to processors.

Theorem 9.  For a task set Γ={τ1,…,τn}, if EHAP-SV partitions it onto m processors Π={π1,…,πm} with success and schedules it under the RM scheduling policy, all tasks in Γ can satisfy their deadlines.

Proof.  Let us take processor πj∈Π and its assigned task set Γ(πj) into consideration. As indicated in line 12 in Algorithm 1, it is schedulable for Γ(πj) to be executed on processor πj according to RM scheduling policy. This implies that the task set assigned to each processor is schedulable.    □

From Theorem 9, we can conclude that the task allocation produced by EHAP-SV consistently guarantees that all tasks in Γ meet their deadlines. Algorithm 1 EHAP-SV algorithm.	
Input:  Task set Γ={τ1,…,τn}, multiprocessor platform Π.

Output:  Task partitions {Γ(π1),…,Γ(πk)}.

Goal:  To partition task set Γ on multiprocessor platform Π.

  1: k←0

  2: while  Γ≠∅  do

  3:    k←k+1

  4:    for each task τi∈Γ do

  5:      Γisub←{τi}

  6:      Γuntest←Γ∖{τi}

  7:      while Γuntest≠∅ do

  8:         τselected←NIL

  9:         Uselected←0

10:         Hmin←1

11:         for each task τj∈Γuntest do

12:           if It is feasible for Γisub∪{τj} then

13:              Hj←Hslack(Γisub∪{τj})

14:              if Hmin>Hj then

15:                Hmin←Hj

16:                τselected←τj

17:                Uselected←Uj

18:              else if Hmin=Hj and Uselected<Uj

19:                τselected←τj then

20:                Uselected←Uj

21:              end if

22:           else

23:              Γuntest←Γuntest∖{τj}

24:           end if

25:         end for

26:         if τselected≠NIL then

27:           Γisub←Γisub∪{τselected}

28:           Γuntest←Γuntest∖{τselected}

29:         end if

30:      end while

31:    end for

32:    Γselected←∅

33:    Umax←0

34:    for each task τi∈Γ do

35:      if Umax<UΓisub then

36:         Γselected←Γisub

37:         Umax←UΓisub

38:      end if

39:    end for

40:    Γ(πk)←Γselected

41:    Γ←Γ∖Γselected

42: end while

	

From Algorithm 1, it is evident that the computational complexity of the EHAP-SV algorithm is primarily influenced by the feasibility test’s complexity, the complexity of computing the harmonic index based on slack variation, and the task set size. The feasibility tests can be achieved in pseudo-polynomial time with the WCRT analysis using the iterative technique [22]. In addition, from Theorem 8, we can obtain that the calculation of the slack variation-based harmonic index also exhibits pseudo-polynomial time complexity. Therefore, we can conclude that the EHAP-SV algorithm’s time complexity is pseudo-polynomial.

Example 4.  Let us consider the task set Γ given in Table 3 once again. As illustrated in Figure 6, it is the task partitioning process for Γ using EHAP-SV. We can see that EHAP-SV partitions all tasks in two groups, {τ1,τ2,τ3} and {τ4,τ5}, one by one. Consequently, EHAP-SV can allocate the task set Γ to two processors by effectively exploring the harmonic relationship based on its effective harmonicity quantification.

4.2. Workload-Aware Harmonic Partitioning

The EHAP-SV method can optimize system usage by leveraging the harmonic relationship to assign harmonic tasks to the same processor. However, it may face performance degradation when dealing with heavy-utilization tasks, as it does not consider certain workload characteristics during the task allocation. To address this issue, we design a metric that combines harmonic relationship exploration with workload awareness to guide task allocation, and design a workload-aware harmonic task partitioning method (named WAHP-SV).

Algorithm 2 gives the WAHP-SV algorithm. Unlike EHAP-SV, we introduce a new metric, denoted as νj, for each task τj. This metric is employed for determining tasks that exhibit both high harmonicity and high workload for generating candidate subsets in WAHP-SV. For a sub-task set Γisub and a task τj, the metric νj is defined by (24) νj=Uj−Hslack(Γisub∪{τj}).

where Uj is the utilization of task τj and it is used for workload awareness. Hslack(Γisub∪{τj}) is a measure of the harmonicity for task set Γisub∪{τj} and it is used for harmonic awareness. In the task assignment, the tasks with higher νj are prioritized (lines 13–15).

Theorem 10.  For a task set Γ, if WAHP-SV successfully partitions it onto m processors Π={π1,…,πm} and schedules it under the RM scheduling policy, all tasks in Γ can satisfy their deadlines.

Proof.  Let us take processor πj∈Π and its assigned task set Γ(πj) into consideration. As indicated in line 11 in Algorithm 2, it is feasible for Γ(πj) to be executed on processor πj under the RM policy. This indicates that it is schedulable for the task set on each processor.    □

From Theorem 10, we can conclude that the task allocation produced by WAHP-SV consistently guarantees that all tasks in Γ meet their deadlines.

From Algorithm 2, it is evident that the time complexity of the WAHP-SV algorithm is identical to that of the EHAP-SV algorithm. Thus, the time complexity of the WAHP-SV algorithm is also pseudo-polynomial.

It is worth noting that WAHP-SV can also partition the task set Γ given in Table 3 for two processors. Furthermore, the experimental evaluation demonstrates that WAHP-SV outperforms EHAP-SV in terms of schedulability, attributed to its ability to be aware of workload and explore harmonic relationships. Algorithm 2 WAHP-SV algorithm.	
Input:  Task set Γ={τ1,…,τn}, multiprocessor platform Π.

Output:  Task partitions {Γ(π1),…,Γ(πk)}.

Goal:  To partition task set Γ on multiprocessor platform Π.

  1: k←0

  2: while  Γ≠∅  do

  3:    k←k+1

  4:    for each task τi∈Γ do

  5:      Γisub←{τi}

  6:      Γuntest←Γ∖{τi}

  7:      while Γuntest≠∅ do

  8:         τselected←NIL

  9:         νmax←0

10:         for each task τj∈Γuntest do

11:           if It is feasible for Γisub∪{τj} then

12:              νj←Uj−Hslack(Γisub∪{τj})

13:              if νmax<νj then

14:                τselected←τj

15:                νmax←νj

16:              end if

17:           else

18:              Γuntest←Γuntest∖{τj}

19:           end if

20:         end for

21:         if τselected≠NIL then

22:           Γisub←Γisub∪{τselected}

23:           Γuntest←Γuntest∖{τselected}

24:         end if

25:      end while

26:    end for

27:    Γselected←∅

28:    Umax←0

29:    for each task τi∈Γ do

30:      if Umax<UΓisub then

31:         Γselected←Γisub

32:         Umax←UΓisub

33:      end if

34:    end for

35:    Γ(πk)←Γselected

36:    Γ←Γ∖Γselected

37: end while

	

5. Experimental Evaluation

To assess the effectiveness of our enhanced harmonic task partitioning methods, we implemented eight algorithms in the experiment, which are listed below:BFDU: an extension of the best-fit (BF) strategy, where tasks are ordered in decreasing utilization;

WFDU: an extension of the worst-fit (WF) strategy, where tasks are ordered in decreasing utilization;

FFDU: an extension of the first-fit (FF) strategy, where tasks are ordered in decreasing utilization;

PSER: a harmonic partition scheduling algorithm based on the period scaling from [14];

HAPS: a harmonic partition scheduling algorithm with the harmonic index based on utilization change from [14];

ENSE: an ensemble method of BFDU, WFDU, FFDU, PSER, and HAPS;

EHAP-SV: our enhanced harmonic partition scheduling algorithm with harmonic index based on slack variation;

WAHP-SV: our workload-aware harmonic partition scheduling algorithm with harmonic index based on slack variation.

Objectives. Our evaluation has two primary goals: to compare the performance of our enhanced harmonic task partitioning algorithms with existing algorithms regarding schedulability; and to evaluate the required number of processors for different partition approaches.

5.1. Workload

To evaluate the performance of various methods in relation to system utilization, we synthesized two types of task sets (i.e., light task sets and general task sets) by the UUniFast approach from [23]. For the light task sets, task utilization is uniformly distributed within [0, 0.5], and for general task sets, task utilization is evenly distributed within [0, 1]. The task period is evenly distributed within [100, 1000]. For a task set Γ, we define its normalized utilization Unor(Γ) as (25) Unor(Γ)=UΓm.

where m is the processor number and UΓ is the utilization of Γ. We consider three values for m: 4, 8, and 16.

With the above parameters, we created task sets with normalized utilization Unor ranging from 0.7 to 0.975 with an increment of 0.025. We synthesized 1000 task sets for each Unor.

5.2. Results

Schedulability. Figure 7 and Figure 8 illustrate the schedulable task set fraction plotted against the normalized system utilization in systems with 4 processors, 8 processors, and 16 processors for light task sets and general task sets, respectively.

We make several observations regarding the performance of the existing algorithms. First, HAPS consistently outperforms BFDU, WFDU, FFDU, and PSER in most cases. This is because HAPS can take advantage of harmonics to enhance the schedulability of the system by taking into account both the period and utilization of each task in the quantification of harmonicity, while BFDU, WFDU, and FFDU overlook the effect of harmonic relationship exploration on the system schedulability and PSER only considers the relationship among periods of tasks in the harmonicity quantification. Second, BFDU, WFDU, and FFDU outperform PSER in the systems with four and eight processors for all types of task sets. This is because BFDU, WFDU, and FFDU can enhance the system schedulability by leveraging the task workload characteristic, especially for the general task sets with some heavy tasks. Third, the schedulability enhancement of BFDU, WFDU, and FFDU over PSER is reduced as the processor number rises, and they perform worse than PSER for 16-processor systems. This can be attributed to the fact that with more processors there are more tasks in a task set, providing more chances for PSER to enhance system schedulability by exploiting the task period relationships.

Our primary result is that EHAP-SV and WAHP-SV consistently outperform all existing partitioned scheduling methods owing to the effective harmonicity quantification of the slack variation-based harmonic index. Note that EHAP-SV and WAHP-SV also always outperform the ensemble method (i.e., ENSE) of BFDU, WFDU, FFDU, PSER, and HAPS. This demonstrates that EHAP-SV and WAHP-SV can find additional schedulable task sets that have not been found so far with existing methods. The performance enhancement grows with increasing processor number, depicting the scalability of EHAP-SV and WAHP-SV. For 16-processor systems, when the system utilization is 0.975, WAHP-SV schedules about 21.9% and 33.2% of task sets for light task sets and general task sets, respectively, while all existing methods schedule almost none of them. Even without workload awareness, for general task sets, when the system utilization is 0.95, the performance improvement of EHAP-SV over the ensemble method ENSE due to the effective harmonic quantification is as much as 48.3% in a four-processor system and 152.9% in an eight-processor system. In addition, we can also see that WAHP-SV always outperforms EHAP-SV in all test cases, and the schedulability improvement of WAHP-SV over EHAP-SV becomes more significant as the task set utilization increases, especially for general task sets. As system utilization increases, tasks with higher utilization are prone to be part of a general task set, and WAHP-SV can significantly improve the partitioning of such task sets through workload awareness. In particular, when system utilization is 0.95 in four-processor systems, the schedulable ratio achieved by WAHP-SV is nearly double that of EHAP-SV.

Number of processors. Figure 9 and Figure 10 illustrate the relationship between the required processor number and normalized system utilization for systems with 4, 8, and 16 processors for light task sets and general task sets, respectively.

From the experimental results, we can observe that both EHAP-SV and WAHP-SV outperform all existing methods including the ensemble method ENSE in most test cases. This can be attributed to the fact that EHAP-SV and WAHP-SV enhance the performance through efficient exploration of harmonic relationships based on effective quantification of harmonicity. The results also demonstrate that WAHP-SV outperforms EHAP-SV in some test cases, owing to its effective integration of harmonic relationship exploration and workload awareness. Additionally, we can observe that WAHP-SV can save up to one processor compared to the non-harmonic partitioned scheduling approaches (i.e., BFDU, WFDU, and FFDU) in 8-processor system and 16-processor systems for both light and general task sets.

6. Conclusions and Future Work

As one of the primary approaches in multiprocessor scheduling, partitioned scheduling has been widely accepted in both academic and industrial fields of IoT to efficiently process substantial streams of sensor-generated data while maintaining real-time performance. In this study, we propose an enhanced harmonic partitioned scheduling method that is based on efficient harmonic relationship exploration. In our approach, we designed a harmonic index to guide the task partition by quantifying the task set harmonicity in terms of the maximum variation in the slack time of the lowest-priority task in the task set. With our proposed harmonic index, we presented a harmonic task partitioning scheme (named HWAP-SV) for periodic real-time tasks scheduled on multiprocessors following RM policy. Furthermore, to alleviate the problem of “fragmentation” in the pure harmonic task partitioning method, we also proposed a workload-aware harmonic task partitioning scheme called WAHP-SV by designing a metric that combines harmonic relationship exploration with workload awareness to strategically allocate workloads among processors. Our evaluation shows that both EHAP-SV and WHAP-SV consistently surpass the state-of-the-art partitioned scheduling methods. We believe that similar results can be obtained for the mixed-criticality task model and directed acyclic graph (DAG) task model owing to the generality of the slack variation-based harmonic index, and we would like to verify this in the future.

Author Contributions

Conceptualization, J.R. and J.Z.; methodology, J.R. and J.Z.; software, J.Z. and S.L.; validation, X.L. and W.C. (Wei Cao); formal analysis, J.R. and X.L.; investigation, S.L. and W.C. (Wenxin Chu); writing—original draft preparation, J.R. and J.Z.; writing—review and editing, J.R. and J.Z.; visualization, C.S.; supervision, J.R. and J.Z.; project administration, J.R.; funding acquisition, J.R. and W.C (Wei Cao). All authors have read and agreed to the published version of the manuscript.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

The authors declare no conflicts of interest.

Figure 1 Simulation of an SAS for {τ1,τ2,τ3} given in Table 2.

Figure 2 Scenario illustration for the proof of Theorem 4.

Figure 3 Scenario illustration for the proof of Theorem 5.

Figure 4 Workload of higher-priority tasks τi (i<n) during [rnW,rnW+Tn).

Figure 5 Workload of higher-priority tasks τi (i<n) during [rnB−tend,rnB+Tn).

Figure 6 Task partitioning process with EHAP-SV.

Figure 7 Fraction of schedulable tasks sets for light task sets.

Figure 8 Fraction of schedulable tasks sets for general task sets.

Figure 9 Processor requirements for light task sets.

Figure 10 Processor requirements for general task sets.

sensors-24-05773-t001_Table 1 Table 1 Major notation used in the paper.

Notation	Description	
Ci	Worst-case execution time of task τi	
Ti	Period of task τi	
Di	Relative deadline of task τi	
Ji,k	A job of task τi	
ri,k	Release time of job Ji,k	
Ri	Worst-case response time of task τi	
Ui, UΓ	Utilization of task τi and task set Γ, respectively	
HΓ	Hyperperiod of task set Γ	
Si,k	Slack time for a job Ji,k of task τi	
SiW	Worst-case slack time of task τi	
SiB	Best-case slack time of task τi	
Huc(Γ)	Utilization change-based harmonic index of task set Γ	
Hslack(Γ)	Slack variation-based harmonic index of task set Γ	

sensors-24-05773-t002_Table 2 Table 2 An example task set for harmonic index Huc.

Task	Ci	Ti	Ti′	
τ1	1	2	1.5	
τ2	1	3	3	
τ3	1	6	6	

sensors-24-05773-t003_Table 3 Table 3 Task parameters of an example task set.

Task	Ci	Ti	Di	Ui	
τ1	1	2	2	0.5	
τ2	1	3	3	0.3333	
τ3	1	6	6	0.1667	
τ4	1.5	5	5	0.3	
τ5	4	7	7	0.5714	

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
==== Refs
References

1. Pyun K.R. Kwon K. Yoo M.J. Kim K.K. Gong D. Yeo W.H. Han S. Ko S.H. Machine-learned wearable sensors for real-time hand-motion recognition: Toward practical applications Natl. Sci. Rev. 2024 11 nwad298 10.1093/nsr/nwad298 38213520
2. Li Y. Liu C. Zou H. Che L. Sun P. Yan J. Liu W. Xu Z. Yang W. Dong L. Integrated wearable smart sensor system for real-time multi-parameter respiration health monitoring Cell Rep. Phys. Sci. 2023 4 101191 10.1016/j.xcrp.2022.101191
3. Rao A.S. Radanovic M. Liu Y. Hu S. Fang Y. Khoshelham K. Palaniswami M. Ngo T. Real-time monitoring of construction sites: Sensors, methods, and applications Autom. Constr. 2022 136 104099 10.1016/j.autcon.2021.104099
4. Sangaiah A.K. Rostami A.S. Hosseinabadi A.A.R. Shareh M.B. Javadpour A. Bargh S.H. Hassan M.M. Energy-aware geographic routing for real-time workforce monitoring in industrial informatics IEEE Internet Things J. 2021 8 9753 9762 10.1109/JIOT.2021.3056419
5. Venkatraman S. Goel N. Singaravelu M. Namana S. Mohan M. Rohith G. Optimised distributed sensor system for covid protocol monitoring using multiprocessor architecture Meas. Sensors 2023 25 100653 10.1016/j.measen.2022.100653
6. Jugade C. Mohamed S. Goswami D. Nelson A.T. Veen G.v. Goossens K.G.W. Predictable multi-core implementation of multi-rate sensor fusion for high-precision positioning systems Proceedings of the American Control Conference Toronto, ON, Canada 8–12 July 2024 Institute of Electrical and Electronics Engineers Los Alamitos, CA, USA 2024 4470 4477
7. Jiang Q. Wang H. Kong Q. Zhang Y. Chen B. On-Orbit Remote Sensing Image Processing Complex Task Scheduling Model Based on Heterogeneous Multiprocessor IEEE Trans. Geosci. Remote Sens. 2023 61 1001718 10.1109/TGRS.2023.3327279
8. Cilardo A. Cinque M. Simone L.D. Mazzocca N. Virtualization Over Multiprocessor Systems-on-Chip: An Enabling Paradigm for the Industrial Internet of Things Computer 2022 55 35 47 10.1109/MC.2022.3140896
9. Baciu M.D. Capota E.A. Stângaciu C.S. Curiac D.I. Micea M.V. Multi-Core Time-Triggered OCBP-Based Scheduling for Mixed Criticality Periodic Task Systems Sensors 2023 23 1960 10.3390/s23041960 36850557
10. Stevanato A. Cucinotta T. Abeni L. Oliveira D.B.D. An Evaluation of Adaptive Partitioning of Real-Time Workloads on Linux Proceedings of the IEEE 24th ISORC Daegu, Republic of Korea 1–3 June 2021 53 61
11. Munien C. Ezugwu A.E. Metaheuristic algorithms for one-dimensional bin-packing problems: A survey of recent advances and applications J. Intell. Syst. 2021 30 636 663 10.1515/jisys-2020-0117
12. Sun Z. Guo M. Liu X. A Survey of Real-Time Scheduling on Multiprocessor Systems Proceedings of the 39th NCTCS Yinchuan, China 23–25 July 2021 89 118
13. Kumar A. Gupta S.K. A systematic survey of multiprocessor real-time scheduling and synchronization protocol Int. J. Sens. Wirel. Commun. Control 2022 12 212 229 10.2174/2210327912666220105141851
14. Fan M. Han Q. Liu S. Ren S. Quan G. Ren S. Enhanced fixed-priority real-time scheduling on multi-core platforms by exploiting task period relationship J. Syst. Softw. 2015 99 85 96 10.1016/j.jss.2014.09.010
15. Han C.C. Tyan H.Y. A Better Polynomial-Time Schedulability Test for Real-Time Fixed-Priority Scheduling Algorithms Proceedings of the IEEE 18th RTSS San Francisco, CA, USA 3–5 December 1997 36 45
16. Wang T. Homsi S. Niu L. Ren S. Bai O. Quan G. Qiu M. Harmonicity-Aware Task Partitioning for Fixed Priority Scheduling of Probabilistic Real-Time Tasks on Multi-Core Platforms ACM TECS 2017 16 101:1 101:21 10.1145/3064813
17. Ren J. Bi R. Su X. Liu Q. Wu G. Tan G. Workload-aware harmonic partitioned scheduling for probabilistic real-time systems Proceedings of the DATE Dresden, Germany 19–23 March 2018 213 218
18. Wang T. Han Q. Sha S. Wen W. Quan G. Qiu M. On Harmonic Fixed-Priority Scheduling of Periodic Real-Time Tasks with Constrained Deadlines Proceedings of the 53rd ACM/EDAC/IEEE DAC Austin, TX, USA 5–9 June 2016 1 6
19. Ren J. Su X. Xie G. Yu C. Tan G. Wu G. Workload-Aware Harmonic Partitioned Scheduling of Periodic Real-Time Tasks with Constrained Deadlines Proceedings of the The 56th ACM/IEEE DAC Las Vegas, NV, USA 2–6 June 2019 1 6
20. Joseph M. Pandya P. Finding Response Times in a Real-Time System Comput. J. 1986 29 390 395 10.1093/comjnl/29.5.390
21. Bril R.J. Lukkien J.J. Verhaegh W.F.J. Worst-Case Response Time Analysis of Real-Time Tasks under Fixed-Priority Scheduling with Deferred Preemption Real-Time Syst. 2009 42 63 119 10.1007/s11241-009-9071-z
22. Davis R.I. Zabos A. Burns A. Efficient Exact Schedulability Tests for Fixed Priority Real-Time Systems IEEE Trans. Comput. 2008 57 1261 1276 10.1109/TC.2008.66
23. Bini E. Buttazzo G.C. Measuring the Performance of Schedulability Tests Real-Time Syst. 2005 30 129 154 10.1007/s11241-005-0507-9
