Keywords

1 Introduction

Finding feasible schedules for tasks running in hard, real-time computing systems is generally NP-hard [1]. A vast amount of work has been done in the area of real-time scheduling by both operations research and computer science communities.

The proposed approach is based on an optimization algorithm inspired from the Honey Bees Mating Optimization (HBMO). It combines an HBMO algorithm, Genetic Algorithms (GA), Simulated Annealing (SA), Tabu Search (TS) and the Greedy Randomized Adaptive Search Procedure (GRASP). The scheduling algorithms can be rated based on different parameters like makespan, flowtime, communication cost, reliability cost, and makespan [2]. The task duplication scheduling scheme has been utilized to minimize the processor idle time and lessen the mean task response time in [3]. In this paper, we aim to obtain a schedule called feasible if both of the following conditions are met (1) No precedence constraints are violated and (2) all temporal constraints are satisfied. In order to realize this goal, we have used a new approach based on the hybridization of several algorithms. Our strategy uses the HBMO as a base algorithm which combines a number of different procedures. Each of them corresponds to a different phase of the mating process of the honey bees.

In the next section, we see also that the honey bee mating algorithm has never been applied to resolve real-time tasks scheduling problems. This prompted us to use this strategy and hybridizing it with other metaheuristics in order to see its performance to resolve this kind of problem. Our contribution consists in combining the global search represented by HBMO with some local search metaheuristics for the resolution of real-time task scheduling problems in order to intensify the search in promising zones detected by the HBMO exploration process. This hybridization is realized with methods which have been applied in isolation in the resolution of real-time task scheduling problems: GA, TS, SA and GRASP [4, 5] First, we have to select the population of honey bees that will make up the initial hive. In the proposed approach, this population is created by using GA alone, or GRASP alone, or random selection selected. Then a percentage is selected from these three populations using a hybridization of these processes. The best member of each initial population obtained is selected as the queen of the hive. All the other members of each population are the drones.

The two local search strategies SA and TS are used as workers for improving the broods.

The paper is organized in the following way. The related works are presented in the Sect 2. The presentation and formulation of real-time tasks scheduling problems is described in Sect. 3. Section 4 presents the proposed Scheduling Approach. The resolution process of the scheduling real-time tasks problem is detailed in Sect. 5. Section 6 presents the simulation and experimental results arrived at. The paper finishes with the conclusion and recommendations for future research.

2 Related Works

The task scheduling problem is defined as one of the many popular academic NP-hard problems. In [6], different aspects in scheduling and issues in various levels of real time systems are described. The use of metaheuristic methods shows their efficiency and effectiveness to solve these categories of complex problems [7]. In the literature, many metaheuristics have been proposed based on methods and approaches to task scheduling. In [8], Talbi et al. have hybridized Simulated Annealing (SA) with Genetic Algorithms (GA). The authors in [9] resolve the scheduling task problem through hybridization of Particle Swarm Optimization (PSO) with GA.

The comparison between various scheduling algorithms and simulations results is given in [10]. An scheduling algorithm has multiobjective to minimize the total tardiness and total number of processors is used in [11]. The authors combine Adaptive Weight Approach with genetic algorithm and simulated annealing method. In order to explore the computing power of quantum computation, an approach based on the hybrid Quantum genetic algorithm is used to resolve the real-time scheduling problem in multiprocessor environment in [12]. In [13], the authors applied Bee Colony Optimization (BCO) as a heuristic algorithm to solve the problem of static scheduling of independent tasks on identical machines. This strategy is based on the intelligent behavior of honey bees in the foraging process. Koudil et al. adapted the MBO algorithm to solve integrated partitioning/scheduling problems in co-design in [14]. This algorithm gives good results in terms of solution quality and execution time. The Fuzzy logic is also used to solve the real time tasks scheduling problem. In [15], the authors propose a model witch in the input stage consists of three linguistic variables i.e. CPU time, deadline and communication overhead.

3 Partitioning and Scheduling

