簡易檢索 / 詳目顯示

研究生: 曾梓晏
Tseng, Zi-Yen
論文名稱: 應用微服務建構WoT平台之研究
A Study on Applying Microservices to Building WoT Platform
指導教授: 陳敬
Chen, Jing
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 電腦與通信工程研究所
Institute of Computer & Communication Engineering
論文出版年: 2021
畢業學年度: 109
語文別: 中文
論文頁數: 104
中文關鍵詞: 物聯網微服務邊緣運算WoT
外文關鍵詞: IoT, Microservices, Web of Things, edge computing, WoT
相關次數: 點閱:99下載:4
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 近年來,物聯網裝置與技術逐年成長,而其目前的困境是既有的程式通常採用單體式架構,面對日趨龐大且複雜的程式,在功能性擴充或是效能擴充上較難有應變彈性,若能使用微服務架構取代既有單體式架構問題便能迎刃而解。而微服務主要是將既有程式切割成多個完全獨立的模組,並且透過 HTTP 等網路協定當作跨模組的溝通協定。
    本論文針對物聯網設計一微服務架構之平台,以微服務作為最小粒度,並且使用既有的開源專案 Docker 作為部署工具,有別於以雲端為主的平台,本論文成果將部署在邊緣裝置上以解決雲端服務在延遲較嚴重的情況,並搭配容器等技術使微服務得到更完整的效能彈性。在規範上,以全球資訊網協會制定的 WoT 規範為基礎,制定以服務為最小粒度的規範,服務為微服務架構中定義之最小可獨立運作之模組,WoT 為全球資訊網協會協同多間網路服務商制定之規範,目的在於提供統一的規範以利跨廠商間的裝置協同運作。
    本論文實作以微服務架構設計為基礎,將微服務架構之物聯網專案部署在多個邊緣運算裝置上。實作內容包含:(1)以微服務架構設計之物聯網專案,提供更好的功能擴充彈性;(2)使用 mDNS 協定提供服務的可發現性,提供在同一網域下自動發現服務,提供相較傳統物聯網上更便利的可發現性;(3)實作符合服務描述規範之服務,內容如種類、描述、通訊介面等。
    本論文旨在將微服務架構導入物聯網,並且根據 WoT 規範制定最小粒度為服務的框架,提供彈性更好、擴展容易的程式架構;在部署上,採用邊緣運算和 Docker 工具,用以解決雲端運算的既有延遲嚴重等問題。

    Applications of Internet of Things (IoT) increase rapidly and can be observed almost everywhere. However, during the widespread growing, many issues from different arenas have emerged which range from the development of IoT applications to the deployment of IoT devices provided by different makers. Interoperability is the most noticeable one among these issues and it is considered as the main source of causing the fragmentation. Scalability and findability are the other two important issues in developing sophisticated IoT applications. In addressing these issues and taking advantage of existing Web technology, WoT (Web of Things) has been proposed as one general approach. A WoT platform which integrates useful techniques to help manage IoT devices as well as build IoT applications would be very beneficial.
    This study aims to build a WoT platform which would help improve the efficiency in building IoT applications and increase the interoperability, scalability and findability of using IoT devices. The platform is designed based on the concept of microservice architecture and take advantage of edge computing. A microservice can either be provided by the function of an IoT device standing as a node supporting edge computing or implemented by a software module working in the server-client style. By composing the functionality of an IoT application through combining stand-alone microservices as much as possible, the conventional monolithic application program can be divided into a number of microservices among which there are basic core microservices taking charge of necessary management functions and optionally configured microservices, either local or remote ones, responsible for carrying out the functions required by the application. The architecture thus helps decrease the coupling while increasing the scalability. To counter the fragmentation issue in IoT application, the WoT recommendations proposed by World Wide Web Consortium (W3C) is followed to increase the interoperability. To increase the findability, multicast domain name service (mDNS) protocol is used to help find the desired services. In concerning the performance and to reduce consuming network bandwidth, the mechanism of service chain is included in the design.
    An example implementation is conducted to demonstrative the effectiveness of the WoT platform. The example microservices were implemented and deployed using container technology on the edge computing service, and classic HTTP protocol is used for communication. The results of running test cases showed that the example WoT platform worked well and the microservices provided by IoT devices could be easily configured into the application. This study therefore concludes that microservice architecture can be applied to build WoT platform and effectively helps develop IoT application.

    第1章 緒論 1 1.1 研究背景 1 1.2 研究動機與目的 3 1.3 研究方法 3 1.4 章節規劃 4 第2章 相關研究 5 2.1 WoT (Web of Things) 5 2.1.1 WoT基礎介紹 5 2.1.2 WoT相關規範 7 2.1.3 物聯網的特性 9 2.2 WoT相關技術探討 12 2.2.1 微服務架構 12 2.2.2 微服務間的通訊 15 2.2.3 mDNS 17 2.2.4 Docker 與容器 17 2.2.5 邊緣運算 (edge computing) 19 2.3 物聯網相關文獻探討 20 2.3.1 WoT相關研究 20 2.3.2 微服務架構應用於物聯網之探討 22 2.4 討論 22 第3章 系統架構與設計 23 3.1 使用情境 23 3.2 架構設計 25 3.3 微服務設計 28 3.3.1 微服務框架設計 28 3.3.2 中介者 (Broker) 30 3.3.3 管理人 (Manager) 31 3.3.4 發現器 (Finder) 32 3.3.5 運算器 (Computing) 33 3.3.6 適配器 (Adapter) 35 3.3.7 應用程式 (Application) 37 3.4 微服務間的溝通與服務鏈 39 3.5 錯誤處理器 (Error Handler) 43 3.6 物描述 (Thing Description) 45 3.7 討論 46 第4章 系統實作 48 4.1 實作環境 48 4.2 微服務框架實作 49 4.2.1 伺服器 (server) 49 4.2.2 廣播器 (broadcast) 50 4.2.3 服務鏈 (service chain) 52 4.2.4 錯誤處理器 (error handler) 55 4.2.5 狀態回報 (status report) 57 4.2.6 小結 57 4.3 微服務實作 58 4.3.1 中介者 (Broker) 58 4.3.2 管理人 (Manager) 60 4.3.3 發現器 (Finder) 61 4.3.4 運算器 (Computing) 63 4.3.5 適配器 (Adapter) 66 4.4 物描述文件 67 4.5 應用實作 69 4.6 討論 71 第5章 測試與成果 72 5.1 測試環境 72 5.2 微服務建置與執行 75 5.3 功能性測試 77 5.3.1 各微服務之功能測試 78 5.3.2 微服務框架功能性測試 91 5.4 應用開發範例 97 第6章 結論與展望 99 6.1 結論 99 6.2 未來展望 99 參考文獻 100

    [1] "Edigreen 空氣盒子." https://airbox.edimaxcloud.com/ (accessed on 23 Apr., 2021).
    [2] "Welcome to Flask — Flask Documentation (2.0.x)." https://flask.palletsprojects.com/en/2.0.x/ (accessed on 20 Apr., 2021).
    [3] "What's LXC?" https://linuxcontainers.org/lxc/introduction/ (accessed on 22 Jun., 2021).
    [4] I. K. Aksakalli, T. Çelik, A. B. Can, and B. Teki̇nerdoğan, "Deployment and communication patterns in microservice architectures: A systematic literature review," Journal of Systems and Software, p. 111014, 2021.
    [5] M. Alaa, A. A. Zaidan, B. B. Zaidan, M. Talal, and M. L. M. Kiah, "A review of smart home applications based on Internet of Things," Journal of Network and Computer Applications, vol. 97, pp. 48-65, 2017.
    [6] M. Aly, F. Khomh, Y.-G. Guéhéneuc, H. Washizaki, and S. Yacout, "Is fragmentation a threat to the success of the Internet of Things?," IEEE Internet of Things Journal, vol. 6, no. 1, pp. 472-487, 2018.
    [7] Apple. "Apple Bonjour Overview." https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/NetServices/Articles/about.html (accessed on 22 Jun., 2021).
    [8] F. Bachmann, L. Bass, P. Clements, D. Garlan, and J. Ivers, "Documenting software architecture: Documenting interfaces," Carnegie Mellon Software Engineering Institute, 2002.
    [9] M. Boucadair, R. Penno, and D. Wing, "RFC 6970: Universal plug and play (UPnP) internet gateway device-port control protocol interworking function (IGD-PCP IWF)," Internet Engineering Task Force, 2013.
    [10] T. Bray, "The javascript object notation (json) data interchange format," 2014.
    [11] S. Cheshire and M. Krochmal, "Multicast dns," RFC 6762, February, 2013.
    [12] S. Cheshire and M. Krochmal, "Rfc 6762: Multicast dns," Internet Engineering Task Force (IETF) standard, 2013.
    [13] W. C. M. R. Coordinator. "Solution for IoT Interoperability - W3C Web of Things (WoT)." https://www.w3.org/2020/04/pressrelease-wot-rec.html.en (accessed on 20 Apr., 2021).
    [14] Docker. "Docker official web." https://www.docker.com/ (accessed on 23 Apr., 2021).
    [15] B. El Khalyly, A. Belangour, M. Banane, and A. Erraissi, "A comparative study of Microservices-Based IoT platforms," International Journal of Advanced Computer Science and Applications (IJACSA), vol. 11, no. 7, 2020.
    [16] E. Evans and E. J. Evans, Domain-driven design: tackling complexity in the heart of software. Addison-Wesley Professional, 2004.
    [17] A. S. Foundation. "Apache Thrift." https://thrift.apache.org/ (accessed on 9 Sep., 2021).
    [18] R. P. Foundation. "Operating system images – Raspberry Pi." https://www.raspberrypi.com/software/operating-systems/ (accessed on 12 Oct., 2021).
    [19] R. P. Foundation. "Raspberry Pi 4 Model B." https://www.raspberrypi.com/products/raspberry-pi-4-model-b/ (accessed on 12 Oct., 2021).
    [20] A. S. Foundation. "ActiveMQ." https://activemq.apache.org/ (accessed on 6 Sep., 2021).
    [21] M. P. Fredrik Dahlqvist, Alexander Rajko, and Jonathan Shulman. "Growing opportunities in the Internet of Things." https://www.mckinsey.com/industries/private-equity-and-principal-investors/our-insights/growing-opportunities-in-the-internet-of-things (accessed on 26 Mar., 2021).
    [22] GlobalData. "Revenue from IoT related services will total $96bn in APAC by 2023, says GlobalData." https://www.globaldata.com/revenue-from-iot-related-services-will-total-96bn-in-apac-by-2023-says-globaldata/ (accessed on 26 Mar., 2021).
    [23] D. Guinard. "What is the Web of Things?" https://webofthings.org/2017/04/08/what-is-the-web-of-things/ (accessed on 23 Jul., 2021).
    [24] E. Hozdić, "Smart factory for industry 4.0: A review," International Journal of Modern Manufacturing Technologies, vol. 7, no. 1, pp. 28-35, 2015.
    [25] IIDj. "Japan Radiation Map." https://jciv.iidj.net/map/ (accessed on 25 Oct., 2021).
    [26] S. Kaebisch, T. Kamiya, M. McCool, V. Charpenay, and M. Kovatsch. "Web of Things (WoT) Thing Description." https://www.w3.org/TR/wot-thing-description/ (accessed on 30 Apr., 2021).
    [27] D. Kanjilal, D. Singh, R. Reddy, and J. Mathew, "Smart farm: extending automation to the farm level," Int. J. Sci. Technol. Res, vol. 3, no. 7, pp. 109-113, 2014.
    [28] G. Kiczales et al., "Aspect-oriented programming," in European conference on object-oriented programming, 1997: Springer, pp. 220-242.
    [29] A. Ltd. "ARM Cortex-A Series Programmer's Guide for ARMv8-A." https://developer.arm.com/documentation/den0024/a/ (accessed on 12 Oct., 2021).
    [30] A. Ltd. "Cortex-A72 Arm Developer." https://developer.arm.com/ip-products/processors/cortex-a/cortex-a72 (accessed on 12 Oct., 2021).
    [31] J. Pan and J. McElhannon, "Future edge cloud and edge computing for internet of things applications," IEEE Internet of Things Journal, vol. 5, no. 1, pp. 439-449, 2017.
    [32] W. M. Paul Scott-Murphy, Jakub Stasiak. "zeroconf 0.36.2." https://pypi.org/project/zeroconf/ (accessed on 30 Aug., 2021).
    [33] R. Perrey and M. Lycett, "Service-oriented architecture," in 2003 Symposium on Applications and the Internet Workshops, 2003. Proceedings., 2003: IEEE, pp. 116-119.
    [34] D. Raggett, "The web of things: Challenges and opportunities," Computer, vol. 48, no. 5, pp. 26-32, 2015.
    [35] J. Redmon, S. Divvala, R. Girshick, and A. Farhadi, "You only look once: Unified, real-time object detection," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp. 779-788.
    [36] L. Richardson and S. Ruby, RESTful web services. O'Reilly Media, Inc., 2008.
    [37] O. Ronneberger, P. Fischer, and T. Brox, "U-net: Convolutional networks for biomedical image segmentation," in International Conference on Medical image computing and computer-assisted intervention, 2015: Springer, pp. 234-241.
    [38] J. Sampé, M. Sánchez-Artigas, P. García-López, and G. París, "Data-driven serverless functions for object storage," in Proceedings of the 18th ACM/IFIP/USENIX Middleware Conference, 2017, pp. 121-133.
    [39] W. Shi, J. Cao, Q. Zhang, Y. Li, and L. Xu, "Edge computing: Vision and challenges," IEEE internet of things journal, vol. 3, no. 5, pp. 637-646, 2016.
    [40] P. Sim. "Docker - container and lightweight virtualization." https://www.slideshare.net/janghoonsim/docker-container-and-lightweight-virtualization (accessed on 25 Oct., 2021).
    [41] L. Sun, Y. Li, and R. A. Memon, "An open IoT framework based on microservices architecture," China Communications, vol. 14, no. 2, pp. 154-162, 2017.
    [42] J. Thönes, "Microservices," IEEE software, vol. 32, no. 1, pp. 116-116, 2015.
    [43] V. Trifa, D. Guinard, and D. Carrera. "Web thing model." https://www.w3.org/Submission/wot-model/ (accessed on 30 Apr., 2021).
    [44] S. Trilles, A. González-Pérez, and J. Huerta, "An IoT platform based on microservices and serverless paradigms for smart farming purposes," Sensors, vol. 20, no. 8, p. 2418, 2020.
    [45] VMware. "Messaging that just works — RabbitMQ." https://www.rabbitmq.com/ (accessed on 6 Sep., 2021).
    [46] W3C. "W3C Web of Things." https://www.w3.org/WoT/ (accessed on 9 Sep., 2021).
    [47] D. Zeng, S. Guo, and Z. Cheng, "The web of things: A survey," J. Commun., vol. 6, no. 6, pp. 424-438, 2011.
    [48] H. Zimmermann, "OSI reference model-the ISO model of architecture for open systems interconnection," IEEE Transactions on communications, vol. 28, no. 4, pp. 425-432, 1980.

    下載圖示 校內:2023-10-26公開
    校外:2024-10-26公開
    QR CODE