Presentation is loading. Please wait.

Presentation is loading. Please wait.

TinyOS 石万兵 2019/4/6 mice.

Similar presentations


Presentation on theme: "TinyOS 石万兵 2019/4/6 mice."— Presentation transcript:

1 TinyOS 石万兵 2019/4/6 mice

2 报告内容 TinyOS简介 TinyOS的特点 TinyOS的编程 TinyOS的模拟器 TinyDB数据库
TinyOS的虚拟机--Mate 2019/4/6 mice

3 TinyOS简介 TinyOS是一个开源的嵌入式操作系统,它是由加州大学的伯利克分校开发出来的,主要应用于无线传感器网络方面。它是基于一种组件(Component-Based)的架构方式,使得能够快速实现各种应用。 2019/4/6 mice

4 TinyOS简介 TinyOS的程序采用的是模块化设计,所以它的程序核心往往都很小(一般来说核心代码和数据大概在400 Bytes左右),能够突破传感器存储资源少的限制,这能够让TinyOS很有效的运行在无线传感器网络上并去执行相应的管理工作等。 2019/4/6 mice

5 TinyOS简介 TinyOS本身提供了一系列的组件,可以很简单方便的编制程序,用来获取和处理传感器的数据并通过无线电来传输信息。
可以把TinyOS看成是一个可以与传感器进行交互的API接口,它们之间可以进行各种通讯。 2019/4/6 mice

6 TinyOS简介 TinyOS在构建无线传感器网络时,它会有一个基地控制台,主要是用来控制各个传感器子节点,并聚集和处理它们所采集到的信息。TinyOS只要在控制台发出管理信息,然后由各个节点通过无线网络互相传递,最后达到协同一致的目的,比较方便。 2019/4/6 mice

7 TinyOS 简介 2019/4/6 mice

8 TinyOS的特点 Componented-Based Architecture
TinyOS提供一系列可重用的组件,一个应用程序可以通过连接配置文件(A Wiring Specification)将各种组件连接起来,以完成它所需要的功能。 Event-Driven Architecture TinyOS的应用程序都是基于事件驱动模式的,采用事件触发去唤醒传感器工作。 2019/4/6 mice

9 TinyOS的特点 Tasks And Events Concurrency Model
tasks一般用在对于时间要求不是很高的应用中,且tasks之间是平等的,即在执行时是按顺序先后来得,而不能互相占先执行,一般为了减少tasks的运行时间,要求每一个task都很短小,能够使系统的负担较轻;events一般用在对于时间的要求很严格的应用中,而且它可以占先优于tasks和其他events执行,它可以被一个操作的完成或是来自外部环境的事件触发,在TinyOS中一般由硬件中断处理来驱动事件。 2019/4/6 mice

10 TinyOS的特点 Split-Phase Operations
在TinyOS中由于tasks 之间不能互相占先执行,所以TinyOS没有提供任何阻塞操作,为了让一个耗时较长的操作尽快完成,一般来说都是将对这个操作的需求和这个操作的完成分开来实现,以便获得较高的执行效率。 2019/4/6 mice

11 TinyOS的特点 Support self-configuration for sensor network
The message in TinyOS is fixed size Two kind of interrupt—Clock and Radio Single-shared stack No kernel,process management,virtual memory Complete integration with hardware 2019/4/6 mice

12 TOS Scheduler FIFO Scheduler
由于在TinyOS中没有进程管理的概念,它对任务是按简单的FIFO队列进行处理的,对资源采取预先分配,且这个队列里最多只能有7个未解决的任务。 TinyOS对任务的处理是按“bit-manipulation”方式进行的。 2019/4/6 mice

13 TOS Scheduler Prioritized Scheduler Each task given priority
Send/Receive,Encryption tasks given higher priority Higher priority tasks inserted ahead in the FIFO queue Queue full—lower priority posted task dropped Tasks preempted for every bit received 2019/4/6 mice

14 Network Management—Active Message
Simple,extensible paradigm Widely used in parallel and distributed systems Integrating communication and computation Distributed event model where networked nodes send event 2019/4/6 mice

15 Network Management—Active Message
Each Active Message Contains User-level handler to be invoked on arrival Data payload passed as argument Event-centric nature Enables network communication to overlap with sensor-interaction 2019/4/6 mice

