簡易檢索 / 詳目顯示

研究生: 羅智晟
Jhih-Cheng Luo
論文名稱: 物聯網中基於發佈訂閱模式之事件偵測系統設計與實作
A Design and Implementation of a Publish/Subscribe-Based Event Detection System for Internet of Things
指導教授: 邱舉明
Ge-Ming Chiu
口試委員: 邱舉明
Ge-Ming Chiu
項天瑞
Tien-Ruey Hsiang
沈上翔
Shan-Hsiang Shen
鄧惟中
Wei-Chung Teng
學位類別: 碩士
Master
系所名稱: 電資學院 - 資訊工程系
Department of Computer Science and Information Engineering
論文出版年: 2017
畢業學年度: 106
語文別: 中文
論文頁數: 72
中文關鍵詞: 事件偵測智能感測裝置物聯網區間樹中介器MQTT發佈/訂 閱系統
外文關鍵詞: Event Detection, Intelligent Sensor Device, Internet of Things (IoT), Interval Tree, Middleware, MQTT, Publish/Subscribe System
相關次數: 點閱:418下載:7
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報

近年來由於資通訊技術(ICT) 的進步,越來越多的智能感測裝置已逐漸全
面支援連網的功能。在各種智能感測裝置蓬勃的發展之下,物聯網(Internet of
Things, IoT) 也在各個領域中扮演著一個不可或缺的角色。各式各樣的應用與服務
逐漸的發展起來,有的應用偏向於以位置為基礎的服務,有的則是偏向於大數據
的資料收集與應用。然而,在這些眾多應用當中,我們發現到一個潛在的事件偵
測導向的應用服務。大量的智能感測裝置被廣泛的部署在各個區域中,使用者可
以根據其應用與需求,針對不同的智能感測裝置來訂閱自己感興趣的資訊,當這
些訂閱的事件發生時,使用者將可得到一個由系統所發出的提醒通知。在這樣的
服務模型下,要如何設計出一個可靠的系統,來提供使用者一個事件偵測的服務,
是本論文主要探討的議題。
在本論文中,我們將基於MQTT 協定設計出一個出版訂閱系統的中介器,來
提供使用者一個事件偵測的服務。我們也在系統設計的過程當中,發現到若依照
傳統發佈訂閱模式下,其資料的傳輸過程中會產生的一些頻寬浪費,導致智能感
測裝置消耗過多的能源之問題。為了解決這些問題,本研究也提出了有效的解決
方案。最後透過實驗的模擬,證明本研究所設計出之系統,除了能提供使用者服
務以外,還能夠有效的降低系統上不必要的資料傳輸發生,進而達到節省整體網
路頻寬並使智能感測裝置達到省電之目的。


Owing to the progress of information and communication technology (ICT), a growing
number of intelligent sensor devices have gradually begun to support connection to
the Internet. As the vast amount of intelligent devices have a rapid development, the Internet
of Things (IoT) plays a significant role in many fields. With the development of
the applications and services, some of the applications tend to be location-based service
(LBS) and some of the services tend to be big data analytics. However, we discovered a
potential application service model based on the event-based detection service in the IoT.
A large number of intelligent sensor devices have been deployed in many areas. Users can
subscribe to information from different kinds of intelligent sensor devices based on their
own demands or applications. The system will send a notification to the users when these
subscribed events occur. One of the crucial issues in this paper is how to design a reliable
system to provide this kind of event-based detection service to the users.
In this paper, we propose a publish/subscribe middleware architecture based on the
MQTT protocol to offer users an event-based detection service. In the process of research,
we also found that some waste of bandwidth and energy were caused by the transmission of
data under the traditional publish/subscribe paradigm. We proposed a practical solution
to tackle the problem of unnecessary data transmission in the system. Lastly, we will
simulate this method to prove that our approach can reduce data transmission in IoT.

