The design and implementation of a scalable Internet of things teaching development system
-
摘要: 物联网(Internet of Things, IoT)技术正在蓬勃发展中, 而在嵌入式的课堂中, 如何引领学生结合嵌入式的技术进行物联网领域的初步探索是一个值得思考的问题. 为了降低学生学习的成本和开发的难度, 设计并实现了一个可扩展性强的集管理功能和开发应用功能于一体的物联网教学开发系统; 采用开源框架Spring Boot和Vue, 完成了系统云端的研发; 基于微服务架构很好地解决了耦合性强和可扩展性差的问题. 同时, 为了应对高并发场景, 设计了一种基于阈值过滤的负载均衡优化算法. 实验结果表明, 该算法提升了云端的平均响应速度, 改善了在复杂网络环境下的负载均衡效果. 硬件端基于MSP432开发平台和EMW3080 Wi-Fi模块实现了一套简单易用的支持配网和数据通信的SDK (Software Development Kit), 降低了硬件底层工作的复杂度和学习成本, 使得开发者可以专注于实现业务逻辑.Abstract: Internet of things (IoT) technology is booming, and from the viewpoint of embedded experimental teaching, it is worth thinking about how to lead students to conduct preliminary exploration in the field of Internet of things with embedded technology. In order to reduce the difficulties and costs of student learning and development, we designed and implemented a scalable IoT teaching and development system that integrates management and development functions. We adopted the open-source framework of Spring Boot and Vue to complete the development for the cloud side of the system. Using a micro-service architecture, we solved the typical challenges of strong coupling and poor scalability. In order to cope with high concurrency scenarios, we designed a load balancing optimization algorithm based on threshold filtering. Experimental results showed that the algorithm enhances the average response speed of the cloud and improves load balancing in complex network environments. Based on the MSP432 development platform and the EMW3080 Wi-Fi module, we implemented an easy-to-use SDK(Software Development Kit) that supports network distribution and data communication on the hardware side. The SDK reduced the complexity of the underlying hardware work and learning costs, allowing developers to focus on implementing business logic. Combining the work of software and hardware, the proposed IoT teaching development system provides a complete set of personalized IoT development solutions and an embedded teaching management system.
-
Key words:
- Internet of things /
- micro-services /
- cloud technology /
- load balancing
-
表 1 3组对比实验结果
Tab. 1 Three groups of comparative experimental results
算法 线程数 并发量 平均响应时间 /ms 吞吐量 出错率 RR 10 160 5.67 56.50 0 100 1600 110.33 278.87 0 500 8000 767.00 320.69 0 SWRR 10 160 7.00 56.99 0 100 1600 180.33 197.93 0 500 8000 533.00 323.77 0 BR 10 160 4.67 57.07 0 100 1600 89.33 312.44 0 500 8000 531.33 326.67 0 LA BTF 10 160 3.00 57.95 0 100 1600 74.00 326.17 0 500 8000 357.33 468.78 0 表 2 1组对比实验结果
Tab. 2 Set of comparative experimental results
算法 线程数 并发量 平均响应时间/ms 吞吐量 出错率 RR 1000 16000 1714.33 10391 0.10 SWRR 1000 16000 1812.00 10575 0.07 BR 1000 16000 1642.30 12691 0.06 LA BTF 1000 16000 1654.00 22552 0.03 表 3 2组对比实验结果
Tab. 3 Two groups of comparative experimental results
算法 线程数 并发量 平均响应时间 /ms 吞吐量 出错率 RR 10 160 403.67 9.91 0.007 1000 16000 3325.67 159.57 0.231 SWRR 10 160 364.33 10.43 0.003 1000 16000 3432.00 160.34 0.103 BR 10 160 37.00 56.80 0 1000 16000 1029.30 295.94 0.098 LA BTF 10 160 10.67 55.04 0 1000 16000 1000.30 271.55 0.026 -
[1] ASHTON K. That “Internet of things” thing [EB/OL]. (2009-06-22)[2020-03-01]. http://www.itrco.jp/libraries/RFIDjournal-That%20Internet%20of%20Things%20Thing.pdf. [2] PANETTA K. 5 trends emerge in the Gartner hype cycle for emerging technologies, 2018 [EB/OL]. (2018-04-16)[2020-03-01]. https://www.gartner.com/smarterwithgartner/5-trends-emerge-in-gartner-hype-cycle-for-emerging-technologies-2018/. [3] The top 10 IoT segments in 2018—based on 1 600 real IoT projects [EB/OL]. [2020-03-01]. https://iot-analytics.com/top-10-iot-segments-2018-real-iot-projects/. [4] 付琳, 江世明. 新工科背景下的地方本科高校嵌入式系统课程实践教学改革的探索 [J]. 高校实验室科学技术, 2019(3): 36-38. [5] 马雄. 基于微服务架构的系统设计与开发 [D]. 南京: 南京邮电大学, 2017. [6] LEE J S, SU Y W, SHEN C C. A comparative study of wireless protocols: Bluetooth, UWB, ZigBee, and Wi-Fi [C]// IECON 2007 - 33rd Annual Conference of the IEEE Industrial Electronics Society. IEEE, 2007: 46-51. DOI: 10.1109/IECON.2007.4460126. [7] 陈杨. 基于SOA的物联网智慧服务系统的设计与实现 [D]. 南京: 南京邮电大学, 2016. [8] 刘劭. 基于微服务的教学支持平台服务端的设计与实现 [D]. 南京: 南京大学, 2018. [9] 吴瑶瑶, 杨庚. 云环境下分布式文件系统负载均衡研究 [J]. 计算机工程与应用, 2019, 55(10): 67-72, 224. [10] 杨贾冰. 面向云服务的服务协同与负载均衡策略的设计与实现 [D]. 北京: 北京邮电大学, 2019. [11] 王东. 动态反馈负载均衡策略的研究 [D]. 哈尔滨: 哈尔滨工程大学, 2018. [12] 郑少斌. 支持多协议的微服务化物联网平台研究与实现 [D]. 广州: 华南理工大学, 2019. [13] WANG W K, CASALE G. Evaluating weighted round robin load balancing for cloud web services [C]//2014 16th International Symposium on Symbolic and Numeric Algorithms for Scientific Computing. IEEE, 2014: 393-400. [14] 王宇耕, 肖鹏, 张力, 等. 基于负载预测的自适应权值负载均衡算法 [J]. 计算机工程与设计, 2019, 40(4): 1033-1037. [15] 于金刚, 耿云飞, 杨海波, 等. 基于MQTT协议的消息引擎服务器的设计与实现 [J]. 小型微型计算机系统, 2016, 37(10): 2238-2243. [16] DANG D, PACK D J, BARRETT S F. Embedded Systems Design with the Texas Instruments MSP432 32-bit Processor [M]. [S. l.]: Morgan and Claypool Publishers, 2016.