Android下多协议兼容的海水淡化成套设备监控手机APP研发

 2022-05-05 08:05

论文总字数:32737字

摘 要

水是生命之源。水资源在自然界和人类社会的发展中,起着决定性的作用。然而,随着世界人口的日益增长,人类对水等自然资源的需求也在不断提升,而目前地球的淡水资源,经常不能满足人类生产生活的需要。除了从需求端注意节水、探索用水新方法以外,从淡水的来源方面增加水资源的供给也十分重要。其中,海水淡化是缓解淡水匮乏问题的一个行之有效的方法,是当前的一个研究热点。当前的海水淡化设备,由于自然条件的不同,所使用的能源也不同,有的采用风能,有的采用太阳能,有的使用风光互补,即使使用同一种能源,也会出现不同的通讯协议,没有办法完全统一。

针对以上问题,本文首先介绍了研究背景和意义,然后分模块实现了兼容多通讯协议的海水淡化成套设备监控Android app的开发。其中,登录与注册功能采用了Bmob后端云的服务器,在海水淡化基地的选择界面中,引入了百度地图API,并使用Flask的RESTful API搭建了本地服务器以存放数据,基地位置、名称以及基地内设备名称通过NoHttp框架从本地服务器获取。最后,实现了多种通讯协议的解析,并在本地服务器搭建了数据引擎对数据监测进行了模拟。

测试结果表明,该app界面友好,操作简便,实现了多协议的兼容和海水淡化成套设备数据的实时监测,系统能稳定可靠运行,具有一定的实际应用价值。

关键词:Android,海水淡化,多协议,监测系统

Abstract

Water is the source of life. Water resources play a decisive role in the development of nature and human society. However, with the increasing population of the world, so is the demand for water and other natural resources. At present, the freshwater resources of the earth often cannot meet the needs of human production and life. In addition to paying attention to water saving from the demand side and exploring new methods of water use, it is also very important to increase the supply of water resources from the source of freshwater. Among various ways, seawater desalination is an effective method to alleviate the problem of freshwater shortage, and it is a current research hotspot. Current desalination equipment, due to different natural conditions, uses different energy, some use wind energy. Some use solar energy, some use complementary energy of wind and solar. Even if the same energy is used, there will be different communication protocols, hence no way to fully unify them.

Aiming at the above problems, this paper first introduces the background and significance of the research, and then realizes the development of the Android app for seawater desalination monitoring based on multi-protocol. The function of login and registration utilize the Bmob back-end cloud server. Baidu Map API is introduced into the interface of the selection of seawater desalination factories. A local server is built using Flask-based RESTful API to store data. The locations and names of the factories and device names are obtained from the local server through the NoHttp framework. Finally, the analysis of various communication protocols is realized, and a data engine is built on the local server to simulate the data monitoring.

The test results show that the app has friendly interface, simple operation and multi-protocol compatibility. It realizes the real-time monitoring of desalination equipment data. The system can run stably and reliably, and has certain practical value.

KEY WORDS: Android, Seawater desalination, Multi-protocol, Monitoring system

目 录

摘 要 I

Abstract II

第一章 绪论 1

1.1 课题背景和意义 1

1.2 设备监测技术研究现状 2

1.3 研究内容和章节安排 2

1.3.1 研究内容 2

1.3.2 章节安排 2

第二章 海水淡化设备监控手机app软件总体设计 4

2.1 需求分析 4

2.1.1 功能指标 4

2.1.2 性能指标 4

2.2 开发环境搭建 4

2.2.1 Android Studio介绍 4

2.2.2 开发环境搭建步骤 4

2.3 总体设计 7

2.4 本章小结 7

第三章 登录注册模块及基地和设备选择模块的设计与实现 8

3.1 Bmob后端云 8

3.1.1 Bmob后端云简介 8

3.1.2 Bmob的配置 8

3.2 登录功能实现 9

3.3 注册功能实现 11

3.4 百度地图API 13

3.4.1 百度地图API简介 13

3.4.2 百度地图API的配置 13

3.5 RESTful API 16

3.5.1 RESTful API简介 16

3.5.2 配置、数据存放与Http方法实现 16

3.6 NoHttp框架 18

3.6.1 NoHttp框架简介 18

3.6.2 NoHttp的配置 18

3.7 基地选择功能实现 19

3.7.1 引入百度地图 19

3.7.2 从服务器获取基地信息 19

3.7.3 在地图上动态添加坐标 21

3.7.4 通过悬浮按钮实现查看和增删基地数据功能 22

3.8 设备选择功能实现 24

3.8.1 动态添加ListView展示设备名称 24

3.8.2 放置设备的图片 25

3.8.3 通过悬浮按钮实现增删设备数据功能 28

3.9 本章小结 29

第四章 多协议解析及数据采集显示与报警模块的设计与实现 31

4.1 Modbus RTU协议解析 31

4.1.1 App端发送请求 31

4.1.2 服务器端发送数据 33

4.1.3 App端接收数据 34

4.2 Modbus TCP协议解析 35

4.2.1 App端发送请求 35

4.2.2 服务器端发送数据 35

4.2.3 App端接收数据 36

4.3 显示数据功能的实现 36

4.4 报警功能的实现 37

4.5 本章小结 39

第五章 海水淡化设备监控手机app软件测试 40

5.1 功能测试 40

5.2 性能测试 44

5.3 本章小结 44

第六章 总结与展望 45

6.1 总结 45

6.2 展望 45

参考文献 46

致 谢 48

绪论

课题背景和意义

水是生命的源泉,也是人类社会进步和经济社会发展的重要能源动力。随着世界人口的增长和经济的持续发展,人类对于水资源的需求也不断提升。地球表面有约70%的部分被水覆盖,然而,其中绝大部分不适合人类饮用,如海水、苦咸水和废水等,淡水资源仅占水资源总量的25%。而且,这些淡水资源绝大部分都储存在极地冰川、高山积雪中,或者以地下水以及土壤水的形式储藏在地下,很难被人类直接利用。人类可以直接使用的淡水资源,仅仅占水资源总量的0.26%,水资源稀缺形势较为严峻[1]

剩余内容已隐藏,请支付后下载全文,论文总字数:32737字

您需要先支付 80元 才能查看全部内容!立即支付

该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;