# An IoT-Based Computational Framework for Healthcare Monitoring in Mobile Environments
## 3 Distributed Computational Framework
### Framework Specification
A coarse-grained allows a high level of abstraction but increases the need for communicating application details and synchronization. In contrast, a fine-grained needs so much scheduling work. This framework considers as granularity unit the application task. The review of existing implementations and state-of-the-art techniques are very important for designing the right decomposition of the applications. In addition, the application requirements and the working environment constraints play an important role in designing the proper data-flow diagrams. Generally, modern implementations of many computer methods take into account limited-resource target devices such as wearables and sensing devices. In these cases, some key features must be considered such as the enhanced communication capabilities and battery consumption. As a result, the target application is described by a directed graph \(\mathbb{A}=\{\mathbb{T},\mathbb{F}\}\) where:  
* \(\mathbb{T}\) is the vertex set and represents the set of application's tasks required for data acquisition, processing and monitoring. Then, the application is broken down into a list of tasks: \(\mathbb{T}=\{\mathfrak{t}_{1},\mathfrak{t}_{2},\ldots,\mathfrak{t}_{n}\}\)
* \(\mathbb{F}\) is the edge set and represents the data flows exchanged between the tasks. The data flows set the precedence between the tasks and the volume of exchanged data. \(\mathbb{F}(\mathfrak{i},\mathfrak{j})\in\mathbb{F}\) defines the volume of data exchanged between the tasks \(\mathfrak{i}\) and \(\mathfrak{j}\). For the SD application example conducted along this section, a lot of work have been reviewed in this research in order to design the proper data flow decomposition. Thus, the list of identified tasks corresponds with the most common processes involved in the SD detection mentioned in the state-of-the-art techniques. The data flow diagram shown in Figure 2(a) depicts an example of an application modelled according to this principle. This task size can be one of the previously mentioned, it can be variable-sized and executed sequentially. 1. Resource planning  
Once the computational load is characterized, the next step consists of determining where each task will be processed. The idea of the framework is that the processing flows from BAN devices to other devices outside it. In this step, the network architecture, and the IoT environment are essential inputs for carrying out the resource planning. In accordance with the proposed framework, the devices \(\mathbb{D}\) involved are defined as follows:  
* Let \(\mathbb{B}\) be the set of devices or 'things' of the BAN. These devices are worn by users. Their work consists in sensing and communicating the data to other devices. In addition, they may have some computing power. * Let \(\mathbb{M}\) be the set of available computers outside the BAN of the user. This set includes the computers and other mobile devices that have processing capabilities. Thus, the devices of this set can show the data and process it. * Let E be a set of external sensors. This set includes another type of external devices to the user for sensing other information for the application. For example, environmental conditions such as ambient humidity and temperature. That is: \(\mathcal{D}=\{\text{B}\}\bigcup\{\text{M}\}\bigcup\{\text{E}\}\)  
In this way, the computation begins inside the BAN where the data are acquired and can be complete in other more powerful devices, that is from B to M devices. Although possible, a data stream back is not contemplated from the M to the B devices. The ideal configurations are expected to distribute incrementally the processing of the application with the objective of computing the raw acquired bio-signals in the nearest location for the user, and reducing the communication needs with the M devices. This causes two main positive effects: on the one hand, the user can monitor elaborated data, and, on the other hand, the medical devices increase their capability of handle more users at the same time.