简体   繁体   English

将传感器数据发送到hazelcast数据库并将其链接到开发工具以设计仪表板

[英]Send sensor data to hazelcast database and link it to development tools to design dashboards

Can we use hazel-cast database to link and design the data according to tracker with bar graph, below are the points which I need to confirm to build the application for hardware: - I am using temperature sensor interfacing with Arduino Yun and wanted to upload the data given by temperature sensor on hazel-cast server. 我们能否使用hazel-cast数据库根据带条形图的跟踪器来链接和设计数据,以下是我需要确认以构建硬件应用程序的几点:-我正在使用与Arduino Yun相连的温度传感器 ,并想上传由淡褐色服务器上的温度传感器提供的数据。

  • By using single database output uploaded in hazelcast server, reads the data through database through Arduino MKR1000. 通过使用在hazelcast服务器中上传的单个数据库输出,通过Arduino MKR1000通过数据库读取数据。

  • Link the data to different development tools to design different types of dashboards like Pie chart, Bar chart, Line chart etc. Please suggest how the best way to link to create the database in data-grid 将数据链接到不同的开发工具,以设计不同类型的仪表板,例如饼图,条形图,折线图等。请提出如何在数据网格中链接以创建数据库的最佳方法

You can configure Hazelcast to use a MapLoader - MapStore to persist the cached data to any back-end persistence mechanism – relational or no-sql databases may be good choices. 您可以将Hazelcast配置为使用MapLoader - MapStore将缓存的数据持久化到任何后端持久性机制–关系数据库或no-sql数据库可能是不错的选择。 On your first point, I wouldn't expect anything running on the Arduino to update the database directly, but the MKR1000 is going to get you connectivity, so you can use Kafka/MQTT/… - take a look at https://blog.hazelcast.com/hazelcast-backbone-iot-internet-things/ . 在您的第一点上,我不希望Arduino上运行的任何程序可以直接更新数据库,但是MKR1000将为您提供连接,因此您可以使用Kafka / MQTT /…-看一下https:// blog .hazelcast.com / hazelcast-backbone-iot-internet-things / If you choose this route, you'd set up a database that is accessible to all cluster members, create the MapLoader/MapStore class (see the example code , for help) and configure the cluster to read/write. 如果选择此路由,则将建立一个所有集群成员均可访问的数据库,创建MapLoader / MapStore类(请参见示例代码 ,以获取帮助),并将集群配置为可读写。 Once the data is in the cluster, access is easy and you can use a dashboard tool of your choice to present the data. 一旦数据进入集群,访问就很容易了,您可以使用自己选择的仪表板工具来显示数据。

(edit) - to your question about presenting historical data on your dashboard: (编辑)-关于在仪表板上显示历史数据的问题:

Rahul's blog post describes a very cool implementation of near/real-time data management in a Hazelcast RingBuffer . 拉胡尔的博客文章描述了Hazelcast一个非常酷的实施近/实时数据管理的RingBuffer In that post, I think he mentioned collecting data every second and buffering two minutes worth. 在那篇文章中,我认为他提到了每秒收集数据并缓冲两分钟的时间。

The ring buffer has a configured capacity, but note that he is over-writing, on add - this is kind of a given for real-time systems; 环形缓冲区具有已配置的容量,但是请注意,他是被覆盖的,另外-这是实时系统的一种功能; given the choice is losing older data or crashing. 如果选择丢失旧数据或崩溃。

For a generalized query-tool approach, I think you'd augment this. 对于通用的查询工具方法,我认为您可以对此进行扩充。 Off the top of my head, I could see using the ring-buffer in conjunction with a distributed map. 在我的头顶上方,我可以看到结合使用环形缓冲区和分布式地图。 You could (but wouldn't need to) populate the map, using an map-event interceptor to populate the ring buffer. 您可以(但不需要)使用地图事件拦截器填充环形缓冲区来填充地图。 That should leave the existing functionality intact. 那应该使现有功能保持完整。 The map, though, would allow you to configure a map-store/map-loader, so that your data is saved in a backing store. 不过,地图将允许您配置地图存储/地图加载器,以便将数据保存在后备存储中。 The map would support queries - but keep in mind that IMDG queries do not read through to the backing store. 该地图将支持查询-但请记住,IMDG查询不会读入后备存储。

This would give you flexibility, at the cost of some complexity. 这会给您带来灵活性,但会带来一些复杂性。 The real-time data in the ring buffer would be always available, quickly and easily. 环形缓冲区中的实时数据将始终可用,快速而轻松。 Data returned from querying the map would be very quick, too. 查询地图返回的数据也将非常快。 For 'historical' data, you can query your backing-store - which is slower, but will probably have relatively great storage capacity. 对于“历史”数据,您可以查询您的后备存储-速度较慢,但​​可能具有相对较大的存储容量。 The trick here is to know when to query each. 这里的技巧是知道何时查询每个查询。 The most recent data is a given, with it's fixed capacity. 最新数据是给定的,具有固定容量。 You need to know how much is in the cluster - ie how far back your in-memory history goes. 您需要知道集群中有多少存储空间,即内存历史记录可以追溯到多长时间。 I think it best to configure the expiry to a useful limit and provision the storage so that data leaves the map by expiration - not eviction. 我认为最好将到期时间配置为有用的限制并配置存储,以使数据按到期时间而不是逐出而离开地图。 In this way, you can know what the beginning of the in-memory history is. 通过这种方式,您可以知道内存历史记录的开始。 Monitoring eviction events would tell you that your cluster has a complete view of data back to a known time. 监视逐出事件将告诉您群集具有可以追溯到已知时间的完整数据视图。

How you want to use data on your dashboard will basically depend on how you have modelled your data - one map or multiple maps etc. Then you can retrieve data through single key-based lookups or by running queries and use that for your dashboard. 想要在仪表板上使用数据的方式基本上取决于您对数据建模的方式-一个地图或多个地图等。然后,您可以通过基于键的单个查询或运行查询来检索数据,并将其用于仪表板。 You can define the lifetime of the data - be it few minutes or hours or days. 您可以定义数据的生存期-几分钟,几小时或几天。 See eviction: http://docs.hazelcast.org/docs/3.10.1/manual/html-single/index.html#map-eviction 请参阅驱逐: http : //docs.hazelcast.org/docs/3.10.1/manual/html-single/index.html#map-eviction

If you decide to use a visualisation tool for dashboard that can use JMX then you can latch on to Hazelcast exposed JMX beans that would give you information about data stored in the cluster and lot more. 如果您决定为可以使用JMX的仪表板使用可视化工具,则可以锁定暴露于Hazelcast的JMX Bean,这些JMX Bean将为您提供有关集群中存储的数据的信息以及更多信息。 Check out this: http://docs.hazelcast.org/docs/3.10.1/manual/html-single/index.html#monitoring-with-jmx 看看这个: http : //docs.hazelcast.org/docs/3.10.1/manual/html-single/index.html#monitoring-with-jmx

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

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