1 Introduction

In recent years, there has been a growing trend in using smart IoT, and low-power wearable devices due to their role in promoting the quality of life for people [1,2,3]. However, the rechargeable battery-based wearable devices have charging and discharging nature which requires a repetitive human intervention [4]. Minimizing this frequent intervention by increasing the size of the energy storage element in such devices is inapplicable and hinders the comfortable and user-friendly design [4, 5]. Furthermore, batteries represent added cost to the device and non-environmental friendly solution. In order to overcome the limitations of the battery-based wearable devices, energy harvesters such as kinetic, solar, and thermal ones have been used to harvest energy for powering up wearable device [6]. Using energy harvesting does not eliminate the need for batteries but reduces it. This is because current systems are designed to give fixed performance, and it shut off whenever the energy is below a certain level. This requires fixed and stable energy source which is not the case for most of the energy harvesting technologies [6,7,8].

The energy harvesting technology is widely used in biomedical wearable devices as the energy can be easily scavenged from the ambient motion, kinetic energy, of the human body [9,10,11]. Such biomedical devices can be used for continuous monitoring purposes by sensing and acquiring different bio-signals (e.g., heart rate, blood glucose level, temperature, and oxygen saturation of the blood) [12, 13]. The energy harvesting technology is remarkably beneficial in this context as it allows using a simultaneous source of energy which allows the transducer to harvest sufficient energy to power the sensors. Therefore, two techniques are utilized for powering: harvest-and-store and harvest-and-use depending on the body activity, due to the variable nature of the gathered energy of human motion [14, 15]. When the kinetic activity of the human body is high, there is sufficient energy to be used for powering purposes and to be stored in a supercapacitor. This stored energy is then used whenever the activity of the human body is low and insufficient to feed the wearable device with the minimal required energy.

Accordingly, the energy harvesting-based wearable devices contain Power Management Unit (PMU) to control and organize the flow of the energy throughout the device [16, 17]. However, PMU does not control the application of the system and uses only micrcontroller built-in features to manage the power consumption. This raises the need for finding a way to correlate between the available energy and the system functionality. This means, enabling/disabling some functions of the system based on the available energy. Alternatively, adapting the running function and the required time for each function based on the available energy. This will make the system survive severe energy conditions without interruption. Hence, Task scheduling algorithms can be used to create a table for the time window in terms of location and width for executing each function in the system based on the available energy [18]. Thus, task scheduling can be considered as a beneficial mechanism to manage the execution of various sensing tasks under limited, and time-varying harvested energy [14, 19]. This can be crucial to maximize the performance in the context of continuous monitoring to avoid any interruption in the device operation [8]. Three main task scheduling algorithms were tested: the Dynamic Voltage and Frequency Scaling (DVFS), the decomposing and combining of tasks, and the duty cycling, to create the optimum order of task operation based on the available energy. [14]. The details of these algorithms will be presented in the upcoming section. Then, the impact of the generated order from each algorithm on the energy will be illustrated.

In this paper, sensors task scheduling is proposed for the energy harvesting-based wearable biomedical devices based on the Snake Optimizer (SO) and a greedy approach to compute Hamming-based Tikhonov’s regularization to mandate the feasibility of the obtained solution.

The remaining paper parts are organized as follows. The literature review is presented in Sect. 2. The system description and problem formulation, including the objective function, constraints, Tikhonov regularization approach, are found in Sect. 3. In Sect. 4, the details of the adopted snake optimization technique are found. The results are presented and discussed in Sect. 5, while the conclusion is summarized in Sect. 6.

2 Literature survey

