码迷,mamicode.com
首页 > 其他好文 > 详细

[Alljoyn] 1、物联网开源软件框架alljoyn研究(一)——初步了解

时间:2015-08-01 23:31:30      阅读:821      评论:0      收藏:0      [点我收藏+]

标签:

 

 

What is AllJoyn?[是一个合作的开源软件框架目的在于连接万物]

An Open Source API Framework For the Internet of Everything
A way devices and applications publish APIs over a network in a standard way
Why APIs?
– Because this is what software developers understand and work with every day
These APIs are the functionality that the “things” on the network expose to other “things”
– E.g. temperature, time of day, etc.…
– Services and/or devices can compose these APIs to provide whatever set of functionality they require
– The APIs are critical to interoperability between devices and services
How do applications know what APIs are available?
– AllJoyn provides application discovery and fine-grained discovery of the APIs supported by applications
– This is accomplished in a platform and radio-link agnostic way

Overview[它是一个分布式软件总线,该总线提供的“介质”能够使AllJoyn应用互相通信,应用可以被固化在微处理器、手机apps或者是传统的PC应用或服务;一个应用既可以是服务器又可以是客户端;该Bus的建立是ad hoc]

AllJoyn implements a “distributed software bus”
– The bus provides the “medium” that enables AllJoyn applications to communicate via published APIs
? Applications may be firmware on microcontrollers, mobile device “apps” or traditional applications on PCs/servers
– Applications publishing APIs are services, while those consuming the APIs are clients
? An application can be both a service and a client: this is makes AllJoyn a peer-to-peer system
– Communication is via messages that map directly to APIs in high-level programming languages
Bus formation is ad hoc
– Based on discovery of applications/services
– Abstracts link-specific discovery mechanisms
Protocol is network-independent
– Wire protocol is based on the D-Bus wire-protocol with extensions
– Can run over Wi-Fi, Wi-Fi Direct, Ethernet, PLC and Bluetooth
? Could likely run over others

High Level System Architecture[高层次体系结构包括路由节点和页节点,路由节点可以连接路由节点或叶节点,叶节点只能连接叶节点]

AllJoyn Bus is composed of two types of nodes:
– Routing Nodes (RN)
– Leaf Nodes (LN)
? LN can only connect to RN
? RN can connect to other RN
– AllJoyn can be thought of as a mesh of stars

Ad Hoc Bus Formation: Discovery[Ad Hoc Bus的发现机制:接口描述包含在About Message中,真正的发现机制是依赖运输层的,不同运输层采用的协议多不相同]

Interface descriptions contained in About message
? Services advertise, and Clients find, About messages
? connect to advertisers supporting desired interfaces
Actual discovery mechanism is transport dependent:
? On Wi-Fi, PLC, Ethernet: lightweight IP multicast protocol
? On Wi-Fi Direct: would use pre-association discovery

技术分享

 

Ad Hoc Bus Formation: Session Creation[会话建立将导致bus连接扩展]

Session creation will cause Routing Nodes to connect and extend the bus
? Once connected, buses merge and have a single shared namespace
? Peers can discover when other peers join or leave the bus
? Peers can interact via their APIs
? Session reference counting keeps device-to-device connections alive
? Multicast events can be sent to all peers in the session

技术分享

 

AllJoyn Software Framework: High-level architecture[软件框架高层体系结构]

A comprehensive software communication framework

技术分享

 

Software Components[AllJoyn由Client Library和Router组成。其中Client Library包括Standard Client(SC)和Thin Client(TC),SC跑在HLOS上,支持多线程,不同开发平台和语言。TC限制比较多,仅有C语言]

AllJoyn has two main architectural components: the Client Library and the Router
Client Library
– This is referred to as a Client Library because all AllJoyn applications are clients of the router
? This is true regardless of if, in their application context, they are exposing services, or are clients of other services
? Applications are peers if they implement both client and service functionality
– The Client Library is what software developers interact with: the API set of the AllJoyn SDK
– There are two implementations of the Client Library: the Standard Client (SC) and the Thin Client (TC)
– The SC is targeted at applications running in HLOS environments
? The SDK APIs for the SC provide a high level of abstraction, and allow complex multi-threaded applications
? Native implementation is in C++ and there are a number of language bindings for various platforms available
– The TC is targeted at applications that would reside on deeply embedded devices (i.e. device firmware)
? Targets a very minimal memory (RAM and ROM) footprint,
? Implemented in C, with no other language bindings
? TC depends on a Routing Node running elsewhere, likely off device

Software Components: Router[任何包含路由器的节点是路由节点,路由器使用SC(因此跑在HLOS上)

Router
– Any node containing the router is a Routing Node
– The router is built using the Standard Client library, and so must run on an HLOS
– This can be deployed as a standalone daemon/service or integrated with the SC in an application
? The only platforms on which standalone functionality is currently supported are Linux-based, such as OpenWRT
– The Router functionality consists of bus management and routing AllJoyn messages
? Bus management includes
– Managing the namespace: application addressing over the bus
– Cross-device communication: discovering services and connecting to the routing node supporting that service on behalf leaf nodes
? Message routing consists of delivering messages between applications, or to the router itself
– AllJoyn control signaling also uses AllJoyn messages
– Routing Nodes do the “heavy lifting” in the Alljoyn system
– Leaf Nodes depend on Routing Nodes to interact with other nodes

Software Components: Language Bindings

Standard Client Library supports multiple language bindings
? Java binding available, compatible with Dalvik
? Objective C binding is available for use on iOS and MacOS
? Managed C++, C#, WinJS, and Visual Basic are available for use in Windows 8 style applications
? Unity + C Binding available for use on Android
? NPAPI binding for JavaScript is available
– All of the bindings are currently wrappers around the native C++ implementation
– Same object model for all bindings
– Seamless interoperability between applications written in different languages
Thin Client Library only supports C
– Most appropriate language for embedded RTOS development
– Other language wrappers around the C implementation being investigated

 



 

 

[正版请搜索:beautifulzzzz(看楼主博客园官方博客,享高质量生活)]

[如果您也喜欢智能硬件的东西,可以交个朋友~]

[如果您胸怀大志,能团结各路豪杰的乱世英雄,也可以留下一下信息~]

AllJoyn持续更新中。。。\(^o^)/~ 

[Alljoyn] 1、物联网开源软件框架alljoyn研究(一)——初步了解

标签:

原文地址:http://www.cnblogs.com/zjutlitao/p/4694680.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!