簡易檢索 / 詳目顯示

研究生: 劉姿均
Liu, TzuChun
論文名稱: 微型嵌入式平台上之韌體更新及腳本化執行框架
A Scriptable Execution and Reprogramming Framework for Resource-Constrained Embedded Platforms
指導教授: 周百祥
Chou, Pai H.
口試委員: 蔡明哲
Tsai, Ming-Jer
張立平
Chang, Li-Pin
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 資訊工程學系
Computer Science
論文出版年: 2013
畢業學年度: 101
語文別: 英文
論文頁數: 97
中文關鍵詞: 無線感測網路
外文關鍵詞: remote invocation, EcoSD
相關次數: 點閱:2下載:0
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 本論文提出了EcoExec+,支援微型嵌入式平台上遠端韌體更新及互動執行的框架。EcoExec+採用主從式的網路架構( client-server architecture )。使用者透過系統提供之API於資源豐富的客戶端(resource-rich client)對無線感測平台進行遠端程序調用( Remote Procedure Call, RPC),存取無線感測平台的資訊及服務、控制並執行其系統及應用程式。動態物件導向程式語言(如Python)的支援將平台視為本機端物件(local data objects)進行存取,更有助於無線感測平台透過EcoExec+開發環境進行應用開發。
    EcoExec+於伺服器端提出腳本為基礎( script-based )的架構來記錄平台執行程序,並於有限記憶體下支援遠端程序調用服務、工作管理( Job Control )等。透過客戶端以互動方式進行程序之修改,客戶端參數、回傳值的型態編組及反編組( type marshaling
    /demarshaling )與程式管理端即時的編譯及遠端韌體更新機制,大量減少伺服器裝置上資源使用的同時,於無線感測平台上完成動態開發環境之實踐。
    值得注意的是,EcoExec+同時高度模組化了客戶端與伺服器端的架構,使得系統具力;(3)容易移植到其他編輯程序( compiler )及指令集架構( instruction-set architecture )。本論文於實驗中不僅將既有應用與EcoExec+之互動模式整合,並完成系統層面之開發,如溝通介面之切換與分層網路之建置,驗證了本論文所提出之框架大幅度的減少測試、開發無線感測平台所需耗費的時間及成本,也讓微型嵌入式裝置不再因有限的資源而侷限其開發應用。


    EcoExec+ is a framework for interactive programming of resource-constrained wireless sensor nodes. It provides an application programming interface (API) for making remote procedure calls (RPC) to a node from a resource-rich client such as a host PC or a mobile device. When used in conjunction with a dynamic language such as Python, it makes a friendly and powerful development environment by enabling nodes to be accessed just like local data objects. EcoExec+ handles all type marshaling
    and demarshaling of the parameters and return values on the client side. Optionally, just-in-time compilation and remote firmware patching before the invocation can also be done by either the same host PC or a separate server. The runtime-support code on the node handles RPC service, job control,
    and code patching functions. The contributions of EcoExec+ over its predecessor, EcoExec, is the significantly enhanced modular organization on both the client and server sides, enabling it to be configured to a variety of communication interfaces, to co-exist with existing runtime systems, and
    be easily portable to other compilers or instruction-set architectures. Case studies confirm that Eco-Exec+ enables development of nontrivial applications with significantly reduced effort, thanks to the interactive programming and type marshaling support.

    Contents 1 1 Introduction 8 1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.2 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.3 Thesis Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2 Related Work 12 2.1 Remote Reprogramming in Wireless Sensor Networks . . . . . . . . . . . . . . . . 12 2.2 Interactive Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3 System Overview 19 3.1 General Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.1.1 Fat Client, Thin Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.1.2 Types of Targeted Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.2 Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.2.1 Function Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.2.2 Variable Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.2.3 Code Staging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.2.4 Incremental Remote Reprogramming . . . . . . . . . . . . . . . . . . . . . 23 3.2.5 Job Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.3 System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.3.1 RPC Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.3.2 Code Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.3.3 RPC Server on Embedded Nodes . . . . . . . . . . . . . . . . . . . . . . . 26 3.4 System Execution Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4 Client Subsystem 34 4.1 The Python Programming Environment . . . . . . . . . . . . . . . . . . . . . . . . 35 4.2 User Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 4.2.1 Command Line User Interface . . . . . . . . . . . . . . . . . . . . . . . . . 36 4.2.2 Customized API support . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 4.3 Command Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 4.4 Client-Side Runtime Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4.4.1 Resource Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4.4.2 Remote Job Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 5 Code Management on Host 42 5.1 Image Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 5.1.1 Generation of the Loader Script . . . . . . . . . . . . . . . . . . . . . . . . 43 5.1.2 Adjustment to the Interrupt Vector . . . . . . . . . . . . . . . . . . . . . . . 43 5.1.3 Modification for Incrementally Linking . . . . . . . . . . . . . . . . . . . . 44 5.2 Version Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 5.2.1 Version Numbering Convention . . . . . . . . . . . . . . . . . . . . . . . . 46 5.2.2 The Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 6 Thin-Server Subsystem 49 6.1 Script Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 6.2 Communication Abstract Layer (CAL) . . . . . . . . . . . . . . . . . . . . . . . . . 52 6.2.1 Transport Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 6.2.2 Network Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 6.3 System Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 6.3.1 Get Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 6.3.2 Put Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 6.3.3 Execute Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 6.3.4 Job Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 6.4 Application Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 6.5 Payload Dispatcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 6.6 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 7 Communication Issues 58 7.1 Packet Interface vs. Streaming Interface . . . . . . . . . . . . . . . . . . . . . . . . 58 7.1.1 Packet/Message Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 7.1.2 Stream/Message Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 7.2 RPC Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 8 Evaluation 64 8.1 Experimental Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 8.1.1 Hardware Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 8.1.2 Software Description - SDCC . . . . . . . . . . . . . . . . . . . . . . . . . 67 8.2 Application Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 8.2.1 Application Development Case: Motion Detection . . . . . . . . . . . . . . 68 8.2.2 Bootstrapping: A Switch Between Different Communication Interface . . . . 69 8.2.3 Bootstrapping: Network Protocol . . . . . . . . . . . . . . . . . . . . . . . 74 8.2.4 Application Development Case: EcoSTS . . . . . . . . . . . . . . . . . . . 79 8.3 Result and Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 8.3.1 Memory Footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 8.3.2 Upload Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 8.3.3 Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 9 Conclusions and Future Work 89 9.1 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 9.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 A Appendix: Command Table 93

    [1] Python Programming Language – Official Website. http://www.python.org.
    [2] SDCC - Small Device C Compiler. http://sdcc.sourceforge.net.
    [3] BOULIS, A., HAN, C.-C., SHEA, R., AND SRIVASTAVA, M. B. SensorWare: Programming sensor networks beyond code update and querying. Pervasive and Mobile Computing 3, 4 (2007), 386 – 412. <ce:title>Middleware for Pervasive Computing</ce:title>.
    [4] CHIEN-AN, C. EcoSec: A thin security layer for interactive programming on WSN. Master’s thesis, National TsingHua University, HsinChu, Taiwan, June 2012.
    [5] DAWSON-HAGGERTY, S., JIANG, X., TOLLE, G., ORTIZ, J., AND CULLER, D. sMAP: a simple measurement and actuation profile for physical information. In Proceedings of the 8th
    ACM Conference on Embedded Networked Sensor Systems (New York, NY, USA, 2010), SenSys’10, ACM, pp. 197–210.
    [6] HSUEH, C.-H., TU, Y.-H., LI, Y.-C., AND CHOU, P. EcoExec: An interactive execution framework for ultra compact wireless sensor nodes. In Sensor Mesh and Ad Hoc Communications and Networks (SECON), 2010 7th Annual IEEE Communications Society Conference on (june 2010), pp. 1 –9.
    [7] HUI, J. W., AND CULLER, D. The dynamic behavior of a data dissemination protocol for network programming at scale. In Proceedings of the 2nd international conference on Embedded networked sensor systems (New York, NY, USA, 2004), SenSys ’04, ACM, pp. 81–94.
    [8] JEONG, J., AND CULLER, D. Incremental network programming for wireless sensors. In Sensor and Ad Hoc Communications and Networks, 2004. IEEE SECON 2004. 2004 First Annual IEEE Communications Society Conference on (oct. 2004), pp. 25 – 33.
    [9] JEONG, J., KIM, S., AND BROAD, A. Network reprogramming. No. 12.
    [10] KOSHY, J., AND PANDEY, R. Remote incremental linking for energy-efficient reprogramming
    of sensor networks. In Proceeedings of the Second European Workshop on Wireless Sensor Networks (31 Jan.-2 Feb. 2005), pp. 354 – 365.
    [11] KOSHY, J., AND PANDEY, R. VMSTAR: synthesizing scalable runtime environments for sensor networks. In Proceedings of the 3rd international conference on Embedded networked sensor systems (New York, NY, USA, 2005), SenSys ’05, ACM, pp. 243–254.
    [12] LEVIS, P., AND CULLER, D. Maté: a tiny virtual machine for sensor networks. SIGOPS Operating Systems Review 36, 5 (Oct. 2002), 85–95.
    [13] LEVIS, P., GAY, D., AND CULLER, D. Bridging the gap: Programming sensor networks with application specific virtual machines. Tech. rep., 2004.
    [14] LEVIS, P., MADDEN, S., POLASTRE, J., SZEWCZYK, R., WHITEHOUSE, K., WOO, A., GAY, D., HILL, J., WELSH, M., BREWER, E., AND CULLER, D. TinyOS: An operating system for sensor networks. In Ambient Intelligence (2004), Springer Verlag.
    [15] MILLER, J. S., DINDA, P. A., AND DICK, R. P. Evaluating a BASIC approach to sensor network node programming. In Proceedings of the 7th ACM Conference on Embedded Networked Sensor Systems (New York, NY, USA, 2009), SenSys ’09, ACM, pp. 155–168.
    [16] OUSTERHOUT, J. Scripting: higher level programming for the 21st century. Computer 31, 3 (mar 1998), 23 –30.
    [17] REIJERS, N., AND LANGENDOEN, K. Efficient code distribution in wireless sensor networks. In Proceedings of the 2nd ACM international conference on Wireless sensor networks and applications (New York, NY, USA, 2003), WSNA ’03, ACM, pp. 60–67.
    [18] SHARPE, W. F., AND JACOB, N. L. BASIC: An Introduction to Computer Programming Using the BASIC Language, 3rd ed. The Free Press, New York, NY, USA, 1979.
    [19] STATHOPOULOS, T., HEIDEMANN, J., AND ESTRIN, D. A remote code update mechanism for wireless sensor networks. Tech. rep., November 26 2003.
    [20] TU, Y.-H., LI, Y.-C., CHIEN, T.-C., AND CHOU, P. H. EcoCast: Interactive, object-oriented macroprogramming for networks of ultra-compact wireless sensor nodes. In Information Processing in Sensor Networks (IPSN), 2011 10th International Conference on (april 2011), pp. 366 –377.
    [21] WHITEHOUSE, K., TOLLE, G., TANEJA, J., SHARP, C., KIM, S., JEONG, J., HUI, J., DUTTA, P., AND CULLER, D. Marionette: using rpc for interactive development and debugging of wireless embedded networks. In Proceedings of the 5th international conference on Information processing in sensor networks (New York, NY, USA, 2006), IPSN ’06, ACM, pp. 416–423.
    [22] XIE, Q., LIU, J., AND CHOU, P. Tapper: a lightweight scripting engine for highly constrained wireless sensor nodes. In Information Processing in Sensor Networks, 2006. IPSN 2006. The Fifth International Conference on (0-0 2006), pp. 342 –349.
    [23] YU-MING, K. EcoSTS: A compact and contactless motion measurement system for coastal sediments tracking. Master’s thesis, National TsingHua University, HsinChu, Taiwan, June 2012.

    無法下載圖示 全文公開日期 本全文未授權公開 (校內網路)
    全文公開日期 本全文未授權公開 (校外網路)

    QR CODE