This section considers the previous studies that focused on providing task scheduling algorithms for energy harvesting-based wearable devices. The sensor nodes consume power depending on the clock frequency and the delivered voltage. Consequently, it is possible to adjust both the supplied voltage and the operating frequency to optimize the consumed power on a real-time basis. Using the concept of dynamic voltage and frequency scaling, the energy consumption can be minimized while considering the performance constraints. Weather-Conditioned Moving Average (WCMA), which is a method for task scheduling. Traditional inter-task scheduling (W-LSA) and task migration have been proposed to enhance performance by proactively balancing task workload [20]. Liu et al. [18] introduced a scheduling algorithm that estimates the predicted harvested energy and adapts the processing of the task according to it and the available energy. Also, they suggested in another study [21] to switch between the direct use of the current harvested energy and the stored energy while running the sensor nodes to overcome wasting the harvested energy in battery leakage. Another scheduling technique was presented by Liu et al. in [22] where they combined both the concepts of adaptive and static schedules with DVFS to achieve the highest possible performance while considering timing constraints. The algorithm schedules the tasks adaptively whenever there is a prediction of overflowing energy to optimize the operation by maximizing the benefit from the energy being harvested. Allavena and Mossé proposed a task scheduling technique in [23] which uses DVFS, and the tasks are prioritized according to their deadlines. On the other hand, the choice of task execution depends on the available energy. If the current energy is higher than a certain predefined threshold, the task can be executed; otherwise, the task will be postponed. For healthcare monitoring, a task scheduler was developed by Ravinagarajan et al. in [24]. In a framework based on DVFS and a linear regression-based algorithm, their schedule is meant to manage both the periodic and the sporadic tasks.

Although the DVFS-based algorithms are efficient with the energy harvesting technology, they may not offer sufficient voltage levels to execute some tasks. However, the task scheduling algorithms that rely on decomposing and combining tasks can decompose the energy-intensive tasks into multiple sub-tasks that demand lower energy during their operation. Zhu et al. in [25] introduced an algorithm based on task decomposition and combining to optimize the energy consumption. The decomposition phase imposes dividing an intensive task into two separate sub-tasks of data sensing and transmission when the scavenged energy is limited. While in the combining phase, multiple transmission sub-tasks can be combined by grouping the data and transmitting them in a single data pocket to minimize the energy consumption. A relatively reduced delay characterizes this concurrent task execution, and smaller latency [14]. By evaluating their task scheduling algorithm, the results showed that their algorithm could efficiently utilize the dynamically available energy. More tasks can be executed with fewer missed deadlines, which shows the reliability of the decomposing and combining-based algorithm.

In energy harvesting-based devices, the duty cycle adjusting mechanisms are commonly used to optimize energy consumption. Duty cycling is mainly based on managing the sleep, and awake modes, which reduces the overall energy consumption while maintaining the functionality of sensor nodes [26]. In an energy budget-based duty cycling framework, Kansal et al. [27] introduced a duty cycling technique where the duty cycle of each sensor node of the system depends on the average harvested energy and the consumed energy in the wake and sleep modes. In their study, the duty cycle adjustment depends on the overall energy consumption, which cannot exceed the average harvested energy. In [28], a mathematical model was described for duty cycling. The model maximizes the system’s performance on a real-time basis by employing an exponentially weighted moving average scheme to predict the harvested energy. This helps estimate the duty cycle to operate sensors nodes of the system. In another study [29], the authors employed a dynamically-controlled duty cycle to maximize the utilization of the harvested energy. Whenever the harvested energy is limited, they consider duty cycle reduction. Another energy budget-based duty cycling mechanisms were presented in [30] and [31] by Yang et al.. The first study introduced an adaptive sensing scheduling algorithm by dynamically adjusting the sensing rate according to the available energy budget. In contrast, an online scheduling policy was suggested in the second study. In case of the unavailability of sufficient harvested energy, estimating or predicting the upcoming energy is beneficial for managing the tasks in terms of execution or delay. Previous related studies [32,33,34,35] showed different methods for predicting the future harvested energy. Most of these studies considered the surrounding environment in energy prediction.

3 System description and problem formulation

3.1 System overview

In this section, a mathematical realization for the problem of our interest will be conducted by formulating the objective function used in the optimization technique and presenting Tikhonov’s regularization approach. In order to profile the problem, it is crucial to mention the components of our adopted energy harvesting-based biomedical wearable device which represent a test platform for the algorithm. The system consists of the basic essential components that guarantee the functionality: a piezoelectric harvester, a bridge rectifier, a supercapacitor, a processing unit, and sensors. However, not all of these components will participate in the problem formulation. The sensors and the supercapacitor are the only components that matter in the problem formulation, which governs the energy consumption (and its corresponding voltage drop across the supercapacitor) based on the activity of the sensors. However, the proposed algorithm can be applied on the system even if the number of functions is increased.

