基于Android的SQLite數(shù)據(jù)庫診斷工具的設計和實現(xiàn)
發(fā)布時間:2018-02-08 20:13
本文關鍵詞: SQLite數(shù)據(jù)庫 SQL語句 診斷工具 Android系統(tǒng) 出處:《北京交通大學》2017年碩士論文 論文類型:學位論文
【摘要】:SQLite數(shù)據(jù)庫是一個獨立的、具有高可靠性的嵌入式數(shù)據(jù)庫,是移動設備上使用非常廣泛的數(shù)據(jù)庫引擎。在手機終端設備中,用戶與應用軟件的交互本質(zhì)是與數(shù)據(jù)庫的交互,而數(shù)據(jù)庫與應用軟件的交互越密切,數(shù)據(jù)庫相關的性能問題就會越顯著。在手機終端產(chǎn)品中,許多應用都會訪問數(shù)據(jù)庫,包括內(nèi)置應用(比如聯(lián)系人、短信、圖庫)和第三方應用(比如微信、QQ、微博等),SQL語句的質(zhì)量對應用軟件的數(shù)據(jù)訪問效率有較大影響。有些應用其內(nèi)部數(shù)據(jù)庫很小且查詢簡單,該情況下SQL語句的質(zhì)量對查詢性能影響不大;但也存在許多應用數(shù)據(jù)庫比較大,存在復雜查詢,該情況下質(zhì)量好的SQL語句相對于質(zhì)量差的SQL語句在性能上就會有較大的差別。該差別主要體現(xiàn)在系統(tǒng)的資源消耗情況和系統(tǒng)的響應時間上。這就要求應用開發(fā)者在提供SQL語句時要考慮到語句執(zhí)行效率問題,盡可能從SQL語句的寫法上優(yōu)化,使執(zhí)行效率最高。然而現(xiàn)在的Android手機應用中都存在著或多或少的低效SQL語句,公司亟需一套SQLite數(shù)據(jù)庫的SQL語句診斷工具來協(xié)助開發(fā)和測試人員定位低效的SQL語句。本課題正是從該角度出發(fā),分析SQLite數(shù)據(jù)庫在Android系統(tǒng)中的執(zhí)行原理和過程,結(jié)合Android系統(tǒng)的運行機制,對SQLite數(shù)據(jù)庫診斷工具進行設計和開發(fā)。作者在軟件開發(fā)過程中的主要工作包括:調(diào)研分析SQLite數(shù)據(jù)庫中SQL語句的優(yōu)化問題的研究背景以及該問題的國內(nèi)外研究現(xiàn)狀;調(diào)研分析SQLite數(shù)據(jù)庫中SQL語句的執(zhí)行原理,理解SQLite的SQL語句執(zhí)行過程;調(diào)研分析Android系統(tǒng)中的Framework層的運行機制;著手Android系統(tǒng)中控制臺的開發(fā),控制臺是用戶與系統(tǒng)進行交互的媒介,統(tǒng)一管理用戶的輸入輸出流,作為入口可以對用戶行為進行規(guī)范;著手Android系統(tǒng)中內(nèi)容共享者組件ContentProvider的開發(fā),ContetProvider是不同應用程序之間進行數(shù)據(jù)交互的標準,控制臺通過ContentProvider與系統(tǒng)中應用數(shù)據(jù)進行交互;對開發(fā)后的工具進行實例驗證,證明SQLite數(shù)據(jù)庫診斷工具的有效性和可行性。本課題針對SQLite數(shù)據(jù)庫使用過程中可能存在的SQL使用問題提出并開發(fā)了一套SQL語句的診斷工具,該工具能夠獲取應用中的劣質(zhì)SQL語句。該SQLite數(shù)據(jù)庫診斷工具已經(jīng)取得了一定的進展,并合入公司的自動化檢測工具中,能夠在開發(fā)和測試人員進行SQL語句優(yōu)化時提供一定的幫助。
[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 何丹丹;;基于黑盒測試的嵌入式系統(tǒng)平臺設計與實現(xiàn)[J];現(xiàn)代電子技術;2016年21期
2 崔娜;;面向數(shù)據(jù)庫性能的SQL語句解析與翻譯[J];現(xiàn)代電子技術;2016年11期
3 范琛琛;施勇;薛質(zhì);;基于ADB調(diào)試的Andrio系統(tǒng)植入研究[J];信息安全與通信保密;2015年11期
4 王壘;;嵌入式數(shù)據(jù)庫關鍵技術的研究與實現(xiàn)[J];數(shù)字技術與應用;2015年02期
5 黃玉坤;陳榕;裴喜龍;曹t,
本文編號:1496172
本文鏈接:http://sikaile.net/kejilunwen/ruanjiangongchenglunwen/1496172.html
最近更新
教材專著