摘要: | 近幾年來,在無線感測網路研究中,有效率的作業系統具有吸引人的特色像是輕量化核心、反應性、遠端程式更新和併行性,已經引起相當多的關注。這些大部分的作業系統研究都是集中在事件-驅動核心的即時性。然而,中斷的潛在缺點將會造成被喚醒事件的延遲和對於無線感測應用程式的錯誤分析。為了延長節點的生命週期,當節點上的裝置沒被使用時,供給裝置的電源也許會被關掉。絕大多數電池驅動的無線感測應用程式都是利用無線事件去喚醒正在睡眠的節點,也就是無線功能總是打開。然而在通訊的時候,無線元件總是比其他元件耗損更多的能量。當不用無線通訊的時候就關掉無線功能,可以使無線裝置的功率可以消耗更低。從中斷的觀點來看,非同步計時器事件(計時器溢位)會是一個也是唯一的一個內部事件用來喚醒正在睡眠的微控制器,因此週期性任務在無線感測應用中是不可或缺的。 這篇論文有兩個貢獻。我們的第一個貢獻是發展出三款的先進無線感測平台,取名叫Octopus。這些平台分別以AVR、MSP430和CC2430為基礎。為了最佳化繞線程序,我們歸納出一些無線嵌入式電路佈局原則。這些原則可以使尺寸縮小化,更少的貫孔和較短的走線,且會導致低成本電路板,較少的雜訊和較好的雜訊免疫力。我們也提出任務執行時間量測(TDM)。使用自製裝置E-MCU對執行中的應用程式做電量剖面分析,可以顯示哪些任務或是元件消耗較多的CPU運算時間和哪些部分的程式碼是屬於電力敏感部分。甚至我們可以將CPU電量損耗分解成各個程序和原始碼區塊的電量損耗,能量剖面圖讓我們去改善哪個任務或是哪個程式區塊消耗大量的CPU電量。我們的第二個貢獻是提出EXOS,一個用於無線感測網路的計時-驅動作業系統其擁有一個精巧且即時的核心。它可以被移植到記憶體資源有限的平台。EXOS系統核心可以同時處理偶發式任務和週期性任務。當任務被穿插在任務佇列時,EXOS提供共存性,而當外部事件發生時,EXOS能提供快速反應。假如EXOS系統核心沒有任務處理的時候,它可以自動地進入不同睡眠程度去延長節點的生命週期。本研究的估算已顯示此作業系統可以被實際整合到無線感測網路。最後我們也指出未來研究的新穎可行性。In recent years, considerable concern has arisen over the efficient operating systems with some attractive features in the research of wireless sensor networks: lightweight kernel, reactivity, on-the-air programming, and concurrency. The majority of research in such operating systems has focused on the reactive nature of an event-driven kernel. However, the inherent drawbacks of interrupts will result in the latency of invoked events and the erroneous breakdown for wireless sensor applications. For extending the node lifetime, power to the components on the node may be turned off since they are not in use. Most battery-driven wireless sensor applications use radio events to wake up sleeping nodes. That is, the radio is always on. During the transmission intervals, it always consumes more energy than other components. The energy consumption of the radio can be reduced even further by turning it off when not in use. From point of view of the interrupt, the asynchronous timer event (such as the overflow of a timer) is the one and only internal event to invoke the sleeping microcontroller. Therefore, periodic tasks are indispensible in wireless sensor applications. The contributions of this dissertation are twofold. The first contribution is that we have already designed and implemented three kinds of novel wireless sensor platforms called Octopus. These platforms are based on AVR, MSP430, and CC2430, respectively. To optimize the routing process, we conclude some principles for laying out a wireless embedded PCB. These can lead to a smaller board size, fewer vias, and short track lengths, and then result in lower PCB cost, less noise, and better noise immunity. We also proposed TDM (Task Duration Measurement). Using the self-made device, E-MCU, to profile the application during execution can reveal which task or component consumes a large portion of the CPU processing time or which blocks of the source code are very power-sensitive. Even we can break the CPU energy consumption down to individual routines and blocks of the source code. Energy profiling allows us to improve which task or block of the source code consumes a huge amount of the CPU energy. The second contribution is that we present EXOS, a timer-driven operating system with a tiny and real-time kernel for wireless sensor networks. It can be ported to any other memory-constrained platforms. The EXOS kernel can handle both sporadic tasks and periodic tasks. EXOS provides the concurrency as the tasks are interlaced into the task queues and obtains rapid response as external events occur. If the EXOS kernel has no task to process, it will automatically enter a different level of sleep mode to extend the node lifetime. The evaluation of this dissertation has demonstrated that EXOS can be practically integrated into wireless sensor networks. Finally, we also point to novel possibilities for future research. |