In this study, two sensors are utilized: a heart rate sensor and a temperature sensor, where the activity of both sensors determines the corresponding voltage drop across the supercapacitor, which acts as the system energy reservoir. The heart rate sensor is selected as it measures a quantity needed to be monitored continuously. This represents the situation of high frequency of the discharging cycles to test the algorithm capabilities in heavy load applications. While the temperature sensor represents relatively low frequent operations. However, the temperature indicates several biological conditions such as blood pressure which makes it an important parameter to be measured [36]. We adopted the beat-to-beat optical Pulse Sensor as our heart rate sensor [37] and the non-contact infrared MLX90614 thermometer [38] as the temperature sensor to be connected to the micro-controller [39].

The main objective of using the optimization technique, SO, is to find the best schedule which organizes the operation across the two sensors. Accordingly, before proceeding in the problem formulation, we need to model the activity of the two sensors by representing their activity in two bits. The MSB (Most Significant Bit) indicates the status of the heart rate sensor, while the LSB (Least Significant Bit) indicates the status of the temperature sensor. If the sensor is ON, then the binary value of its corresponding bit is equal to 1. While if the sensor is OFF, then the binary value of its corresponding bit is equal to 0. We consider a smart wearable system that contains a power-aware task scheduler thus by decoding the two binary bits into corresponding decimal values, a more compact representation is achieved as follows:

$$\begin{aligned}{} & {} y_{k}\,\in \{0, 1, 2, 3\}_{dec} \end{aligned}$$
(1)
$$\begin{aligned}{} & {} y_{k}\,\in \{00, 01, 10, 11\}_{bin} \end{aligned}$$
(2)

where \(y_{k}\) is a decision variable which indicates the activity of the two sensors over a specific period divided into \(N_{slots}\) time slots. k refers to the slot number where \(k\,\in \{1, 2,...,N_{slots}\}\). Accordingly, the desired task schedule is expected to be a sequence of decision variables \(Y=\{y_{1},y_{2},...,y_{N_{slots}}\}\) corresponding to defined \(N_{slots}\) time slots as illustrated in Fig. 1.

Fig. 1
figure 1

Illustration of the desired schedule Y over the time slots

3.2 Assumptions and constraints

The sensors are used to acquire some human vital signs and then translate them into a meaningful value [40]. Consequently, these sensors should operate on a periodic basis, ensuring a valid real-time operation. According to the type of signal being sensed, the frequency of signal acquisition is determined [40, 41]. In general, somebody parameters are likely to change more rapidly according to the body’s activity and health condition while others are not. For example, the heart rate frequently fluctuates and needs multiple measurements over a short time horizon while the body temperature can be obtained with a single measurement over a longer time horizon. Hence, the frequency of reading both sensors is not the same and also the period of measuring. This should be considered while formulating the problem in this study to maintain the functionality constraints. Thus, the assumed period \({P}_{hr}\) upon which the heart rate sensor operates must be less than the assumed period \({P}_{t}\) upon which the temperature sensor operates. These operational criteria can be listed as follows:

  • The heart rate sensor measures the body’s heart rate only once during each \({P}_{hr}\) period.

  • The temperature sensor acquires the body temperature only once during each \({P}_{t}\) period.

  • \({P}_{hr} < {P}_{t}\).

3.3 Objective function

Maximizing the energy throughout the energy harvesting-based biomedical wearable device is the main target of this work. Consequently, the optimization technique is meant to find the schedule Y, which maximizes the energy over \(N_{slots}\) time slots. In order to find the best schedule, we need to calculate the voltage drop across the supercapacitor to determine the effect of the schedule upon the energy consumption. To maximize the energy, we should guarantee that the final voltage across the supercapacitor \(V_{final}\) is maximized as well. The final voltage \(V_{final}\) can be easily calculated depending on a dataset we generated from a lab-based biomedical device. By setting an initial voltage and iterating throughout the generated dataset, and accumulating the voltage drop across the supercapacitor at the end of each time slot, \(V_{final}\) can be calculated.

Moreover, to force the snake optimization technique to eliminate the infeasible solutions as much as possible, a regularization approach is chosen for this study. A Hamming-based Tikhonov regularization is adopted to penalize the infeasible solution depending on how much the solution Y violates the earlier-mentioned constraints. Accordingly, The objective function can be expressed mathematically as follows:

