Chapter 5 IoT Design Methodology PDF

Summary

This document outlines the 10 steps of an IoT design methodology, from defining purpose and requirements to developing the IoT application. It includes sections on modeling, specifying services, and integration considerations. This document is suitable for university-level study.

Full Transcript

# Chapter 5: IoT Design Methodology ## Outline - IoT Design Methodology that includes: - Purpose & Requirements Specification - Process Specification - Domain Model Specification - Information Model Specification - Service Specifications - IoT Level Specification - Functional View Sp...

# Chapter 5: IoT Design Methodology ## Outline - IoT Design Methodology that includes: - Purpose & Requirements Specification - Process Specification - Domain Model Specification - Information Model Specification - Service Specifications - IoT Level Specification - Functional View Specification - Operational View Specification - Device & Component Integration - Application Development ## IoT Design Methodology - Steps | Step | Description | |---|---| | Purpose & Requirements | Define Purpose & Requirements of IoT system | | Process Model Specification | Define the use cases | | Domain Model Specification | Define Physical Entities, Virtual Entities, Devices, Resources and Services in the IoT system | | Information Model Specification | Define the structure (e.g. relations, attributes) of all the information in the IoT system | | Service Specifications | Map Process and Information Model to services and define service specifications | | IoT Level Specification | Define the IoT level for the system | | Functional View Specification | Map IoT Level to functional groups | | Operational View Specification | Define communication options, service hosting options, storage options, device options | | Device & Component Integration | Integrate devices, develop and integrate the components | | Application Development | Develop Applications | ## Step 1: Purpose & Requirements Specification - The first step in IoT system design methodology is to define the purpose and requirements of the system. - In this step, the system purpose, behavior and requirements (such as data collection requirements, data analysis requirements, system management requirements, data privacy and security requirements, user interface requirements) are captured. ## Step 2: Process Specification - The second step in the IoT design methodology is to define the process specification. - In this step, the use cases of the IoT system are formally described based on and derived from the purpose and requirement specifications. ## Step 3: Domain Model Specification - The third step in the IoT design methodology is to define the Domain Model. - The domain model describes main concepts, entities and objects in the domain of IoT system to be designed. - Domain model defines the attributes of the objects and relationships between objects. - Domain model provides an abstract representation of the concepts, objects and entities in the IoT domain, independent of any specific technology or platform. - With the domain model, IoT system designers can get an understanding of the IoT domain for which the system is to be designed. ## Step 4: Information Model Specification - The fourth step in the IoT design methodology is to define the Information Model. - Information Model defines the structure of all the information in the IoT system, for example, attributes of Virtual Entities, relations, etc. - Information model does not describe the specifics of how the information is represented or stored. - To define the information model, we first list the Virtual Entities defined in the Domain Model. - Information model adds more details to the Virtual Entities by defining their attributes and relations. ## Step 5: Service Specifications - The fifth step in the IoT design methodology is to define the service specifications. - Service specifications define the services in the IoT system, service types, service inputs/output, service endpoints, service schedules, service preconditions and service effects. ## Step 6: IoT Level Specification - The sixth step in the IoT design methodology is to define the IoT Level for the system. - In Chapter-1, we defined five IoT deployment levels. ## Step 7: Functional View Specification - The seventh step in the IoT design methodology is to define the Functional View. - The Functional View (FV) defines the functions of the IoT systems grouped into various Functional Groups (FGs). - Each Functional Group either provides functionalities for interacting with instances of concepts defined in the Domain Model or provides information related to these concepts. - It provides a detailed description of the system's functionalities, components, and their interactions, focusing on what the system does and how it operates. ## Step 8: Operational View Specification - The eighth step in the IoT design methodology is to define the Operational View Specifications. - In this step, various options pertaining to the IoT system deployment and operation are defined, such as, service hosting options, storage options, device options, application hosting options, etc. ## Step 9: Device & Component Integration - The ninth step in the IoT design methodology is the integration of the devices and components. ## Step 10: Application Development - The final step in the IoT design methodology is to develop the IoT application. ## Home Automation Case Study ## Step:1 - Purpose & Requirements - Applying this to the example of a smart home automation system, the purpose and requirements for the system may be described as follows: - **Purpose:** A home automation system that allows controlling of the lights in a home remotely using a web application. - **Behavior:** The home automation system should have auto and manual modes. - In auto mode, the system measures the light level in the room and switches on the light when it gets dark. - In manual mode, the system provides the option of manually and remotely switching on/off the light. - **System Management Requirement:** The system should provide remote monitoring and control functions. - **Data Analysis Requirement:** The system should perform local analysis of the data. - **Application Deployment Requirement:** The application should be deployed locally on the device, but should be accessible remotely. - **Security Requirement:** The system should have basic user authentication capability. ## Step:2 - Process Specification - A diagram depicts an abstract representation of the process. The diagram shows a branching process starting with a Mode node. The Mode node branches out into "Auto" and "Manual". The "Auto" branch flows into a "Light-Level" node, which has two states: "Level: Low" and "Level: High". Both states then have two sub-states: "state: On" and "state: Off". The "Manual" branch flows into a "Light-State" node, which also has two states: "state: On" and "state: Off". The "On" and "OFF" states are further broken down into two states "state: On" and "state: Off". ## Step 3: Domain Model Specification - A diagram depicts a Domain Model specification for a home automation system. The diagram shows the main concepts, entities, and relationships that govern the interaction between different elements in the system. It outlines the overall structure from a high-level perspective. - Key Entities: - User - Active Digital Artefact App - Human User, - Virtual Entity: Room - Physical Entity: Room, Appliance, Device, Minicomputer - Service - Resource - Network Resource - OnDevice Resource - Sensor, LDR - Actuator, Relay - Key Relationships: - Interacts with - Relates to - Monitors - Acts on - Invokes/Subscribes - Associated with - Exposes, Hosts, Attached to - One-way Association - Generalization/Specialization - Aggregation Relationship - Type: Entity, service, resource, device, attribute ## Step 4: Information Model Specification - A diagram depicts the structure of all the information in the IoT system, showing the attributes of Virtual Entities and their relationship. - Virtual Entities: - Room (EntityType: Room, ID: Room1) - Light Appliance (EntityType: Appliance, ID: Light1, RoomID: Room1) - Attributes: - Light-Level (AttributeName: lightLevel, AttributeType: level) - State (AttributeName: lightState, AttributeType: state) - Relationships: - Has light-Level - Is in state ## Step 5: Service Specifications - A diagram depicts service specifications for a home automation system. The diagram includes the inputs, outputs, and relationships between the system's components and services. - It shows three services: - Mode (Type: REST) - State (Type: REST) - Controller (Type: Native) ## Step 6: IoT Level Specification - A diagram depicts the structure of an IoT system, showcasing the communication and interactions between components at the local and cloud levels. - **Local:** - App - REST Communication - Database - Controller service - Resource - Device - Monitoring Node (performs analysis, stores data) - **Cloud:** - Node (smart device or sensor with computing capabilities, connectivity, sensors or actuators to collect, process, and exchange data.) - Controller service (manages and controls devices, data flow, or other aspects of an IoT system) - REST services (implement RESTful architecture for facilitating communication and interaction between IoT devices, applications, and systems) ## Step 7: Functional View Specification - A diagram showcases the Functional View Specification of a home automation system. This diagram depicts a mapping between the system functionalities, components, and their interaction, highlighting the system's operations in detail. - Functional Groups: - Device - Management - Services - Security - Communication - Application - Relationships: - 1. IoT device maps to the Device FG (sensors, actuators devices, computing devices) and the Management FG (device management) - 2. Resources map to the Device FG (on-device resource) and Communication FG (communication APIs and protocols) - 3. Controller service maps to the Services FG (native service). Web Services mapto Services FG (web services) - 4. Web Services map to Services FG (web services) - 5. Database maps to the Management FG (database management) and Security FG (database security) - 6. Application maps to the Application FG (web application, application and database servers), Management FG (app management) and Security FG (appsecurity) ## Step 8: Operational View Specification - A diagram depicts the system deployment and operation, using a box-and-arrow structure. - Key Components: - Native Service - Web Services - Application Management - Database Management - Device Management - Computing Device - Sensor - Actuator - Web App - Application Server - Database Server - Security - Authentication - Communication - Key Relationships: - Communication APIs - Communication Protocols - Device - Management - Services - Application - The IoT system deployment and operation are defined, such as, **service hosting options**, **storage options**, **device options**, **application hosting options**, etc. ## Step 9: Device & Component Integration - A diagram shows how to integrate a Raspberry Pi with an LDR (Light Dependent Resistor), ULN2803A, and a relay. The circuit is shown connected to a breadboard, suggesting the assembly of a component. - The circuit is designed to control a linear actuator based on the light level detected by the LDR. - This step focuses on the physical integration of the device and the component. ## Step 10: Application Development - A diagram depicts the UI of a home automation system with the user interface showing options for "Auto" and "Light". - **Auto:** Controls the light appliance automatically based on the lighting conditions in the room. - **Light:** This is used when Auto mode is off and allows the user to manually control the light appliance or to reflect the current state of the light appliance when Auto mode is on. ## Implementation: RESTful Web Services - A diagram shows how REST services are implemented with the Django REST Framework. - The diagram showcases a process that includes four key steps: - **1. Map services to models**. Model fields store the states (on/off, auto/manual) - **2. Write Model serializers**: Serializers allow complex data (such as model instances) to be converted to native Python datatypes that can then be easily rendered into JSON, XML or other content types. - **3. Write ViewSets for the Models**: This combines the logic for a set of related views in a single class. - **4. Write URL patterns for the services**. Since ViewSets are used instead of views, the URL conf is automatically generated. - The implementation of the RESTful web services is described in detail, including the code snippets and explanations regarding: - **Models (models.py)** - **Serializers (serializers.py)** - **Views (views.py)** - **URL Patterns (urls.py)** - **REST API:** - **Screenshot of browsable State REST API** - **Screenshot of browsable Mode REST API** - **RESTful web services:** This section provides detailed information on RESTful web services, including their functions, characteristics, and the HTTP methods they utilize. ## Implementation: Controller Native Service - A diagram showcases the implementation of a Controller Native Service using Python. - The code snippets provided demonstrate the implementation of the native service, including code specifically for reading data from an LDR (Light Dependent Resistor) sensor, switching on/off a light, and executing automated and manual modes for controlling the light appliance. ## Native Services vs Web Services - A description highlights the differences between native services and web services. - **Native Services:** - Built for specific platforms or device types, often installed on the device itself. - Written in languages specific to the platform, e.g., Java or Swift. - Can access system/device resources, e.g., GPS or camera. - Can function without an internet connection. - Generally have higher security and safety than web apps. - **Web Services:** - Delivered over the internet and accessed through a web browser. - Users do not need to install them on their devices. - Written in languages like JavaScript, CSS, and HTML5, similar to websites. - **Comparison:** - Native apps are generally faster and more secure but require more development time and resources. - Web apps are easier to develop and maintain but may not offer the same level of performance or security as native apps. ## Implementation: Application - A diagram illustrates a Django Application, highlighting the implementation of the application views (views.py) and the Django application template, illustrating the logic behind the "Auto" and "Light" UI buttons. - **1. Implement Django Application View:** The code snippet shows how to handle user requests, send information to a REST API, analyze responses, and dynamically update the page based on the received data. - **2. Implement Django Application Template:** (This step focuses on the frontend of the application, presenting the HTML code of the user interface, along with styling and code snippets for dynamically enabling or disabling UI elements based on user input.) ## Finally - Integrate the System - A diagram depicts a visual representation of the system's integration, showcasing the components and their relationships within a local and cloud environment. The diagram highlights these aspects: - **Setup the device** - **Deploy and run the REST and Native services** - **Deploy and run the Application** - **Setup the database** - **Deployment Scenario-1:** - The diagram separates the system's components into "Local" and "Cloud." - **Local:** Includes the App, Database, Controller service, Resource, and Device. - **Cloud:** Includes the Django Application, SQLite Database, and Raspberry Pi. - The deployment scenario showcases the relationship between each component, emphasizing their roles and communication pathways. - **Django Application:** utilizes REST services through Django REST Framework. - **SQLite Database:** stores and manages data for the application and services. - **Native Service:** runs on a Raspberry Pi, handling local data and controlling the actuators based on sensor input. - **Raspberry Pi:** a device connected to sensors and actuators and hosts the native service, managing the interaction between the physical world and the application. - The diagram clearly illustrates how the various components interact, enabling a complete and integrated home automation system.

Use Quizgecko on...
Browser
Browser