Asynchronous monad for reactive IoT programming

Tian Zhao, Adam Berger, Yonglun Li
{"title":"Asynchronous monad for reactive IoT programming","authors":"Tian Zhao, Adam Berger, Yonglun Li","doi":"10.1145/3427763.3428314","DOIUrl":null,"url":null,"abstract":"Many industrial IoT applications process sensor data over distributed networks to monitor devices in real-time. Since the sensor telemetries are transmitted over networks as events, imperative and event-driven programs are often used to handle IoT data. However, the inverted control flow and shared global states of these imperative programs make them difficult to interface with synchronized computation on IoT data. This problem is further complicated for high-frequency data such as electric signals, which may require dynamic adjustment to data sampling rate to operate under the constraints of network and system. In this paper, we propose a push-pull reactive programming model for IoT application to address this challenge. This model uses push-streams for asynchronous computation such as data capturing and user controls and uses pull streams for synchronized computation such as data analysis. This model is simpler than push-based models by avoiding the complexity of glitch prevention through re-sampling in pull-streams. It is also more flexible than pull-based models by allowing dynamic adjustment of the sampling rate to maintain real-time speed of the IoT computation. The push-stream has a monadic interface, which converts to a pull stream through buffering. A pull stream converts to a push-stream when driven by a clock. The dynamic switching of our streams is based on a monadic abstraction called AsyncM that uses continuation passing style and a form of cancellation token for asynchronous control. Our model is simple and can use threads or event callbacks for concurrency.","PeriodicalId":114576,"journal":{"name":"Proceedings of the 7th ACM SIGPLAN International Workshop on Reactive and Event-Based Languages and Systems","volume":"48 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-11-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"4","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 7th ACM SIGPLAN International Workshop on Reactive and Event-Based Languages and Systems","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3427763.3428314","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 4

Abstract

Many industrial IoT applications process sensor data over distributed networks to monitor devices in real-time. Since the sensor telemetries are transmitted over networks as events, imperative and event-driven programs are often used to handle IoT data. However, the inverted control flow and shared global states of these imperative programs make them difficult to interface with synchronized computation on IoT data. This problem is further complicated for high-frequency data such as electric signals, which may require dynamic adjustment to data sampling rate to operate under the constraints of network and system. In this paper, we propose a push-pull reactive programming model for IoT application to address this challenge. This model uses push-streams for asynchronous computation such as data capturing and user controls and uses pull streams for synchronized computation such as data analysis. This model is simpler than push-based models by avoiding the complexity of glitch prevention through re-sampling in pull-streams. It is also more flexible than pull-based models by allowing dynamic adjustment of the sampling rate to maintain real-time speed of the IoT computation. The push-stream has a monadic interface, which converts to a pull stream through buffering. A pull stream converts to a push-stream when driven by a clock. The dynamic switching of our streams is based on a monadic abstraction called AsyncM that uses continuation passing style and a form of cancellation token for asynchronous control. Our model is simple and can use threads or event callbacks for concurrency.
用于响应式物联网编程的异步单子
许多工业物联网应用通过分布式网络处理传感器数据,以实时监控设备。由于传感器遥测数据作为事件通过网络传输,因此命令式和事件驱动程序通常用于处理物联网数据。然而,这些命令式程序的反向控制流和共享全局状态使得它们难以与物联网数据的同步计算接口。对于电信号等高频数据,这一问题更加复杂,在网络和系统的约束下,可能需要动态调整数据采样率。在本文中,我们提出了一种用于物联网应用的推拉响应式编程模型来解决这一挑战。该模型使用推流进行异步计算,如数据捕获和用户控制,并使用拉流进行同步计算,如数据分析。该模型比基于推的模型更简单,避免了通过在拉流中重新采样来防止故障的复杂性。它也比基于拉的模型更灵活,允许动态调整采样率,以保持物联网计算的实时速度。推流有一个单元接口,通过缓冲转换为拉流。当由时钟驱动时,拉流转换为推流。流的动态切换基于一种称为AsyncM的一元抽象,它使用延续传递风格和一种形式的取消令牌来进行异步控制。我们的模型很简单,可以使用线程或事件回调实现并发。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书