目錄 論文摘要. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . II 誌謝. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . III 目錄. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . IV 圖目錄. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VII 表目錄. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 演算法目錄. . . . . . . . . . . . . . . . . . . . . . . . . . . . . XI 第一章緒論. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 研究背景. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 論文目標. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 論文架構. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 第二章相關研究. . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.1 發佈訂閱系統Publish/Subscirbe System . . . . . . . . . . . . . . . . . 4 2.2 Message Queue Telemetry Transport (MQTT) Protocol . . . . . . . . . . 5 2.2.1 服務質量Qualities of Service (QoS) . . . . . . . . . . . . . . . 5 2.2.2 保留訊息Retained message . . . . . . . . . . . . . . . . . . . . 7 2.2.3 最後遺囑Last Will and Testament . . . . . . . . . . . . . . . . . 7 2.3 Common Middleware . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.3.1 SINA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.3.2 Maté . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.3.3 Mires . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 第三章問題描述與系統模型. . . . . . . . . . . . . . . . . . . . . 10 3.1 問題定義. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.2 系統模型. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.2.1 智能感測裝置(Intelligent sensor device) . . . . . . . . . . . . . 11 3.2.2 使用者(Users) . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 第四章中介器設計. . . . . . . . . . . . . . . . . . . . . . . . . 14 4.1 系統架構. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.2 中介器(Middleware) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.3 基本運作流程. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.3.1 情境一:裝置因電力或網路問題離開感測網路. . . . . . . . 19 4.3.2 情境二:當使用者取消或更改訂閱情況下. . . . . . . . . . . 20 4.4 進階演算法. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.4.1 區間樹(Interval tree) . . . . . . . . . . . . . . . . . . . . . . . 23 4.4.2 處理使用者資料. . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.4.3 處理智能感測裝置的感測資料. . . . . . . . . . . . . . . . . . 29 第五章實驗結果與分析. . . . . . . . . . . . . . . . . . . . . . . 31 5.1 實驗環境設定. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.1.1 智能感測裝置之設定. . . . . . . . . . . . . . . . . . . . . . . 32 5.1.2 使用者之設定. . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.2 實驗結果. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.2.1 使用者數量的影響. . . . . . . . . . . . . . . . . . . . . . . . 34 5.2.2 使用者訂閱的事件中平均Query 數量的影響. . . . . . . . . . 38 5.2.3 智能感測裝置數量的影響. . . . . . . . . . . . . . . . . . . . 42 5.2.4 裝置存取機率的偏斜程度. . . . . . . . . . . . . . . . . . . . 46 5.2.5 裝置存取機率的偏斜程度對於Query 訂閱範圍長度的影響. . 50 第六章結論與未來研究方向. . . . . . . . . . . . . . . . . . . . . 55 參考文獻. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

