基于Android的SQLite数据库诊断工具的设计和实现
发布时间:2018-02-08 20:13
本文关键词: SQLite数据库 SQL语句 诊断工具 Android系统 出处:《北京交通大学》2017年硕士论文 论文类型:学位论文
【摘要】:SQLite数据库是一个独立的、具有高可靠性的嵌入式数据库,是移动设备上使用非常广泛的数据库引擎。在手机终端设备中,用户与应用软件的交互本质是与数据库的交互,而数据库与应用软件的交互越密切,数据库相关的性能问题就会越显著。在手机终端产品中,许多应用都会访问数据库,包括内置应用(比如联系人、短信、图库)和第三方应用(比如微信、QQ、微博等),SQL语句的质量对应用软件的数据访问效率有较大影响。有些应用其内部数据库很小且查询简单,该情况下SQL语句的质量对查询性能影响不大;但也存在许多应用数据库比较大,存在复杂查询,该情况下质量好的SQL语句相对于质量差的SQL语句在性能上就会有较大的差别。该差别主要体现在系统的资源消耗情况和系统的响应时间上。这就要求应用开发者在提供SQL语句时要考虑到语句执行效率问题,尽可能从SQL语句的写法上优化,使执行效率最高。然而现在的Android手机应用中都存在着或多或少的低效SQL语句,公司亟需一套SQLite数据库的SQL语句诊断工具来协助开发和测试人员定位低效的SQL语句。本课题正是从该角度出发,分析SQLite数据库在Android系统中的执行原理和过程,结合Android系统的运行机制,对SQLite数据库诊断工具进行设计和开发。作者在软件开发过程中的主要工作包括:调研分析SQLite数据库中SQL语句的优化问题的研究背景以及该问题的国内外研究现状;调研分析SQLite数据库中SQL语句的执行原理,理解SQLite的SQL语句执行过程;调研分析Android系统中的Framework层的运行机制;着手Android系统中控制台的开发,控制台是用户与系统进行交互的媒介,统一管理用户的输入输出流,作为入口可以对用户行为进行规范;着手Android系统中内容共享者组件ContentProvider的开发,ContetProvider是不同应用程序之间进行数据交互的标准,控制台通过ContentProvider与系统中应用数据进行交互;对开发后的工具进行实例验证,证明SQLite数据库诊断工具的有效性和可行性。本课题针对SQLite数据库使用过程中可能存在的SQL使用问题提出并开发了一套SQL语句的诊断工具,该工具能够获取应用中的劣质SQL语句。该SQLite数据库诊断工具已经取得了一定的进展,并合入公司的自动化检测工具中,能够在开发和测试人员进行SQL语句优化时提供一定的帮助。
[Abstract]:SQLite database is an independent, highly reliable embedded database, which is a widely used database engine on mobile devices. In mobile terminal devices, the interaction between users and application software is essentially interaction with database. The closer the interaction between the database and the application, the more significant the performance problems associated with the database. In mobile terminal products, many applications access the database, including built-in applications (such as contacts, SMS, etc.). The quality of SQL statements, such as WeChat QQQ, Weibo and so on, has a great impact on the data access efficiency of the application software. Some applications have small internal databases and simple queries. In this case, the quality of SQL statements has little effect on query performance, but there are many large application databases and complex queries. In this case, there is a great difference in performance between SQL statements with good quality and SQL statements with poor quality. The difference is mainly reflected in the resource consumption of the system and the response time of the system. This requires the application developer. When providing SQL statements, consider the efficiency of statement execution, Optimize the writing of SQL sentences as much as possible, so that the execution efficiency is the highest. However, there are more or less inefficient SQL statements in current Android mobile applications. The company urgently needs a set of SQL statement diagnosis tools of SQLite database to help develop and test people to locate inefficient SQL statements. From this point of view, this paper analyzes the execution principle and process of SQLite database in Android system. Combined with the running mechanism of Android system, The main work of the author in the process of software development includes: investigating and analyzing the research background of SQL sentence optimization in SQLite database and the domestic and foreign research status of this problem; Investigate and analyze the execution principle of SQL statement in SQLite database, understand the SQL statement execution process of SQLite; investigate and analyze the running mechanism of Framework layer in Android system; start the development of console in Android system, the console is the medium for the user to interact with the system. The user's input and output streams are managed uniformly, which can be used as an entry point to standardize the user's behavior, and the ContetProvider is the standard for data exchange between different applications, starting with the development of ContentProvider, the content sharing component in the Android system. The console interacts with the application data in the system through ContentProvider. To prove the validity and feasibility of SQLite database diagnostic tools, this paper proposes and develops a set of SQL diagnostic tools for the possible problems of SQL usage in the process of using SQLite database. The tool can obtain poor quality SQL statements in application. The SQLite database diagnostic tool has made some progress and has been integrated into the automated testing tools of the company. Be able to help developers and testers optimize SQL statements.
【学位授予单位】:北京交通大学
【学位级别】:硕士
【学位授予年份】:2017
【分类号】:TP311.13;TP316
【参考文献】
相关期刊论文 前10条
1 何丹丹;;基于黑盒测试的嵌入式系统平台设计与实现[J];现代电子技术;2016年21期
2 崔娜;;面向数据库性能的SQL语句解析与翻译[J];现代电子技术;2016年11期
3 范琛琛;施勇;薛质;;基于ADB调试的Andrio系统植入研究[J];信息安全与通信保密;2015年11期
4 王垒;;嵌入式数据库关键技术的研究与实现[J];数字技术与应用;2015年02期
5 黄玉坤;陈榕;裴喜龙;曹t,
本文编号:1496172
本文链接:https://www.wllwen.com/kejilunwen/ruanjiangongchenglunwen/1496172.html