硕士专业学位论文 
 
论文题目 
基于 Android 的智能家居 APP 的 
 
 
设计与实现 
  研 究 生 姓 名 
李涛 
  指导教师姓名 
                    杨季文 
  专 业 名 称 
    计算机技术 
  研 究 方 向 
智能化信息处理技术 
  论文提交日期 
2014 年 4 月 
 
 
苏州大学学位论文独创性声明 
 
本人郑重声明:所提交的学位论文是本人在导师的指导下,独立进
行研究工作所取得的成果。除文中已经注明引用的内容外,本论文不含
其他个人或集体已经发表或撰写过的研究成果,也不含为获得苏州大学
或其它教育机构的学位证书而使用过的材料。对本文的研究作出重要贡
献的个人和集体,均已在文中以明确方式标明。本人承担本声明的法律
责任。 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
论文作者签名:             日  期:             
 
 
苏州大学学位论文使用授权声明 
 
本人完全了解苏州大学关于收集、保存和使用学位论文的规定,即:
学位论文著作权归属苏州大学。本学位论文电子文档的内容和纸质论文
的内容相一致。苏州大学有权向国家图书馆、中国社科院文献信息情报
中心、中国科学技术信息研究所(含万方数据电子出版社)、中国学术期
刊(光盘版)电子杂志社送交本学位论文的复印件和电子文档,允许论
文被查阅和借阅,可以采用影印、缩印或其他复制手段保存和汇编学位
论文,可以将学位论文的全部或部分内容编入有关数据库进行检索。  
涉密论文□ 
本学位论文属             在     年   月解密后适用本规定。 
非涉密论文□ 
 
 
 
 
 
 
 
 
 
 
论文作者签名:              日  期:             
导 师 签 名:             日  期:             
 
基于 Android 的智能家居 APP 的设计与实现                                                    中文摘要 
基于 Android 的智能家居 APP 的设计与实现 
中文摘要 
本课题来源于某 IT 企业“智能家居系统”项目。移动互联网的出现,大大提高
了智能家居操作控制的实时性和便捷性,必将进一步推动智能家居的发展。基于移动
平台的智能家居应用已经成为智能家居系统不可或缺的重要组成部分。本课题的主要
内容是设计实现一个基于 Android 的智能家居 APP,并提炼出可复用的中间件。 
本文首先介绍了智能家居 APP 的开发背景和意义,以及相关知识和技术。接着,
按照软件需求层次,分析了智能家居 APP 的需求。然后,给出了智能家居 APP 的总
体设计,包括系统平台选择、软件结构设计、系统功能模块划分和数据结构设计等。
随后,详细介绍了基础功能层和核心功能层的设计与实现,这两层的模块以中间件的
形式存在。最后,介绍了用户功能的详细设计与实现。 
本文介绍的智能家居 APP 是智能家居系统的重要组成部分,有较高的实用价值。
本文按照软件分层思想设计的智能家居 APP 中间件,符合高内聚低耦合的准则,具
有重复使用的价值。本文介绍的基于 Android 的智能家居 APP 的设计思想和开发方
法,对其他移动平台的应用开发也具有一定的参考价值。 
 
关键词:智慧社区,智能家居,移动应用,Android,中间件 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  作    者:李  涛 
  指导老师:杨季文(教授) 
 
 
 
 
I 
Abstract 
Design and Implementation of Smart home APP Based On Android 
Design and Implementation of Smart home APP Based 
On Android 
Abstract 
This  topic  comes  from  an  IT  company’s  project  called  "Smart  Home  System".  The 
emergence of the mobile Internet has greatly improved the timeliness and convenience of 
the smart home operation, also it will further promote the development of smart home. The 
smart home application which based on mobile platform has become an indispensable and 
important  component  of  the  smart  home  system.  The  main  content  of  this  topic  is 
designing  and  implementing  a  smart  home  APP  based  on  Android,  and  extracting  the 
reusable middleware. 
This  paper  first  introduces  the  development  background  and  significance  of  smart 
home  APP,  as  well  as  related  knowledge  and  skills.  Secondly,  according  to  the  software 
requirement level, analyzes the needs of smart home APP. Then, it gives the overall design 
of smart home APP, includes the choice of system platform, software architecture design, 
system  function  module  partition  and  data  structure  design,  etc. Subsequently, this  paper 
makes  a  detailed  description  of  the  design  and  implementation  of  basic  functional  layer 
and  core  functional  layer,the  modules  of  these  two  layers  exist  in  the  form  of  the 
middleware. Finally, this paper introduces the detailed design and implementation of user 
functionality. 
The  smart  home  APP  introduced  by  this  paper  is  an  important  part  of  smart  home 
system,  and  there  is  a  high  practical  value.  According  to  Software  layering  thought  this 
paper designs the middleware of smart home app. With the principle of high cohesion and 
low coupling, this middlware has much value of reuse. The design idea and development 
method  of  smart  home  APP  based  on  Android  that  introduced  by  this  paper  also  has  a 
certain reference value on application development of the other mobile platform. 
 
