简体   繁体   English

Fiware-Orion-如何使用属性值历史记录(值列表)

[英]Fiware-Orion - How to work with attributes values history (lists of values)

I want to register some entities in my Orion instance and keep the history of attributes values in a way I can get the list of values of this attributes. 我想在Orion实例中注册一些实体,并以一种获取该属性值列表的方式保留属性值的历史记录。

For example, a sensor S1 measuring temperature of a room hourly should keep a list of values in its temperature attribute in a way that every new update should be added in the end of the list. 例如,每小时测量一个房间温度的传感器S1应该在其temperature属性中保留一个值列表,以使每个新更新都应添加到列表的末尾。

The update operation I am doing now only updates the value, without adding it to some "list". 我现在执行的update操作仅更新值,而不将其添加到某些“列表”中。 I've read the documentation, but I did not find out some useful information about this. 我已经阅读了文档,但是没有找到一些有用的信息。 Does anyone have suggestions? 有人有建议吗?

that's a good question. 这是个好问题。 You have different options: 您有不同的选择:

1/ Use the STH component to deal with time data series https://github.com/Fiware/context.STH.Comet 1 /使用STH组件处理时间数据序列https://github.com/Fiware/context.STH.Comet

2/ Model your entities in Orion using a similar pattern to the one used by the FIWARE Data Models "AirQualityObserved" or "WeatherObserved" 2 /使用与FIWARE数据模型“ AirQualityObserved”或“ WeatherObserved”使用的模式相似的模式在Orion中对实体建模

http://fiware-datamodels.readthedocs.io/en/latest/Environment/AirQualityObserved/doc/spec/index.html http://fiware-datamodels.readthedocs.io/en/latest/Environment/AirQualityObserved/doc/spec/index.html

ie create one entity for each observation and tag it with a "dateObserved" property. 即为每个观察创建一个实体,并使用“ dateObserved”属性对其进行标记。 Then you can do queries like 然后您可以执行类似的查询

http://orion:1026/v2/entities?type=TemperatureObserved&q=room:R1;dateObserved >=2017-01-01&options=values&orderBy=dateObserved http:// orion:1026 / v2 / entities?type = TemperatureObserved&q = room:R1; dateObserved > = 2017-01-01&options = values&orderBy = dateObserved

This will provide an ordered array of temperature values measured since the first of January. 自1月1日以来,这将提供一个有序的温度值数组。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM