0% found this document useful (0 votes)
12 views25 pages

IOT Module 3 Notes

The document outlines the vision, mission, program educational objectives, and outcomes for a Computer Science and Engineering program focused on the Internet of Things (IoT). It details the IoT design methodology, including specifications for purpose, process, domain, information, service, and application development, as well as an introduction to Python programming for IoT applications. Assessment methods and specific outcomes related to computer system components and intelligent internet applications are also included.

Uploaded by

elaika2015
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views25 pages

IOT Module 3 Notes

The document outlines the vision, mission, program educational objectives, and outcomes for a Computer Science and Engineering program focused on the Internet of Things (IoT). It details the IoT design methodology, including specifications for purpose, process, domain, information, service, and application development, as well as an introduction to Python programming for IoT applications. Assessment methods and specific outcomes related to computer system components and intelligent internet applications are also included.

Uploaded by

elaika2015
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

INTERNET OF THINGS [BCS701]

Department of Computer Science and Engineering


VISION

To be recognized as a center of knowledge dissemination in Computer Science and


Engineering by imparting value-added education to transform budding minds into competent
computer professionals.

MISSION
• Provide a value-based learning environment enriched with ethics, honesty and integrity
that equips students to cater to the needs of society and industry.
• Augment the knowledge of students towards cutting-edge technologies and state-of-the
art tools of Computer Science & Engineering.
• Create opportunities for all-round development of students through co-curricular and
extra-curricular activities.
• Promote research, innovation and development activities in the field of Computer Science
among staff and students without any bias.

PROGRAM EDUCATIONAL OBJECTIVES

1. Graduates will work productively as computer science engineers exhibiting ethical

qualities and leadership roles in multi-disciplinary teams.


2. Graduates will adapt to the changing technologies, tools and societal requirements.
3. Graduates will design and deploy software that meets the needs of individuals and the
industries.
4. Graduates will take up higher education and/or be associated with the field so that
they can keep themselves abreast of Research & Development.

1
INTERNET OF THINGS [BCS701]

PROGRAM OUTCOMES

Engineering graduates in Computer Science and Engineering will be able to:


1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering
fundamentals, and an engineering specialization to the solution of complex engineering
problems.
2. Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of
mathematics, natural sciences, and engineering sciences.
3. Design/development of solutions: Design solutions for complex engineering problems
and design system components or processes that meet the specified needs with
appropriate consideration for the public health and safety, and the cultural, societal, and
environmental considerations.
4. Conduct investigations of complex problems: Use research-based knowledge and
research methods including design of experiments, analysis and interpretation of data,
and synthesis of the information to provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modeling to complex
engineering activities with an understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to
assess societal, health, safety, legal and cultural issues and the consequent responsibilities
relevant to the professional engineering practice.
7. Environment and Sustainability: Understand the impact of the professional engineering
solutions in societal and environmental contexts, and demonstrate the knowledge of, and
need for sustainable development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities
and norms of the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or
leader in diverse teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and
write effective reports and design documentation, make effective presentations, and give
and receive clear instructions.

2
INTERNET OF THINGS [BCS701]

11. Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a member
and leader in a team, to manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for, and have the preparation and ability to engage
in independent and life-long learning in the broadest context of technological change.

PROGRAM SPECIFIC OUTCOMES


[Link] System Components: Apply the principles of computer system software
engineering to design, develop and deploy computer subsystems.
2. Intelligent Internet Applications: Apply the knowledge of data storage, analytics and
internet architecture in designing Internet based application.

3
INTERNET OF THINGS [BCS701]

CO:3 Apply the concepts of python programming for different IoT applications.

CO:4 Develop applications using python programming with Raspberry Pi.

Interpret different data analytics frameworks for IoT.


CO:5

ASSESSMENT METHODS-DIRECT

UNIVERSITY EXAMINATION (SEE) 50 Marks (100 scaled down to 50)

INTERNAL ASSESSMENT (CIE) 50 Marks (100 scaled down to 50)

• TEST – 2
25 Marks (25 + 25 marks scaled down to 15)

• Mini Project-1
10 Marks (10 + 10 marks scaled down to 10)
• PRACTICAL SESSION 25 Marks
a) Continuous evaluation 15 Marks
b) Lab CIE Test 10 Marks

4
INTERNET OF THINGS [BCS701]

MODULE – 3

SYLLABUS

IoT Design Methodology: 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

Introduction to Python: Installing Python, Python Data Types & Data Structures, Control Flow, Functions,
Modules, Packages, File Input/Output, Date/Time Operations, Classes.

Textbook: Ch. 5.2 - 5.4, 6.2 – 6.11.

IOT Design Methodology

SESSION – 1