A real-time application is normally composed of multiple tasks with different levels of criticality: Missing deadlines is not desirable. In this context, three categories of real-time applications are defined [2, 16]:

  • Soft real-time applications: The system could still work correctly Although the tasks could miss some deadlines. However, missing some deadlines for soft real-time tasks will lead to paying penalties.

  • Hard real-time applications: The tasks can not miss any deadline, otherwise, undesirable or fatal results will be produced in the system.

  • Firm real-time applications: The tasks, which are such that the sooner they finish their computations before their deadlines, the more rewards they gain.

In this paper, a real-time task \( t_{ij} \) graph is defined by a set of temporal constraints such as \( \left\{ { st(t_{ij}^{k} ), \,c(t_{ij}^{k} ),\,ft1(t_{ij}^{k} ),\,dl(t_{ij}^{k} ) } \right\} \) as well as preemption and static periodicity constraints. The Table 1 reports the temporal constraints or parameters description of real-time system to study.

Table 1. Description of the real-time tasks adopted

The task model real-time system is usually described by a set of task graphs. The related concepts are defined as follows:

System: A real-time system is modeled as a set \( {\text{G}} = \left\{ {{\text{Gi}},{\text{i}} = 1,..{\text{g}}\} } \right. \) of periodic task graph.

Task graph: A task graph \( {\text{Gi}} \) is a directed acyclic graph (DAG) of period \( \uptau{\text{i }} \) and defined by a 2-tuple \( {\text{Gi}} = \left\{ {{\text{Ti}},{\text{Ei}},\uptau{\text{i}}} \right\} \) where:

  • \( Ti = \left\{ {tij,j = 1,..ni} \right.\} \) represents the set of tasks,

  • \( Ei = \left\{ {eijl,j = 1,..ni} \right.\} \) represents the set of communications.

Task: A task \( tij \) is a node of task graph and defined by \( t_{ij}^{k } \) denote the processor implementation (instance of task).

The problem consists of three parts:

Part 1: Partitioning \( {\text{P}} \), which determines the assignment of each task to \( {\text{p}}_{\text{u}} ,\,{\text{u}} \in \left\{ {1, \ldots .{\text{p}}} \right.\} \), processors:

$$ \forall {\text{t}}_{\text{ij}} ,{\text{P}}\left( {{\text{t}}_{\text{ij}} } \right) = {\text{p}}_{\text{u}} ,\,{\text{u}} \in \left\{ {1, \ldots .{\text{p}}} \right.\} $$
(1)

Part 2: Scheduling on processors \( {\text{SC}}1_{\text{u}} \), which associates each task instance assigned on processors \( \left\{ {1, \ldots .{\text{p}}} \right.\} \) a start time st.

$$ \begin{array}{*{20}c} {\forall {\text{P}}({\text{t}}_{\text{ij}}) = {\text{p}}_{\text{u }} ,{\text{t}}_{\text{ij}} \to {\text{SCh}}_{{1_{\text{u}} }} \left( {{\text{t}}_{\text{ij}}^{\text{k}} } \right) = {\text{st}}\left( {{\text{t}}_{\text{ij}}^{\text{k}} } \right), } \\ {\quad \quad \quad \quad \quad {\text{u}} \in \left\{ {1, \ldots .{\text{p}}} \right.\} } \\ \end{array} $$
(2)

Part 3: Scheduling on interconnexion system \( SCh\_2_{I} \), Which associates each inter-processors communication a start time st. The communication defined by \( e_{ijl} \) is a directed edge, which means task \( t_{ij} \) precedes \( t_{il} \). Each communication is associated with a data transmission time on a specific communication channel. It is commonly assumed, in multiprocessor systems research, that communication between tasks assign to the same processor is effectively instantaneous, compared with inter processors communication.

$$ {\text{e}}_{\text{ijl}}^{\text{k}} \to {\text{SCh}}\_2{\text{I}}\left( {{\text{e}}_{\text{ijl}}^{\text{k}} } \right) = {\text{st}}\left( {{\text{e}}_{\text{ijl}}^{\text{k}} } \right),\left\{ {{\text{e}}_{\text{ijl}}^{\text{k}} \in {\text{E}}_{\text{i}}^{\text{k }} \text{ / } {\text{P}}\left( {{\text{t}}_{\text{ij}} }\right) \ne {\text{P}}\left( {{\text{t}}_{\text{il}} } \right)} \right\} $$
(3)