$$\begin{aligned} {f(Y)}= & {} {V}_{final}\,(Y)\,+\,{T}_{Tikhonov}(Y) \end{aligned}$$
(3)
$$\begin{aligned} \hat{Y}= & {} {{\,\textrm{argmax}\,}}_{\forall Y}\,(f(Y)) \end{aligned}$$
(4)

where \({T}_{Tikhonov}\) is the regularization term that will be deeply described in the upcoming subsection. \(\hat{Y}\) is the optimum schedule.

3.4 Hamming-based Tikhonov regularization approach

The regularization using Tikhonov’s technique has proven its efficiency in many previous studies [42,43,44]. When the search space of the problem is large, regularization techniques such as Tikhonov’s are preferable to be imposed to constrain the possible solution space [45]. The strategy is based on adding a regularization term to the objective function in order to approach a particular solution with desirable properties [8]. This added term enforces the optimization algorithm to exclude the infeasible solutions by adding a penalty. Through this, it is possible to find or approach the desired optimal solution \(\hat{Y}\), which satisfies our objective of maximizing the energy. In this study, the solution Y can be represented in terms of binary values, as illustrated earlier. Accordingly, we propose a greedy approach to compute the Tikhonov regularization term based on Hamming distance efficiently. In the context of dealing with binary values: 0 or 1, Hamming distance between two-bit vectors of equal lengths is the number of bits at which the corresponding elements of the vectors have different values and can be represented as follows [46]:

$$\begin{aligned} d_{Hamming}= s( Y \oplus {Y}_{NF}) \end{aligned}$$
(5)

where \({Y}_{NF}\) is the nearest feasible solution to solution Y, \(\oplus\) is the XOR operator, and s(.) is a summation operator of the bit vectors. However, our energy harvesting-based wearable biomedical system has two sensors where their schedule, solution Y, can be represented in two separate binary vectors. Thus, the Hamming distance in this study is computed for the solution of each sensor separately using Algorithm 1 which eventually represents the \({L}^{2}\) (2-norm) regularization, and hence, \({T}_{Tikhonov}\) is calculated as follows:

$$\begin{aligned} {T}_{Tikhonov}(Y)= -\, \lambda \times \, \sqrt{\sum _{n=1}^{N_{s}}(d_{Hamming})_{n}^2} \end{aligned}$$
(6)

where \(\lambda\) is the Lagrange multiplier, \(N_s\) is the number of sensors which is equal to two in this study. According to this number of sensors \(N_s\), Algorithm 1 is repeated to compute the required Hamming distance for each sensor solution \(Sol_n\) separately along with \(N_{slots}\) time slots. The algorithm firstly computes the nearest feasible solution \(Sol{_{NF}}{_{n}}\) for sensor n then finds the Hamming distance between it and \(Sol_n\). For computing \(Sol{_{NF}}{_{n}}\), the sensor period \(P_n\) is needed along with the slot number \(S_n\) at which the sensor starts firstly to operate.

figure e

For more elaboration, suppose we have \(Sol_n = \{1, 0, 1, 1, 0, 1\}_{bin}\), \(P_n=2\), once \(S_n\) is found, the nearest feasible solution \(Sol{_{NF}}{_{n}}\) can be generated as shown in Fig.  2, and hence the Hamming distance can be computed. Since we are dealing with the optimization problem of a relatively large search space, the meta-heuristic is not guaranteed to reach the global maximum. The required computation to calculate the nearest neighbor is an NP-hard problem. So, it can explode in time exponentially. Accordingly, we propose an approximate algorithm to compute the nearest feasible solution.

Fig. 2
figure 2

Visualizing the approximate approach to compute the nearest feasible solution

4 Snake optimizer

