Hyper Sensor Markup Language
超传感器标记语言(HSML)

HSML是一种面向物联网(Internet of Things)的混搭(Mashup)语言,它能够在异构的传感器、促动器和网络服务之间,实现快速、可定制的服务合成。无论是否具备技术背景,用户都可以轻松地检索、集成和共享现有的物联网服务,并构建属于自己的物联网应用。
当前的物联网应用开发依赖于多种高度垂直、封闭式的硬件、标准、协议和技术栈,它们形成了各自孤立的技术孤岛(technical silos),不仅造成了高昂的技术门槛与开发成本,也使得大部分Internet of Things系统并不能真正互通,而仅仅是Internet-connected Things。 HSML旨在打破上述的技术壁垒,通过提供一种统一的物联网服务封装、描述和合成机制,屏蔽复杂的底层技术细节,而仅暴露标准的网络服务接口,从而实现终端用户的无代码/低代码开发。

HSML is a Internet-of-Thing Mashup language that enables swift, customizable service compositions among heterogeneous sensors. actuators and web services. Users, with or without technical expertise, are able to easily retrieve, intergrate and share existed IoT services and establish their own applications. Current IoT application development relies on a variety of highly vertical, monolithic hardware platforms, standards, protocols, and technology stacks. These form isolated technical silos, which not only result in high technical barriers and development costs, but also mean that most “Internet of Things” systems are not truly interoperable—instead, they are merely Internet‑connected things. HSML aims to break down the above-mentioned technical barriers by providing a unified mechanism for encapsulating, describing, and composing IoT services. It conceals complex low-level technical details and exposes only standardized web service interfaces, thereby enabling no-code/low-code development for end users.

HSML用于标记物联网服务状态及状态转移的句法示意

如上图所示,HSML采用了与目前WWW技术栈被最广泛使用的超文本标记语言(HTML)十分近似的标记语言形式,从而延续其较高的可读性与使用一致性。它提供三种描述符,分别是:

As shown in the figure above, HSML adopts a markup language format that closely resembles HyperText Markup Language (HTML), the most widely used language in the current WWW technology stack, thereby inheriting its high readability and consistency of use. It provides three types of descriptors, respectively:

  • 资源描述符(Resource Descriptor):用于获取以及描述用于合成的传感器/促动器网络资源。
    For accessing and describing composable sensor/ actuator resources.
  • 服务描述符(Service Descriptor):用于将已导入的网络资源进一步与特定的服务关联。
    For associating specific service components with imported resources.
  • 状态转移描述符(State Transfer Descriptor):用于将两个及以上的物联网资源的状态转移根据用户指定的规则互相连结。
    For linking state transfers of two or more resources together according to designated rules.

此处涉及到了一个关键概念,即物联网资源的「状态」与「状态转移」。HSML采用了基于RESTful(Representational State Transfer)风格的标准网络服务接口,用户无需知道物联网资源内部的工作机制,仅通过统一的状态接口、并采用标准的HTTP通讯协议来获取或者设置对应资源的状态。其底层是一种基于有限状态机(Finite State Machine)的概念模型,确保各类异构的物联网设备及其API/SDK被封装成网络服务后的服务接口能够用不同的状态与状态之间的转移来进行描述。同时我们采用了服务编排(Service Orchestration)架构来对封装后的物联网资源进行统一的调度和管理。

A key concept here is the “state” of IoT resources and their “state transfer”. HSML adopts standard web service interfaces in a RESTful (Representational State Transfer) style, so that users do not need to understand the internal workings of IoT resources; instead, they can obtain or set the state of a given resource solely through unified state interfaces and the standard HTTP communication protocol. Underlying this is a conceptual model based on finite state machines (FSMs), which ensures that, once heterogeneous IoT devices and their APIs/SDKs are encapsulated as web services, their interfaces can be described in terms of distinct states and the transitions between those states. At the same time, we employ a service orchestration architecture to provide unified scheduling and management of these encapsulated IoT resources.

HSML文本编辑器以及传感器数据实时可视化案例

上图展示了一个利用HSML编写的传感器数据实时可视化的简单案例。其中每一个<loc>标签描述了一个封装好的环境数据传感器,通过filter服务描述符来过滤所需的数据域,viz服务描述符来指定所需的可视化效果。因此一行HSML语句即可完成针对一个传感器数据的实时可视化。
另一个案例仅仅使用了三行HSML语句,前两个<loc>标签分别指定了获取一个麦克风和一个无人机网络服务的地址,最后一个<lnk>指定了将麦克风的白噪声强度(mobileMic.data.pow)实时映射到无人机上升速度上(drone.upspeed),从而形成一个基于二者之间状态转移的控制回路,如下图所示。

The figure above shows a simple example of real-time sensor data visualization implemented using HSML. In this example, each <loc> tag describes an encapsulated environmental data sensor. The filter service descriptor is used to filter the required data fields, and the viz service descriptor is used to specify the desired visualization effect. As a result, a single line of HSML code is sufficient to achieve real-time visualization for one sensor’s data. Another example uses only three lines of HSML statements. The first two <loc> tags respectively specify the network service addresses for a microphone and a drone. The last <lnk> tag specifies that the microphone’s white noise intensity (mobileMic.data.pow) is to be mapped in real time to the drone’s ascent speed (drone.upspeed), thereby forming a control loop based on the state transitions between the two, as show in the figure below.

基于物联网的泛在式游戏化体验

上述使用吹气控制无人机浮起的案例起源于我们想要实现一个物理现实中的Flappy Bird游戏。物联网作为沟通数字世界与物理世界的重要界面技术(Interfacing Technology)之一,其技术赋能特性能够为包括混合现实在内的扩张现实技术栈带来进一步将可玩性/游戏化体验扩张至日常生活空间的可能性。而HSML及其底层的物联网服务框架则为这一未来愿景奠定了计算架构和终端用户参与的基础。
有关HSML的详细信息请参考此处

The above example of using exhaled breath to make a drone float originated from our attempt to create a physical version of the game Flappy Bird. As one of the key interfacing technologies between the digital and physical worlds, the technological affordance of IoT can empower extended reality technologies—including mixed reality—to further expand playability and gamified experiences into everyday living spaces. HSML and its underlying IoT service framework, in turn, lay the computational and end-user participation foundations for this envisioned future. Please refer here for more details about HSML.