Fig 3.1: IoT Design Methodology - Steps

5
INTERNET OF THINGS [BCS701]

3.1 IOT Design and Methodology


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 the 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, the 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 Specification


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

6
INTERNET OF THINGS [BCS701]

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.

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.

7
INTERNET OF THINGS [BCS701]

3.2 Home Automation Case Study


Step 1: Purpose & Requirements Specification
Applying this to our 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.
• Behaviour: 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

Fig 3.2: Process specification for home automation IoT system

8
INTERNET OF THINGS [BCS701]

Step 3: Domain Model Specification

Fig 3.3: Domain model of the home automation IoT system

Step 4: Information Model Specification

Fig 3.4: Information model of the home automation IoT system


9
INTERNET OF THINGS [BCS701]

Fig 3.5: Deriving services from process specification and information model for home automation IoT system

Step 5: Service Specification

Fig 3.6: service specification of the home automation IoT system

10
INTERNET OF THINGS [BCS701]

Step 6: IOT Level Specification

Fig 3.7: Deployment design of the home automation IoT system

Step 7: Functional View Specification

Fig 3.8: Mapping deployment level to functional groups for home automation IoT System

11
INTERNET OF THINGS [BCS701]

Step 8: Operational View Specification

Fig 3.9: Mapping functional groups to operational view for home automation IoT System

Step 9: Device & Component Integration

Fig 3.10: Schematic diagram of the home automation IoT system showing the device, sensor and actuator integrated

Step 10: Application Development


• Auto: Controls the light appliance automatically based on the lighting conditions in
the room
• Light: When Auto mode is off, it is used for manually controlling the light appliance.
When Auto mode is on, it reflects the current state of the light appliance.

12
INTERNET OF THINGS [BCS701]

3.3 IoT Systems – Logical Design using Python

3.3.1 Introduction to Python


Python is a general-purpose high level programming language and suitable for providing a
solid foundation to the reader in the area of cloud computing.

The main characteristics of Python are:


Multi-paradigm programming language
• Python supports more than one programming paradigms including object-oriented
programming and structured programming
Interpreted Language
• Python is an interpreted language and does not require an explicit compilation step.
The Python interpreter executes the program source code directly, statement by
statement, as a processor or scripting engine does.
Interactive Language
• Python provides an interactive mode in which the user can submit commands at the
Python prompt and interact with the interpreter directly.

Benefits of Python:
Easy-to-learn, read and maintain
• Python is a minimalistic language with relatively few keywords, uses English
keywords and has fewer syntactical constructions as compared to other languages.
Reading Python programs feels like English with pseudo-code like constructs. Python
is easy to learn yet an extremely powerful language for a wide range of applications.
Object and Procedure Oriented
• Python supports both procedure-oriented programming and object-oriented
programming. Procedure oriented paradigm allows programs to be written around
procedures or functions that allow reuse of code. Procedure oriented paradigm allows
programs to be written around objects that include both data and functionality.
Extendable
• Python is an extendable language and allows integration of low-level modules written
in languages such as C/C++. This is useful when you want to speed up a critical
portion of a program.
Scalable
• Due to the minimalistic nature of Python, it provides a manageable structure for large
programs.
Portable
• Since Python is an interpreted language, programmers do not have to worry about
compilation, linking and loading of programs. Python programs can be directly
executed from source

13
INTERNET OF THINGS [BCS701]

Broad Library Support


• Python has a broad library support and works on various platforms such as Windows,
Linux, Mac, etc.

3.3.2 Python Setup


Windows:
• Python binaries for Windows can be downloaded from [Link] .
• For the examples and exercise in this book, you would require Python 2.7 which can
be directly downloaded from: [Link]
[Link] .
• Once the python binary is installed you can run the python shell at the command
prompt using > python

Linux:

3.3.3 Python Data Types & Data Structures

[Link] Numbers:
Number data type is used to store numeric values. Numbers are immutable data types,
therefore changing the value of a number data type results in a newly allocated object.

14
INTERNET OF THINGS [BCS701]

[Link] Strings:
A string is simply a list of characters in order. There are no limits to the number of characters
you can have in a string.

[Link] Lists:
List a compound data type used to group together other values. List items need not all have
the same type. A list contains items separated by commas and enclosed within square
brackets.

15
INTERNET OF THINGS [BCS701]

[Link] Tuples:
A tuple is a sequence data type that is similar to the list. A tuple consists of a number of values
separated by commas and enclosed within parentheses. Unlike lists, the elements of tuples
cannot be changed, so tuples can be thought of as read-only lists.

[Link] Dictionary:
Dictionary is a mapping data type or a kind of hash table that maps keys to values. Keys in a
dictionary can be of any data type, though numbers and strings are commonly used for keys. Values
in a dictionary can be any data type or object.