Scheduling in real-time systems requires that the order of execution be stipulated. A schedule is called feasible if both of the following conditions are met:

  1. (1)

    All precedence constraints are respected and

  2. (2)

    All timing constraints are satisfied such as the deadline defined by \( dl(t_{ij}^{k} ) \) which means the task must be finished before the deadline, otherwise the system will fail. In the multiprocessor system. The task scheduling is a mapping process of all tasks to p processors. The goal of the scheduler is to schedule the system’s tasks on these p processors, so that every task is completed before the expiration of the deadline \( dl(t_{ij}^{k} ) \).

Here we use the similar cost function as [17]. The cost function formulated by Eq. (4) serves to calculate the tardiness scheduling of the real time system.

$$ \begin{aligned} & Tardiness = \\ & \sum\nolimits_{k} {\sum\nolimits_{i} {\sum\nolimits_{j} {fcost\left( {t_{ij}^{k} } \right) = } } } \\ & \;\left\{ {\;\begin{array}{*{20}l} {\left| {dl\left( { t_{ij}^{k} } \right)} \right. - \left. {ft\left( {t_{ij}^{k} } \right)} \right| } \hfill & { if \,\,ft(t_{ij}^{k} ) > dl(t_{ij}^{k} ) } \hfill \\ 0 \hfill & { if\,\,ft(t_{ij}^{ k} ) < dl (t_{ij}^{k} )} \hfill \\ \end{array} } \right. \\ \end{aligned} $$
(4)

With:

$$ \left\{ {\begin{array}{*{20}c} {ft(t_{ij}^{k} ) = st(t_{ij}^{k} ) + c(t_{ij}^{k} ) } \\ { st(t_{ij}^{k\_1} ) \le st(t_{ij}^{k} ) \le dl(t _{ij}^{ k} ) - c(t_{ ij}^{k} )} \\ \end{array} } \right. $$
(5)

The Real-time tasks complete their computing time before their deadlines as early as possible. Different comportments are showed in Fig. 1.

Fig. 1.
figure 1

Comportments of the real time instances of the task

4 Hybrid HBMO for Real Time Scheduling Resolution Problem

The HBMO algorithm was proposed by Abbass in [17]. Since then it has been used on a number of different applications [18,19,20,21,22]. HBMO was found to outperform some better known algorithms. However, it has not been applied to real-time scheduling problems. A honey-bee colony consists of the queen(s), drones, worker(s) and broods. The Honey-bee Mating Optimization algorithm mimics the natural mating behavior of the queen bee when she leaves the hive to mate with drones in the air. After each mating, the genetic pool of the queen is enhanced by adding sperm to her spermatheca. Before the mating flight begins, the queen is initialized with a certain amount of energy and only ends her mating flight when the energy level drops below a threshold level (which is close to zero) or when her spermatheca is full. The probability of a drone mating with a queen obeys the following annealing function:

$$ Prob\left( D \right) = e^{{\left[ { - \Delta \left( {f\Delta } \right)/speed\left( t \right)} \right]}} $$
(6)

where Δ(f) is the absolute difference between the fitness of D and the fitness of the queen and Speed(t) is the speed of the queen at a given time t. After each flight, the queen’s speed and energy evolve according to the following equations:

$$ Speed\left( {t + 1} \right)\, = \, \propto \, \times \,Speed\left( t \right) $$
(7)
$$ Energy\left( {t + 1} \right) = Energy\left( t \right) $$
(8)

where factor α ∈ (0,1) is the amount of speed and energy reduction after each flight. The workers are presented as heuristics whose functionality is to improve the broods produced during the mating process.

To diversify the initial HBMO population and select the best solution as the queen, Genetic Algorithms (GA) and GRASP method are used. The former, GA, works very well on mixed (continuous and discrete) combinatorial problems. Genetic Algorithms create a population of solutions and apply genetic operators such as mutation and crossover to improve the solutions in order to find the best one(s) [24]. The latter, GRASP, is a multi-start or iterative process, in which each GRASP iteration consists of two phases, a construction phase, in which a feasible solution is produced, and a local search phase, in which a local optimum in the neighborhood of the constructed solution is sought. GRASP has proved its efficiency in research and computer science applications as well as in industrial applications.

To improve the broods produced during the queen’s mating, we use two workers based on local search metaheuristics: Tabu Search (TS) and Simulated Annealing (SA).

5 Presentation of the Resolution Process

In this section, we present the approach adapted to resolve the issues addressed. To start with, a set of parameters must be defined:

  • The bee population represents the set of scheduling plans of real-time tasks with temporal constraints,

  • The queen represents the tasks best scheduling plan in the population generated by GA, by GRASP, randomly or hybridization of a percentage from each of the three populations obtained using the three aforementioned procedures and gradually improved by the implementation of the neighborhood generations iterative procedures (crossover in the HBMO) and two workers SA and TS.

  • The drones make up the remaining task scheduling plans.

Algorithm 2 describes The HBMO approach for scheduling

figure a

A summary of differences and similarities between the HBMO approach applied for the resolution of the real time scheduling problem and the original algorithm are showed in Table 2.

Table 2. Differences and similarities between our HBMO-real time scheduling and the original HBMO

6 Simulation and Experimental Results

This part is devoted to the implementation and testing of the algorithmic methods developed above. In order to assess the effectiveness of the approaches under study, we constructed a testbench consisting three task systems, which are randomly generated. The systems were composed of 40, 60 and 80 task graphs. Each task graph had its own temporal characteristics. The parameters of the algorithm have been selected after thorough testing. A number of different values were tested and the ones selected are those that yielded the best results in both solution quality and computational time. The best values for these parameters appear in the Tables 3 and 4.

Table 3. Parameters and their values for the HBMO approach adopted
Table 4. Parameters and their values for the used approaches

In the first time, we generate the initial population of the proposed algorithm randomly and with GA. After 10 runs, The Fig. 2 illustrate the graphic results obtained through the application of HBMO, GA and GRASP approaches. The best real-time task scheduling approach is to be selected taking into consideration the Cost function criteria. The graphics results show that the HBMO approach converge to the optimal results comparing with the GA and GRASP methods.

Fig. 2.
figure 2

Graphic results obtained through different hybridization processes example of 60 tasks

In order to ameliorate scheduling real-time problem results obtained through the application of basic HBMO (HBMO_Random), we have hybridized the HBMO algorithm with other metaheuristics: Genetic algorithms GA, GRASP and hybridization (three sub-populations made up of one percentage from random, one percentage from AG, one percentage from GRASP) in the stage of initial population generation. The Fig. 3 presents all graphic results obtained through different hybridization processes. The graphics results show that the results given by HBMO-hybridization approach were best than the results given by the HBMO with GA and HBMO with GRASP algorithms. We notice also that the results given by the HBMO-GRASP and HBMO-hybridization were nearly the same. (in the iterations number 34, 24, 16 and 9) the values obtained by HBMO_hybridization and the HBMO_GRASP are the same).

Fig. 3.
figure 3

Graphic results obtained through different hybridization processes example of 80 tasks.

7 Conclusion

In this paper, an approach is proposed to solve real-time task scheduling problems. This approach is based on the hybridization of several algorithms inspired from nature such as Genetic, HBMO, Tabu Search and Simulated Annealing and GRASP algorithms. In the stage of generating initial solutions, the adopted approach uses Genetic Algorithms alone, random selection alone, GRASP alone, and hybridization of the three processes selecting a percentage of the population from each. In the stage of solution improvement by the workers, HBMO uses Tabu Search and Simulated Annealing algorithms. The proposed approach was tested on three real-time task scheduling instances with 40 tasks, 60 tasks and 80 tasks where each task has its own temporal constraints. The gain coefficient from the optimal solution is used as the standard to evaluate the quality of the solutions obtained. Results confirm the positive impact of using a hybrid strategy with regard to function objective quality and computing time in comparison with the hybridization algorithms object of this paper.

The results arrived at show that for real-time scheduling problems (with a number of tasks 80), the best approach is HBMO-Hybridization. In the future works, we will focus our searches to resolve the problem of minimizing the energy consumption in the real-time embedded systems by using the proposed algorithms.