[1] J. A. Stankovic, “Research directions for the internet of things,” IEEE Internet of
Things Journal, vol. 1, no. 1, pp. 3–9, Feb 2014.
[2] A. Zanella, N. Bui, A. Castellani, L. Vangelista, and M. Zorzi, “Internet of things for
smart cities,” IEEE Internet of Things Journal, vol. 1, no. 1, pp. 22–32, Feb 2014.
[3] A. Al-Fuqaha, M. Guizani, M. Mohammadi, M. Aledhari, and M. Ayyash, “Internet
of things: A survey on enabling technologies, protocols, and applications,” IEEE
Communications Surveys Tutorials, vol. 17, no. 4, pp. 2347–2376, Jun 2015.
[4] L. D. Xu, W. He, and S. Li, “Internet of things in industries: A survey,” IEEE Transactions
on Industrial Informatics, vol. 10, no. 4, pp. 2233–2243, Nov 2014.
[5] L. Chen, S. Thombre, K. Järvinen, E. S. Lohan, A. Alén-Savikko, H. Leppäkoski,
M. Z. H. Bhuiyan, S. Bu-Pasha, G. N. Ferrara, S. Honkala, J. Lindqvist, L. Ruotsalainen,
P. Korpisaari, and H. Kuusniemi, “Robustness, security and privacy in
location-based services for future IoT: A survey,” IEEE Access, vol. 5, pp. 8956–
8977, Apr 2017.
[6] F. J. Riggins and S. F. Wamba, “Research directions on the adoption, usage, and
impact of the internet of things through the use of big data analytics,” in 2015 48th
Hawaii International Conference on System Sciences, Jan 2015, pp. 1531–1540.
[7] MQTT Version 3.1.1., OASIS Standard, October 2014, latest version: http://
docs.oasis-open.org/mqtt/mqtt/v3.1.1/mqtt-v3.1.1.html. [Online]. Available: http:
//docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html
[8] B. Chandramouli, J. M. Phillips, and J. Yang, “Value-based notification conditions
in large-scale publish/subscribe systems,” in Proceedings of the 33rd International
Conference on Very Large Data Bases. VLDB Endowment, 2007, pp. 878–889.
[9] B. Chandramouli and J. Yang, “End-to-end support for joins in large-scale publish/
subscribe systems,” VLDB Endowment, vol. 1, no. 1, pp. 434–450, Aug. 2008.
[10] A. Demers, J. Gehrke, M. Hong, M. Riedewald, and W. White, “Towards expressive
publish/subscribe systems,” in Proceedings of the 10th International Conference on Advances in Database Technology. Berlin, Heidelberg: Springer-Verlag, 2006, pp.
627–644.
[11] A. Machanavajjhala, E. Vee, M. Garofalakis, and J. Shanmugasundaram, “Scalable
ranked publish/subscribe,” VLDB Endowment, vol. 1, no. 1, pp. 451–462, Aug. 2008.
[12] P. T. Eugster, P. A. Felber, R. Guerraoui, and A.-M. Kermarrec, “The many faces
of publish/subscribe,” ACM Computing Surveys, vol. 35, no. 2, pp. 114–131, Jun.
2003.
[13] S. Hadim and N. Mohamed, “Middleware: middleware challenges and approaches
for wireless sensor networks,” IEEE Distributed Systems Online, vol. 7, no. 3, pp.
1–1, March 2006.
[14] S. R. Madden, M. J. Franklin, J. M. Hellerstein, and W. Hong, “TinyDB: An acquisitional
query processing system for sensor networks,” ACM Transactions on
Database Systems, vol. 30, no. 1, pp. 122–173, Mar. 2005.
[15] W. B. Heinzelman, A. L. Murphy, H. S. Carvalho, and M. A. Perillo, “Middleware
to support sensor network applications,” IEEE Network, vol. 18, no. 1, pp. 6–14, Jan
2004.
[16] T. Liu and M. Martonosi, “Impala: A middleware system for managing autonomic,
parallel sensor systems,” in Proceedings of the Ninth ACM SIGPLAN Symposium on
Principles and Practice of Parallel Programming. New York, NY, USA: ACM,
2003, pp. 107–118.
[17] R. Barr, J. C. Bicket, D. S. Dantas, B. Du, T. W. D. Kim, B. Zhou, and E. G. Sirer, “On
the need for system-level support for ad hoc and sensor networks,” ACM SIGOPS
Operating Systems Review, vol. 36, no. 2, pp. 1–5, Apr. 2002.
[18] C.-C. Shen, C. Srisathapornphat, and C. Jaikaeo, “Sensor information networking
architecture and applications,” IEEE Personal Communications, vol. 8, no. 4, pp.
52–59, Aug 2001.
[19] P. Levis and D. Culler, “Maté: A tiny virtual machine for sensor networks,” in
Proceedings of the 10th International Conference on Architectural Support for Programming
Languages and Operating Systems. New York, NY, USA: ACM, 2002,
pp. 85–95.
[20] J. Hill, R. Szewczyk, A. Woo, S. Hollar, D. Culler, and K. Pister, “System architecture
directions for networked sensors,” in Proceedings of the ninth international
conference on Architectural support for programming languages and operating systems,
vol. 28, no. 5. New York, NY, USA: ACM, Nov. 2000, pp. 93–104.
[21] E. Souto, G. Guimarães, G. Vasconcelos, M. Vieira, N. Rosa, and C. Ferraz, “A
message-oriented middleware for sensor networks,” in Proceedings of the 2Nd Workshop
on Middleware for Pervasive and Ad-hoc Computing. New York, NY, USA:
ACM, 2004, pp. 127–134.
[22] P. Buonadonna, J. Hill, and D. Culler, “Active message communication for tiny networked
sensors,” in Proceedings of the 20th Annual Joint Conference of the IEEE
Computer and Communications Societies, Anchorage, Alaska, USA, April 2001.
[23] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein, Introduction to Algorithms,
3rd ed. The MIT Press, 2009, ch. 13.
[24] (2017) Arduino. [Online]. Available: https://www.arduino.cc/
[25] (2017) Raspberry Pi. [Online]. Available: https://www.raspberrypi.org/
[26] (2017) Node.js. [Online]. Available: https://nodejs.org/
[27] (2017) Wireshark: network protocol analyzer. [Online]. Available: https:
//www.wireshark.org/
[28] M. Collina, “mosca,” https://github.com/mcollina/mosca, 2013.
[29] L. Breslau, P. Cao, L. Fan, G. Phillips, and S. Shenker, “Web caching and zipf-like
distributions: evidence and implications,” in INFOCOM ’99. Eighteenth Annual
Joint Conference of the IEEE Computer and Communications Societies. Proceedings.
IEEE, vol. 1, Mar 1999, pp. 126–134.
[30] (2017) IPSO Alliance. [Online]. Available: http://www.ipso-alliance.org/
[31] C. Bormann, A. P. Castellani, and Z. Shelby, “CoAP: An application protocol for
billions of tiny internet nodes,” IEEE Internet Computing, vol. 16, no. 2, pp. 62–67,
March 2012.
[32] (2017) Docker. [Online]. Available: https://www.docker.com/

QR CODE