Key words: Intelligence Community, Smart Home, Mobile Applications, Android,   
Middleware 
Written      by  Tao  Li 
Supervised by Jiwen Yang 
II 
 
目    录 
第一章  引言.......................................................................................................................... 1 
1.1  课题背景.................................................................................................................. 1 
1.2  课题内容.................................................................................................................. 2 
1.3  课题意义.................................................................................................................. 3 
1.4  本文结构安排.......................................................................................................... 3 
第二章  相关知识和技术...................................................................................................... 5 
2.1 Android 系统简介 .................................................................................................... 5 
2.2 Android 系统架构 .................................................................................................... 5 
2.2.1  应用程序........................................................................................................ 6 
2.2.2  应用程序框架................................................................................................ 6 
2.2.3 Android 运行时 .............................................................................................. 7 
2.2.4  系统库............................................................................................................ 7 
2.2.5 Linux 内核 ...................................................................................................... 8 
2.3  消息推送技术.......................................................................................................... 9 
2.3.1  消息推送的常见实现机制............................................................................ 9 
2.3.2  百度云推送技术.......................................................................................... 10 
2.4  语音识别技术........................................................................................................ 12 
2.4.1  语音识别基本原理...................................................................................... 12 
2.4.2 Google 语音识别技术 .................................................................................. 13 
2.5  本章小结................................................................................................................ 13 
第三章  系统需求分析........................................................................................................ 14 
3.1  智能家居系统组成................................................................................................ 14 
3.2  业务需求................................................................................................................ 15 
3.3  用户需求................................................................................................................ 16 
3.3.1  用例图模型.................................................................................................. 17 
3.3.2  设备管理...................................................................................................... 18 
 
 
 
3.3.3  信息服务...................................................................................................... 20 
3.3.4  数据查询...................................................................................................... 22 
3.4  功能需求................................................................................................................ 23 
3.5  非功能需求............................................................................................................ 25 
3.6  本章小结................................................................................................................ 26 
第四章  系统总体设计........................................................................................................ 27 
4.1  系统平台的比较和选择........................................................................................ 27 
4.1.1  系统平台的比较.......................................................................................... 27 
4.1.2  系统平台的选择.......................................................................................... 28 
4.2  软件结构设计........................................................................................................ 29 
4.2.1  软件模块结构.............................................................................................. 29 
4.2.2  功能与模块的关系...................................................................................... 31 
4.2.3  中间件.......................................................................................................... 34 
4.3  系统功能模块设计................................................................................................ 36 
4.3.1  信息服务模块.............................................................................................. 37 
4.3.2  数据查询模块.............................................................................................. 37 
4.3.3  设备管理模块.............................................................................................. 38 
4.3.4  软件设置模块.............................................................................................. 39 
4.4  数据结构设计........................................................................................................ 39 
4.4.1 XML 设计 ..................................................................................................... 39 
4.4.2  数据库设计.................................................................................................. 42 
4.5  本章小结................................................................................................................ 44 
第五章  中间件详细设计与实现........................................................................................ 45 
5.1  基础功能层的详细设计与实现............................................................................ 45 
5.1.1  网络通信模块.............................................................................................. 45 
5.1.2  数据存储模块.............................................................................................. 48 
5.1.3  数据管理模块.............................................................................................. 50 
5.2  核心功能层的详细设计与实现............................................................................ 53