In this work, the snake optimization technique is utilized to find the most feasible task schedule for the above-described problem. The snake optimization algorithm is a recent nature-inspired technique that was introduced in [47]. The inspiration comes from the behavior of snake mating in nature. The snakes are cold-blooded vertebrates belonging to reptiles, and crucial factors govern the mating between the female and male snakes. The competition among the males to attract females’ attention for mating starts to take place when the temperature is sufficiently low during the late spring, and early summer [48]. However, the mating process does not rely on the temperature nor female’s decision only, but also on the food availability [48]. Accordingly, mating occurs only when the temperature is low, and food is available; otherwise, the snakes will only search for food or eat what is already there. By considering this information in the optimization context, two phases in the searching process can be figured out: exploration and exploitation. When the environmental factors from food and low temperature do not exist, the snakes only go searching for food to survive, and this is the exploration. At the same time, the exploitation phase has various transition phases to efficiently reach the global minimum. If the temperature is high, but the food is available, the snakes care about only eating the existing food. In the case of food availability and a low-temperature environment, the mating process occurs. There are two different cases for the mating process: the fighting and mating modes. In the fight mode, each male will compete for the best female, and each female will attempt to select the best male. On the other hand, in the mating mode, the mating of each pair is related to the quantity of the available food.

Before getting more familiar with the mathematics behind the SO technique, it is important to mention that SO is just like all the metaheuristics algorithms; it starts by generating a random initial population to be able to begin the optimization algorithm process. Also, this work follows the original parameters of the SO technique presented earlier by Hashim et al. in [47], where they assumed that the population is divided into two groups: a male group and a female group of an equal number of members. The process starts by defining the surrounding temperature \(T_{surr}\) and the food quantity \(Q_{food}\) as follows:

$$\begin{aligned} T_{surr}= & {} exp\left(\frac{-t}{t_{max}}\right) \end{aligned}$$
(7)
$$\begin{aligned} Q_{food}= & {} 0.5 \,*\, exp\left(\frac{t\,-\,t_{max}}{t_{max}}\right) \end{aligned}$$
(8)

where t is the current iteration and \(t_{max}\) is the maximum number of iterations. If \(Q_{food}\) is less than a threshold of 0.25, this means that the snakes go exploration and search for food, and this can be modeled as follows:

$$\begin{aligned} X_{i,j}(t + 1)= & {} X_{rand,j}(t)\,\pm \, 0.05 \times A_j \nonumber \\{} & {} \quad \times ((X_{max} - X_{min}) \times r + X_{min}) \end{aligned}$$
(9)

where,

$$\begin{aligned} A_{j} = exp\left(\frac{-\, f_{rand,j}}{f_{i,j}}\right) \end{aligned}$$
(10)

\(X_{i,j}\) refers to the \(i^{th}\) snake position of gender j (male or female) where this equation is calculated during the exploration for the two groups: the male group (\(X_{i,m}\)) and the female one (\(X_{i,f}\)). \(X_{rand,j}\) refers to the position of a random snake while r is a random number following a uniform distribution between 0 and 1. \(A_j\) represents the ability of the snake to find the food during searching, and it is measured in terms of the fitness f. Furthermore, if the \(Q_{food}\) is more than the threshold and \(T_{surr}\) is higher than 0.6 (which means the surrounding environment is hot), then no mating will occur, and the snakes focus on feeding themselves with the available food. Hence, this behavior can be expressed as:

$$\begin{aligned} X_{i,j}(t + 1) = X_{food}\,\pm \, 2 \times T_{surr} \times r \times ((X_{food} - X_{i,j} (t)) ) \end{aligned}$$
(11)

where \(X_{food}\) is the position of the best individuals. Whenever the food is still available, and the temperature becomes cold enough and lower than the 0.6 threshold, the mating will occur either in the fight mode or the mating mode. During the fighting mode, the fighting ability of the female and male agents can be calculated from:

$$\begin{aligned} FM= exp\left(\frac{-\, f_{best,f}}{f_{i}}\right)\,,\, FF= exp\left(\frac{-\, f_{best,m}}{f_{i}}\right) \end{aligned}$$
(12)

where \(f_{best,f}\) is the fitness of the best agent of the female group, while \(f_{best,m}\) is the fitness of the best agent of the male group and \(f_i\) is the agent fitness. Consequently, the fighting mode can be modeled as:

$$\begin{aligned} X_{i,m}(t + 1)= & {} X_{i,m}(t) + 2 FM \times r \times (Q_{food} \times X_{best, f}\nonumber \\{} & {} \quad - X_{i,m}(t)) \end{aligned}$$
(13)
$$\begin{aligned} X_{i,f}(t + 1)= & {} X_{i,f}(t+1) + 2 FF \times r \times (Q_{food} \times X_{best, m}\nonumber \\{} & {} \quad - X_{i,f}(t+1)) \end{aligned}$$
(14)