[Link] Type Conversions:

16
INTERNET OF THINGS [BCS701]

3.3.4 Control Flow

[Link] if Statement:
The if statement in Python is similar to the if statement in other languages.

[Link] for Statement:


• The for statement in Python iterates over items of any sequence (list, string, etc.) in
the order in which they appear in the sequence.
• This behaviour is different from the for statement in other languages such as C in
which an initialization, incrementing and stopping criteria are provided.

[Link] while statement:


The while statement in Python executes the statements within the while loop as long as the
while condition is true.

[Link] Range Statement:


The range statement in Python generates a list of numbers in arithmetic progression.

17
INTERNET OF THINGS [BCS701]

[Link] break/continue statements:


The break and continue statements in Python are similar to the statements in C.

[Link] pass Statements:


• The pass statement in Python is a null operation.
• The pass statement is used when a statement is required syntactically but you do not want
any command or code to execute.

18
INTERNET OF THINGS [BCS701]

3.3.5 Functions:
A function is a block of code that takes information in (in the form of parameters), does some
computation, and returns a new piece of information based on the parameter information.

A function in Python is a block of code that begins with the keyword def followed by the function
name and parentheses. The function parameters are enclosed within the parenthesis.

The code block within a function begins after a colon that comes after the parenthesis enclosing
the parameters.

The first statement of the function body can optionally be a documentation string or docstring.

[Link] Default Arguments:


• Functions can have default values of the parameters.
• If a function with default values is called with fewer parameters or without any parameter,
the default values of the parameters are used

19
INTERNET OF THINGS [BCS701]

[Link] Passing by Reference:


• All parameters in the Python functions are passed by reference.
• If a parameter is changed within a function the change also reflected back in the calling
function.

[Link] Keyword Arguments:


Functions can also be called using keyword arguments that identifies the arguments by the
parameter name when the function is called.

[Link] Variable Length Arguments:


Python functions can have variable length arguments. The variable length arguments are passed to
as a tuple to the function with an argument prefixed with asterix (*)

20
INTERNET OF THINGS [BCS701]

3.3.6 Modules
• Python allows organizing the program code into different modules which improves the code
readability and management.
• A module is a Python file that defines some functionality in the form of functions or classes.
• Modules can be imported using the import keyword.
• Modules to be imported must be present in the search path.

3.3.7 Packages
Python package is hierarchical file structure that consists of modules and subpackages.

Packages allow better organization of modules related to a single application environment.

21
INTERNET OF THINGS [BCS701]

3.3.8 File Handling


• Python allows reading and writing to files using the file object.
• The open(filename, mode) function is used to get a file object.
• The mode can be read (r), write (w), append (a), read and write (r+ or w+), read-binary (rb),
write-binary (wb), etc.
• After the file contents have been read the close function is called which closes the file
object.

22
INTERNET OF THINGS [BCS701]

3.3.9 Date/Time Operations


• Python provides several functions for date and time access and conversions.
• The datetime module allows manipulating date and time in several ways.
• The time module in Python provides various time-related functions.

3.3.10 Classes
Python is an Object-Oriented Programming (OOP) language. Python provides all the standard
features of Object Oriented Programming such as classes, class variables, class methods, inheritance,
function overloading, and operator overloading.
1. Class:
• A class is simply a representation of a type of object and user-defined prototype for an
object that is composed of three things: a name, attributes, and operations/methods.

2. Instance/Object:
• Object is an instance of the data structure defined by a class.

3. Inheritance:
• Inheritance is the process of forming a new class from an existing class or base class.

4. Function overloading:
• Function overloading is a form of polymorphism that allows a function to have different
meanings, depending on its context.

5. Operator overloading:
• Operator overloading is a form of polymorphism that allows assignment of more than one
function to a particular operator.

23
INTERNET OF THINGS [BCS701]

6. Function overriding:
• Function overriding allows a child class to provide a specific implementation of a function
that is already provided by the base class. Child class implementation of the overridden
function has the same name, parameters and return type as the function in the base class.

[Link] Class Example


The variable studentCount is a class variable that is shared by all instances of the class Student and
is accessed by [Link].

The variables name, id and grades are instance variables which are specific to each instance of the
class.

There is a special method by the name __init__() which is the class constructor.

The class constructor initializes a new instance when it is created. The function __del__() is the class
destructor

24
INTERNET OF THINGS [BCS701]

[Link] Class Inheritance


In this example Shape is the base class and Circle is the derived class. The class Circle inherits the
attributes of the Shape class.

The child class Circle overrides the methods and attributes of the base class (eg. draw() function
defined in the base class Shape is overridden in child class Circle).

25

You might also like