Internet Engineering Task Force (IETF) C. Jennings Request for Comments: 8428 Cisco Category: Standards Track Z. Shelby ISSN: 2070-1721 ARM J. Arkko A. Keranen Ericsson C. Bormann Universitaet Bremen TZI August 2018
Internet Engineering Task Force (IETF) C. Jennings Request for Comments: 8428 Cisco Category: Standards Track Z. Shelby ISSN: 2070-1721 ARM J. Arkko A. Keranen Ericsson C. Bormann Universitaet Bremen TZI August 2018
Sensor Measurement Lists (SenML)
传感器测量列表(SenML)
Abstract
摘要
This specification defines a format for representing simple sensor measurements and device parameters in Sensor Measurement Lists (SenML). Representations are defined in JavaScript Object Notation (JSON), Concise Binary Object Representation (CBOR), Extensible Markup Language (XML), and Efficient XML Interchange (EXI), which share the common SenML data model. A simple sensor, such as a temperature sensor, could use one of these media types in protocols such as HTTP or the Constrained Application Protocol (CoAP) to transport the measurements of the sensor or to be configured.
本规范定义了在传感器测量列表(SenML)中表示简单传感器测量和设备参数的格式。表示是在JavaScript对象表示法(JSON)、简明二进制对象表示法(CBOR)、可扩展标记语言(XML)和高效XML交换(EXI)中定义的,它们共享通用的SenML数据模型。一个简单的传感器,如温度传感器,可以使用HTTP或受限应用协议(CoAP)等协议中的这些介质类型之一来传输传感器的测量值或进行配置。
Status of This Memo
关于下段备忘
This is an Internet Standards Track document.
这是一份互联网标准跟踪文件。
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.
本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 7841第2节。
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8428.
有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问https://www.rfc-editor.org/info/rfc8428.
Copyright Notice
版权公告
Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved.
版权所有(c)2018 IETF信托基金和确定为文件作者的人员。版权所有。
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(https://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。
Table of Contents
目录
1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Requirements and Design Goals . . . . . . . . . . . . . . . . 4 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 6 4. SenML Structure and Semantics . . . . . . . . . . . . . . . . 6 4.1. Base Fields . . . . . . . . . . . . . . . . . . . . . . . 7 4.2. Regular Fields . . . . . . . . . . . . . . . . . . . . . 7 4.3. SenML Labels . . . . . . . . . . . . . . . . . . . . . . 8 4.4. Extensibility . . . . . . . . . . . . . . . . . . . . . . 9 4.5. Records and Their Fields . . . . . . . . . . . . . . . . 9 4.5.1. Names . . . . . . . . . . . . . . . . . . . . . . . . 9 4.5.2. Units . . . . . . . . . . . . . . . . . . . . . . . . 10 4.5.3. Time . . . . . . . . . . . . . . . . . . . . . . . . 10 4.5.4. Values . . . . . . . . . . . . . . . . . . . . . . . 11 4.6. Resolved Records . . . . . . . . . . . . . . . . . . . . 12 4.7. Associating Metadata . . . . . . . . . . . . . . . . . . 12 4.8. Sensor Streaming Measurement Lists (SenSML) . . . . . . . 12 4.9. Configuration and Actuation Usage . . . . . . . . . . . . 13 5. JSON Representation (application/senml+json) . . . . . . . . 13 5.1. Examples . . . . . . . . . . . . . . . . . . . . . . . . 14 5.1.1. Single Data Point . . . . . . . . . . . . . . . . . . 14 5.1.2. Multiple Data Points . . . . . . . . . . . . . . . . 14 5.1.3. Multiple Measurements . . . . . . . . . . . . . . . . 15 5.1.4. Resolved Data . . . . . . . . . . . . . . . . . . . . 17 5.1.5. Multiple Data Types . . . . . . . . . . . . . . . . . 17 5.1.6. Collection of Resources . . . . . . . . . . . . . . . 18 5.1.7. Setting an Actuator . . . . . . . . . . . . . . . . . 18 6. CBOR Representation (application/senml+cbor) . . . . . . . . 19 7. XML Representation (application/senml+xml) . . . . . . . . . 21 8. EXI Representation (application/senml-exi) . . . . . . . . . 23
1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Requirements and Design Goals . . . . . . . . . . . . . . . . 4 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 6 4. SenML Structure and Semantics . . . . . . . . . . . . . . . . 6 4.1. Base Fields . . . . . . . . . . . . . . . . . . . . . . . 7 4.2. Regular Fields . . . . . . . . . . . . . . . . . . . . . 7 4.3. SenML Labels . . . . . . . . . . . . . . . . . . . . . . 8 4.4. Extensibility . . . . . . . . . . . . . . . . . . . . . . 9 4.5. Records and Their Fields . . . . . . . . . . . . . . . . 9 4.5.1. Names . . . . . . . . . . . . . . . . . . . . . . . . 9 4.5.2. Units . . . . . . . . . . . . . . . . . . . . . . . . 10 4.5.3. Time . . . . . . . . . . . . . . . . . . . . . . . . 10 4.5.4. Values . . . . . . . . . . . . . . . . . . . . . . . 11 4.6. Resolved Records . . . . . . . . . . . . . . . . . . . . 12 4.7. Associating Metadata . . . . . . . . . . . . . . . . . . 12 4.8. Sensor Streaming Measurement Lists (SenSML) . . . . . . . 12 4.9. Configuration and Actuation Usage . . . . . . . . . . . . 13 5. JSON Representation (application/senml+json) . . . . . . . . 13 5.1. Examples . . . . . . . . . . . . . . . . . . . . . . . . 14 5.1.1. Single Data Point . . . . . . . . . . . . . . . . . . 14 5.1.2. Multiple Data Points . . . . . . . . . . . . . . . . 14 5.1.3. Multiple Measurements . . . . . . . . . . . . . . . . 15 5.1.4. Resolved Data . . . . . . . . . . . . . . . . . . . . 17 5.1.5. Multiple Data Types . . . . . . . . . . . . . . . . . 17 5.1.6. Collection of Resources . . . . . . . . . . . . . . . 18 5.1.7. Setting an Actuator . . . . . . . . . . . . . . . . . 18 6. CBOR Representation (application/senml+cbor) . . . . . . . . 19 7. XML Representation (application/senml+xml) . . . . . . . . . 21 8. EXI Representation (application/senml-exi) . . . . . . . . . 23
9. Fragment Identification Methods . . . . . . . . . . . . . . . 26 9.1. Fragment Identification Examples . . . . . . . . . . . . 26 9.2. Fragment Identification for XML and EXI Formats . . . . . 27 10. Usage Considerations . . . . . . . . . . . . . . . . . . . . 27 11. CDDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 30 12.1. SenML Units Registry . . . . . . . . . . . . . . . . . . 30 12.2. SenML Labels Registry . . . . . . . . . . . . . . . . . 35 12.3. Media Type Registrations . . . . . . . . . . . . . . . . 36 12.3.1. senml+json Media Type Registration . . . . . . . . . 37 12.3.2. sensml+json Media Type Registration . . . . . . . . 38 12.3.3. senml+cbor Media Type Registration . . . . . . . . . 39 12.3.4. sensml+cbor Media Type Registration . . . . . . . . 41 12.3.5. senml+xml Media Type Registration . . . . . . . . . 42 12.3.6. sensml+xml Media Type Registration . . . . . . . . . 43 12.3.7. senml-exi Media Type Registration . . . . . . . . . 44 12.3.8. sensml-exi Media Type Registration . . . . . . . . . 45 12.4. XML Namespace Registration . . . . . . . . . . . . . . . 47 12.5. CoAP Content-Format Registration . . . . . . . . . . . . 47 13. Security Considerations . . . . . . . . . . . . . . . . . . . 47 14. Privacy Considerations . . . . . . . . . . . . . . . . . . . 48 15. References . . . . . . . . . . . . . . . . . . . . . . . . . 49 15.1. Normative References . . . . . . . . . . . . . . . . . . 49 15.2. Informative References . . . . . . . . . . . . . . . . . 51 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 53 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 54
9. Fragment Identification Methods . . . . . . . . . . . . . . . 26 9.1. Fragment Identification Examples . . . . . . . . . . . . 26 9.2. Fragment Identification for XML and EXI Formats . . . . . 27 10. Usage Considerations . . . . . . . . . . . . . . . . . . . . 27 11. CDDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 30 12.1. SenML Units Registry . . . . . . . . . . . . . . . . . . 30 12.2. SenML Labels Registry . . . . . . . . . . . . . . . . . 35 12.3. Media Type Registrations . . . . . . . . . . . . . . . . 36 12.3.1. senml+json Media Type Registration . . . . . . . . . 37 12.3.2. sensml+json Media Type Registration . . . . . . . . 38 12.3.3. senml+cbor Media Type Registration . . . . . . . . . 39 12.3.4. sensml+cbor Media Type Registration . . . . . . . . 41 12.3.5. senml+xml Media Type Registration . . . . . . . . . 42 12.3.6. sensml+xml Media Type Registration . . . . . . . . . 43 12.3.7. senml-exi Media Type Registration . . . . . . . . . 44 12.3.8. sensml-exi Media Type Registration . . . . . . . . . 45 12.4. XML Namespace Registration . . . . . . . . . . . . . . . 47 12.5. CoAP Content-Format Registration . . . . . . . . . . . . 47 13. Security Considerations . . . . . . . . . . . . . . . . . . . 47 14. Privacy Considerations . . . . . . . . . . . . . . . . . . . 48 15. References . . . . . . . . . . . . . . . . . . . . . . . . . 49 15.1. Normative References . . . . . . . . . . . . . . . . . . 49 15.2. Informative References . . . . . . . . . . . . . . . . . 51 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 53 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 54
Connecting sensors to the Internet is not new, and there have been many protocols designed to facilitate it. This specification defines a format and media types for carrying simple sensor information in protocols such as HTTP [RFC7230] or CoAP [RFC7252]. The SenML format is designed so that processors with very limited capabilities could easily encode a sensor measurement into the media type, while at the same time, a server parsing the data could collect a large number of sensor measurements in a relatively efficient manner. SenML can be used for a variety of data flow models, most notably data feeds pushed from a sensor to a collector, and for the web resource model where the sensor data is requested as a resource representation (e.g., "GET /sensor/temperature").
将传感器连接到互联网并不是什么新鲜事,已经有许多协议被设计来促进它。本规范定义了在HTTP[RFC7230]或CoAP[RFC7252]等协议中承载简单传感器信息的格式和媒体类型。SenML格式的设计使得功能非常有限的处理器可以轻松地将传感器测量编码为媒体类型,同时,解析数据的服务器可以以相对高效的方式收集大量传感器测量。SenML可用于各种数据流模型,最显著的是从传感器推送到收集器的数据馈送,也可用于web资源模型,其中传感器数据被请求作为资源表示(例如,“获取/传感器/温度”)。
There are many types of more complex measurements and measurements that this media type would not be suitable for. SenML strikes a balance between having some information about the sensor carried with the sensor data so that the data is self-describing, but it also tries to make that a fairly minimal set of auxiliary information for
有许多更复杂的测量类型,这种介质类型不适合测量。SenML在传感器数据中携带一些传感器信息以使数据具有自描述性之间取得了平衡,但它也试图使这些信息成为传感器的一组相当小的辅助信息
efficiency reasons. Other information about the sensor can be discovered by other methods such as using the Constrained RESTful Environments (CoRE) Link Format [RFC6690].
效率原因。有关传感器的其他信息可以通过其他方法发现,例如使用受限RESTful环境(CoRE)链接格式[RFC6690]。
SenML is defined by a data model for measurements and simple metadata about measurements and devices. The data is structured as a single array that contains a series of SenML Records that can each contain fields such as a unique identifier for the sensor, the time the measurement was made, the unit the measurement is in, and the current value of the sensor. Serializations for this data model are defined for JSON [RFC8259], CBOR [RFC7049], XML [W3C.REC-xml-20081126], and Efficient XML Interchange (EXI) [W3C.REC-exi-20140211].
SenML由测量数据模型和关于测量和设备的简单元数据定义。数据结构为单个数组,其中包含一系列SenML记录,每个记录可以包含传感器的唯一标识符、测量时间、测量单位以及传感器的当前值等字段。此数据模型的序列化定义为JSON[RFC8259]、CBOR[RFC7049]、XML[W3C.REC-XML-20081126]和高效XML交换(EXI)[W3C.REC-EXI-20140211]。
For example, the following shows a measurement from a temperature gauge encoded in the JSON syntax.
例如,下面显示了从JSON语法编码的温度计进行的测量。
[ {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","v":23.1} ]
[ {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","v":23.1} ]
In the example above, the array has a single SenML Record with a measurement for a sensor named "urn:dev:ow:10e2073a01080063" with a current value of 23.1 degrees Celsius.
在上面的示例中,阵列有一个SenML记录,其中包含一个名为“urn:dev:ow:10e2073a01080063”的传感器的测量值,当前值为23.1摄氏度。
The design goal is to be able to send simple sensor measurements in small packets from large numbers of constrained devices. Keeping the total size of the payload small makes it easy to also use SenML in constrained networks, e.g., in an IPv6 over Low-Power Wireless Personal Area Network (6LoWPAN) [RFC4944]. It is always difficult to define what small code is, but there is a desire to be able to implement this in roughly 1 KB of flash on an 8-bit microprocessor. Experience with power meters and other large-scale deployments has indicated that the solution needs to support allowing multiple measurements to be batched into a single HTTP or CoAP request. This "batch" upload capability allows the server side to efficiently support a large number of devices. It also conveniently supports batch transfers from proxies and storage devices, even in situations where the sensor itself sends just a single data item at a time. The multiple measurements could be from multiple related sensors or from the same sensor but at different times.
设计目标是能够从大量受约束的设备发送小数据包中的简单传感器测量值。将有效负载的总大小保持在较小的范围内,可以方便地在受限网络中使用SenML,例如,在通过低功率无线个人区域网络(6LoWPAN)的IPv6中使用SenML[RFC4944]。定义什么是小代码总是很困难,但人们希望能够在8位微处理器上用大约1KB的闪存实现这一点。在功率计和其他大规模部署方面的经验表明,该解决方案需要支持将多个测量值批处理到单个HTTP或CoAP请求中。这种“批量”上传功能允许服务器端高效地支持大量设备。它还方便地支持代理和存储设备的批量传输,即使在传感器本身一次只发送一个数据项的情况下也是如此。多个测量可以来自多个相关传感器,也可以来自同一传感器,但时间不同。
The basic design is an array with a series of measurements. The following example shows two measurements made at different times. The value of a measurement is given by the "v" field, the time of a measurement is in the "t" field, the "n" field has a unique sensor name, and the unit of the measurement is carried in the "u" field.
基本设计是一个具有一系列测量的阵列。以下示例显示在不同时间进行的两次测量。测量值由“v”字段给出,测量时间在“t”字段中,“n”字段具有唯一的传感器名称,测量单位在“u”字段中。
[ {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020076e+09, "v":23.5}, {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020091e+09, "v":23.6} ]
[ {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020076e+09, "v":23.5}, {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020091e+09, "v":23.6} ]
To keep the messages small, it does not make sense to repeat the "n" field in each SenML Record, so there is a concept of a Base Name, which is simply a string that is prepended to the Name field of all elements in that Record and any Records that follow it. So, a more compact form of the example above is the following.
为了保持消息较小,在每个SenML记录中重复“n”字段是没有意义的,因此有一个基本名称的概念,它只是一个字符串,在该记录中的所有元素的名称字段以及其后的任何记录前面加上。因此,上面示例的更紧凑形式如下所示。
[ {"bn":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020076e+09, "v":23.5}, {"u":"Cel","t":1.276020091e+09, "v":23.6} ]
[ {"bn":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020076e+09, "v":23.5}, {"u":"Cel","t":1.276020091e+09, "v":23.6} ]
In the above example, the Base Name is in the "bn" field, and the "n" fields in each Record are empty strings, so they are omitted.
在上面的示例中,基名称位于“bn”字段中,而每个记录中的“n”字段都是空字符串,因此省略了它们。
Some devices have accurate time while others do not, so SenML supports absolute and relative times. Time is represented in floating point as seconds. Values greater than or equal to 2**28 represent an absolute time relative to the Unix epoch. Values less than 2**28 represent time relative to the current time.
一些设备有精确的时间,而另一些设备没有,因此SenML支持绝对时间和相对时间。时间以浮点表示为秒。大于或等于2**28的值表示相对于Unix历元的绝对时间。小于2**28的值表示相对于当前时间的时间。
A simple sensor with no absolute wall-clock time might take a measurement every second, batch up 60 of them, and then send the batch to a server. It would include the relative time each measurement was made compared to the time the batch was sent in each SenML Record. If the server has accurate time based on, e.g., the Network Time Protocol (NTP), it may use the time it received the data and the relative offset to replace the times in the SenML with absolute times before saving the SenML information in a document database.
一个没有绝对挂钟时间的简单传感器可能每秒进行一次测量,将其中60个进行批处理,然后将批处理发送到服务器。它将包括每次测量的相对时间,与每个SenML记录中发送批次的时间相比。如果服务器具有基于例如网络时间协议(NTP)的准确时间,则在将SenML信息保存在文档数据库中之前,它可以使用接收数据的时间和相对偏移量将SenML中的时间替换为绝对时间。
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“建议”、“不建议”、“可”和“可选”在所有大写字母出现时(如图所示)应按照BCP 14[RFC2119][RFC8174]所述进行解释。
This document also uses the following terms:
本文件还使用以下术语:
SenML Record: One measurement or configuration instance in time presented using the SenML data model.
SenML记录:使用SenML数据模型及时呈现的一个度量或配置实例。
SenML Pack: One or more SenML Records in an array structure.
SenML包:数组结构中的一个或多个SenML记录。
SenML Label: A short name used in SenML Records to denote different SenML fields (e.g., "v" for "value").
SenML标签:在SenML记录中使用的一个短名称,用于表示不同的SenML字段(例如,“v”表示“value”)。
SenML Field: A component of a record that associates a value to a SenML Label for this record.
SenML字段:记录的一个组件,它将一个值与该记录的SenML标签相关联。
SenSML: Sensor Streaming Measurement List (see Section 4.8).
SenSML:传感器流测量列表(见第4.8节)。
SenSML Stream: One or more SenML Records to be processed as a stream.
SenSML流:作为流处理的一个或多个SenML记录。
This document uses the terms "attribute" and "tag" where they occur with the underlying technologies (XML, CBOR [RFC7049], and the CoRE Link Format [RFC6690]); they are not used for SenML concepts, per se. However, note that "attribute" has been widely used in the past as a synonym for the SenML "field".
本文档使用术语“属性”和“标记”,它们与底层技术(XML、CBOR[RFC7049]和核心链接格式[RFC6690])一起出现;它们本身并不用于SenML概念。但是,请注意,“attribute”在过去被广泛用作SenML“field”的同义词。
All comparisons of text strings are performed byte by byte, which results in the comparisons being case sensitive.
文本字符串的所有比较都是逐字节执行的,这导致比较区分大小写。
Where arithmetic is used, this specification uses the familiar notation of the programming language C, except that the operator "**" stands for exponentiation.
在使用算术的情况下,本规范使用编程语言C中熟悉的符号,但运算符“**”表示求幂。
Each SenML Pack carries a single array that represents a set of measurements and/or parameters. This array contains a series of SenML Records with several fields described below. There are two kinds of fields: base and regular. Both the base and regular fields can be included in any SenML Record. The base fields apply to the entries in the Record and also to all Records after it up to, but not
每个SenML包都带有一个表示一组测量值和/或参数的数组。该数组包含一系列具有以下几个字段的SenML记录。有两种字段:基本字段和常规字段。基本字段和常规字段都可以包含在任何SenML记录中。基本字段适用于记录中的条目,也适用于记录之后的所有记录,但不适用于
including, the next Record that has that same base field. All base fields are optional. Regular fields can be included in any SenML Record and apply only to that Record.
包括具有相同基字段的下一条记录。所有基本字段都是可选的。常规字段可以包含在任何SenML记录中,并且仅适用于该记录。
Base Name: This is a string that is prepended to the names found in the entries.
基本名称:这是一个字符串,位于条目中的名称前面。
Base Time: A base time that is added to the time found in an entry.
基准时间:添加到条目中的时间的基准时间。
Base Unit: A base unit that is assumed for all entries, unless otherwise indicated. If a record does not contain a Unit value, then the Base Unit is used. Otherwise, the value found in the Unit (if any) is used.
基本单位:除非另有说明,否则为所有条目假定的基本单位。如果记录不包含单位值,则使用基本单位。否则,将使用单位中的值(如果有)。
Base Value: A base value is added to the value found in an entry, similar to Base Time.
基本值:将基本值添加到条目中的值,类似于基本时间。
Base Sum: A base sum is added to the sum found in an entry, similar to Base Time.
基本和:基本和添加到条目中的和中,类似于基本时间。
Base Version: Version number of the media type format. This field is an optional positive integer and defaults to 10 if not present.
基本版本:媒体类型格式的版本号。此字段是可选的正整数,如果不存在,则默认为10。
Name: Name of the sensor or parameter. When appended to the Base Name field, this must result in a globally unique identifier for the resource. The name is optional, if the Base Name is present. If the name is missing, the Base Name must uniquely identify the resource. This can be used to represent a large array of measurements from the same sensor without having to repeat its identifier on every measurement.
名称:传感器或参数的名称。当附加到基本名称字段时,必须为资源生成全局唯一标识符。如果存在基本名称,则名称是可选的。如果缺少名称,则基名称必须唯一标识资源。这可用于表示来自同一传感器的大量测量值,而无需在每次测量中重复其标识符。
Unit: Unit for a measurement value. Optional.
单位:测量值的单位。可选择的
Value: Value of the entry. Optional if a Sum value is present; otherwise, it's required. Values are represented using basic data types. This specification defines floating-point numbers ("v" field for "Value"), booleans ("vb" for "Boolean Value"), strings ("vs" for "String Value"), and binary data ("vd" for "Data Value"). Exactly one Value field MUST appear unless there is a Sum field, in which case it is allowed to have no Value field.
Value:条目的值。如果存在总和值,则为可选;否则,它是必需的。值使用基本数据类型表示。本规范定义了浮点数(“v”字段表示“值”)、布尔值(“vb”表示“布尔值”)、字符串(“vs”表示“字符串值”)和二进制数据(“vd”表示“数据值”)。只有一个值字段必须出现,除非有总和字段,在这种情况下,不允许有值字段。
Sum: Integrated sum of the values over time. Optional. This field is in the unit specified in the Unit value multiplied by seconds. For historical reasons, it is named "sum" instead of "integral".
总和:随时间变化的值的总和。可选择的此字段采用单位值乘以秒中指定的单位。由于历史原因,它被命名为“和”,而不是“积分”。
Time: Time when the value was recorded. Optional.
时间:记录值的时间。可选择的
Update Time: Period of time in seconds that represents the maximum time before this sensor will provide an updated reading for a measurement. Optional. This can be used to detect the failure of sensors or the communications path from the sensor.
更新时间:表示此传感器提供测量更新读数之前的最长时间的时间段(秒)。可选择的这可用于检测传感器故障或传感器的通信路径。
Table 1 provides an overview of all SenML fields defined by this document with their respective labels and data types.
表1概述了本文档定义的所有SenML字段及其各自的标签和数据类型。
+---------------+-------+------------+------------+------------+ | Name | Label | CBOR Label | JSON Type | XML Type | +---------------+-------+------------+------------+------------+ | Base Name | bn | -2 | String | string | | Base Time | bt | -3 | Number | double | | Base Unit | bu | -4 | String | string | | Base Value | bv | -5 | Number | double | | Base Sum | bs | -6 | Number | double | | Base Version | bver | -1 | Number | int | | Name | n | 0 | String | string | | Unit | u | 1 | String | string | | Value | v | 2 | Number | double | | String Value | vs | 3 | String | string | | Boolean Value | vb | 4 | Boolean | boolean | | Data Value | vd | 8 | String (*) | string (*) | | Sum | s | 5 | Number | double | | Time | t | 6 | Number | double | | Update Time | ut | 7 | Number | double | +---------------+-------+------------+------------+------------+
+---------------+-------+------------+------------+------------+ | Name | Label | CBOR Label | JSON Type | XML Type | +---------------+-------+------------+------------+------------+ | Base Name | bn | -2 | String | string | | Base Time | bt | -3 | Number | double | | Base Unit | bu | -4 | String | string | | Base Value | bv | -5 | Number | double | | Base Sum | bs | -6 | Number | double | | Base Version | bver | -1 | Number | int | | Name | n | 0 | String | string | | Unit | u | 1 | String | string | | Value | v | 2 | Number | double | | String Value | vs | 3 | String | string | | Boolean Value | vb | 4 | Boolean | boolean | | Data Value | vd | 8 | String (*) | string (*) | | Sum | s | 5 | Number | double | | Time | t | 6 | Number | double | | Update Time | ut | 7 | Number | double | +---------------+-------+------------+------------+------------+
Table 1: SenML Labels
表1:SenML标签
(*) Data Value is a base64-encoded string with the URL-safe alphabet as defined in Section 5 of [RFC4648], with padding omitted. (In CBOR, the octets in the Data Value are encoded using a definite-length byte string, major type 2.)
(*)数据值是一个base64编码字符串,带有[RFC4648]第5节中定义的URL安全字母表,省略了填充。(在CBOR中,数据值中的八位字节使用定长字节字符串(主类型2)进行编码。)
For details of the JSON representation, see Section 5; for CBOR, see Section 6; and for XML, see Section 7.
有关JSON表示的详细信息,请参见第5节;关于CBOR,见第6节;关于XML,请参见第7节。
The SenML format can be extended with further custom fields. Both new base and regular fields are allowed. See Section 12.2 for details. Implementations MUST ignore fields they don't recognize unless that field has a label name that ends with the "_" character, in which case an error MUST be generated.
SenML格式可以通过进一步的自定义字段进行扩展。新的基本字段和常规字段都是允许的。详见第12.2节。实现必须忽略它们无法识别的字段,除非该字段的标签名以“\u1”字符结尾,在这种情况下,必须生成错误。
All SenML Records in a Pack MUST have the same version number. This is typically done by adding a Base Version field to only the first Record in the Pack or by using the default value.
包中的所有SenML记录必须具有相同的版本号。这通常通过仅向包中的第一条记录添加基本版本字段或使用默认值来完成。
Systems reading one of the objects MUST check for the Base Version field. If this value is a version number larger than the version that the system understands, the system MUST NOT use this object. This allows the version number to indicate that the object contains structure or semantics that is different from what is defined in the present document beyond just making use of the extension points provided here. New version numbers can only be defined in an RFC that updates this specification or its successors.
读取其中一个对象的系统必须检查“基本版本”字段。如果此值的版本号大于系统理解的版本号,则系统不得使用此对象。这允许版本号指示对象包含的结构或语义与本文档中定义的不同,而不仅仅是使用此处提供的扩展点。新版本号只能在更新本规范或其后续规范的RFC中定义。
The Name value is concatenated to the Base Name value to yield the name of the sensor. The resulting concatenated name needs to uniquely identify and differentiate the sensor from all others. The concatenated name MUST consist only of characters out of the set "A" to "Z", "a" to "z", and "0" to "9", as well as "-", ":", ".", "/", and "_"; furthermore, it MUST start with a character out of the set "A" to "Z", "a" to "z", or "0" to "9". This restricted character set was chosen so that concatenated names can be used directly within various URI schemes (including segments of an HTTP path with no special encoding; note that a name that contains "/" characters maps into multiple URI path segments) and can be used directly in many databases and analytic systems. [RFC5952] contains advice on encoding an IPv6 address in a name. See Section 14 for privacy considerations that apply to the use of long-term stable unique identifiers.
名称值连接到基本名称值,以生成传感器的名称。产生的连接名称需要唯一标识传感器并将其与所有其他传感器区分开来。连接的名称必须仅包含集合“A”到“Z”、“A”到“Z”和“0”到“9”中的字符,以及“--”、“:”、“/”和“389;”中的字符;此外,它必须以集合“a”到“Z”、“a”到“Z”或“0”到“9”之外的字符开头。选择此受限字符集是为了使连接的名称可以直接在各种URI方案中使用(包括没有特殊编码的HTTP路径段;请注意,包含“/”字符的名称映射到多个URI路径段),并且可以直接在许多数据库和分析系统中使用。[RFC5952]包含有关在名称中编码IPv6地址的建议。有关适用于长期稳定唯一标识符使用的隐私注意事项,请参见第14节。
Although it is RECOMMENDED that concatenated names be represented as URIs [RFC3986] or URNs [RFC8141], the restricted character set specified above puts strict limits on the URI schemes and URN namespaces that can be used. As a result, implementers need to take care in choosing the naming scheme for concatenated names, because such names both need to be unique and need to conform to the restricted character set. One approach is to include a bit string
尽管建议将连接的名称表示为URI[RFC3986]或URN[RFC8141],但上面指定的受限字符集对可以使用的URI方案和URN命名空间进行了严格限制。因此,实现人员在选择连接名称的命名方案时需要小心,因为这样的名称既需要唯一,也需要符合受限字符集。一种方法是包含位字符串
that has guaranteed uniqueness (such as a 1-wire address [AN1796]). Some of the examples within this document use the device URN namespace as specified in [DEVICE-URN]. Universally Unique Identifiers (UUIDs) [RFC4122] are another way to generate a unique name. However, the restricted character set does not allow the use of many URI schemes, such as the "tag" scheme [RFC4151] and the "ni" scheme [RFC6920], in names as such. The use of URIs with characters incompatible with this set and possible mapping rules between the two are outside the scope of the present document.
它保证了唯一性(例如单线地址[AN1796])。本文档中的一些示例使用[device-URN]中指定的设备URN命名空间。通用唯一标识符(UUID)[RFC4122]是生成唯一名称的另一种方法。然而,受限字符集不允许在名称中使用许多URI方案,例如“标记”方案[RFC4151]和“ni”方案[RFC6920]。使用与此集合不兼容的字符的URI以及两者之间可能的映射规则超出了本文档的范围。
If the Record has no Unit, the Base Unit is used as the Unit. Having no Unit and no Base Unit is allowed; any information that may be required about units applicable to the value then needs to be provided by the application context.
如果记录没有单位,则使用基本单位作为单位。不允许有单元和基本单元;应用程序上下文需要提供有关适用于该值的单位的任何信息。
If either the Base Time or Time value is missing, the missing field is considered to have a value of zero. The Base Time and Time values are added together to get a value representing the time of measurement.
如果缺少基准时间或时间值,则缺少的字段将被视为值为零。将基准时间和时间值相加,以获得表示测量时间的值。
Values less than 268,435,456 (2**28) represent time relative to the current time. That is, a time of zero indicates that the sensor does not know the absolute time and the measurement was made roughly "now". A negative value indicates seconds in the past from roughly "now". Positive values up to 2**28 indicate seconds in the future from "now". An example for employing positive values would be actuation use, when the desired change should happen in the future, but the sender or the receiver does not have accurate time available.
小于268435456(2**28)的值表示相对于当前时间的时间。也就是说,时间为零表示传感器不知道绝对时间,测量大致是“现在”进行的。负值表示从大约“现在”到过去的秒数。最大为2**28的正值表示从“现在”开始的未来秒数。采用正值的一个例子是驱动使用,当期望的变化应在未来发生,但发送方或接收方没有准确的可用时间时。
Values greater than or equal to 2**28 represent an absolute time relative to the Unix epoch (1970-01-01T00:00Z in UTC time), and the time is counted the same way as the Portable Operating System Interface (POSIX) "seconds since the epoch" [TIME_T]. Therefore, the smallest absolute Time value that can be expressed (2**28) is 1978-07-04 21:24:16 UTC.
大于或等于2**28的值表示相对于Unix历元的绝对时间(UTC时间为1970-01-01T00:00Z),该时间的计算方式与便携式操作系统接口(POSIX)“自历元起的秒数”[时间]相同。因此,可以表示的最小绝对时间值(2**28)为1978-07-04 21:24:16 UTC。
Because Time values up to 2**28 are used for representing time relative to "now" and Time and Base Time are added together, care must be taken to ensure that the sum does not inadvertently reach 2**28 (i.e., absolute time) when relative time was intended to be used.
由于最多2**28的时间值用于表示相对于“现在”的时间,并且时间和基准时间加在一起,因此必须注意确保当打算使用相对时间时,总和不会无意中达到2**28(即绝对时间)。
Obviously, SenML Records referenced to "now" are only useful within a specific communication context (e.g., based on information on when the SenML Pack, or a specific Record in a SenSML Stream, was sent) or together with some other context information that can be used for deriving a meaning of "now"; the expectation for any archival use is that they will be processed into UTC-referenced records before that context would cease to be available. This specification deliberately leaves the accuracy of "now" very vague as it is determined by the overall systems that use SenML. In a system where a sensor without wall-clock time sends a SenML Record with a time referenced to "now" over a high-speed RS-485 link to an embedded system with accurate time that resolves "now" based on the time of reception, the resulting time uncertainty could be within 1 ms. At the other extreme, a deployment that sends SenML wind-speed readings over a Low-Earth Orbit (LEO) satellite link from a mountain valley might have resulting reception Time values that are easily a dozen minutes off the actual time of the sensor reading, with the time uncertainty depending on satellite locations and conditions.
显然,引用“now”的SenML记录仅在特定通信上下文中有用(例如,基于SenML包或SenML流中的特定记录何时被发送的信息),或者与可用于派生“now”含义的一些其他上下文信息一起使用;任何存档使用的期望是,在上下文不再可用之前,它们将被处理成UTC引用的记录。本规范有意使“现在”的准确性非常模糊,因为它是由使用SenML的整个系统决定的。在一个系统中,没有挂钟时间的传感器通过高速RS-485链路向一个嵌入式系统发送一个时间参考为“现在”的SenML记录,该记录的准确时间根据接收时间解析为“现在”,由此产生的时间不确定性可能在1毫秒内。在另一个极端,从山谷通过低地球轨道(LEO)卫星链路发送SenML风速读数的部署可能产生的接收时间值很容易与传感器读数的实际时间相差十几分钟,时间不确定性取决于卫星位置和条件。
If only one of the Base Sum or Sum value is present, the missing field is considered to have a value of zero. The Base Sum and Sum values are added together to get the sum of measurement. If neither the Base Sum nor the Sum is present, then the measurement does not have a Sum value.
如果只有一个基和或和值存在,则缺少的字段被视为值为零。将基和和和值相加,得到测量值之和。如果既不存在基和也不存在和,则测量值没有和数值。
If the Base Value or Value is not present, the missing field(s) is considered to have a value of zero. The Base Value and Value are added together to get the value of the measurement.
如果基值或值不存在,则缺少的字段被视为值为零。将基值和值相加,得到测量值。
Representing the statistical characteristics of measurements, such as accuracy, can be very complex. Future specification may add new fields to provide better information about the statistical properties of the measurement.
表示度量的统计特征(如精度)可能非常复杂。未来的规范可能会添加新字段,以提供有关测量统计特性的更好信息。
In summary, the structure of a SenML Record is laid out to support a single measurement per Record. If multiple data values are measured at the same time (e.g., air pressure and altitude), they are best kept as separate Records linked through their Time value; this is even true when one of the data values is more "meta" than others (e.g., describes a condition that influences other measurements at the same time).
总之,SenML记录的结构设计为支持每个记录的单个测量。如果同时测量多个数据值(例如,气压和高度),最好将其作为单独的记录保存,并通过其时间值链接;当其中一个数据值比其他数据值更为“元”时(例如,描述了同时影响其他测量值的条件),情况也是如此。
Sometimes it is useful to be able to refer to a defined normalized format for SenML Records. This normalized format tends to get used for big data applications and intermediate forms when converting to other formats. Also, if SenML Records are used outside of a SenML Pack, they need to be resolved first to ensure applicable base values are applied.
有时,能够为SenML记录引用定义的规范化格式是很有用的。当转换为其他格式时,这种规范化格式往往会用于大数据应用程序和中间表单。此外,如果在SenML包之外使用SenML记录,则需要首先解析这些记录,以确保应用适用的基值。
A SenML Record is referred to as "resolved" if it does not contain any base values, i.e., labels starting with the character "b", except for Base Version fields (see below), and has no relative times. To resolve the Records, the applicable base values of the SenML Pack (if any) are applied to the Record. That is, for the base values in the Record or before the Record in the Pack, Name and Base Name are concatenated, the Base Time is added to the time of the Record, the Base Unit is applied to the Record if it did not contain a Unit, etc. In addition, the Records need to be in chronological order in the Pack. An example of this is shown in Section 5.1.4.
如果SenML记录不包含任何基值,即除基版本字段(见下文)外,以字符“b”开头的标签,并且没有相对时间,则称其为“已解析”。要解析记录,将SenML包(如果有)的适用基本值应用于记录。也就是说,对于记录中的基本值或在数据包中的记录之前,名称和基本名称被连接,基本时间被添加到记录的时间,如果记录不包含单位,则基本单位被应用到记录,等等。此外,数据包中的记录需要按时间顺序排列。第5.1.4节给出了一个示例。
The Base Version field MUST NOT be present in resolved Records if the SenML version defined in this document is used; otherwise, it MUST be present in all the resolved SenML Records.
如果使用本文档中定义的SenML版本,则基本版本字段不得出现在已解析记录中;否则,它必须出现在所有解析的SenML记录中。
A future specification that defines new base fields needs to specify how the field is resolved.
定义新基本字段的未来规范需要指定字段的解析方式。
SenML is designed to carry the minimum dynamic information about measurements and, for efficiency reasons, does not carry significant static metadata about the device, object, or sensors. Instead, it is assumed that this metadata is carried out of band. For web resources using SenML Packs, this metadata can be made available using the CoRE Link Format [RFC6690]. The most obvious use of this link format is to describe that a resource is available in a SenML format in the first place. The relevant media type indicator is included in the Content-Type (ct=) link attribute (which is defined for the link format in Section 7.2.1 of [RFC7252]).
SenML被设计为携带关于测量的最小动态信息,并且出于效率原因,不携带关于设备、对象或传感器的重要静态元数据。相反,假定此元数据在带外执行。对于使用SenML包的web资源,可以使用核心链接格式[RFC6690]提供此元数据。这种链接格式最明显的用途是首先描述一个资源是以SenML格式提供的。相关媒体类型指示符包含在内容类型(ct=)链接属性中(该属性是为[RFC7252]第7.2.1节中的链接格式定义的)。
In some usage scenarios of SenML, the implementations store or transmit SenML in a stream-like fashion, where data is collected over time and continuously added to the object. This mode of operation is optional, but systems or protocols using SenML in this fashion MUST specify that they are doing this. SenML defines separate media types to indicate Sensor Streaming Measurement Lists (SenSML) for this
在SenML的某些使用场景中,实现以流式方式存储或传输SenML,数据随时间收集并不断添加到对象中。这种操作模式是可选的,但是以这种方式使用SenML的系统或协议必须指定它们正在这样做。SenML定义了单独的媒体类型,以指示此服务器的传感器流测量列表(SenSML)
usage (see Section 12.3.2). In this situation, the SenSML Stream can be sent and received in a partial fashion, i.e., a measurement entry can be read as soon as the SenML Record is received and does not have to wait for the full SenSML Stream to be complete.
用法(见第12.3.2节)。在这种情况下,SenSML流可以以部分方式发送和接收,即,一旦接收到SenML记录,就可以读取测量条目,而不必等待完整的SenSML流完成。
If times relative to "now" (see Section 4.5.3) are used in SenML Records of a SenSML Stream, their interpretation of "now" is based on the time when the specific Record is sent in the stream.
如果SenSML流的SenML记录中使用了与“现在”相关的时间(见第4.5.3节),则其对“现在”的解释基于特定记录在流中发送的时间。
SenML can also be used for configuring parameters and controlling actuators. When a SenML Pack is sent (e.g., using an HTTP/CoAP POST or PUT method) and the semantics of the target are such that SenML is interpreted as configuration/actuation, SenML Records are interpreted as a request to change the values of given (sub)resources (given as names) to given values at the given time(s). The semantics of the target resource supporting this usage can be described, e.g., using [RID-CoRE]. Examples of actuation usage are shown in Section 5.1.7.
SenML还可用于配置参数和控制执行器。当发送SenML包(例如,使用HTTP/CoAP POST或PUT方法)且目标的语义使得SenML被解释为配置/驱动时,SenML记录被解释为在给定时间将给定(子)资源(以名称给出)的值更改为给定值的请求。可以描述支持此用法的目标资源的语义,例如,使用[RID CoRE]。第5.1.7节给出了驱动使用示例。
For the SenML fields shown in Table 2, the SenML Labels are used as the JSON object member names within JSON objects representing the JSON SenML Records.
对于表2中所示的SenML字段,SenML标签用作表示JSON SenML记录的JSON对象中的JSON对象成员名称。
+---------------+-------+-----------+ | Name | Label | JSON Type | +---------------+-------+-----------+ | Base Name | bn | String | | Base Time | bt | Number | | Base Unit | bu | String | | Base Value | bv | Number | | Base Sum | bs | Number | | Base Version | bver | Number | | Name | n | String | | Unit | u | String | | Value | v | Number | | String Value | vs | String | | Boolean Value | vb | Boolean | | Data Value | vd | String | | Sum | s | Number | | Time | t | Number | | Update Time | ut | Number | +---------------+-------+-----------+
+---------------+-------+-----------+ | Name | Label | JSON Type | +---------------+-------+-----------+ | Base Name | bn | String | | Base Time | bt | Number | | Base Unit | bu | String | | Base Value | bv | Number | | Base Sum | bs | Number | | Base Version | bver | Number | | Name | n | String | | Unit | u | String | | Value | v | Number | | String Value | vs | String | | Boolean Value | vb | Boolean | | Data Value | vd | String | | Sum | s | Number | | Time | t | Number | | Update Time | ut | Number | +---------------+-------+-----------+
Table 2: JSON SenML Labels
表2:JSON SenML标签
The root JSON value consists of an array with one JSON object for each SenML Record. All the fields in the above table MAY occur in the Records with member values of the type specified in the table.
根JSON值由一个数组组成,每个SenML记录有一个JSON对象。上表中的所有字段都可能出现在具有表中指定类型的成员值的记录中。
Only the UTF-8 [RFC3629] form of JSON is allowed. Characters in the String Value are encoded using the escape sequences defined in [RFC8259]. Octets in the Data Value are base64 encoded with the URL-safe alphabet as defined in Section 5 of [RFC4648], with padding omitted.
只允许UTF-8[RFC3629]形式的JSON。字符串值中的字符使用[RFC8259]中定义的转义序列进行编码。数据值中的八位字节使用[RFC4648]第5节中定义的URL安全字母表进行base64编码,省略了填充。
Systems receiving measurements MUST be able to process the range of floating-point numbers that are representable as IEEE double-precision, floating-point numbers [IEEE.754]. This allows Time values to have better than microsecond precision over the next 100 years. The number of significant digits in any measurement is not relevant, so a reading of 1.1 has exactly the same semantic meaning as 1.10. If the value has an exponent, the "e" MUST be in lower case. In the interest of avoiding unnecessary verbosity and speeding up processing, the mantissa SHOULD be less than 19 characters long, and the exponent SHOULD be less than 5 characters long.
接收测量的系统必须能够处理可表示为IEEE双精度浮点数的浮点数范围[IEEE.754]。这使得时间值在未来100年内的精度优于微秒。任何测量中的有效位数都不相关,因此1.1的读数与1.10的语义含义完全相同。如果该值具有指数,“e”必须为小写。为了避免不必要的冗长和加速处理,尾数长度应小于19个字符,指数长度应小于5个字符。
The following shows a temperature reading taken approximately "now" by a 1-wire sensor device that was assigned the unique 1-wire address of 10e2073a01080063:
以下显示了分配了唯一单线地址10E2073A0108063的单线传感器设备大约“现在”获取的温度读数:
[ {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","v":23.1} ]
[ {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","v":23.1} ]
The following example shows voltage and current "now", i.e., at an unspecified time.
以下示例显示了“现在”的电压和电流,即在未指定的时间。
[ {"bn":"urn:dev:ow:10e2073a01080063:","n":"voltage","u":"V","v":120.1}, {"n":"current","u":"A","v":1.2} ]
[ {"bn":"urn:dev:ow:10e2073a01080063:","n":"voltage","u":"V","v":120.1}, {"n":"current","u":"A","v":1.2} ]
The next example is similar to the above one, but it shows current at Tue Jun 8 18:01:16.001 UTC 2010 and at each second for the previous 5 seconds.
下一个示例与上面的示例类似,但它显示了2010年6月8日星期二18:01:16.001 UTC的电流,以及前5秒的每秒电流。
[ {"bn":"urn:dev:ow:10e2073a0108006:","bt":1.276020076001e+09, "bu":"A","bver":5, "n":"voltage","u":"V","v":120.1}, {"n":"current","t":-5,"v":1.2}, {"n":"current","t":-4,"v":1.3}, {"n":"current","t":-3,"v":1.4}, {"n":"current","t":-2,"v":1.5}, {"n":"current","t":-1,"v":1.6}, {"n":"current","v":1.7} ]
[ {"bn":"urn:dev:ow:10e2073a0108006:","bt":1.276020076001e+09, "bu":"A","bver":5, "n":"voltage","u":"V","v":120.1}, {"n":"current","t":-5,"v":1.2}, {"n":"current","t":-4,"v":1.3}, {"n":"current","t":-3,"v":1.4}, {"n":"current","t":-2,"v":1.5}, {"n":"current","t":-1,"v":1.6}, {"n":"current","v":1.7} ]
As an example of SenSML, the following stream of measurements may be sent via a long-lived HTTP POST from the producer of the stream to its consumer, and each measurement object may be reported at the time it was measured:
作为SenSML的一个示例,以下测量流可以通过长期HTTP POST从流的生产者发送到其消费者,并且可以在测量时报告每个测量对象:
[ {"bn":"urn:dev:ow:10e2073a01080063","bt":1.320067464e+09, "bu":"%RH","v":21.2}, {"t":10,"v":21.3}, {"t":20,"v":21.4}, {"t":30,"v":21.4}, {"t":40,"v":21.5}, {"t":50,"v":21.5}, {"t":60,"v":21.5}, {"t":70,"v":21.6}, {"t":80,"v":21.7}, ...
[参考译文]英国电信:1.320067464e+09,“bu”:“RH”,“v”:21.2},{“t”:10,“v”:21.3},{“t”:20,“v”:21.4},{“t”:30,“v”:21.4},{“t”:40,“v”:21.5},{“t”:50,“v”:21.5},{“t”:60,“v”:21.5},{“t”:70,“v”:21.6},{“t”:80,“v”:21.7},{。。。
The following example shows humidity measurements from a mobile device with a 1-wire address 10e2073a01080063, starting at Mon Oct 31 13:24:24 UTC 2011. The device also provides position data, which is provided in the same measurement or parameter array as separate entries. Note that time is used to correlate data that belongs together, e.g., a measurement and a parameter associated with it. Finally, the device also reports extra data about its battery status at a separate time.
以下示例显示了从2011年10月31日星期一13:24:24 UTC开始,从单线地址为10E2073A0108063的移动设备进行的湿度测量。该设备还提供位置数据,这些数据作为单独的条目在同一测量或参数数组中提供。请注意,时间用于关联属于一起的数据,例如测量值和与其相关的参数。最后,该设备还会在单独的时间报告有关其电池状态的额外数据。
[ {"bn":"urn:dev:ow:10e2073a01080063","bt":1.320067464e+09, "bu":"%RH","v":20}, {"u":"lon","v":24.30621}, {"u":"lat","v":60.07965}, {"t":60,"v":20.3}, {"u":"lon","t":60,"v":24.30622}, {"u":"lat","t":60,"v":60.07965}, {"t":120,"v":20.7}, {"u":"lon","t":120,"v":24.30623}, {"u":"lat","t":120,"v":60.07966}, {"u":"%EL","t":150,"v":98}, {"t":180,"v":21.2}, {"u":"lon","t":180,"v":24.30628}, {"u":"lat","t":180,"v":60.07967} ]
[ {"bn":"urn:dev:ow:10e2073a01080063","bt":1.320067464e+09, "bu":"%RH","v":20}, {"u":"lon","v":24.30621}, {"u":"lat","v":60.07965}, {"t":60,"v":20.3}, {"u":"lon","t":60,"v":24.30622}, {"u":"lat","t":60,"v":60.07965}, {"t":120,"v":20.7}, {"u":"lon","t":120,"v":24.30623}, {"u":"lat","t":120,"v":60.07966}, {"u":"%EL","t":150,"v":98}, {"t":180,"v":21.2}, {"u":"lon","t":180,"v":24.30628}, {"u":"lat","t":180,"v":60.07967} ]
The following table shows the size of this example in various forms, as well as the size of each of these forms compressed with gzip.
下表以各种形式显示了此示例的大小,以及使用gzip压缩的每种形式的大小。
+----------+------+-----------------+ | Encoding | Size | Compressed Size | +----------+------+-----------------+ | JSON | 573 | 206 | | XML | 649 | 235 | | CBOR | 254 | 196 | | EXI | 161 | 184 | +----------+------+-----------------+
+----------+------+-----------------+ | Encoding | Size | Compressed Size | +----------+------+-----------------+ | JSON | 573 | 206 | | XML | 649 | 235 | | CBOR | 254 | 196 | | EXI | 161 | 184 | +----------+------+-----------------+
Table 3: Size Comparisons
表3:规模比较
The following shows the example from the previous section in resolved format.
以下以解析格式显示上一节中的示例。
[ {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067464e+09, "v":20}, {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067464e+09, "v":24.30621}, {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067464e+09, "v":60.07965}, {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067524e+09, "v":20.3}, {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067524e+09, "v":24.30622}, {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067524e+09, "v":60.07965}, {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067584e+09, "v":20.7}, {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067584e+09, "v":24.30623}, {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067584e+09, "v":60.07966}, {"n":"urn:dev:ow:10e2073a01080063","u":"%EL","t":1.320067614e+09, "v":98}, {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067644e+09, "v":21.2}, {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067644e+09, "v":24.30628}, {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067644e+09, "v":60.07967} ]
[ {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067464e+09, "v":20}, {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067464e+09, "v":24.30621}, {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067464e+09, "v":60.07965}, {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067524e+09, "v":20.3}, {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067524e+09, "v":24.30622}, {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067524e+09, "v":60.07965}, {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067584e+09, "v":20.7}, {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067584e+09, "v":24.30623}, {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067584e+09, "v":60.07966}, {"n":"urn:dev:ow:10e2073a01080063","u":"%EL","t":1.320067614e+09, "v":98}, {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067644e+09, "v":21.2}, {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067644e+09, "v":24.30628}, {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067644e+09, "v":60.07967} ]
The following example shows a sensor that returns different data types.
以下示例显示返回不同数据类型的传感器。
[ {"bn":"urn:dev:ow:10e2073a01080063:","n":"temp","u":"Cel","v":23.1}, {"n":"label","vs":"Machine Room"}, {"n":"open","vb":false}, {"n":"nfc-reader","vd":"aGkgCg"} ]
[ {"bn":"urn:dev:ow:10e2073a01080063:","n":"temp","u":"Cel","v":23.1}, {"n":"label","vs":"Machine Room"}, {"n":"open","vb":false}, {"n":"nfc-reader","vd":"aGkgCg"} ]
The following example shows the results from a query to one device that aggregates multiple measurements from other devices. The example assumes that a client has fetched information from a device at 2001:db8::2 by performing a GET operation on http://[2001:db8::2] at Mon Oct 31 16:27:09 UTC 2011 and has gotten two separate values as a result: a temperature and humidity measurement as well as the results from another device at http://[2001:db8::1] that also had a temperature and humidity measurement. Note that the last record would use the Base Name from the 3rd record but the Base Time from the first record.
以下示例显示了对一个设备的查询结果,该设备聚合了来自其他设备的多个测量值。该示例假设客户机通过在2011年10月31日星期一16:27:09 UTC从http://[2001:db8::2]上执行GET操作,在2001:db8::2从设备获取信息,并获得两个单独的值:温度和湿度测量以及在http://[2001:db8::1]从另一个设备获取的结果还进行了温度和湿度测量。请注意,最后一条记录将使用第三条记录中的基准名称,但使用第一条记录中的基准时间。
[ {"bn":"2001:db8::2/","bt":1.320078429e+09, "n":"temperature","u":"Cel","v":25.2}, {"n":"humidity","u":"%RH","v":30}, {"bn":"2001:db8::1/","n":"temperature","u":"Cel","v":12.3}, {"n":"humidity","u":"%RH","v":67} ]
[ {"bn":"2001:db8::2/","bt":1.320078429e+09, "n":"temperature","u":"Cel","v":25.2}, {"n":"humidity","u":"%RH","v":30}, {"bn":"2001:db8::1/","n":"temperature","u":"Cel","v":12.3}, {"n":"humidity","u":"%RH","v":67} ]
The following example shows the SenML that could be used to set the current set point of a typical residential thermostat that has a temperature set point, a switch to turn on and off the heat, and a switch to turn on the fan override.
以下示例显示了可用于设置典型住宅恒温器当前设定点的SenML,该恒温器具有温度设定点、打开和关闭热量的开关以及打开风扇超控的开关。
[ {"bn":"urn:dev:ow:10e2073a01080063:"}, {"n":"temp","u":"Cel","v":23.1}, {"n":"heat","u":"/","v":1}, {"n":"fan","u":"/","v":0} ]
[ {"bn":"urn:dev:ow:10e2073a01080063:"}, {"n":"temp","u":"Cel","v":23.1}, {"n":"heat","u":"/","v":1}, {"n":"fan","u":"/","v":0} ]
In the following example, two different lights are turned on. It is assumed that the lights are on a network that can guarantee delivery of the messages to the two lights within 15 ms (e.g., a network using 802.1BA [IEEE802.1BA] and 802.1AS [IEEE802.1AS] for time synchronization). The controller has set the time of the lights to come on at 20 ms in the future from the current time. This allows both lights to receive the message, wait till that time, then apply the switch command so that both lights come on at the same time.
在以下示例中,将打开两个不同的灯光。假设灯位于能够保证在15ms内将消息传送到两个灯的网络上(例如,使用802.1BA[IEEE802.1BA]和802.1AS[IEEE802.1AS]进行时间同步的网络)。控制器已将灯的点亮时间设置为从当前时间开始的20毫秒。这允许两个灯接收信息,等待该时间,然后应用开关命令,使两个灯同时亮起。
[ {"bt":1.320078429e+09,"bu":"/","n":"2001:db8::3","v":1}, {"n":"2001:db8::4","v":1} ]
[ {"bt":1.320078429e+09,"bu":"/","n":"2001:db8::3","v":1}, {"n":"2001:db8::4","v":1} ]
The following shows two lights being turned off using a non-deterministic network that has high odds of delivering a message in less than 100 ms and uses NTP for time synchronization. The current time is 1320078429. The user has just turned off a light switch that is turning off two lights. Both lights are immediately dimmed to 50% brightness to give the user instant feedback that something is changing. However, given the network, the lights will probably dim at somewhat different times. Then 100 ms in the future, both lights will go off at the same time. The instant, but not synchronized, dimming gives the user the sensation of quick responses, and the timed-off 100 ms in the future gives the perception of both lights going off at the same time.
下面显示了使用非确定性网络关闭的两个指示灯,该网络很有可能在不到100毫秒的时间内发送消息,并使用NTP进行时间同步。当前时间为1320078429。用户刚刚关闭了一个正在关闭两个灯的灯开关。这两个灯立即变暗到50%的亮度,以向用户提供即时反馈,说明正在发生变化。然而,考虑到网络,灯光可能会在不同的时间变暗。然后在未来100毫秒,两个灯将同时熄灭。即时但不同步的调光给用户快速响应的感觉,而未来的定时关闭100毫秒会让人感觉两盏灯同时关闭。
[ {"bt":1.320078429e+09,"bu":"/","n":"2001:db8::3","v":0.5}, {"n":"2001:db8::4","v":0.5}, {"n":"2001:db8::3","t":0.1,"v":0}, {"n":"2001:db8::4","t":0.1,"v":0} ]
[ {"bt":1.320078429e+09,"bu":"/","n":"2001:db8::3","v":0.5}, {"n":"2001:db8::4","v":0.5}, {"n":"2001:db8::3","t":0.1,"v":0}, {"n":"2001:db8::4","t":0.1,"v":0} ]
The CBOR [RFC7049] representation is equivalent to the JSON representation, with the following changes:
CBOR[RFC7049]表示法与JSON表示法等效,但有以下更改:
o For JSON Numbers, the CBOR representation can use integers, floating-point numbers, or decimal fractions (CBOR Tag 4); however, a representation SHOULD be chosen such that when the CBOR value is converted to an IEEE double-precision, floating-point value, it has exactly the same value as the original JSON Number converted to that form. For the version number, only an unsigned integer is allowed.
o 对于JSON数字,CBOR表示可以使用整数、浮点数或小数(CBOR标记4);但是,应选择一种表示方式,以便在将CBOR值转换为IEEE双精度浮点值时,其值与转换为该形式的原始JSON编号的值完全相同。对于版本号,只允许使用无符号整数。
o Characters in the String Value are encoded using a text string with a definite length (major type 3). Octets in the Data Value are encoded using a byte string with a definite length (major type 2).
o 字符串值中的字符使用具有一定长度的文本字符串(主类型3)进行编码。数据值中的八位字节使用长度确定的字节字符串(主类型2)进行编码。
o For compactness, the CBOR representation uses integers for the labels, as defined in Table 4. This table is conclusive, i.e., there is no intention to define any additional integer map keys; any extensions will use string map keys. This allows translators converting between CBOR and JSON representations to also convert all future labels without needing to update implementations. Base values are given negative CBOR labels, and others are given non-negative labels.
o 对于紧凑性,CBOR表示使用整数作为标签,如表4所示。此表是决定性的,即无意定义任何其他整数映射键;任何扩展都将使用字符串映射键。这允许转换器在CBOR和JSON表示之间转换,也可以转换所有未来的标签,而无需更新实现。基本值被赋予负CBOR标签,其他值被赋予非负标签。
+---------------+-------+------------+ | Name | Label | CBOR Label | +---------------+-------+------------+ | Base Version | bver | -1 | | Base Name | bn | -2 | | Base Time | bt | -3 | | Base Unit | bu | -4 | | Base Value | bv | -5 | | Base Sum | bs | -6 | | Name | n | 0 | | Unit | u | 1 | | Value | v | 2 | | String Value | vs | 3 | | Boolean Value | vb | 4 | | Sum | s | 5 | | Time | t | 6 | | Update Time | ut | 7 | | Data Value | vd | 8 | +---------------+-------+------------+
+---------------+-------+------------+ | Name | Label | CBOR Label | +---------------+-------+------------+ | Base Version | bver | -1 | | Base Name | bn | -2 | | Base Time | bt | -3 | | Base Unit | bu | -4 | | Base Value | bv | -5 | | Base Sum | bs | -6 | | Name | n | 0 | | Unit | u | 1 | | Value | v | 2 | | String Value | vs | 3 | | Boolean Value | vb | 4 | | Sum | s | 5 | | Time | t | 6 | | Update Time | ut | 7 | | Data Value | vd | 8 | +---------------+-------+------------+
Table 4: CBOR Representation: Integers for Map Keys
表4:CBOR表示:映射键的整数
o For streaming SenSML in CBOR representation, the array containing the records SHOULD be a CBOR array with an indefinite length; for non-streaming SenML, an array with a definite length MUST be used.
o 对于CBOR表示中的streaming SenSML,包含记录的数组应该是长度不定的CBOR数组;对于非流SenML,必须使用具有确定长度的数组。
The following example shows a dump of the CBOR example for the same sensor measurement as in Section 5.1.2.
以下示例显示了第5.1.2节中相同传感器测量的CBOR示例转储。
0000 87 a7 21 78 1b 75 72 6e 3a 64 65 76 3a 6f 77 3a |..!x.urn:dev:ow:| 0010 31 30 65 32 30 37 33 61 30 31 30 38 30 30 36 3a |10e2073a0108006:| 0020 22 fb 41 d3 03 a1 5b 00 10 62 23 61 41 20 05 00 |".A...[..b#aA ..| 0030 67 76 6f 6c 74 61 67 65 01 61 56 02 fb 40 5e 06 |gvoltage.aV..@^.| 0040 66 66 66 66 66 a3 00 67 63 75 72 72 65 6e 74 06 |fffff..gcurrent.| 0050 24 02 fb 3f f3 33 33 33 33 33 33 a3 00 67 63 75 |$..?.333333..gcu| 0060 72 72 65 6e 74 06 23 02 fb 3f f4 cc cc cc cc cc |rrent.#..?......| 0070 cd a3 00 67 63 75 72 72 65 6e 74 06 22 02 fb 3f |...gcurrent."..?| 0080 f6 66 66 66 66 66 66 a3 00 67 63 75 72 72 65 6e |.ffffff..gcurren| 0090 74 06 21 02 f9 3e 00 a3 00 67 63 75 72 72 65 6e |t.!..>...gcurren| 00a0 74 06 20 02 fb 3f f9 99 99 99 99 99 9a a3 00 67 |t. ..?.........g| 00b0 63 75 72 72 65 6e 74 06 00 02 fb 3f fb 33 33 33 |current....?.333| 00c0 33 33 33 |333| 00c3
0000 87 a7 21 78 1b 75 72 6e 3a 64 65 76 3a 6f 77 3a |..!x.urn:dev:ow:| 0010 31 30 65 32 30 37 33 61 30 31 30 38 30 30 36 3a |10e2073a0108006:| 0020 22 fb 41 d3 03 a1 5b 00 10 62 23 61 41 20 05 00 |".A...[..b#aA ..| 0030 67 76 6f 6c 74 61 67 65 01 61 56 02 fb 40 5e 06 |gvoltage.aV..@^.| 0040 66 66 66 66 66 a3 00 67 63 75 72 72 65 6e 74 06 |fffff..gcurrent.| 0050 24 02 fb 3f f3 33 33 33 33 33 33 a3 00 67 63 75 |$..?.333333..gcu| 0060 72 72 65 6e 74 06 23 02 fb 3f f4 cc cc cc cc cc |rrent.#..?......| 0070 cd a3 00 67 63 75 72 72 65 6e 74 06 22 02 fb 3f |...gcurrent."..?| 0080 f6 66 66 66 66 66 66 a3 00 67 63 75 72 72 65 6e |.ffffff..gcurren| 0090 74 06 21 02 f9 3e 00 a3 00 67 63 75 72 72 65 6e |t.!..>...gcurren| 00a0 74 06 20 02 fb 3f f9 99 99 99 99 99 9a a3 00 67 |t. ..?.........g| 00b0 63 75 72 72 65 6e 74 06 00 02 fb 3f fb 33 33 33 |current....?.333| 00c0 33 33 33 |333| 00c3
In CBOR diagnostic notation (Section 6 of [RFC7049]), this is:
在CBOR诊断符号(RFC7049第6节)中,这是:
[{-2: "urn:dev:ow:10e2073a0108006:", -3: 1276020076.001, -4: "A", -1: 5, 0: "voltage", 1: "V", 2: 120.1}, {0: "current", 6: -5, 2: 1.2}, {0: "current", 6: -4, 2: 1.3}, {0: "current", 6: -3, 2: 1.4}, {0: "current", 6: -2, 2: 1.5}, {0: "current", 6: -1, 2: 1.6}, {0: "current", 6: 0, 2: 1.7}]
[{-2: "urn:dev:ow:10e2073a0108006:", -3: 1276020076.001, -4: "A", -1: 5, 0: "voltage", 1: "V", 2: 120.1}, {0: "current", 6: -5, 2: 1.2}, {0: "current", 6: -4, 2: 1.3}, {0: "current", 6: -3, 2: 1.4}, {0: "current", 6: -2, 2: 1.5}, {0: "current", 6: -1, 2: 1.6}, {0: "current", 6: 0, 2: 1.7}]
A SenML Pack or Stream can also be represented in XML format as defined in this section.
SenML包或流也可以用本节中定义的XML格式表示。
Only the UTF-8 form of XML is allowed. Octets in the Data Value are base64 encoded with the URL-safe alphabet as defined in Section 5 of [RFC4648], with padding omitted.
只允许使用UTF-8格式的XML。数据值中的八位字节使用[RFC4648]第5节中定义的URL安全字母表进行base64编码,省略了填充。
The following shows an XML example for the same sensor measurement as in Section 5.1.2.
以下显示了第5.1.2节中相同传感器测量的XML示例。
<sensml xmlns="urn:ietf:params:xml:ns:senml"> <senml bn="urn:dev:ow:10e2073a0108006:" bt="1.276020076001e+09" bu="A" bver="5" n="voltage" u="V" v="120.1"></senml> <senml n="current" t="-5" v="1.2"></senml> <senml n="current" t="-4" v="1.3"></senml> <senml n="current" t="-3" v="1.4"></senml> <senml n="current" t="-2" v="1.5"></senml> <senml n="current" t="-1" v="1.6"></senml> <senml n="current" v="1.7"></senml> </sensml>
<sensml xmlns="urn:ietf:params:xml:ns:senml"> <senml bn="urn:dev:ow:10e2073a0108006:" bt="1.276020076001e+09" bu="A" bver="5" n="voltage" u="V" v="120.1"></senml> <senml n="current" t="-5" v="1.2"></senml> <senml n="current" t="-4" v="1.3"></senml> <senml n="current" t="-3" v="1.4"></senml> <senml n="current" t="-2" v="1.5"></senml> <senml n="current" t="-1" v="1.6"></senml> <senml n="current" v="1.7"></senml> </sensml>
The SenML Stream is represented as a sensml element that contains a series of senml elements for each SenML Record. The SenML fields are represented as XML attributes. For each field defined in this document, the following table shows the SenML Labels, which are used for the XML attribute name, as well as the according restrictions on the XML attribute values ("type") as used in the XML senml elements.
SenML流表示为一个SenML元素,该元素包含每个SenML记录的一系列SenML元素。SenML字段表示为XML属性。对于本文档中定义的每个字段,下表显示了用于XML属性名称的SenML标签,以及对XML SenML元素中使用的XML属性值(“类型”)的相应限制。
+---------------+-------+----------+ | Name | Label | XML Type | +---------------+-------+----------+ | Base Name | bn | string | | Base Time | bt | double | | Base Unit | bu | string | | Base Value | bv | double | | Base Sum | bs | double | | Base Version | bver | int | | Name | n | string | | Unit | u | string | | Value | v | double | | String Value | vs | string | | Data Value | vd | string | | Boolean Value | vb | boolean | | Sum | s | double | | Time | t | double | | Update Time | ut | double | +---------------+-------+----------+
+---------------+-------+----------+ | Name | Label | XML Type | +---------------+-------+----------+ | Base Name | bn | string | | Base Time | bt | double | | Base Unit | bu | string | | Base Value | bv | double | | Base Sum | bs | double | | Base Version | bver | int | | Name | n | string | | Unit | u | string | | Value | v | double | | String Value | vs | string | | Data Value | vd | string | | Boolean Value | vb | boolean | | Sum | s | double | | Time | t | double | | Update Time | ut | double | +---------------+-------+----------+
Table 5: XML SenML Labels
表5:XML SenML标签
The RelaxNG [RNC] Schema for the XML is:
XML的RelaxNG[RNC]模式是:
default namespace = "urn:ietf:params:xml:ns:senml" namespace rng = "http://relaxng.org/ns/structure/1.0"
default namespace = "urn:ietf:params:xml:ns:senml" namespace rng = "http://relaxng.org/ns/structure/1.0"
senml = element senml { attribute bn { xsd:string }?, attribute bt { xsd:double }?, attribute bv { xsd:double }?, attribute bs { xsd:double }?, attribute bu { xsd:string }?, attribute bver { xsd:int }?,
senml=元素senml{attribute bn{xsd:string}?、attribute bt{xsd:double}?、attribute bv{xsd:double}?、attribute bs{xsd:double}?、attribute bu{xsd:string}、attribute bver{xsd:int}?,
attribute n { xsd:string }?, attribute s { xsd:double }?, attribute t { xsd:double }?, attribute u { xsd:string }?, attribute ut { xsd:double }?,
属性n{xsd:string}?、属性s{xsd:double}?、属性t{xsd:double}?、属性u{xsd:string}?、属性ut{xsd:double}?,
attribute v { xsd:double }?, attribute vb { xsd:boolean }?, attribute vs { xsd:string }?, attribute vd { xsd:string }? }
attribute v { xsd:double }?, attribute vb { xsd:boolean }?, attribute vs { xsd:string }?, attribute vd { xsd:string }? }
sensml = element sensml { senml+ }
sensml = element sensml { senml+ }
start = sensml
start = sensml
For efficient transmission of SenML over, e.g., a constrained network, EXI can be used. This encodes the XML Schema [W3C.REC-xmlschema-1-20041028] structure of SenML into binary tags and values rather than ASCII text. An EXI representation of SenML SHOULD be made using the strict schema mode of EXI. However, this mode does not allow tag extensions to the schema; therefore, any extensions will be lost in the encoding. For uses where extensions need to be preserved in EXI, the non-strict schema mode of EXI MAY be used.
为了通过受限网络等有效传输SenML,可以使用EXI。这将SenML的xmlschema[W3C.REC-xmlschema-1-20041028]结构编码为二进制标记和值,而不是ASCII文本。SenML的EXI表示应该使用EXI的严格模式模式。但是,此模式不允许对模式进行标记扩展;因此,任何扩展都将在编码过程中丢失。对于需要在EXI中保留扩展的用途,可以使用EXI的非严格模式。
The EXI header MUST include "EXI Options", as defined in [W3C.REC-exi-20140211], with a schemaId set to the value of "a", indicating the schema provided in this specification. Future revisions to the schema can change the value of the schemaId to allow for backwards compatibility. When the data will be transported over CoAP or HTTP, an EXI Cookie SHOULD NOT be used as it simply makes things larger and is redundant to information provided in the Content-Type header.
EXI头必须包括[W3C.REC-EXI-20140211]中定义的“EXI选项”,schemaId设置为值“a”,表示本规范中提供的模式。模式的未来修订可以更改schemaId的值,以允许向后兼容。当数据将通过CoAP或HTTP传输时,不应使用EXI Cookie,因为它只会使内容变大,并且与内容类型标头中提供的信息冗余。
The following is the XSD Schema to be used for strict schema-guided EXI processing. It is generated from the RelaxNG.
以下是用于严格模式引导的EXI处理的XSD模式。它是由松弛产生的。
<?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:ietf:params:xml:ns:senml" xmlns:ns1="urn:ietf:params:xml:ns:senml"> <xs:element name="senml"> <xs:complexType> <xs:attribute name="bn" type="xs:string" /> <xs:attribute name="bt" type="xs:double" /> <xs:attribute name="bv" type="xs:double" /> <xs:attribute name="bs" type="xs:double" /> <xs:attribute name="bu" type="xs:string" /> <xs:attribute name="bver" type="xs:int" /> <xs:attribute name="n" type="xs:string" /> <xs:attribute name="s" type="xs:double" /> <xs:attribute name="t" type="xs:double" /> <xs:attribute name="u" type="xs:string" /> <xs:attribute name="ut" type="xs:double" /> <xs:attribute name="v" type="xs:double" /> <xs:attribute name="vb" type="xs:boolean" /> <xs:attribute name="vs" type="xs:string" /> <xs:attribute name="vd" type="xs:string" /> </xs:complexType> </xs:element> <xs:element name="sensml"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" ref="ns1:senml" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
<?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:ietf:params:xml:ns:senml" xmlns:ns1="urn:ietf:params:xml:ns:senml"> <xs:element name="senml"> <xs:complexType> <xs:attribute name="bn" type="xs:string" /> <xs:attribute name="bt" type="xs:double" /> <xs:attribute name="bv" type="xs:double" /> <xs:attribute name="bs" type="xs:double" /> <xs:attribute name="bu" type="xs:string" /> <xs:attribute name="bver" type="xs:int" /> <xs:attribute name="n" type="xs:string" /> <xs:attribute name="s" type="xs:double" /> <xs:attribute name="t" type="xs:double" /> <xs:attribute name="u" type="xs:string" /> <xs:attribute name="ut" type="xs:double" /> <xs:attribute name="v" type="xs:double" /> <xs:attribute name="vb" type="xs:boolean" /> <xs:attribute name="vs" type="xs:string" /> <xs:attribute name="vd" type="xs:string" /> </xs:complexType> </xs:element> <xs:element name="sensml"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" ref="ns1:senml" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
The following shows a hexdump of the EXI produced from encoding the following XML example. Note that this example is the same information as the first example in Section 5.1.2 but in JSON format.
下面显示了通过编码下面的XML示例生成的EXI的hextump。请注意,此示例的信息与第5.1.2节中的第一个示例相同,但为JSON格式。
<sensml xmlns="urn:ietf:params:xml:ns:senml"> <senml bn="urn:dev:ow:10e2073a01080063:" n="voltage" u="V" v="120.1"></senml> <senml n="current" u="A" v="1.2"></senml> </sensml>
<sensml xmlns="urn:ietf:params:xml:ns:senml"> <senml bn="urn:dev:ow:10e2073a01080063:" n="voltage" u="V" v="120.1"></senml> <senml n="current" u="A" v="1.2"></senml> </sensml>
Which compresses with EXI to the following displayed in hexdump:
使用EXI压缩到hexdump中显示的以下内容:
0000 a0 30 0d 84 80 f3 ab 93 71 d3 23 2b b1 d3 7b b9 |.0......q.#+..{.| 0010 d1 89 83 29 91 81 b9 9b 09 81 89 81 c1 81 81 b1 |...)............| 0020 99 d2 84 bb 37 b6 3a 30 b3 b2 90 1a b1 58 84 c0 |....7.:0.....X..| 0030 33 04 b1 ba b9 39 32 b7 3a 10 1a 09 06 40 38 |3....92.:....@8| 003f
0000 a0 30 0d 84 80 f3 ab 93 71 d3 23 2b b1 d3 7b b9 |.0......q.#+..{.| 0010 d1 89 83 29 91 81 b9 9b 09 81 89 81 c1 81 81 b1 |...)............| 0020 99 d2 84 bb 37 b6 3a 30 b3 b2 90 1a b1 58 84 c0 |....7.:0.....X..| 0030 33 04 b1 ba b9 39 32 b7 3a 10 1a 09 06 40 38 |3....92.:....@8| 003f
The above example used the bit-packed form of EXI, but it is also possible to use a byte-packed form of EXI, which can make it easier for a simple sensor to produce valid EXI without really implementing EXI. Consider the example of a temperature sensor that produces a value in tenths of degrees Celsius over a range of 0.0 to 55.0. It would produce an XML SenML file such as:
上面的示例使用了位压缩形式的EXI,但也可以使用字节压缩形式的EXI,这可以使简单传感器在不真正实现EXI的情况下更容易产生有效的EXI。考虑温度传感器在0到55的范围内产生十摄氏度的温度的例子。它将生成一个XML SenML文件,如:
<sensml xmlns="urn:ietf:params:xml:ns:senml"> <senml n="urn:dev:ow:10e2073a01080063" u="Cel" v="23.1"></senml> </sensml>
<sensml xmlns="urn:ietf:params:xml:ns:senml"> <senml n="urn:dev:ow:10e2073a01080063" u="Cel" v="23.1"></senml> </sensml>
The compressed form, using the byte-alignment option of EXI, for the above XML is the following:
对于上述XML,使用EXI的字节对齐选项的压缩表单如下所示:
0000 a0 00 48 80 6c 20 01 06 1d 75 72 6e 3a 64 65 76 |..H.l ...urn:dev| 0010 3a 6f 77 3a 31 30 65 32 30 37 33 61 30 31 30 38 |:ow:10e2073a0108| 0020 30 30 36 33 02 05 43 65 6c 01 00 e7 01 01 00 03 |0063..Cel.......| 0030 01 |.| 0031
0000 a0 00 48 80 6c 20 01 06 1d 75 72 6e 3a 64 65 76 |..H.l ...urn:dev| 0010 3a 6f 77 3a 31 30 65 32 30 37 33 61 30 31 30 38 |:ow:10e2073a0108| 0020 30 30 36 33 02 05 43 65 6c 01 00 e7 01 01 00 03 |0063..Cel.......| 0030 01 |.| 0031
A small temperature sensor device that only generates this one EXI file does not really need a full EXI implementation. It can simply hard code the output, replacing the 1-wire device ID starting at byte 0x14 and going to byte 0x23 with its device ID and replacing the value "0xe7 0x01" at location 0x2b and 0x2c with the current temperature. The EXI specification [W3C.REC-exi-20140211] contains the full information on how floating-point numbers are represented, but for the purpose of this sensor, the temperature can be converted to an integer in tenths of degrees (231 in this example). EXI stores 7 bits of the integer in each byte with the top bit set to one if there are further bytes. So, the first byte is set to the low 7 bits of the integer temperature in tenths of degrees plus 0x80. In this example, 231 & 0x7F + 0x80 = 0xE7. The second byte is set to the integer temperature in tenths of degrees right-shifted 7 bits. In this example, 231 >> 7 = 0x01.
一个只生成一个EXI文件的小型温度传感器设备实际上并不需要完整的EXI实现。它可以简单地硬编码输出,用其设备ID替换从字节0x14开始到字节0x23的单线设备ID,并用当前温度替换位置0x2b和0x2c处的值“0xe7 0x01”。EXI规范[W3C.REC-EXI-20140211]包含浮点数表示方式的完整信息,但对于该传感器而言,温度可以转换为十分之一度的整数(本例中为231度)。EXI在每个字节中存储7位整数,如果还有更多字节,则将顶部位设置为1。因此,第一个字节被设置为整数温度的低7位,以十分之一度加0x80为单位。在本例中,231&0x7F+0x80=0xE7。第二个字节设置为整数温度,以十分之一度为单位,右移7位。在本例中,231>>7=0x01。
A SenML Pack typically consists of multiple SenML Records, and for some applications, it may be useful to be able to refer to a single Record, or a set of Records, in a Pack with a fragment identifier. The fragment identifier is only interpreted by a client and does not impact retrieval of a representation. The SenML fragment identification is modeled after Comma-Separated Value (CSV) fragment identifiers [RFC7111].
一个SenML包通常由多个SenML记录组成,对于某些应用程序来说,能够引用一个带有片段标识符的包中的单个记录或一组记录可能会很有用。片段标识符仅由客户端解释,不影响表示的检索。SenML片段标识是根据逗号分隔值(CSV)片段标识符[RFC7111]建模的。
To select a single SenML Record, the "rec" scheme followed by a single number is used. For the purpose of numbering Records, the first Record is at position 1. A range of records can be selected by giving the first and the last record number separated by a "-" character. Instead of the second number, the "*" character can be used to indicate the last SenML Record in the Pack. A set of Records can also be selected using a comma-separated list of Record positions or ranges.
要选择单个SenML记录,请使用后跟单个数字的“rec”方案。为了对记录进行编号,第一条记录位于位置1。通过给出第一个和最后一个记录编号(以“-”字符分隔),可以选择一系列记录。可以使用“*”字符代替第二个数字来指示数据包中的最后一条SenML记录。还可以使用逗号分隔的记录位置或范围列表来选择一组记录。
(We use the term "selecting a Record" for identifying it as part of the fragment, not in the sense of isolating it from the Pack -- the Record still needs to be interpreted as part of the Pack, e.g., using the base values defined in earlier Records.)
(我们使用术语“选择记录”来将其标识为片段的一部分,而不是将其从包中分离出来——该记录仍然需要解释为包的一部分,例如,使用早期记录中定义的基值。)
The 3rd SenML Record from the "coap://example.com/temp" resource can be selected with:
第三条SenML记录来自“coap://example.com/temp“可以使用以下选项选择资源:
coap://example.com/temp#rec=3
coap://example.com/temp#rec=3
Records from 3rd to 6th can be selected with:
可以使用以下选项选择第3到第6个记录:
coap://example.com/temp#rec=3-6
coap://example.com/temp#rec=3-6
Records from 19th to the last can be selected with:
可以使用以下选项选择从第19条到最后一条的记录:
coap://example.com/temp#rec=19-*
coap://example.com/temp#rec=19-*
The 3rd and 5th Records can be selected with:
第3条和第5条记录可通过以下方式选择:
coap://example.com/temp#rec=3,5
coap://example.com/temp#rec=3,5
To select the Records from third to fifth, the 10th Record, and all Records from 19th to the last:
要选择从第三条到第五条、第十条记录以及从第十九条到最后一条的所有记录,请执行以下操作:
coap://example.com/temp#rec=3-5,10,19-*
coap://example.com/temp#rec=3-5,10,19-*
In addition to the SenML fragment identifiers described above, with the XML and EXI SenML formats, the syntax defined in the XPointer element() Scheme [XPointerElement] of the XPointer Framework [XPointerFramework] can be used. (This is required by [RFC7303] for media types using the syntax suffix structured with "+xml". For consistency, SenML allows this for the EXI formats as well.)
除了上面描述的SenML片段标识符之外,对于XML和EXI SenML格式,还可以使用XPointer框架[XPointerFramework]的XPointer element()Scheme[XPointerElement]中定义的语法。(这是[RFC7303]对于使用“+xml”结构的语法后缀的媒体类型所必需的。为保持一致性,SenML还允许EXI格式使用此功能。)
Note that fragment identifiers are available to the client side only; they are not provided in transfer protocols such as CoAP or HTTP. Thus, they cannot be used by the server in deciding which media type to send. Where a server has multiple representations available for a resource identified by a URI, it might send a JSON or CBOR representation when the client was directed to use an XML/EXI fragment identifier with it. Clients can prevent running into this problem by explicitly requesting an XML or EXI media type (e.g., using the CoAP Accept option) when XML-/EXI-only fragment identifier syntax is in use in the URI.
请注意,片段标识符仅对客户端可用;在诸如CoAP或HTTP之类的传输协议中不提供它们。因此,服务器无法使用它们来决定发送哪种媒体类型。如果服务器对URI标识的资源有多个表示,则当客户机被指示使用XML/EXI片段标识符时,它可能会发送JSON或CBOR表示。当URI中使用XML-/EXI only片段标识符语法时,客户端可以通过显式请求XML或EXI媒体类型(例如,使用CoAP Accept选项)来防止遇到此问题。
The measurements support sending both the current value of a sensor as well as an integrated sum. For many types of measurements, the sum is more useful than the current value. For historical reasons, this field is called "Sum" instead of "integral", which would more accurately describe its function. For example, an electrical meter that measures the energy a given computer uses will typically want to measure the cumulative amount of energy used. This is less prone to error than reporting the power each second and trying to have something on the server side sum together all the power measurements. If the network between the sensor and the meter goes down over some period of time, when it comes back up, the cumulative sum helps reflect what happened while the network was down. A meter like this would typically report a measurement with the unit set to watts, but it would put the sum of energy used in the "s" field of the measurement. It might optionally include the current power in the "v" field.
测量支持发送传感器的当前值以及积分和。对于许多类型的测量,总和比当前值更有用。由于历史原因,该字段被称为“和”,而不是“积分”,这将更准确地描述其功能。例如,测量给定计算机使用的能量的电表通常需要测量累计使用的能量。与每秒报告功率并尝试在服务器端将所有功率测量值相加相比,这更不容易出错。如果传感器和电表之间的网络在一段时间内出现故障,当它恢复时,累计总和有助于反映网络故障时发生的情况。这样的电表通常会报告单位设置为瓦特的测量,但它会将所用能量的总和放在测量的“s”字段中。它可以选择在“v”字段中包含当前电源。
While the benefit of using the integrated sum is fairly clear for measurements like power and energy, it is less obvious for something like temperature. Reporting the sum of the temperature makes it easy to compute averages even when the individual temperature values are not reported frequently enough to compute accurate averages. Implementers are encouraged to report the cumulative sum as well as the raw value of a given sensor.
虽然使用积分和的好处在功率和能量等测量中相当明显,但在温度等测量中则不太明显。报告温度之和可以轻松计算平均值,即使单个温度值的报告频率不足以计算准确的平均值。鼓励实施者报告给定传感器的累积和以及原始值。
Applications that use the cumulative Sum values need to understand they are very loosely defined by this specification, and depending on the particular sensor implementation, they may behave in unexpected ways. Applications should be able to deal with the following issues:
使用累积和值的应用程序需要了解,本规范对累积和值的定义非常松散,并且根据特定的传感器实现,累积和值可能会以意外的方式运行。应用程序应能够处理以下问题:
1. Many sensors will allow the cumulative sums to "wrap" back to zero after the value gets sufficiently large.
1. 许多传感器将允许累积总和在值足够大后“包装”回零。
2. Some sensors will reset the cumulative sum back to zero when the device is reset, loses power, or is replaced with a different sensor.
2. 当设备复位、断电或更换为其他传感器时,某些传感器会将累计和复位回零。
3. Applications cannot make assumptions about when the device started accumulating values into the sum.
3. 应用程序无法假设设备何时开始将值累积到总和中。
Typically, applications can make some assumptions about specific sensors that will allow them to deal with these problems. A common assumption is that for sensors whose measurement values are non-negative, the sum should never get smaller; if the sum does get smaller, the application will know that one of the situations listed above has happened.
通常情况下,应用程序可以对特定传感器进行一些假设,以允许它们处理这些问题。一个常见的假设是,对于测量值为非负的传感器,总和永远不会变小;如果总和变小,应用程序将知道发生了上面列出的情况之一。
Despite the name "Sum", the Sum field is not useful for applications that maintain a running count of the number of times an event happened or that keep track of a counter such as the total number of bytes sent on an interface. Data like that can be sent directly in the Value field.
尽管名称为“Sum”,但Sum字段对于维护事件发生次数的运行计数或跟踪计数器(如在接口上发送的总字节数)的应用程序并不有用。这样的数据可以直接在值字段中发送。
As a convenient reference, the JSON and CBOR representations can be described with the common Concise Data Definition Language (CDDL) specification [CDDL-CBOR] in Figure 1 (informative).
作为一个方便的参考,JSON和CBOR表示可以用图1(信息性)中的通用简明数据定义语言(CDDL)规范[CDDL-CBOR]来描述。
SenML-Pack = [1* record]
SenML-Pack = [1* record]
record = { ? bn => tstr, ; Base Name ? bt => numeric, ; Base Time ? bu => tstr, ; Base Units ? bv => numeric, ; Base Value ? bs => numeric, ; Base Sum ? bver => uint, ; Base Version ? n => tstr, ; Name ? u => tstr, ; Units ? s => numeric, ; Sum ? t => numeric, ; Time ? ut => numeric, ; Update Time ? ( v => numeric // ; Numeric Value vs => tstr // ; String Value vb => bool // ; Boolean Value vd => binary-value ) ; Data Value * key-value-pair }
record = { ? bn => tstr, ; Base Name ? bt => numeric, ; Base Time ? bu => tstr, ; Base Units ? bv => numeric, ; Base Value ? bs => numeric, ; Base Sum ? bver => uint, ; Base Version ? n => tstr, ; Name ? u => tstr, ; Units ? s => numeric, ; Sum ? t => numeric, ; Time ? ut => numeric, ; Update Time ? ( v => numeric // ; Numeric Value vs => tstr // ; String Value vb => bool // ; Boolean Value vd => binary-value ) ; Data Value * key-value-pair }
; now define the generic versions key-value-pair = ( label => value )
; now define the generic versions key-value-pair = ( label => value )
label = non-b-label / b-label non-b-label = tstr .regexp "[A-Zac-z0-9][-_:.A-Za-z0-9]*" / uint b-label = tstr .regexp "b[-_:.A-Za-z0-9]+" / nint
label = non-b-label / b-label non-b-label = tstr .regexp "[A-Zac-z0-9][-_:.A-Za-z0-9]*" / uint b-label = tstr .regexp "b[-_:.A-Za-z0-9]+" / nint
value = tstr / binary-value / numeric / bool numeric = number / decfrac
value = tstr / binary-value / numeric / bool numeric = number / decfrac
Figure 1: Common CDDL Specification for CBOR and JSON SenML
图1:CBOR和JSON SenML的通用CDDL规范
For JSON, we use text labels and base64url-encoded binary data (Figure 2).
对于JSON,我们使用文本标签和base64url编码的二进制数据(图2)。
bver = "bver" n = "n" s = "s" bn = "bn" u = "u" t = "t" bt = "bt" v = "v" ut = "ut" bu = "bu" vs = "vs" vd = "vd" bv = "bv" vb = "vb" bs = "bs"
bver = "bver" n = "n" s = "s" bn = "bn" u = "u" t = "t" bt = "bt" v = "v" ut = "ut" bu = "bu" vs = "vs" vd = "vd" bv = "bv" vb = "vb" bs = "bs"
binary-value = tstr ; base64url encoded
二进制值=tstr;base64url编码
Figure 2: JSON-Specific CDDL Specification for SenML
图2:SenML的JSON特定CDDL规范
For CBOR, we use integer labels and native binary data (Figure 3).
对于CBOR,我们使用整数标签和本机二进制数据(图3)。
bver = -1 n = 0 s = 5 bn = -2 u = 1 t = 6 bt = -3 v = 2 ut = 7 bu = -4 vs = 3 vd = 8 bv = -5 vb = 4 bs = -6
bver = -1 n = 0 s = 5 bn = -2 u = 1 t = 6 bt = -3 v = 2 ut = 7 bu = -4 vs = 3 vd = 8 bv = -5 vb = 4 bs = -6
binary-value = bstr
binary-value = bstr
Figure 3: CBOR-Specific CDDL Specification for SenML
图3:SenML的CBOR特定CDDL规范
IANA has created a new "Sensor Measurement Lists (SenML)" registry that contains the subregistries defined in Sections 12.1 and 12.2.
IANA创建了一个新的“传感器测量列表(SenML)”注册表,其中包含第12.1节和第12.2节中定义的子区域。
IANA has created a registry of SenML unit symbols called the "SenML Units" registry. The primary purpose of this registry is to make sure that symbols uniquely map to indicate a type of measurement. Definitions for many of these units can be found in other publications such as [NIST811] and [BIPM]. Units marked with an asterisk are NOT RECOMMENDED to be produced by new implementations but are in active use and SHOULD be implemented by consumers that can use the corresponding SenML units that are closer to the unscaled SI units.
IANA创建了一个SenML单元符号注册表,称为“SenML单元”注册表。此注册表的主要目的是确保符号唯一映射以指示测量类型。许多此类单位的定义见其他出版物,如[NIST811]和[BIPM]。标有星号的单位不建议由新的实施方式生产,而是在积极使用中,并且应该由能够使用相应的SenML单位(更接近非标度SI单位)的消费者实施。
+----------+------------------------------------+-------+-----------+ | Symbol | Description | Type | Reference | +----------+------------------------------------+-------+-----------+ | m | meter | float | RFC 8428 | | kg | kilogram | float | RFC 8428 | | g | gram* | float | RFC 8428 | | s | second | float | RFC 8428 | | A | ampere | float | RFC 8428 | | K | kelvin | float | RFC 8428 | | cd | candela | float | RFC 8428 | | mol | mole | float | RFC 8428 | | Hz | hertz | float | RFC 8428 | | rad | radian | float | RFC 8428 | | sr | steradian | float | RFC 8428 | | N | newton | float | RFC 8428 | | Pa | pascal | float | RFC 8428 | | J | joule | float | RFC 8428 | | W | watt | float | RFC 8428 | | C | coulomb | float | RFC 8428 | | V | volt | float | RFC 8428 | | F | farad | float | RFC 8428 | | Ohm | ohm | float | RFC 8428 | | S | siemens | float | RFC 8428 | | Wb | weber | float | RFC 8428 | | T | tesla | float | RFC 8428 | | H | henry | float | RFC 8428 | | Cel | degrees Celsius | float | RFC 8428 | | lm | lumen | float | RFC 8428 | | lx | lux | float | RFC 8428 | | Bq | becquerel | float | RFC 8428 | | Gy | gray | float | RFC 8428 | | Sv | sievert | float | RFC 8428 | | kat | katal | float | RFC 8428 | | m2 | square meter (area) | float | RFC 8428 | | m3 | cubic meter (volume) | float | RFC 8428 | | l | liter (volume)* | float | RFC 8428 | | m/s | meter per second (velocity) | float | RFC 8428 | | m/s2 | meter per square second | float | RFC 8428 | | | (acceleration) | | | | m3/s | cubic meter per second (flow rate) | float | RFC 8428 | | l/s | liter per second (flow rate)* | float | RFC 8428 | | W/m2 | watt per square meter (irradiance) | float | RFC 8428 | | cd/m2 | candela per square meter | float | RFC 8428 | | | (luminance) | | | | bit | bit (information content) | float | RFC 8428 | | bit/s | bit per second (data rate) | float | RFC 8428 | | lat | degrees latitude (Note 1) | float | RFC 8428 | | lon | degrees longitude (Note 1) | float | RFC 8428 |
+----------+------------------------------------+-------+-----------+ | Symbol | Description | Type | Reference | +----------+------------------------------------+-------+-----------+ | m | meter | float | RFC 8428 | | kg | kilogram | float | RFC 8428 | | g | gram* | float | RFC 8428 | | s | second | float | RFC 8428 | | A | ampere | float | RFC 8428 | | K | kelvin | float | RFC 8428 | | cd | candela | float | RFC 8428 | | mol | mole | float | RFC 8428 | | Hz | hertz | float | RFC 8428 | | rad | radian | float | RFC 8428 | | sr | steradian | float | RFC 8428 | | N | newton | float | RFC 8428 | | Pa | pascal | float | RFC 8428 | | J | joule | float | RFC 8428 | | W | watt | float | RFC 8428 | | C | coulomb | float | RFC 8428 | | V | volt | float | RFC 8428 | | F | farad | float | RFC 8428 | | Ohm | ohm | float | RFC 8428 | | S | siemens | float | RFC 8428 | | Wb | weber | float | RFC 8428 | | T | tesla | float | RFC 8428 | | H | henry | float | RFC 8428 | | Cel | degrees Celsius | float | RFC 8428 | | lm | lumen | float | RFC 8428 | | lx | lux | float | RFC 8428 | | Bq | becquerel | float | RFC 8428 | | Gy | gray | float | RFC 8428 | | Sv | sievert | float | RFC 8428 | | kat | katal | float | RFC 8428 | | m2 | square meter (area) | float | RFC 8428 | | m3 | cubic meter (volume) | float | RFC 8428 | | l | liter (volume)* | float | RFC 8428 | | m/s | meter per second (velocity) | float | RFC 8428 | | m/s2 | meter per square second | float | RFC 8428 | | | (acceleration) | | | | m3/s | cubic meter per second (flow rate) | float | RFC 8428 | | l/s | liter per second (flow rate)* | float | RFC 8428 | | W/m2 | watt per square meter (irradiance) | float | RFC 8428 | | cd/m2 | candela per square meter | float | RFC 8428 | | | (luminance) | | | | bit | bit (information content) | float | RFC 8428 | | bit/s | bit per second (data rate) | float | RFC 8428 | | lat | degrees latitude (Note 1) | float | RFC 8428 | | lon | degrees longitude (Note 1) | float | RFC 8428 |
| pH | pH value (acidity; logarithmic | float | RFC 8428 | | | quantity) | | | | dB | decibel (logarithmic quantity) | float | RFC 8428 | | dBW | decibel relative to 1 W (power | float | RFC 8428 | | | level) | | | | Bspl | bel (sound pressure level; | float | RFC 8428 | | | logarithmic quantity)* | | | | count | 1 (counter value) | float | RFC 8428 | | / | 1 (ratio, e.g., value of a switch; | float | RFC 8428 | | | Note 2) | | | | % | 1 (ratio, e.g., value of a switch; | float | RFC 8428 | | | Note 2)* | | | | %RH | percentage (relative humidity) | float | RFC 8428 | | %EL | percentage (remaining battery | float | RFC 8428 | | | energy level) | | | | EL | seconds (remaining battery energy | float | RFC 8428 | | | level) | | | | 1/s | 1 per second (event rate) | float | RFC 8428 | | 1/min | 1 per minute (event rate, "rpm")* | float | RFC 8428 | | beat/min | 1 per minute (heart rate in beats | float | RFC 8428 | | | per minute)* | | | | beats | 1 (cumulative number of heart | float | RFC 8428 | | | beats)* | | | | S/m | siemens per meter (conductivity) | float | RFC 8428 | +----------+------------------------------------+-------+-----------+
| pH | pH value (acidity; logarithmic | float | RFC 8428 | | | quantity) | | | | dB | decibel (logarithmic quantity) | float | RFC 8428 | | dBW | decibel relative to 1 W (power | float | RFC 8428 | | | level) | | | | Bspl | bel (sound pressure level; | float | RFC 8428 | | | logarithmic quantity)* | | | | count | 1 (counter value) | float | RFC 8428 | | / | 1 (ratio, e.g., value of a switch; | float | RFC 8428 | | | Note 2) | | | | % | 1 (ratio, e.g., value of a switch; | float | RFC 8428 | | | Note 2)* | | | | %RH | percentage (relative humidity) | float | RFC 8428 | | %EL | percentage (remaining battery | float | RFC 8428 | | | energy level) | | | | EL | seconds (remaining battery energy | float | RFC 8428 | | | level) | | | | 1/s | 1 per second (event rate) | float | RFC 8428 | | 1/min | 1 per minute (event rate, "rpm")* | float | RFC 8428 | | beat/min | 1 per minute (heart rate in beats | float | RFC 8428 | | | per minute)* | | | | beats | 1 (cumulative number of heart | float | RFC 8428 | | | beats)* | | | | S/m | siemens per meter (conductivity) | float | RFC 8428 | +----------+------------------------------------+-------+-----------+
Table 6: IANA Registry for SenML Units
表6:SenML单元的IANA注册表
o Note 1: Assumed to be in World Geodetic System 1984 (WGS84), unless another reference frame is known for the sensor.
o 注1:假设为1984年世界大地测量系统(WGS84),除非已知传感器的另一参考坐标系。
o Note 2: A value of 0.0 indicates the switch is off, 1.0 indicates on, and 0.5 indicates half on. The preferred name of this unit is "/". For historical reasons, the name "%" is also provided for the same unit, but note that while that name strongly suggests a percentage (0..100), it is NOT a percentage but the absolute ratio!
o 注2:0.0表示开关关闭,1.0表示打开,0.5表示半开。此单元的首选名称为“/”。出于历史原因,也为同一单位提供了名称“%”,但请注意,尽管该名称强烈表示百分比(0..100),但它不是百分比,而是绝对比率!
New entries can be added to the registration by Expert Review as defined in [RFC8126]. Experts should exercise their own good judgment but need to consider the following guidelines:
根据[RFC8126]中的定义,可以通过专家评审将新条目添加到注册中。专家应该行使自己的良好判断力,但需要考虑以下准则:
1. There needs to be a real and compelling use for any new unit to be added.
1. 需要有一个真正的和令人信服的使用任何新的单位被添加。
2. Each unit should define the semantic information and be chosen carefully. Implementers need to remember that the same word may be used in different real-life contexts. For example, degrees when measuring latitude have no semantic relation to degrees when measuring temperature; thus, two different units are needed.
2. 每个单元应定义语义信息,并仔细选择。实现者需要记住,同一个词可能会在不同的现实环境中使用。例如,测量纬度时的度数与测量温度时的度数没有语义关系;因此,需要两个不同的单元。
3. These measurements are produced by computers for consumption by computers. The principle is that conversion has to be easily done when both reading and writing the media type. The value of a single canonical representation outweighs the convenience of easy human representations or loss of precision in a conversion.
3. 这些测量值由计算机生成,供计算机使用。其原理是,在读取和写入媒体类型时,必须轻松完成转换。单一规范表示法的价值超过了简单的人类表示法的便利性或转换过程中的精度损失。
4. Use of System of Units (SI) prefixes such as "k" before the unit is not recommended. Instead, one can represent the value using scientific notation such as 1.2e3. The "kg" unit is an exception to this rule since it is an SI base unit; the "g" unit is provided for legacy compatibility.
4. 不建议在单位前使用单位制(SI)前缀,如“k”。相反,可以使用科学符号表示值,如1.2e3。“kg”单位是该规则的例外,因为它是SI基本单位;提供“g”单元是为了实现传统兼容性。
5. For a given type of measurement, there will only be one unit type defined. So for length, meter is defined, and other lengths such as mile, foot, and light year are not allowed. For most cases, the SI unit is preferred.
5. 对于给定的测量类型,将只定义一种单位类型。因此,对于长度,定义了米,不允许使用其他长度,如英里、英尺和光年。在大多数情况下,首选国际单位制。
(Note that some amount of judgment will be required here, as even SI itself is not entirely consistent in this respect. For instance, for temperature, [ISO-80000-5] defines a quantity, item 5-1 (thermodynamic temperature), and a corresponding unit of 5-1.a (Kelvin); [ISO-80000-5] goes on to define another quantity, item 5-2 ("Celsius temperature"), and the corresponding unit of 5-2.a (degree Celsius). The latter quantity is defined such that it gives the thermodynamic temperature as a delta from T0 = 275.15 K. ISO 80000-5 is defining both units side by side and not really expressing a preference. This level of recognition of the alternative unit degree Celsius is the reason why Celsius temperatures seem exceptionally acceptable in the SenML units list alongside Kelvin.)
(请注意,此处需要进行一定程度的判断,因为即使SI本身在这方面也不完全一致。例如,对于温度,[ISO-80000-5]定义了一个量,即第5-1项(热力学温度),以及相应的5-1.a(开尔文)单位;[ISO-80000-5]接着定义了另一个量,即第5-2项(“摄氏温度”),以及相应的单位5-2.a(摄氏度)定义后一个量时,其给出的热力学温度为T0=275.15 K之间的增量。ISO 80000-5将两个单位并排定义,而不是真正表示偏好。对替代单位摄氏度的认识水平是摄氏温度在SenML u中异常可接受的原因nits列表与开尔文一起列出。)
6. Symbol names that could be easily confused with existing common units or units combined with prefixes should be avoided. For example, selecting a unit name of "mph" to indicate something that had nothing to do with velocity would be a bad choice, as "mph" is commonly used to mean "miles per hour".
6. 应避免容易与现有通用单位或与前缀组合的单位混淆的符号名称。例如,选择一个单位名称“mph”来表示与速度无关的东西将是一个错误的选择,因为“mph”通常用于表示“英里/小时”。
7. The following should not be used because they are common SI prefixes: Y, Z, E, P, T, G, M, k, h, da, d, c, u, n, p, f, a, z, y, Ki, Mi, Gi, Ti, Pi, Ei, Zi, and Yi.
7. 不应使用以下前缀,因为它们是常见的SI前缀:Y、Z、E、P、T、G、M、k、h、da、d、c、u、n、P、f、a、Z、Y、Ki、Mi、Gi、Ti、Pi、Ei、Zi和Yi。
8. The following units should not be used as they are commonly used to represent other measurements: Ky, Gal, dyn, etg, P, St, Mx, G, Oe, Gb, sb, Lmb, mph, Ci, R, RAD, REM, gal, bbl, qt, degF, Cal, BTU, HP, pH, B/s, psi, Torr, atm, at, bar, and kWh.
8. 以下单位不应使用,因为它们通常用于表示其他测量值:Ky、Gal、dyn、etg、P、St、Mx、G、Oe、Gb、sb、Lmb、mph、Ci、R、RAD、REM、Gal、bbl、qt、degF、Cal、BTU、HP、pH、B/s、psi、Torr、atm、at、bar和kWh。
9. The unit names are case sensitive, and the correct case needs to be used; however, symbols that differ only in case should not be allocated.
9. 单元名称区分大小写,需要使用正确的大小写;但是,不应分配仅在大小写上不同的符号。
10. A number after a unit typically indicates the previous unit raised to that power, and "/" indicates that the units that follow are the reciprocals. A unit should have only one "/" in the name.
10. 单位后面的数字通常表示上一个单位提升到该功率,而“/”表示后面的单位是倒数。一个单元的名称中只能有一个“/”。
11. A good list of common units can be found in the Unified Code for Units of Measure [UCUM].
11. 在统一度量单位代码[UCUM]中可以找到一个很好的通用单位列表。
IANA has created a new registry for SenML Labels called the "SenML Labels" registry. The initial contents of the registry are as follows:
IANA为SenML标签创建了一个新的注册表,称为“SenML标签”注册表。登记处的初步内容如下:
+--------------+-------+----+-----------+----------+----+-----------+ | Name | Label | CL | JSON Type | XML Type | EI | Reference | +--------------+-------+----+-----------+----------+----+-----------+ | Base Name | bn | -2 | String | string | a | RFC 8428 | | Base Time | bt | -3 | Number | double | a | RFC 8428 | | Base Unit | bu | -4 | String | string | a | RFC 8428 | | Base Value | bv | -5 | Number | double | a | RFC 8428 | | Base Sum | bs | -6 | Number | double | a | RFC 8428 | | Base Version | bver | -1 | Number | int | a | RFC 8428 | | Name | n | 0 | String | string | a | RFC 8428 | | Unit | u | 1 | String | string | a | RFC 8428 | | Value | v | 2 | Number | double | a | RFC 8428 | | String Value | vs | 3 | String | string | a | RFC 8428 | | Boolean | vb | 4 | Boolean | boolean | a | RFC 8428 | | Value | | | | | | | | Data Value | vd | 8 | String | string | a | RFC 8428 | | Sum | s | 5 | Number | double | a | RFC 8428 | | Time | t | 6 | Number | double | a | RFC 8428 | | Update Time | ut | 7 | Number | double | a | RFC 8428 | +--------------+-------+----+-----------+----------+----+-----------+
+--------------+-------+----+-----------+----------+----+-----------+ | Name | Label | CL | JSON Type | XML Type | EI | Reference | +--------------+-------+----+-----------+----------+----+-----------+ | Base Name | bn | -2 | String | string | a | RFC 8428 | | Base Time | bt | -3 | Number | double | a | RFC 8428 | | Base Unit | bu | -4 | String | string | a | RFC 8428 | | Base Value | bv | -5 | Number | double | a | RFC 8428 | | Base Sum | bs | -6 | Number | double | a | RFC 8428 | | Base Version | bver | -1 | Number | int | a | RFC 8428 | | Name | n | 0 | String | string | a | RFC 8428 | | Unit | u | 1 | String | string | a | RFC 8428 | | Value | v | 2 | Number | double | a | RFC 8428 | | String Value | vs | 3 | String | string | a | RFC 8428 | | Boolean | vb | 4 | Boolean | boolean | a | RFC 8428 | | Value | | | | | | | | Data Value | vd | 8 | String | string | a | RFC 8428 | | Sum | s | 5 | Number | double | a | RFC 8428 | | Time | t | 6 | Number | double | a | RFC 8428 | | Update Time | ut | 7 | Number | double | a | RFC 8428 | +--------------+-------+----+-----------+----------+----+-----------+
Note that CL = CBOR Label and EI = EXI ID.
请注意,CL=CBOR标签,EI=EXI ID。
Table 7: IANA Registry for SenML Labels
表7:SenML标签的IANA注册表
This is the same table as Table 1, with notes removed and columns added for the information that is all the same for this initial set of registrations, but it will need to be supplied with different values for new registrations.
这是与表1相同的表,删除了注释,并添加了与此初始注册集相同的信息列,但需要为新注册提供不同的值。
All new entries must define the Name, Label, and XML Type, but the CBOR labels SHOULD be left empty as CBOR will use the string encoding for any new labels. The EI column contains the EXI schemaId value of the first schema that includes this label, or it is empty if this label was not intended for use with EXI. The Reference column SHOULD contain information about where to find out more information about this label.
所有新条目都必须定义名称、标签和XML类型,但CBOR标签应为空,因为CBOR将对任何新标签使用字符串编码。EI列包含包含此标签的第一个架构的EXI schemaId值,如果此标签不打算与EXI一起使用,则该列为空。“参考”列应包含有关在何处查找有关此标签的更多信息的信息。
The JSON, CBOR, and EXI types are derived from the XML type. All XML numeric types such as double, float, integer, and int become a JSON Number. XML boolean and string become a JSON Boolean and String,
JSON、CBOR和EXI类型派生自XML类型。所有XML数字类型(如double、float、integer和int)都成为JSON数字。XML布尔值和字符串变成JSON布尔值和字符串,
respectively. CBOR represents numeric values with a CBOR type that does not lose any information from the JSON value. EXI uses the XML types.
分别地CBOR表示具有CBOR类型的数值,该类型不会丢失JSON值中的任何信息。EXI使用XML类型。
New entries can be added to the registration by Expert Review as defined in [RFC8126]. Experts should exercise their own good judgment but need to consider that shorter labels should have more strict review. New entries should not be made that counteract the advice at the end of Section 4.5.4.
根据[RFC8126]中的定义,可以通过专家评审将新条目添加到注册中。专家应该行使自己的良好判断,但需要考虑较短的标签应该有更严格的审查。新条目不得抵消第4.5.4节末尾的建议。
All new SenML Labels that have "base" semantics (see Section 4.1) MUST start with the character "b". Regular labels MUST NOT start with that character. All new SenML Labels with Value semantics (see Section 4.2) MUST have "Value" in their (long-form) name.
所有具有“基本”语义(参见第4.1节)的新SenML标签必须以字符“b”开头。常规标签不得以该字符开头。所有具有值语义的新SenML标签(见第4.2节)的(长格式)名称中必须有“值”。
Extensions that add a label intended for use with XML need to create a new RelaxNG Schema that includes all the labels in the "SenML Labels" registry.
添加用于XML的标签的扩展需要创建一个新的RelaxNG模式,该模式包括“SenML标签”注册表中的所有标签。
Extensions that add a label that is intended for use with EXI need to create a new XSD Schema that includes all the labels in the "SenML Labels" registry and then allocate a new EXI schemaId value. Moving to the next letter in the alphabet is the suggested way to create the new value for the EXI schemaId. Any labels with previously blank ID values SHOULD be updated in the "SenML Labels" registry to have their ID set to this new schemaId value.
添加用于EXI的标签的扩展需要创建一个新的XSD模式,其中包括“SenML标签”注册表中的所有标签,然后分配一个新的EXI schemaId值。移动到字母表中的下一个字母是为EXI schemaId创建新值的建议方法。任何以前ID值为空的标签都应该在“SenML标签”注册表中更新,以便将其ID设置为这个新的schemaId值。
Extensions that are mandatory to understand to correctly process the Pack MUST have a label name that ends with the "_" character.
必须理解才能正确处理包的扩展名必须具有以“\u1”字符结尾的标签名。
The registrations in the subsections below follow the procedures specified in [RFC6838] and [RFC7303]. This document registers media types for each serialization format of SenML (JSON, CBOR, XML, and EXI) and also a corresponding set of media types for streaming use (SenSML; see Section 4.8). Clipboard formats are defined for the JSON and XML forms of SenML but not for streams or non-textual formats.
以下小节中的注册遵循[RFC6838]和[RFC7303]中规定的程序。本文档为SenML的每个序列化格式(JSON、CBOR、XML和EXI)注册媒体类型,并为流媒体使用注册一组相应的媒体类型(SenSML;参见第4.8节)。剪贴板格式是为SenML的JSON和XML格式定义的,但不是为流或非文本格式定义的。
The reason there are both SenML and the streaming SenSML formats is that they are not the same data formats, and they require separate negotiation to understand if they are supported and which one is being used. The non-streaming format is required to have some sort of end-of-pack syntax that indicates there will be no more records. Many implementations that receive SenML wait for this end-of-pack marker before processing any of the records. On the other hand, with the streaming formats, it is explicitly not required to wait for this
存在SenML和streaming SenML格式的原因是它们不是相同的数据格式,它们需要单独协商以了解是否支持它们以及使用哪种格式。非流式格式需要有某种类型的包结束语法,以指示不再有记录。许多接收SenML的实现在处理任何记录之前都会等待这个包结束标记。另一方面,对于流式格式,明确不需要等待
end-of-pack marker. Many implementations that produce streaming SenSML will never send this end-of-pack marker, so implementations that receive streaming SenSML cannot wait for the end-of-pack marker before they start processing the records. Given that SenML and streaming SenML are different data formats, and considering the requirement for separate negotiation, a media type for each one is needed.
包装结束标记。许多产生streaming SenSML的实现永远不会发送此包结束标记,因此接收streaming SenSML的实现不能在开始处理记录之前等待包结束标记。鉴于SenML和streaming SenML是不同的数据格式,并且考虑到单独协商的要求,需要为每种格式指定一种媒体类型。
Type name: application
类型名称:应用程序
Subtype name: senml+json
子类型名称:senml+json
Required parameters: none
所需参数:无
Optional parameters: none
可选参数:无
Encoding considerations: Must be encoded as using a subset of the encoding allowed in [RFC8259]. See RFC 8428 for details. This simplifies implementation of a very simple system and does not impose any significant limitations as all this data is meant for machine-to-machine communications and is not meant to be human readable.
编码注意事项:必须使用[RFC8259]中允许的编码子集进行编码。详见RFC 8428。这简化了一个非常简单的系统的实现,并且没有施加任何明显的限制,因为所有这些数据都是用于机器对机器的通信,并且不是人类可读的。
Security considerations: See Section 13 of RFC 8428.
安全注意事项:见RFC 8428第13节。
Interoperability considerations: Applications MUST ignore any JSON key-value pairs that they do not understand unless the key ends with the "_" character, in which case an error MUST be generated. This allows backwards-compatible extensions to this specification. The "bver" field can be used to ensure the receiver supports a minimal level of functionality needed by the creator of the JSON object.
互操作性注意事项:应用程序必须忽略它们不理解的任何JSON键值对,除非该键值以“_”字符结尾,在这种情况下,必须生成错误。这允许向后兼容此规范的扩展。“bver”字段可用于确保接收方支持JSON对象创建者所需的最低级别的功能。
Published specification: RFC 8428
已发布规范:RFC 8428
Applications that use this media type: The type is used by systems that report, e.g., electrical power usage and environmental information such as temperature and humidity. It can be used for a wide range of sensor reporting systems.
使用此介质类型的应用程序:该类型由报告电力使用和环境信息(如温度和湿度)的系统使用。它可用于各种传感器报告系统。
Fragment identifier considerations: Fragment identification for application/senml+json is supported by using fragment identifiers as specified by RFC 8428.
片段标识符注意事项:使用RFC 8428指定的片段标识符支持application/senml+json的片段标识。
Additional information:
其他信息:
Deprecated alias names for this type: N/A
此类型的已弃用别名:不适用
Magic number(s): N/A
Magic number(s): N/A
File extension(s): senml
文件扩展名:senml
Windows Clipboard Name: "JSON Sensor Measurement List"
Windows剪贴板名称:“JSON传感器测量列表”
Macintosh file type code(s): none
Macintosh文件类型代码:无
Macintosh Universal Type Identifier code: org.ietf.senml-json conforms to public.text
Macintosh通用类型标识符代码:org.ietf.senml-json符合public.text
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Intended usage: COMMON
预期用途:普通
Restrictions on usage: None
使用限制:无
Author: Cullen Jennings <fluffy@iii.ca>
Author: Cullen Jennings <fluffy@iii.ca>
Change controller: IESG
更改控制器:IESG
Type name: application
类型名称:应用程序
Subtype name: sensml+json
子类型名称:sensml+json
Required parameters: none
所需参数:无
Optional parameters: none
可选参数:无
Encoding considerations: Must be encoded as using a subset of the encoding allowed in [RFC8259]. See RFC 8428 for details. This simplifies implementation of a very simple system and does not impose any significant limitations as all this data is meant for machine-to-machine communications and is not meant to be human readable.
编码注意事项:必须使用[RFC8259]中允许的编码子集进行编码。详见RFC 8428。这简化了一个非常简单的系统的实现,并且没有施加任何明显的限制,因为所有这些数据都是用于机器对机器的通信,并且不是人类可读的。
Security considerations: See Section 13 of RFC 8428.
安全注意事项:见RFC 8428第13节。
Interoperability considerations: Applications MUST ignore any JSON key-value pairs that they do not understand unless the key ends with the "_" character, in which case an error MUST be generated. This
互操作性注意事项:应用程序必须忽略它们不理解的任何JSON键值对,除非该键值以“_”字符结尾,在这种情况下,必须生成错误。这
allows backwards-compatible extensions to this specification. The "bver" field can be used to ensure the receiver supports a minimal level of functionality needed by the creator of the JSON object.
允许向后兼容此规范的扩展。“bver”字段可用于确保接收方支持JSON对象创建者所需的最低级别的功能。
Published specification: RFC 8428
已发布规范:RFC 8428
Applications that use this media type: The type is used by systems that report, e.g., electrical power usage and environmental information such as temperature and humidity. It can be used for a wide range of sensor reporting systems.
使用此介质类型的应用程序:该类型由报告电力使用和环境信息(如温度和湿度)的系统使用。它可用于各种传感器报告系统。
Fragment identifier considerations: Fragment identification for application/sensml+json is supported by using fragment identifiers as specified by RFC 8428.
片段标识符注意事项:使用RFC 8428指定的片段标识符支持application/sensml+json的片段标识。
Additional information:
其他信息:
Deprecated alias names for this type: N/A
此类型的已弃用别名:不适用
Magic number(s): N/A
Magic number(s): N/A
File extension(s): sensml
文件扩展名:sensml
Macintosh file type code(s): none
Macintosh文件类型代码:无
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Intended usage: COMMON
预期用途:普通
Restrictions on usage: None
使用限制:无
Author: Cullen Jennings <fluffy@iii.ca>
Author: Cullen Jennings <fluffy@iii.ca>
Change controller: IESG
更改控制器:IESG
Type name: application
类型名称:应用程序
Subtype name: senml+cbor
子类型名称:senml+cbor
Required parameters: none
所需参数:无
Optional parameters: none
可选参数:无
Encoding considerations: Must be encoded as using [RFC7049]. See RFC 8428 for details.
编码注意事项:必须使用[RFC7049]进行编码。详见RFC 8428。
Security considerations: See Section 13 of RFC 8428.
安全注意事项:见RFC 8428第13节。
Interoperability considerations: Applications MUST ignore any key-value pairs that they do not understand unless the key ends with the "_" character, in which case an error MUST be generated. This allows backwards-compatible extensions to this specification. The "bver" field can be used to ensure the receiver supports a minimal level of functionality needed by the creator of the CBOR object.
互操作性注意事项:应用程序必须忽略它们不理解的任何键值对,除非该键值以“_”字符结尾,在这种情况下,必须生成错误。这允许向后兼容此规范的扩展。“bver”字段可用于确保接收器支持CBOR对象创建者所需的最低级别的功能。
Published specification: RFC 8428
已发布规范:RFC 8428
Applications that use this media type: The type is used by systems that report, e.g., electrical power usage and environmental information such as temperature and humidity. It can be used for a wide range of sensor reporting systems.
使用此介质类型的应用程序:该类型由报告电力使用和环境信息(如温度和湿度)的系统使用。它可用于各种传感器报告系统。
Fragment identifier considerations: Fragment identification for application/senml+cbor is supported by using fragment identifiers as specified by RFC 8428.
片段标识符注意事项:使用RFC 8428指定的片段标识符支持应用程序/senml+cbor的片段标识。
Additional information:
其他信息:
Deprecated alias names for this type: N/A
此类型的已弃用别名:不适用
Magic number(s): N/A
Magic number(s): N/A
File extension(s): senmlc
文件扩展名:senmlc
Macintosh file type code(s): none
Macintosh文件类型代码:无
Macintosh Universal Type Identifier code: org.ietf.senml-cbor conforms to public.data
Macintosh通用类型标识符代码:org.ietf.senml-cbor符合public.data
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Intended usage: COMMON
预期用途:普通
Restrictions on usage: None
使用限制:无
Author: Cullen Jennings <fluffy@iii.ca>
Author: Cullen Jennings <fluffy@iii.ca>
Change controller: IESG
更改控制器:IESG
Type name: application
类型名称:应用程序
Subtype name: sensml+cbor
子类型名称:sensml+cbor
Required parameters: none
所需参数:无
Optional parameters: none
可选参数:无
Encoding considerations: Must be encoded as using [RFC7049]. See RFC 8428 for details.
编码注意事项:必须使用[RFC7049]进行编码。详见RFC 8428。
Security considerations: See Section 13 of RFC 8428.
安全注意事项:见RFC 8428第13节。
Interoperability considerations: Applications MUST ignore any key-value pairs that they do not understand unless the key ends with the "_" character, in which case an error MUST be generated. This allows backwards-compatible extensions to this specification. The "bver" field can be used to ensure the receiver supports a minimal level of functionality needed by the creator of the CBOR object.
互操作性注意事项:应用程序必须忽略它们不理解的任何键值对,除非该键值以“_”字符结尾,在这种情况下,必须生成错误。这允许向后兼容此规范的扩展。“bver”字段可用于确保接收器支持CBOR对象创建者所需的最低级别的功能。
Published specification: RFC 8428
已发布规范:RFC 8428
Applications that use this media type: The type is used by systems that report, e.g., electrical power usage and environmental information such as temperature and humidity. It can be used for a wide range of sensor reporting systems.
使用此介质类型的应用程序:该类型由报告电力使用和环境信息(如温度和湿度)的系统使用。它可用于各种传感器报告系统。
Fragment identifier considerations: Fragment identification for application/sensml+cbor is supported by using fragment identifiers as specified by RFC 8428.
片段标识符注意事项:使用RFC 8428指定的片段标识符支持应用程序/sensml+cbor的片段标识。
Additional information:
其他信息:
Deprecated alias names for this type: N/A
此类型的已弃用别名:不适用
Magic number(s): N/A
Magic number(s): N/A
File extension(s): sensmlc
文件扩展名:sensmlc
Macintosh file type code(s): none
Macintosh文件类型代码:无
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Intended usage: COMMON
预期用途:普通
Restrictions on usage: None
使用限制:无
Author: Cullen Jennings <fluffy@iii.ca>
Author: Cullen Jennings <fluffy@iii.ca>
Change controller: IESG
更改控制器:IESG
Type name: application
类型名称:应用程序
Subtype name: senml+xml
子类型名称:senml+xml
Required parameters: none
所需参数:无
Optional parameters: none
可选参数:无
Encoding considerations: Must be encoded as using [W3C.REC-xml-20081126]. See RFC 8428 for details.
编码注意事项:必须使用[W3C.REC-xml-20081126]进行编码。详见RFC 8428。
Security considerations: See Section 13 of RFC 8428.
安全注意事项:见RFC 8428第13节。
Interoperability considerations: Applications MUST ignore any XML tags or attributes that they do not understand unless the attribute name ends with the "_" character, in which case an error MUST be generated. This allows backwards-compatible extensions to this specification. The "bver" attribute in the senml XML tag can be used to ensure the receiver supports a minimal level of functionality needed by the creator of the XML SenML Pack.
互操作性注意事项:应用程序必须忽略它们不理解的任何XML标记或属性,除非属性名称以“\u1”字符结尾,在这种情况下,必须生成错误。这允许向后兼容此规范的扩展。senmlxml标记中的“bver”属性可用于确保接收方支持XML senml包创建者所需的最低级别的功能。
Published specification: RFC 8428
已发布规范:RFC 8428
Applications that use this media type: The type is used by systems that report, e.g., electrical power usage and environmental information such as temperature and humidity. It can be used for a wide range of sensor reporting systems.
使用此介质类型的应用程序:该类型由报告电力使用和环境信息(如温度和湿度)的系统使用。它可用于各种传感器报告系统。
Fragment identifier considerations: Fragment identification for application/senml+xml is supported by using fragment identifiers as specified by RFC 8428.
片段标识符注意事项:通过使用RFC 8428指定的片段标识符,支持应用程序/senml+xml的片段标识。
Additional information:
其他信息:
Deprecated alias names for this type: N/A
此类型的已弃用别名:不适用
Magic number(s): N/A
Magic number(s): N/A
File extension(s): senmlx
文件扩展名:senmlx
Windows Clipboard Name: "XML Sensor Measurement List"
Windows剪贴板名称:“XML传感器测量列表”
Macintosh file type code(s): none
Macintosh文件类型代码:无
Macintosh Universal Type Identifier code: org.ietf.senml-xml conforms to public.xml
Macintosh通用类型标识符代码:org.ietf.senml-xml符合public.xml
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Intended usage: COMMON
预期用途:普通
Restrictions on usage: None
使用限制:无
Author: Cullen Jennings <fluffy@iii.ca>
Author: Cullen Jennings <fluffy@iii.ca>
Change controller: IESG
更改控制器:IESG
Type name: application
类型名称:应用程序
Subtype name: sensml+xml
子类型名称:sensml+xml
Required parameters: none
所需参数:无
Optional parameters: none
可选参数:无
Encoding considerations: Must be encoded as using [W3C.REC-xml-20081126]. See RFC 8428 for details.
编码注意事项:必须使用[W3C.REC-xml-20081126]进行编码。详见RFC 8428。
Security considerations: See Section 13 of RFC 8428.
安全注意事项:见RFC 8428第13节。
Interoperability considerations: Applications MUST ignore any XML tags or attributes that they do not understand unless the attribute name ends with the "_" character, in which case an error MUST be generated. This allows backwards-compatible extensions to this specification. The "bver" attribute in the senml XML tag can be used to ensure the receiver supports a minimal level of functionality needed by the creator of the XML SenML Pack.
互操作性注意事项:应用程序必须忽略它们不理解的任何XML标记或属性,除非属性名称以“\u1”字符结尾,在这种情况下,必须生成错误。这允许向后兼容此规范的扩展。senmlxml标记中的“bver”属性可用于确保接收方支持XML senml包创建者所需的最低级别的功能。
Published specification: RFC 8428
已发布规范:RFC 8428
Applications that use this media type: The type is used by systems that report, e.g., electrical power usage and environmental information such as temperature and humidity. It can be used for a wide range of sensor reporting systems.
使用此介质类型的应用程序:该类型由报告电力使用和环境信息(如温度和湿度)的系统使用。它可用于各种传感器报告系统。
Fragment identifier considerations: Fragment identification for application/sensml+xml is supported by using fragment identifiers as specified by RFC 8428.
片段标识符注意事项:使用RFC 8428指定的片段标识符支持应用程序/sensml+xml的片段标识。
Additional information:
其他信息:
Deprecated alias names for this type: N/A
此类型的已弃用别名:不适用
Magic number(s): N/A
Magic number(s): N/A
File extension(s): sensmlx
文件扩展名:sensmlx
Macintosh file type code(s): none
Macintosh文件类型代码:无
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Intended usage: COMMON
预期用途:普通
Restrictions on usage: None
使用限制:无
Author: Cullen Jennings <fluffy@iii.ca>
Author: Cullen Jennings <fluffy@iii.ca>
Change controller: IESG
更改控制器:IESG
Type name: application
类型名称:应用程序
Subtype name: senml-exi
子类型名称:senml exi
Required parameters: none
所需参数:无
Optional parameters: none
可选参数:无
Encoding considerations: Must be encoded as using [W3C.REC-exi-20140211]. See RFC 8428 for details.
编码注意事项:必须使用[W3C.REC-exi-20140211]进行编码。详见RFC 8428。
Security considerations: See Section 13 of RFC 8428.
安全注意事项:见RFC 8428第13节。
Interoperability considerations: Applications MUST ignore any XML tags or attributes that they do not understand unless the attribute name ends with the "_" character, in which case an error MUST be generated. This allows backwards-compatible extensions to this specification. The "bver" attribute in the senml XML tag can be used to ensure the receiver supports a minimal level of functionality needed by the creator of the XML SenML Pack. Further information on using schemas to guide the EXI can be found in RFC 8428.
互操作性注意事项:应用程序必须忽略它们不理解的任何XML标记或属性,除非属性名称以“\u1”字符结尾,在这种情况下,必须生成错误。这允许向后兼容此规范的扩展。senmlxml标记中的“bver”属性可用于确保接收方支持XML senml包创建者所需的最低级别的功能。有关使用模式指导EXI的更多信息,请参见RFC 8428。
Published specification: RFC 8428
已发布规范:RFC 8428
Applications that use this media type: The type is used by systems that report, e.g., electrical power usage and environmental information such as temperature and humidity. It can be used for a wide range of sensor reporting systems.
使用此介质类型的应用程序:该类型由报告电力使用和环境信息(如温度和湿度)的系统使用。它可用于各种传感器报告系统。
Fragment identifier considerations: Fragment identification for application/senml-exi is supported by using fragment identifiers as specified by RFC 8428.
片段标识符注意事项:使用RFC 8428指定的片段标识符支持应用程序/senml exi的片段标识。
Additional information:
其他信息:
Deprecated alias names for this type: N/A
此类型的已弃用别名:不适用
Magic number(s): N/A
Magic number(s): N/A
File extension(s): senmle
文件扩展名:senmle
Macintosh file type code(s): none
Macintosh文件类型代码:无
Macintosh Universal Type Identifier code: org.ietf.senml-exi conforms to public.data
Macintosh通用类型标识符代码:org.ietf.senml-exi符合public.data
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Intended usage: COMMON
预期用途:普通
Restrictions on usage: None
使用限制:无
Author: Cullen Jennings <fluffy@iii.ca>
Author: Cullen Jennings <fluffy@iii.ca>
Change controller: IESG
更改控制器:IESG
Type name: application
类型名称:应用程序
Subtype name: sensml-exi
子类型名称:sensml exi
Required parameters: none
所需参数:无
Optional parameters: none
可选参数:无
Encoding considerations: Must be encoded as using [W3C.REC-exi-20140211]. See RFC 8428 for details.
编码注意事项:必须使用[W3C.REC-exi-20140211]进行编码。详见RFC 8428。
Security considerations: See Section 13 of RFC 8428.
安全注意事项:见RFC 8428第13节。
Interoperability considerations: Applications MUST ignore any XML tags or attributes that they do not understand unless the attribute name ends with the "_" character, in which case an error MUST be generated. This allows backwards-compatible extensions to this specification. The "bver" attribute in the senml XML tag can be used to ensure the receiver supports a minimal level of functionality needed by the creator of the XML SenML Pack. Further information on using schemas to guide the EXI can be found in RFC 8428.
互操作性注意事项:应用程序必须忽略它们不理解的任何XML标记或属性,除非属性名称以“\u1”字符结尾,在这种情况下,必须生成错误。这允许向后兼容此规范的扩展。senmlxml标记中的“bver”属性可用于确保接收方支持XML senml包创建者所需的最低级别的功能。有关使用模式指导EXI的更多信息,请参见RFC 8428。
Published specification: RFC 8428
已发布规范:RFC 8428
Applications that use this media type: The type is used by systems that report, e.g., electrical power usage and environmental information such as temperature and humidity. It can be used for a wide range of sensor reporting systems.
使用此介质类型的应用程序:该类型由报告电力使用和环境信息(如温度和湿度)的系统使用。它可用于各种传感器报告系统。
Fragment identifier considerations: Fragment identification for application/sensml-exi is supported by using fragment identifiers as specified by RFC 8428.
片段标识符注意事项:使用RFC 8428指定的片段标识符支持应用程序/sensml exi的片段标识。
Additional information:
其他信息:
Deprecated alias names for this type: N/A
此类型的已弃用别名:不适用
Magic number(s): N/A
Magic number(s): N/A
File extension(s): sensmle
文件扩展名:sensmle
Macintosh file type code(s): none
Macintosh文件类型代码:无
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Person & email address to contact for further information: Cullen Jennings <fluffy@iii.ca>
Intended usage: COMMON
预期用途:普通
Restrictions on usage: None
使用限制:无
Author: Cullen Jennings <fluffy@iii.ca>
Author: Cullen Jennings <fluffy@iii.ca>
Change controller: IESG
更改控制器:IESG
This document registers the following XML namespace in the "IETF XML Registry" defined in [RFC3688].
本文档在[RFC3688]中定义的“IETF XML注册表”中注册以下XML命名空间。
URI: urn:ietf:params:xml:ns:senml
URI: urn:ietf:params:xml:ns:senml
Registrant Contact: The IESG.
注册人联系人:IESG。
XML: N/A, the requested URIs are XML namespaces
XML:不适用,请求的URI是XML名称空间
IANA has assigned CoAP Content-Format IDs for the SenML media types in the "CoAP Content-Formats" subregistry within the "Constrained RESTful Environments (CoRE) Parameters" registry [RFC7252]. IDs for the JSON, CBOR, and EXI Content-Formats have been assigned in the 0-255 range (Expert Review), and IDs for the XML Content-Formats have been assigned in the 256-9999 range (IETF Review or IESG Approval). The assigned IDs are shown in the table below:
IANA已为“受限RESTful环境(核心)参数”注册表[RFC7252]中的“CoAP内容格式”子区中的SenML媒体类型分配了CoAP内容格式ID。JSON、CBOR和EXI内容格式的ID分配范围为0-255(专家评审),XML内容格式的ID分配范围为256-9999(IETF评审或IESG批准)。分配的ID如下表所示:
+-------------------------+----------+-----+-----------+ | Media Type | Encoding | ID | Reference | +-------------------------+----------+-----+-----------+ | application/senml+json | - | 110 | RFC 8428 | | application/sensml+json | - | 111 | RFC 8428 | | application/senml+cbor | - | 112 | RFC 8428 | | application/sensml+cbor | - | 113 | RFC 8428 | | application/senml-exi | - | 114 | RFC 8428 | | application/sensml-exi | - | 115 | RFC 8428 | | application/senml+xml | - | 310 | RFC 8428 | | application/sensml+xml | - | 311 | RFC 8428 | +-------------------------+----------+-----+-----------+
+-------------------------+----------+-----+-----------+ | Media Type | Encoding | ID | Reference | +-------------------------+----------+-----+-----------+ | application/senml+json | - | 110 | RFC 8428 | | application/sensml+json | - | 111 | RFC 8428 | | application/senml+cbor | - | 112 | RFC 8428 | | application/sensml+cbor | - | 113 | RFC 8428 | | application/senml-exi | - | 114 | RFC 8428 | | application/sensml-exi | - | 115 | RFC 8428 | | application/senml+xml | - | 310 | RFC 8428 | | application/sensml+xml | - | 311 | RFC 8428 | +-------------------------+----------+-----+-----------+
Table 8: CoAP Content-Format IDs
表8:CoAP内容格式ID
Sensor data presented with SenML can contain a wide array of information that ranges from very public (such as the outside temperature in a given city) to very private (such as patient health information that requires integrity and confidentiality protection). When SenML is used for configuration or actuation, it can be used to change the state of systems and also impact the physical world, e.g., by turning off a heater or opening a lock. Malicious use of SenML to change system state could have severe consequences, potentially including violation of physical security, property damage, and even loss of life.
SenML提供的传感器数据可以包含从非常公开(如给定城市的室外温度)到非常隐私(如需要完整性和保密保护的患者健康信息)的广泛信息。当SenML用于配置或驱动时,它可以用来改变系统的状态,也可以影响物理世界,例如关闭加热器或打开锁。恶意使用SenML更改系统状态可能会产生严重后果,可能包括违反物理安全、财产损失甚至生命损失。
SenML formats alone do not provide any security and instead rely on the protocol that carries them to provide security. Applications using SenML need to look at the overall context of how these formats will be used to decide if the security is adequate. In particular, for sensitive sensor data and actuation use, it is important to ensure that proper security mechanisms are used to provide, e.g., confidentiality, data integrity, and authentication as appropriate for the usage.
SenML格式本身不提供任何安全性,而是依赖于承载它们的协议来提供安全性。使用SenML的应用程序需要查看如何使用这些格式来决定安全性是否足够的总体上下文。特别是,对于敏感传感器数据和驱动使用,重要的是确保使用适当的安全机制来提供,例如,机密性、数据完整性和认证(视使用情况而定)。
SenML formats defined by this specification do not contain any executable content. However, future extensions could potentially embed application-specific executable content in the data.
本规范定义的SenML格式不包含任何可执行内容。但是,未来的扩展可能会在数据中嵌入特定于应用程序的可执行内容。
SenML Records are intended to be interpreted in the context of any applicable base values. If Records become separated from the Record that establishes the base values, the data will be useless or, worse, wrong. Care needs to be taken in keeping the integrity of a Pack that contains unresolved SenML Records (see Section 4.6).
SenML记录旨在根据任何适用的基值进行解释。如果记录与建立基值的记录分离,则数据将无效,或者更糟的是,数据将错误。需要注意保持包含未解析SenML记录的数据包的完整性(见第4.6节)。
See also Section 14.
另见第14节。
Sensor data can range from information with almost no privacy considerations, such as the current temperature in a given city, to highly sensitive medical or location data. This specification provides no security protection for the data but is meant to be used inside another container or transfer protocol such as S/MIME [RFC5751] or HTTP with TLS [RFC2818] that can provide integrity, confidentiality, and authentication information about the source of the data.
传感器数据的范围从几乎没有隐私考虑的信息(如给定城市的当前温度)到高度敏感的医疗或位置数据。本规范不为数据提供安全保护,但用于另一个容器或传输协议(如S/MIME[RFC5751]或HTTP with TLS[RFC2818]),可提供数据源的完整性、机密性和身份验证信息。
The Name fields need to uniquely identify the sources or destinations of the values in a SenML Pack. However, the use of long-term stable and unique identifiers can be problematic for privacy reasons [RFC6973], depending on the application and the potential of these identifiers to be used in correlation with other information. They should be used with care or avoided, for example, as described for IPv6 addresses in [RFC7721].
Name字段需要唯一标识SenML包中值的源或目标。然而,由于隐私原因[RFC6973],长期稳定和唯一标识符的使用可能会出现问题,这取决于应用程序以及这些标识符与其他信息相关使用的可能性。如[RFC7721]中IPv6地址所述,应谨慎使用或避免使用它们。
[BIPM] Bureau International des Poids et Mesures, "The International System of Units (SI)", 8th Edition, 2006.
[BIPM]国际计量局,“国际单位制(SI)”,第8版,2006年。
[IEEE.754] IEEE, "Standard for Binary Floating-Point Arithmetic", IEEE Standard 754.
[IEEE.754]IEEE,“二进制浮点运算标准”,IEEE标准754。
[NIST811] Thompson, A. and B. Taylor, "Guide for the Use of the International System of Units (SI)", NIST Special Publication 811, DOI 10.6028/NIST.SP.811e2008, March 2008.
[NIST 811]Thompson,A.和B.Taylor,“国际单位制(SI)使用指南”,NIST特别出版物811,DOI 10.6028/NIST.SP.811e2008,2008年3月。
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-editor.org/info/rfc2119>.
[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,DOI 10.17487/RFC2119,1997年3月<https://www.rfc-editor.org/info/rfc2119>.
[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 2003, <https://www.rfc-editor.org/info/rfc3629>.
[RFC3629]Yergeau,F.,“UTF-8,ISO 10646的转换格式”,STD 63,RFC 3629,DOI 10.17487/RFC3629,2003年11月<https://www.rfc-editor.org/info/rfc3629>.
[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, DOI 10.17487/RFC3688, January 2004, <https://www.rfc-editor.org/info/rfc3688>.
[RFC3688]Mealling,M.,“IETF XML注册表”,BCP 81,RFC 3688,DOI 10.17487/RFC3688,2004年1月<https://www.rfc-editor.org/info/rfc3688>.
[RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, <https://www.rfc-editor.org/info/rfc4648>.
[RFC4648]Josefsson,S.,“Base16、Base32和Base64数据编码”,RFC 4648,DOI 10.17487/RFC4648,2006年10月<https://www.rfc-editor.org/info/rfc4648>.
[RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type Specifications and Registration Procedures", BCP 13, RFC 6838, DOI 10.17487/RFC6838, January 2013, <https://www.rfc-editor.org/info/rfc6838>.
[RFC6838]Freed,N.,Klensin,J.和T.Hansen,“介质类型规范和注册程序”,BCP 13,RFC 6838,DOI 10.17487/RFC6838,2013年1月<https://www.rfc-editor.org/info/rfc6838>.
[RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, October 2013, <https://www.rfc-editor.org/info/rfc7049>.
[RFC7049]Bormann,C.和P.Hoffman,“简明二进制对象表示法(CBOR)”,RFC 7049,DOI 10.17487/RFC7049,2013年10月<https://www.rfc-editor.org/info/rfc7049>.
[RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained Application Protocol (CoAP)", RFC 7252, DOI 10.17487/RFC7252, June 2014, <https://www.rfc-editor.org/info/rfc7252>.
[RFC7252]Shelby,Z.,Hartke,K.,和C.Bormann,“受限应用协议(CoAP)”,RFC 7252,DOI 10.17487/RFC7252,2014年6月<https://www.rfc-editor.org/info/rfc7252>.
[RFC7303] Thompson, H. and C. Lilley, "XML Media Types", RFC 7303, DOI 10.17487/RFC7303, July 2014, <https://www.rfc-editor.org/info/rfc7303>.
[RFC7303]Thompson,H.和C.Lilley,“XML媒体类型”,RFC 7303,DOI 10.17487/RFC7303,2014年7月<https://www.rfc-editor.org/info/rfc7303>.
[RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 8126, DOI 10.17487/RFC8126, June 2017, <https://www.rfc-editor.org/info/rfc8126>.
[RFC8126]Cotton,M.,Leiba,B.,和T.Narten,“在RFC中编写IANA考虑事项部分的指南”,BCP 26,RFC 8126,DOI 10.17487/RFC8126,2017年6月<https://www.rfc-editor.org/info/rfc8126>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8174]Leiba,B.,“RFC 2119关键词中大写与小写的歧义”,BCP 14,RFC 8174,DOI 10.17487/RFC8174,2017年5月<https://www.rfc-editor.org/info/rfc8174>.
[RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, DOI 10.17487/RFC8259, December 2017, <https://www.rfc-editor.org/info/rfc8259>.
[RFC8259]Bray,T.,Ed.“JavaScript对象表示法(JSON)数据交换格式”,STD 90,RFC 8259,DOI 10.17487/RFC8259,2017年12月<https://www.rfc-editor.org/info/rfc8259>.
[RNC] ISO/IEC, "Information technology -- Document Schema Definition Language (DSDL) -- Part 2: Regular-grammar-based validation -- RELAX NG", ISO/IEC 19757-2, Annex C: RELAX NG Compact syntax, December 2008.
[RNC]ISO/IEC,“信息技术——文档模式定义语言(DSDL)——第2部分:基于规则语法的验证——RELAX NG”,ISO/IEC 19757-2,附录C:RELAX NG紧凑语法,2008年12月。
[TIME_T] The Open Group Base Specifications, "Open Group Standard - Vol. 1: Base Definitions, Issue 7", Section 4.16, "Seconds Since the Epoch", IEEE Standard 1003.1, 2018, <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ V1_chap04.html#tag_04_16>.
[时间]开放组基础规范,“开放组标准-第1卷:基础定义,第7期”,第4.16节,“自新纪元以来的秒数”,IEEE标准1003.12018<http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ V1_chap04.html#tag_04_16>。
[W3C.REC-exi-20140211] Schneider, J., Kamiya, T., Peintner, D., and R. Kyusakov, "Efficient XML Interchange (EXI) Format 1.0 (Second Edition)", W3C Recommendation REC-exi-20140211, February 2014, <http://www.w3.org/TR/2014/REC-exi-20140211>.
[W3C.REC-exi-20140211]Schneider,J.,Kamiya,T.,Peintner,D.,和R.Kyusakov,“高效XML交换(exi)格式1.0(第二版)”,W3C建议REC-exi-20140211,2014年2月<http://www.w3.org/TR/2014/REC-exi-20140211>.
[W3C.REC-xml-20081126] Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth Edition)", W3C Recommendation REC-xml-20081126, November 2008, <http://www.w3.org/TR/2008/REC-xml-20081126>.
[W3C.REC-xml-20081126]Bray,T.,Paoli,J.,Sperberg McQueen,M.,Maler,E.,和F.Yergeau,“可扩展标记语言(xml)1.0(第五版)”,W3C建议REC-xml-20081126,2008年11月<http://www.w3.org/TR/2008/REC-xml-20081126>.
[W3C.REC-xmlschema-1-20041028] Thompson, H., Beech, D., Maloney, M., and N. Mendelsohn, "XML Schema Part 1: Structures Second Edition", W3C Recommendation REC-xmlschema-1-20041028, October 2004, <http://www.w3.org/TR/2004/REC-xmlschema-1-20041028>.
[W3C.REC-xmlschema-1-20041028]Thompson,H.,Beech,D.,Maloney,M.,和N.Mendelsohn,“XML模式第1部分:结构第二版”,W3C建议REC-xmlschema-1-20041028,2004年10月<http://www.w3.org/TR/2004/REC-xmlschema-1-20041028>.
[XPointerElement] Grosso, P., Maler, E., Marsh, J., and N. Walsh, "XPointer element() Scheme", W3C Recommendation REC-xptr-element, March 2003, <https://www.w3.org/TR/2003/REC-xptr-element-20030325/>.
[XPointerElement]Grosso,P.,Maler,E.,Marsh,J.,和N.Walsh,“XPointer元素()方案”,W3C REC建议xptr元素,2003年3月<https://www.w3.org/TR/2003/REC-xptr-element-20030325/>.
[XPointerFramework] Grosso, P., Maler, E., Marsh, J., and N. Walsh, "XPointer Framework", W3C Recommendation REC-XPointer-Framework, March 2003, <http://www.w3.org/TR/2003/REC-xptr-framework-20030325/>.
[XPointerFramework]Grosso,P.,Maler,E.,Marsh,J.,和N.Walsh,“XPointer框架”,W3C建议REC XPointer框架,2003年3月<http://www.w3.org/TR/2003/REC-xptr-framework-20030325/>.
[AN1796] Linke, B., "Overview of 1-Wire Technology and Its Use", Maxim Integrated, Tutorial 1796, June 2008, <http://pdfserv.maximintegrated.com/en/an/AN1796.pdf>.
[AN1796]Linke,B.“单线技术及其使用概述”,Maxim Integrated,教程1796,2008年6月<http://pdfserv.maximintegrated.com/en/an/AN1796.pdf>.
[CDDL-CBOR] Birkholz, H., Vigano, C., and C. Bormann, "Concise data definition language (CDDL): a notational convention to express CBOR and JSON data structures", Work in Progress, draft-ietf-cbor-cddl-05, August 2018.
[CDDL-CBOR]Birkholz,H.,Vigano,C.,和C.Bormann,“简明数据定义语言(CDDL):表达CBOR和JSON数据结构的符号约定”,正在进行的工作,草案-ietf-CBOR-CDDL-052018年8月。
[DEVICE-URN] Arkko, J., Jennings, C., and Z. Shelby, "Uniform Resource Names for Device Identifiers", Work in Progress, draft-ietf-core-dev-urn-02, July 2018.
[DEVICE-URN]Arkko,J.,Jennings,C.,和Z.Shelby,“设备标识符的统一资源名称”,正在进行的工作,草稿-ietf-core-dev-URN-022018年7月。
[IEEE802.1AS] IEEE, "IEEE Standard for Local and Metropolitan Area Networks - Timing and Synchronization for Time-Sensitive Applications in Bridged Local Area Networks", IEEE Standard 802.1AS.
[IEEE802.1AS]IEEE,“局域网和城域网的IEEE标准-桥接局域网中时间敏感应用的定时和同步”,IEEE标准802.1AS。
[IEEE802.1BA] IEEE, "IEEE Standard for Local and metropolitan area networks--Audio Video Bridging (AVB) Systems", IEEE Standard 802.1BA.
[IEEE802.1BA]IEEE,“局域网和城域网的IEEE标准——音频视频桥接(AVB)系统”,IEEE标准802.1BA。
[ISO-80000-5] ISO, "Quantities and units - Part 5: Thermodynamics", ISO 80000-5, Edition 1.0, May 2007.
[ISO-80000-5]ISO,“量和单位-第5部分:热力学”,ISO 80000-5,第1.0版,2007年5月。
[RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, DOI 10.17487/RFC2818, May 2000, <https://www.rfc-editor.org/info/rfc2818>.
[RFC2818]Rescorla,E.,“TLS上的HTTP”,RFC 2818,DOI 10.17487/RFC2818,2000年5月<https://www.rfc-editor.org/info/rfc2818>.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, DOI 10.17487/RFC3986, January 2005, <https://www.rfc-editor.org/info/rfc3986>.
[RFC3986]Berners Lee,T.,Fielding,R.,和L.Masinter,“统一资源标识符(URI):通用语法”,STD 66,RFC 3986,DOI 10.17487/RFC3986,2005年1月<https://www.rfc-editor.org/info/rfc3986>.
[RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally Unique IDentifier (UUID) URN Namespace", RFC 4122, DOI 10.17487/RFC4122, July 2005, <https://www.rfc-editor.org/info/rfc4122>.
[RFC4122]Leach,P.,Mealling,M.和R.Salz,“通用唯一标识符(UUID)URN名称空间”,RFC 4122,DOI 10.17487/RFC4122,2005年7月<https://www.rfc-editor.org/info/rfc4122>.
[RFC4151] Kindberg, T. and S. Hawke, "The 'tag' URI Scheme", RFC 4151, DOI 10.17487/RFC4151, October 2005, <https://www.rfc-editor.org/info/rfc4151>.
[RFC4151]Kindberg,T.和S.Hawke,“标记”URI方案,RFC 4151,DOI 10.17487/RFC4151,2005年10月<https://www.rfc-editor.org/info/rfc4151>.
[RFC4944] Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler, "Transmission of IPv6 Packets over IEEE 802.15.4 Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007, <https://www.rfc-editor.org/info/rfc4944>.
[RFC4944]黑山,G.,Kushalnagar,N.,Hui,J.,和D.Culler,“通过IEEE 802.15.4网络传输IPv6数据包”,RFC 4944,DOI 10.17487/RFC4944,2007年9月<https://www.rfc-editor.org/info/rfc4944>.
[RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet Mail Extensions (S/MIME) Version 3.2 Message Specification", RFC 5751, DOI 10.17487/RFC5751, January 2010, <https://www.rfc-editor.org/info/rfc5751>.
[RFC5751]Ramsdell,B.和S.Turner,“安全/多用途Internet邮件扩展(S/MIME)版本3.2消息规范”,RFC 5751,DOI 10.17487/RFC5751,2010年1月<https://www.rfc-editor.org/info/rfc5751>.
[RFC5952] Kawamura, S. and M. Kawashima, "A Recommendation for IPv6 Address Text Representation", RFC 5952, DOI 10.17487/RFC5952, August 2010, <https://www.rfc-editor.org/info/rfc5952>.
[RFC5952]Kawamura,S.和M.Kawashima,“IPv6地址文本表示的建议”,RFC 5952,DOI 10.17487/RFC5952,2010年8月<https://www.rfc-editor.org/info/rfc5952>.
[RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, <https://www.rfc-editor.org/info/rfc6690>.
[RFC6690]Shelby,Z.“受限RESTful环境(核心)链接格式”,RFC 6690,DOI 10.17487/RFC6690,2012年8月<https://www.rfc-editor.org/info/rfc6690>.
[RFC6920] Farrell, S., Kutscher, D., Dannewitz, C., Ohlman, B., Keranen, A., and P. Hallam-Baker, "Naming Things with Hashes", RFC 6920, DOI 10.17487/RFC6920, April 2013, <https://www.rfc-editor.org/info/rfc6920>.
[RFC6920]Farrell,S.,Kutscher,D.,Dannewitz,C.,Ohlman,B.,Keranen,A.,和P.Hallam Baker,“用哈希命名事物”,RFC 6920,DOI 10.17487/RFC692012013年4月<https://www.rfc-editor.org/info/rfc6920>.
[RFC6973] Cooper, A., Tschofenig, H., Aboba, B., Peterson, J., Morris, J., Hansen, M., and R. Smith, "Privacy Considerations for Internet Protocols", RFC 6973, DOI 10.17487/RFC6973, July 2013, <https://www.rfc-editor.org/info/rfc6973>.
[RFC6973]Cooper,A.,Tschofenig,H.,Aboba,B.,Peterson,J.,Morris,J.,Hansen,M.,和R.Smith,“互联网协议的隐私考虑”,RFC 6973,DOI 10.17487/RFC6973,2013年7月<https://www.rfc-editor.org/info/rfc6973>.
[RFC7111] Hausenblas, M., Wilde, E., and J. Tennison, "URI Fragment Identifiers for the text/csv Media Type", RFC 7111, DOI 10.17487/RFC7111, January 2014, <https://www.rfc-editor.org/info/rfc7111>.
[RFC7111]Hausenblas,M.,Wilde,E.,和J.Tennison,“文本/csv媒体类型的URI片段标识符”,RFC 7111,DOI 10.17487/RFC7111,2014年1月<https://www.rfc-editor.org/info/rfc7111>.
[RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", RFC 7230, DOI 10.17487/RFC7230, June 2014, <https://www.rfc-editor.org/info/rfc7230>.
[RFC7230]Fielding,R.,Ed.和J.Reschke,Ed.,“超文本传输协议(HTTP/1.1):消息语法和路由”,RFC 7230,DOI 10.17487/RFC7230,2014年6月<https://www.rfc-editor.org/info/rfc7230>.
[RFC7721] Cooper, A., Gont, F., and D. Thaler, "Security and Privacy Considerations for IPv6 Address Generation Mechanisms", RFC 7721, DOI 10.17487/RFC7721, March 2016, <https://www.rfc-editor.org/info/rfc7721>.
[RFC7721]Cooper,A.,Gont,F.,和D.Thaler,“IPv6地址生成机制的安全和隐私考虑”,RFC 7721,DOI 10.17487/RFC7721,2016年3月<https://www.rfc-editor.org/info/rfc7721>.
[RFC8141] Saint-Andre, P. and J. Klensin, "Uniform Resource Names (URNs)", RFC 8141, DOI 10.17487/RFC8141, April 2017, <https://www.rfc-editor.org/info/rfc8141>.
[RFC8141]Saint Andre,P.和J.Klensin,“统一资源名称(URN)”,RFC 8141,DOI 10.17487/RFC81412017年4月<https://www.rfc-editor.org/info/rfc8141>.
[RID-CoRE] Shelby, Z., Vial, M., Groves, C., Zhu, J., and B. Silverajan, Ed., "Reusable Interface Definitions for Constrained RESTful Environments", Work in Progress, draft-ietf-core-interfaces-12, June 2018.
[RID CoRE]Shelby,Z.,Vial,M.,Groves,C.,Zhu,J.,和B.Silverajan,Ed.,“受限RESTful环境的可重用接口定义”,正在进行的工作,草稿-ietf-CoRE-interfaces-12,2018年6月。
[UCUM] Schadow, G. and C. McDonald, "The Unified Code for Units of Measure", Version 2.1, Regenstrief Institute and the UCUM Organization, November 2017, <http://unitsofmeasure.org/ucum.html>.
[UCUM]Schadow,G.和C.McDonald,“计量单位统一规范”,版本2.1,Regenstrief研究所和UCUM组织,2017年11月<http://unitsofmeasure.org/ucum.html>.
Acknowledgements
致谢
We would like to thank Alexander Pelov, Alexey Melnikov, Andrew McClure, Andrew McGregor, Bjoern Hoehrmann, Christian Amsuess, Christian Groves, Daniel Peintner, Jan-Piet Mens, Jim Schaad, Joe Hildebrand, John Klensin, Karl Palsson, Lennart Duhrsen, Lisa Dusseault, Lyndsay Campbell, Martin Thomson, Michael Koster, Peter Saint-Andre, Roni Even, and Stephen Farrell, for their review comments.
我们要感谢亚历山大·佩洛夫、亚历克赛·梅尔尼科夫、安德鲁·麦克卢尔、安德鲁·麦格雷戈、比约恩·霍尔曼、克里斯蒂安·阿姆苏斯、克里斯蒂安·格罗夫斯、丹尼尔·佩因纳、扬·皮特·门斯、吉姆·沙德、乔·希尔德布兰德、约翰·克莱辛、卡尔·帕尔森、伦纳特·杜森、丽莎·杜肖奥、林赛·坎贝尔、马丁·汤姆森、迈克尔·科斯特、彼得·圣安德烈、甚至罗尼、,以及斯蒂芬·法雷尔的评论。
Authors' Addresses
作者地址
Cullen Jennings Cisco 400 3rd Avenue SW Calgary, AB T2P 4H2 Canada
Cullen Jennings Cisco 400加拿大卡尔加里西南第三大道,AB T2P 4H2
Email: fluffy@iii.ca
Email: fluffy@iii.ca
Zach Shelby ARM 150 Rose Orchard San Jose 95134 United States of America
Zach Shelby ARM 150玫瑰园圣何塞95134美利坚合众国
Phone: +1-408-203-9434 Email: zach.shelby@arm.com
Phone: +1-408-203-9434 Email: zach.shelby@arm.com
Jari Arkko Ericsson Jorvas 02420 Finland
雅丽爱立信芬兰公司02420
Email: jari.arkko@piuha.net
Email: jari.arkko@piuha.net
Ari Keranen Ericsson Jorvas 02420 Finland
Ari Keranen Ericsson Jorvas 02420芬兰
Email: ari.keranen@ericsson.com
Email: ari.keranen@ericsson.com
Carsten Bormann Universitaet Bremen TZI Postfach 330440 Bremen D-28359 Germany
卡斯滕·鲍曼大学不来梅邮政学院330440不来梅D-28359德国
Phone: +49-421-218-63921 Email: cabo@tzi.org
Phone: +49-421-218-63921 Email: cabo@tzi.org