A Middleware Enabling Novice Programmers to Integrate Sensing in CPS Applications
Total Page:16
File Type:pdf, Size:1020Kb
BraceForce: A Middleware Enabling Novice Programmers to Integrate Sensing in CPS Applications Xi Zheng, Dewayne E. Perry, Christine Julien ([email protected], [email protected], [email protected]) The Center for Advanced Research in Software Engineering Mobile and Pervasive Computing Lab, Electrical and Computer Engineering The University of Texas at Austin TR-ARiSE-2013-003 © Copyright 2013 The University of Texas at Austin BraceForce: A Middleware Enabling Novice Programmers to Integrate Sensing in CPS Applications Xi Zheng, Dewayne E. Perry, Christine Julien The Center for Advanced Research in Software Engineering Mobile and Pervasive Computing Lab The University of Texas at Austin [email protected],[email protected],[email protected] ABSTRACT forms with little potential for portability to other plat- Even as the use of sensor networks to support CPS forms or integration with other sensors. Debugging CPS applications grows, our ability to seamlessly and effi- applications that inherently integrate with a physical ciently incorporate sensor network capabilities remains environment requires not only the aforementioned in- astoundingly difficult. Today, accessing remote sensing tegration of the application with sensing but also the data and integrating this data into the adaptive behav- use of a testing harness that, at debugging time, ac- ior of a dynamic user-facing CPS application requires in- cesses sensed data about the physical environment for teracting with multiple sensor platform languages, data the purposes of validating the actions of the applica- formats, and communication channels and paradigms. tion. Integrating sensing for application and debugging We present BraceForce, an open and extensible middle- support in a way that is easy, flexible, and portable is ware that allows developers to access the myriad remote essential for supporting CPS application development. sensing capabilities inherent to cyber-physical systems In general, research in this space has been focused on using very minimal code. Further, BraceForce incorpo- demonstrating the feasibility of applications, the devel- rates event- and model-driven data acquisition as first- opment of support services such as routing protocols or class concepts to provide efficient access to sensing while energy-saving algorithms, or on advancement of hard- retaining expressiveness and flexibility for applications. ware platforms and operating systems. Little focus has This paper presents the BraceForce middleware archi- been applied to effective development support for ap- tecture and key abstractions, describes their implemen- plications that integrate the capabilities of networked tations, and provides an empirical study using Brace- sensing platforms in easy to use and extensible ways. In Force to support CPS applications. addition to the variety of data formats, communication technologies, and programming platforms a developer Keywords must tackle, CPS applications also require handling net- work dynamics and energy constraints. sensor drivers, sensor network, mobile computing, smart- This paper introduces BraceForce, a middleware for phones, cyber physical systems CPS application development that simplifies the devel- opment, deployment, and debugging of CPS applica- 1. INTRODUCTION tions. In supporting application deployment, Brace- Developing and deploying CPS applications involves Force allows the developer to connect the application to a large amount of low-level programming that requires sensing assets in the deployment environment. In sup- interacting with different (often proprietary) data for- porting application debugging, BraceForce can be used mats, languages, and operating systems. In practice, to monitor a test environment using capabilities that applications are built for specific sensor network plat- may not be available in the deployment environment. Architecturally, BraceForce defines functional tiers that encapsulate related aspects but coordinate in such a way that the tiers' deployment to particular physical assets is flexible. Different tiers can be deployed on user-facing Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are devices or on sensing devices with limited capabilities, not made or distributed for profit or commercial advantage and that copies directly addressing and leveraging the specific capabili- bear this notice and the full citation on the first page. To copy otherwise, to ties and intentions of each device. BraceForce provides republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. auto-discovery of new sensing and computing assets, al- Copyright 200X ACM X-XXXXX-XX-X/XX/XX ...$5.00. lowing easy integration of new capabilities into existing velopment through an exploratory study of BraceForce applications or automatic and seamless extension of a applied to real CPS applications that rely on networked debugging environment. As BraceForce discovers new sensors. BraceForce provides a clear design contract for components, the tiered architecture organically extends integrating new sensors into existing applications. This to these new components, flexibly deploying the neces- paper makes the concrete contributions in three areas: sary tiers to the new components. 1. Supporting CPS application developers and users Instead of using a proprietary programming language (e.g., nesC [9]), supporting a single hardware platform ◦ BraceForce provides a simple and unified program- (e.g., ODK [5]), or creating a new standard (e.g., Dan- ming interface to reduce programming barriers of delion [19] or DASH [7]), BraceForce presents a simple CPS applications that integrate sensing. Java programming interface for integrating new sensing ◦ BraceForce's tiered architecture enables dynamic capabilities. To add a new sensor to BraceForce, a de- updates to CPS applications and their physical de- veloper just needs to implement a simple sensor driver ployments without intervention by the users. interface that provides essential commands (e.g., open, 2. Supporting flexible and expressive CPS applications close, query) and configuration. The driver implementa- ◦ BraceForce can be deployed to heterogeneous de- tion can be specific to the particular sensor but basically vices in different configurations to meet constraints translates raw data into meaningful BraceForce sensor of CPS applications and devices. data constructs, guided by the provided BraceForce in- ◦ BraceForce supports both pull- and push-based in- terfaces. BraceForce handles issues such as thread man- teraction with sensing devices. agement, networking, remote procedure call, etc. ◦ BraceForce embraces model-driven data acquisition BraceForce supports both the traditional pull and more to address energy concerns of CPS applications. flexible push based interaction with sensing devices. Out 3. Studying CPS application development of concern of energy-saving, BraceForce's default form of interaction is event-driven data acquisition, in which ◦ We demonstrate and evaluate how BraceForce makes sensed data is only pushed to an interested applica- both the development process more approachable tion on the occurrence of an event. Applications specify and the resulting CPS application more efficient. ◦ We demonstrate that MDDA within BraceForce thresholds on changes in sensed values that determine can significantly reduce the network overhead, which when new samples are returned. Such an approach has in turn reduces energy consumption. been shown to dramatically reduce energy costs of in- teracting with networked sensors. Existing approaches The next section places this paper's contributions in that support some integration of sensing capabilities the context of related work. In Section 3, we provide with mobile application development [5] provide only complete details of the BraceForce middleware. Sec- continuous sampling or instantaneous polling, which re- tion 4 presents the empirical design for our evaluation, quire the application to tune the interaction with the while Section 5 describes its results. sensing platform and therefore either expend extrane- ous energy or miss important sensed value changes. 2. RELATED WORK BraceForce embraces model-driven data acquisition BraceForce aims to make sensor programming trans- (MDDA) [14, 21, 22, 24, 27] to reduce energy costs of parent to CPS application developers by explicitly and integrating sensing in CPS applications. MDDA sup- intentionally hiding low-level sensing concerns. Brace- presses sensor readings that are predictable according to Force provides CPS application developers dynamic de- some a priori or learned model. BraceForce supports ployment and automatic discovery of networked sensors, (i) temporal models of data evolution based on previ- distributed data caching and aggregation capabilities, ous sensor readings [24]; (ii) models based on underlying and presents the networked sensors through a combina- physics principles of the sensed system [21]; (iii) mod- tion of event-driven and model-driven accessors, provid- els derived from applying data mining to prior sensed ing both flexibility for developers and efficiency for the data [14]; and (iv) models expressing correlations of data deployment. Existing approaches tackle similar and in in space and time [27]. While the use of model-driven some cases overlapping concerns, but, to our knowledge, data acquisition is itself not novel to