## 4 Use Case Study: [PERSON]'s Healthcare Monitoring
### Scenario Overview
After detailing the pivotal role of blockchain in enhancing the security of SIM, it becomes essential to understand the specific processes involved in this security enhancement. To this end, a supplementary algorithm that details the operational steps of the Blockchain Component within SIM is provided in Algorithm 2. Algorithm 2 provides a comprehensive view of how data from IoT devices, such as [PERSON]'s health monitors, are securely processed, verified, and stored within the blockchain framework. It also details the mechanisms for data retrieval and access by authorised entities, such as healthcare data analysts and emergency services. Algorithm 2 shows the sequence of operations, starting from the initial encryption and semantic annotation of the data through its journey in the blockchain network, including transaction creation, data verification, block addition, and consensus achievement. Furthermore, it highlights how data integrity and security are maintained during access requests, ensuring that only authenticated and authorised requests are processed. It provides a practical guide on how these security measures can be implemented in real-world scenarios. Figure 8: Sequence diagram depicting the generic data flow. It shows how annotated health data are passed from the data security module to the blockchain module and the operations involved in this module. Building upon the enhanced security features of SIM, a comparative analysis with other middleware solutions in IoT and smart city applications is presented in Table 3. This analysis highlights the unique security implementations of SIM, including its blockchain integration and encryption techniques, in comparison with other recently proposed platforms in the literature. \begin{table}
\begin{tabular}{l c c c c c} \hline \hline
**Feature** & **SIM** & **SEDIA [53]** & **S2 NetM [52]** & **SeMoM [57]** & **GMSCA [51]** \\ \hline \multirow{4}{*}{Blockchain Implementation} & Integrated for & & & & \\  & data integrity & & & & \\  & and security; & & & & \\  & utilises & Not Used & Not Used & Not Used & Not Used \\  & consensus & & & & \\  & mechanism & & & & \\ \hline \multirow{4}{*}{Encryption Techniques} & AES-256 for data & & & & & \\  & security; ECDSA & Various Network & & & \\  & for digital & Layer Protocols & Access Control & Not Specified & Role-based \\  & signing & & & & Authorization \\ \hline \multirow{4}{*}{Access Control Mechanisms} & PKI for device & & & & \\  & authentication; & & & & \\  & RBAC for & & & & \\  & authorising data & & & & \\  & transfer & & & & \\ \hline \multirow{4}{*}{Unique Security Features} & AI-driven & & & & \\  & feedback for & & & & \\  & continuous & & & & \\  & security & & & & \\  & enhancement; & & & & \\  & smart contracts & & & & \\  & for authenticated & & & & \\  & data access & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Comparative analysis of middleware solutions in IoT and smart city applications. ### Applying the AI Feedback and Analysis Module to the Scenario

The AI Feedback and Analysis Module, depicted in Figure 9, plays a crucial role in improving the middleware's functioning based on feedback from stakeholders. It employs a variety of machine learning techniques, such as deep learning, natural language processing (NLP), clustering and classification, and reinforcement learning (RL), to analyse the feedback and historical data, identify patterns, and suggest improvements. Consider a case where [PERSON], the healthcare data analyst, identifies a pattern where high heart rate alerts are being triggered during [PERSON]'s exercise routines, a known situation that does not require immediate alerts. [PERSON] provides feedback to the system, suggesting that [PERSON]'s physical activities should be taken into account alongside her heart rate before triggering an alert. This feedback is sent to the AI Feedback and Analysis Module. In this module, deep learning algorithms evaluate the feedback alongside historical data and infer that certain high heart rate events correlate with exercise sessions.