where \(X_{i,m}\) and \(X_{i,f}\) refer to \(i^{th}\) male and female positions, respectively. While \(X_{best,m}\) and \(X_{best,j}\) are the positions of the best individual in the male group and the female group, respectively. For the mating mode:

$$\begin{aligned} X_{i,m}(t + 1)= & {} X_{i,m}(t) + 2 \times exp\left(\frac{-\, f_{i,f}}{f_{i,m}}\right) \times r \nonumber \\{} & {} \quad \times (Q_{food} \times X_{i,f}(t) - X_{i,m}(t)) \end{aligned}$$
(15)
$$\begin{aligned} X_{i,\,f}(t + 1)= & {} X_{i,\,f}(t) + 2 \times exp(\frac{-\, f_{i,\,m}}{f_{i,f}}) \times r\nonumber \\{} & {} \quad \times (Q_{food} \times X_{i,m}(t) - X_{i,\,f}(t)) \end{aligned}$$
(16)

If egg hatch, select worst male \(X_{worst,\, m}\) and worst female \(X_{worst,\, f}\) and replace them:

$$\begin{aligned} X_{worst,\, m}= & {} X_{min} + r \times (X_{max} - X_{min}) \end{aligned}$$
(17)
$$\begin{aligned} X_{worst,\, f}= & {} X_{min} + r \times (X_{max} - X_{min}) \end{aligned}$$
(18)

In terms of the formulated problem, the SO optimization algorithm is used in such a manner to generate the desired task schedule. The optimization algorithm starts with setting the parameters and reading the data to work on. The parameters are the initial voltage across the supercapacitor, the number of time slots \(N_{slots}\), \(P_{hr}\), \(P_{t}\), \(\lambda\), and finally, the upper and lower scheduling boundaries. The algorithm iterates for \(N_{itr}\) iterations where it updates the best solution and carries it from one iteration to another.

5 Results

Several experiments are conducted to validate the performance of the snake optimizer technique for sensor task scheduling. Furthermore, the technique performance is compared with that of FPA (Flower Pollination Algorithm) [49] which was utilized in a prior study [8] for task scheduling. Implementation of SO, Hamming distance-based Tikhonov regularization, and all the experiments were done using MATLAB.

Firstly, the SO technique is operated and experimented with at different \(N_{slots}\) to tackle the effect of changing search space complexity on the performance. While the other parameters are set as follows: \({P}_{hr}= 3\), \({P}_{t}= 5\), the initial voltage value across the supercapacitor \(= 3.3\, V\), and \(\lambda = 0.6\) where it is considered a tuning parameter employed during regularization. The value of \(\lambda\) is chosen to fit the objective function which calculates the analog final voltage \(V_{final}\). It is also noticeable that \({P}_{hr}\) is shorter than \({P}_{t}\) to meet the problem constraint, however, both values are chosen to be small in order to guarantee the monitoring functionality.

Figure 3 shows the convergence plot of the SO technique for finding the optimal schedule \(\hat{Y}\) upon the different \(N_{slots}\). As the objective function maximizes the energy across the supercapacitor, the convergence plot tends to increase during the 500 iterations. By looking at the curves, the SO algorithm shows fast convergence and stagnation (i.e., no-changing stage) for \(N_{slots}= 20\). While the evolution curve for \(N_{slots}= 40\) shows a faster convergence than that for \(N_{slots}= 60\).

Furthermore, it is noticeable from the figure that stagnation is likely to occur during some iterations, where no better solution is being found. Yet, SO proves its ability to overcome stagnation over time by reaching better solutions. Also, Fig. 3 shows the potential of SO technique in dealing with the large search spaces to achieve better schedule when \(N_{slots}\) is 40. Although SO is still not guaranteed to reach the optimal schedule, its behavior reveals its efficiency with the assigned problem.

Fig. 3
figure 3

The convergence curves of Snake Optimizer algorithm on different \(N_{slots}\)

It is also important to study the voltage drop across the supercapacitor that occurs due to the best solution or the best task schedule found by the optimization technique. This can be done by observing the final voltage versus the different \(N_{slots}\) time slots as shown in Table 1. It is logical that the final voltage \(V_{final}\) across the supercapacitor decreases as the time slots increases due to the energy demand. From these conducted experiments, it can be concluded that SO shows better optimization performance than the state-of-the-art FPA algorithm.