16 Network Management—Active Message
Handler Functions Extract message quickly from network Provide data for computation/forward data Prevent network congestion Minimal Buffering—Pipeline analogy Quick execution of handlers prevents use of send/receive buffers 2019/4/6 mice

17 Network Management—Transmission Protocol
Ad-hoc 一种不需要网桥(AP)的无线对等传输模式 任两个sensor若在彼此的通讯覆盖范围内,则这两个sensor可直接互相通讯,共享资源 它具有对称性,即B若在A的通讯范围内,则A也在B的通讯范围内;但往往由于某些外部条件的限制,可能会造成这种对称的不协调 2019/4/6 mice

18 Network Management—Transmission Protocol
Multi-hoc 若在两个相距较远的sensor之间通讯,可以寻找一个中间的sensor作为转发的节点,则可以采用接力的方式来完成通讯过程 利用它可以增加无线网络的通讯范围,但随着传输次数增加,数据的正确率降低,传输过程的可靠性也降低 2019/4/6 mice

19 TinyOS的编程 nesC—是一种类似C的语言,它是对C的扩展,也是结构化的语言。它是基于组件式的编程,模块化的设计。
Module(模块) Configuration(连接配置文件) 2019/4/6 mice

20 nesC Component Module—在模块中主要实现代码的编制它可以使用和提供接口,在它的实现部分必须对提供接口里的command和使用接口里的event进行实现。 Configuration—在连接配置文件中主要是将各个组件和模块连接起来成为一个整体,它也可以提供和使用接口。 2019/4/6 mice

21 nesC Interface Interface 在接口里可以声明command和event
Interface有无参数和带参数两种。带参数的接口可以提供多个此接口的实例,每一个实例都有唯一的id标定,从而可以提供一种“fan-out”式的使用;且它的command和event在组件中使用时也必须带上这个参数 2019/4/6 mice

22 TinyOS Simulator TOSSIM—它可以同时模拟多个sensor nodes运行同一个程序,提供运行时的调试和配置,它可以实时监测网络状况,并向网络注入调试信息、Radio or UART packets等,还可以与网络进行交互。 2019/4/6 mice

23 TOSSIM Graph 2019/4/6 mice

24 TinyDB TinyDB 是TinyOS的查询处理系统,它能够从无线网络中的sensor节点上提取数据和信息。
TinyDB提供了一个简单的类似SQL的接口,只要你指定你所感兴趣的数据,它就能将它提取出来,并且通过设置适当的参数,还能够对数据进行过滤和聚集。 TinyOS为TinyDB提供了一个可视化的JAVA API窗口,可以进行实时查询。 2019/4/6 mice

25 TinyDB Features Distributed AQP
Runs on each sensor node Ability to select,join,project and aggregate Acquisitional techniques to reduce power consumption Interleaving query processing with local computations Quantitative analysis for data aggregate 2019/4/6 mice

26 TinyDB Basic Architecture
2019/4/6 mice

27 Acquisitional Query Language
Select-From-Where Clause Support join,projection and aggregation Explicit support for sampling intervals and windowing Sensor data Single table with one column per sensor type 2019/4/6 mice

28 TinyDB Sampling SELECT light,nodeid FROM sensors SAMPLE PERIOD 1024
‘sensors’----a virtual table ‘sample period’----specifies that a new light reading will be delivered once every 1024 milliseconds 2019/4/6 mice

29 TinyDB GUI 2019/4/6 mice

30 TinyDB GUI 2019/4/6 mice

31 TinyDB GUI 2019/4/6 mice

32 Virtual Machine—Mate Program TinyOS networks with short,high-level event handler scripts Tinyscript—a sample,BASIC-like scripting language Bytecode runs in sandboxed VM environment Buggy programs can’t crash a mote 2019/4/6 mice

33 Virtual Machine—Mate Safe execution environment
Impiled user/kernel boundary Event handler—execution triggered by predefined events Sure share variables have no race conditions Tiny code program—self-propagate into network 2019/4/6 mice

34 Mate GUI 2019/4/6 mice

35 报告完毕 谢谢大家 2019/4/6 mice


Download ppt "TinyOS 石万兵 2019/4/6 mice."

Similar presentations


Ads by Google