Table 1 The final voltages across the supercapacitor running the SO at different \(N_{slots}\)

A set of validation experiments is conducted to compare the performance of FPA and SO optimization algorithms on the same problem. FPA showed in previous related work [8] its reliability on finding feasible schedules for a small number of \(N_{slots}\). It will be tested along with SO on finding feasible solutions but for a relatively larger number of time slots. Our Tikhonov regularization approach will be used with both optimization algorithms to maximize the final voltage \(V_{final}\). Figures 4, 5 and 6 compare the performance of SO and FPA on finding the most feasible schedule for \(N_{slots}\) equal to 25, 50 and 100, respectively. More iterations are involved in experimenting FPA and SO, where \(N_{itr}= 1000\).

Fig. 4
figure 4

SO versus FPA at \(N_{slots}=25\)

Fig. 5
figure 5

SO versus FPA at \(N_{slots}=50\)

Fig. 6
figure 6

SO versus FPA at \(N_{slots}=100\)

The remaining key parameters remain the same except for \(P_{hr}\) and \(P_{t}\) which were updated to be equal to 6 and 8, respectively. This update was done to enrich the conducted experiments by investigating the performance upon less frequent operations than the previous experiments and those conducted in [8]. The figures show that the SO algorithm is more reliable for all the \(N_{slots}\) and can reach more feasible solutions that meet the objective function of maximizing the energy.

Besides the feasibility, the SO algorithm converges more noticeably than the FPA algorithm over the iterations. As the number of \(N_{slots}\) increases, the search space dramatically increases, making finding feasible solutions more challenging for both algorithms. Accordingly, FPA appears with smoother behavior in Figs. 5 and 6 as it becomes more difficult to maximize the energy with the increase in the search space. While SO shows bigger jumps indicating that finding better schedules takes much time till reaching the final stagnation.

Furthermore, we investigate how the voltage drops across the supercapacitor by applying the task schedules of FPA and SO for 25 and 50 time slots, then plotting the voltage drop for each slot till \(V_{final}\) is reached, as shown in Fig. 7. From the figure, it is obvious that the schedules of SO results in less voltage drop than that of FPA for both time slots. For 50 time slots, the voltage drop is less than around 0.035 volts.

Fig. 7
figure 7

The effect of task schedules generated by SO and FPA algorithms on the voltage drop across the supercapacitor for different time slots

In terms of energy management, the schedule that maximizes the final voltage across the supercapacitor is preferable if there are no operational constraints. Yet, a constrained problem is adopted in this approach, where finding a feasible schedule that satisfies the operation constraints is crucial to maintain the functionality. The search space in this study depends on the number of slots \(N_{slots}\) and the number of involved components \(N_{comp}\), thus, the computational cost is \(O(2^{N_{comp}\,x\, N_{slots}})\). Despite that, the search space is considerably challenging, the results of optimizing the energy throughout the wearable system using SO-based task scheduling approach outperforms the state-of-the-art FPA algorithm. Also, the snake optimizer algorithm has proven its potential in tackling optimization limitations along with the proposed greedy approach for computing Hamming distance-based Tikhonov’s regularizing term.

6 Conclusion

In this work, two optimization techniques are used in order to create an optimum scheduler for task operation. The main goal of the proposed techniques is to avoid power interruption. Then, a test platform is used to illustrate the impact of the task scheduling on the battery lifetime. The platform consists of a temperature sensor and a heart rate sensor. The first algorithm is based on the snake optimization technique. Also, the functionality constraints are enforced with a Hamming-based Tikhonov regularization in a greedy approach. The proposed task scheduling technique can be generalized and efficiently maximizes the supercapacitor’s stored energy. Second one is the flower pollination algorithm in maintaining the supercapacitor energy. The capability of generalization of the SO technique makes it suitable for the inclusion of more sensors and modules in future studies. SO algorithm showed better convergence time than FPA (over 50\(\%\)) for this problem. Moreover, SO showed 20\(\%\) saving in energy saving than FPA for same number of iteration.

7 Supplementary information

The used dataset in the presented experiments is provided as Data.mat and Data.csv along with its description in Description.pdf.