軟件工程專業(yè)的2016本科畢業(yè)的外文翻譯_第1頁
軟件工程專業(yè)的2016本科畢業(yè)的外文翻譯_第2頁
軟件工程專業(yè)的2016本科畢業(yè)的外文翻譯_第3頁
軟件工程專業(yè)的2016本科畢業(yè)的外文翻譯_第4頁
軟件工程專業(yè)的2016本科畢業(yè)的外文翻譯_第5頁
已閱讀5頁,還剩12頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、外文翻譯外文題目: SQLite Embedded Database System Research and Implementation院 (系): 計(jì)算機(jī)科學(xué)與通信工程學(xué)院專 業(yè): 計(jì)算機(jī)科學(xué)與技術(shù)(軟件工程方向)班 級: 姓 名: 學(xué) 號: 指導(dǎo)教師: 2016 年 5 月 4 日SQLite Embedded Database System Research and ImplementationIntroduction With the wide range of embedded system applications and user data processing and man

2、agement of increased demand, a variety of smart devices and database technologies work in tandem to get attention. This database not only has the main function of the traditional database, but also has embedded and mobile technology to support two characteristics, it is often used in Pocket PC, PDA,

3、 vehicle equipment, mobile phones and other embedded devices. The rise of this database technology so that people no longer subject to a single operating system restrictions, anytime, anywhere business, and impart information. Can be said that the development of embedded database to improve the univ

4、ersality of access to data, anytime, anywhere access to information so that people desire to become possible.1 embedded database system architecture embedded database and operating system, database system and application-specific integrated to run on a variety of smart embedded devices. Compared wit

5、h traditional database systems, which generally are smaller and have a strong portability and ease of use, and functionality to achieve a more complete user data management operations. However, due to resource constraints of embedded systems, it can not as a complete database to provide large volume

6、s of data management, and embedded devices can be placed anywhere, influenced by the environment, data reliability is low. In practice, in order to compensate for small embedded database storage capacity, reliability and low enough, usually in the back-end database on a PC configured to achieve high

7、-capacity data storage and management. Embedded database as the front-end equipment, you need a GUI interface to achieve human-computer interaction on embedded devices and the PC through the serial port and the main data source on the exchange of data between to achieve server-side data management s

8、ystem, receiving the embedded terminals of the data and download data to the embedded terminal and other operations. 2、SQLites architecture and development of technologyD Richard Heap SQLite is developed with a small C library implementation of a powerful embedded relational database management syst

9、em. It provides support for most of the SQL92: more tables, indexes, transactions, views, triggers, and a series of user interface and driver.2.1 SQLite ArchitectureSQLite can be divided into eight major subsystems, shown in Figure 1. Top is marked processor (tokenizer) and analyzer (parser). Highly

10、 optimized analytics generator can quickly generate efficient code. The bottom is based on Knuth optimized B-tree. This page can be run on adjustable buffer (pagecache) that help to find the disk will be reduced to a minimum. Further down the page cache. Its role in the OS abstraction layer on top o

11、f such an arrangement helps to move the database. Architecture is the core of the virtual database engine (VDBE). VDBE complete with all data related to the operation of the client and storage operations and exchange of information between the middle of the unit. It is the SQLite core. After analyzi

12、ng the SQL statement is, VDBE into play. Code generator will translate into a pocket-sized tree analysis program, then these procedures are combined into a pocket-sized virtual machines with VDBE expressed in a series of language instruction. This back and forth, VDBE each instruction, the final com

13、pletion of requirements specified in the query SQL statement. VDBE machine language by the database management of around 128 operation code (op-code) form. For the open table, query indexing, storage, and delete database records, and many other operations have corresponding opcode. VDBE in each inst

14、ruction opcode by the one and three operand (operand) composition. Some instructions use all three operands, some instructions are not a use. It all depends on the nature of instruction. For example, Open command to open a table pointer, use all three operands: the first operand (P1) contains the ID

15、 number of pointers, the second operand (P2) that the root of the table (or tables Home position), the third operand is the name of the table.2.2 SQLite development technologySQLites API is easy to use, only 3 to execute SQL and get data function. It is extensible, allowing programmers to customize

16、the function, then callback () function sets in. Open source community has extended a number of customer interfaces, adapters, drivers, etc., which makes use of SQLite in other languages are also possible.Using the C language API requires only three steps. First, provide the file name and access mod

17、e, to call sqlite_open () connect to the database. Then, perform callback () function, SQLite implementation by each record callback () function to obtain from the database get results. Finally, if you want to execute a SQL query and get a callback () function pointer, you can call sqlite_exec (). Y

18、ou can also call sqlite3_get_table () function to obtain the data contents of the form.SQLite also provides access to binary large object (BLOB) method, while the thread-safe, database management, API extensions, it is also convenient to provide a strong technical support.3 SQLite compiled in the AR

19、M9 development board and a copySQLite official website at www. sqlite. org download SQLite-3.3.8 version, extract the terminal generates SQLite-3.3.8 directory. Into this directory, for sqlite / src / sqliteInt. h to make certain changes to ensure btree (B tree) have the correct variable size. Diffe

20、rent architectures of Linux will be some differences. ARM-Linux can be found for the following components:# ifndef INTPTR_TYPE# if SQLITE_PTR_SZ = 4# define INTPTR_TYPE int# else# define INTPTR_TYPE long long# endifBefore the code above plus# define SQLITE_PTR_SZ 4So the following typedef INTPTR_TYP

21、E ptr; is defined as int type, rather than long long.Modify the contents of the configure file, comment out the relevant code, let the system do not check the cross-compiler environment, or an error, can not generate the Makefile. Then create a new folder sqlite-arm-linux to save the library file wi

22、ll be generated, run the following command to configure:./configure -disable-tcl-prefix=/./sqlite-arm-linux/-host-arm-linuxWill generate the Makefile in this directory. Modify the Makefile in the following statement, specifying the host compiler to GCC:-#BCC = agrm-linux-gcc -g -O2BCC = gcc -g -O2Th

23、en you can run make & & make install commands to compile, unless otherwise error will be in /. . / Sqlite-3.3.8/sqlite-arm-linux/lib directory to generate libraries. Main libsqlite3. so, libsqlite3. so. O, libsqlite3. so. O. 8.6 three documents. At the same time in the bin folder swells into an exec

24、utable file sqlite3. In order to reduce the size of the executable file, use strip to remove one of the debug command processing information.Library file is generated, through NFS (Network File System) to the relevant library files are copied to the ARM development board, set up the NFS server host,

25、 start the target board, run:mount-t nfs01:/./sqlite-arm-linux/mnt -o nolockcp-arf/mnt/lib/libsqlite3.so libsqlite3.so.0. libsqlite3.so.0.8.6/usr/sqlite/libcp/mnt/lib/sqlite3/usr/sqlite/binOne NFS server 01 is IP, so put the folder where the sqlite library to the target board m

26、ount, with the attention-arf copy option, because libsqlite3. so and libsqlite3. so. O is linked to Iibsqlite3. so. O. 8.6.4 embedded database system design and implementation of embedded systems,a powerful graphical user interface to make the system more feature-rich. There are many GUI available,

27、taking into account the licensing and pricing factors in Qt / Embedded based on the development of a database interface program to complete the design of embedded database system. Qt Qt good package mechanism allows a very high degree of modularity, reusability better. The basic structure of embedde

28、d database system shown in Figure 2.figure 2 Embedded database system configuration diagramBy Qts QTable form controls to display data by QListView, QC20mBobox and QTextEdit and other forms of choice for data control, data entry, data table with the PushButton control to create, delete, and data que

29、ry, add, delete, modification and other operations. In this way, the basic management of database systems, and can use the serial interface and data exchange between back-end database. The system interfaces using Qt Designer to achieve the rapid development of the database and the API by calling the

30、 SQLite database interface functions to achieve the basic operation. The following brief overview of the development database interface with QtDesigner the basic methods and key code. Create a new C + + projects, on the basis of a new widget, the widget to add a Table control to display the form as

31、a data interface. Another as needed, add PushButton control to achieve the appropriate action. In the window class, create a new slot, named SelectSlot (). Connect the relevant button signal, the key code is as follows:void MainWindow:SelectSlot()sqlite3 * pDB = NULL;char * errMsg = 0;int rows = 0,c

32、olumns = 0;char * selectResult;int rc = sqlite3_open(test.db,&pDB);/Query and returns the data table contentsrc = sqlite3_get_table(pDB,selectstr,&selectResult,&rows,&columns,&errMsg);if(rc = SQLITE_OK)QMessageBox:information(this,select table,select table successful!);tableView(char * selectResult,

33、int rows,int columns);elseQMessageBox:information(this,select table,select failed!);sqlite3_close(pDB);TableView function which is the role of the query to get the data table displayed in a Table control. Function body procedures are as follows:void MainWindow:tableView(char * selectResult,int rows,

34、int columns)maintable - setNumRows(rows+1);maintable - setNumCols(columns);for(int j=0;jrows+1;j+)for(int k=0;k setText(j,k,selectResultj*columns+k);Terminal into the project directory, modify the *. pro file, and add the following:Here to join the library files needed to compile the program path an

35、d sqlite. h header file. This is all ready, start the compilation.tmake-o Makefile EDBMS. pro generated Makefile, which will build tools to arm-linux-g + +, with cross-compile the relevant library file. Then make to compile, generate ARM development board to run in the binary file, and NFS mounted t

36、o the development board. Run. / EDBMS, as we design the window interface. Query the contents of a table and displayed in QTable control, the main effect of the interface shown in Figure 3.In addition, the system uses SQL Servqr. 2000 as a back-end database, using VB 6. O development, and database vi

37、a ODBC connection, to achieve back-end database management, and is responsible for receiving and processing client requests. End PC and embedded devices can communicate through the serial port, to improve system functionality. In this way, a more complete embedded database system to build up.Conclus

38、ion In this paper,characteristics of the embedded database, based on the design of an embedded database system architecture. Combined with the characteristics of the embedded database, the use of SQLite in ARM-Linux platform to build embedded database system. On this basis, a database interface usin

39、g Qt Designer to use the SQLite database API to achieve the basic operation. Finally, the back-end database configuration and serial communication mechanism for a brief introduction, complete construction of the embedded database system.譯文SQLite嵌入式數(shù)據(jù)庫系統(tǒng)的研究與實(shí)現(xiàn)引 言隨著嵌入式系統(tǒng)的廣泛應(yīng)用及用戶對數(shù)據(jù)處理和管理需求的不斷提高,各種智能設(shè)備與

40、數(shù)據(jù)庫技術(shù)的緊密結(jié)合得到重視。這種數(shù)據(jù)庫不僅具有傳統(tǒng)數(shù)據(jù)庫的主要功能,還具有嵌入式和支持移動技術(shù)兩種特性,因此通常被用在掌上電腦、PDA、車載設(shè)備、移動電話等嵌入式設(shè)備中。這種數(shù)據(jù)庫技術(shù)的興起使人們不再受單一操作系統(tǒng)的限制,可以隨時(shí)隨地處理業(yè)務(wù)、傳遞信息。可以說,嵌入式數(shù)據(jù)庫的發(fā)展提高了數(shù)據(jù)信息接入的普遍性,使人們隨時(shí)隨地獲取信息的愿望成為可能。1 嵌入式數(shù)據(jù)庫系統(tǒng)的體系結(jié)構(gòu)嵌入式數(shù)據(jù)庫將數(shù)據(jù)庫系統(tǒng)與操作系統(tǒng)和具體應(yīng)用集成在一起,運(yùn)行在各種智能嵌入式設(shè)備上。與傳統(tǒng)的數(shù)據(jù)庫系統(tǒng)相比,它一般體積較小,有較強(qiáng)的便攜性和易用性,以及較為完備的功能來實(shí)現(xiàn)用戶對數(shù)據(jù)的管理操作。但是,由于嵌入式系統(tǒng)的資源限

41、制,它無法作為一個(gè)完整的數(shù)據(jù)庫來提供大容量的數(shù)據(jù)管理,而且嵌入式設(shè)備可隨處放置,受環(huán)境影響較大,數(shù)據(jù)可靠性較低。在實(shí)際應(yīng)用中,為了彌補(bǔ)嵌入式數(shù)據(jù)庫存儲容量小、可靠性低的不足,通常在PC機(jī)上配置后臺數(shù)據(jù)庫來實(shí)現(xiàn)大容量數(shù)據(jù)的存儲和管理。嵌入式數(shù)據(jù)庫作為前端設(shè)備,需要一個(gè)GUI交互界面來實(shí)現(xiàn)嵌入式終端上的人機(jī)交互,并通過串口實(shí)現(xiàn)和PC機(jī)上主數(shù)據(jù)源之間的數(shù)據(jù)交換,實(shí)現(xiàn)系統(tǒng)服務(wù)器端數(shù)據(jù)的管理,接收嵌入式終端上傳的數(shù)據(jù)和下載數(shù)據(jù)到嵌入式終端機(jī)等操作。2 SQLite的體系結(jié)構(gòu)及開發(fā)技術(shù)SQLite是D理查德希普開發(fā)的用一個(gè)小型C庫實(shí)現(xiàn)的一種強(qiáng)有力的嵌入式關(guān)系數(shù)據(jù)庫管理體制。它提供對SQL92的大多數(shù)支持:

42、多表、索引、事務(wù)、視圖、觸發(fā)和一系列的用戶接口及驅(qū)動。2.1 SQLite的體系結(jié)構(gòu)SQLite可以分成8個(gè)主要子系統(tǒng),如圖1所示。頂層是標(biāo)記處理器(tokenizer)和分析器(parser)。高度優(yōu)化的分析生成器可以快速生成高效率的代碼。底部是基于Knuth經(jīng)過優(yōu)化的B樹。這樣可以運(yùn)行在可調(diào)整的頁面緩沖(pagecache)上,有助于將對磁盤的查找減到最少。再往下是頁面高速緩存。它作用在OS的抽象層之上,這樣的安排有助于數(shù)據(jù)庫的移動。體系結(jié)構(gòu)的核心是虛擬數(shù)據(jù)庫引擎(VDBE)。VDBE完成與數(shù)據(jù)操作相關(guān)的全部操作并且是客戶和儲存之間進(jìn)行信息交換的中間單元。它是SQLite的核心。在SQL語

43、句被分析之后,VDBE開始起作用。代碼生成器將分析樹翻譯成一個(gè)袖珍程序,隨后這些袖珍程序被組合成用VDBE虛擬機(jī)器語言表示的一系列指令。如此往復(fù),VDBE執(zhí)行每條指令,最終完成SQL語句指定的查詢要求。VDBE的機(jī)器語言由圍繞數(shù)據(jù)庫管理的128個(gè)操作碼(opcode)組成。對于打開表、查詢索引、存儲和刪除記錄以及很多其他數(shù)據(jù)庫操作都有對應(yīng)的操作碼。VDBE里的每條指令由1個(gè)操作碼和3個(gè)操作數(shù)(operand)組成。一些指令使用全部3個(gè)操作數(shù),也有些指令一個(gè)也未使用。這完全取決于指令的性質(zhì)。例如Open指令用于打開一個(gè)表的指針,使用了全部3個(gè)操作數(shù):第1個(gè)操作數(shù)(P1)包含指針的ID號,第2個(gè)操

44、作數(shù)(P2)指出表的根位置(或者表的首頁位置),第3個(gè)操作數(shù)是表的名字。2.2 SQLite開發(fā)技術(shù)SQLite的API易于使用,只需要3個(gè)用來執(zhí)行SQL和獲得數(shù)據(jù)的函數(shù)。它還是可擴(kuò)展的,允許程序員自定義函數(shù),然后通過callback()函數(shù)集合進(jìn)去。開放源碼團(tuán)體已經(jīng)擴(kuò)展了眾多的客戶接口、適配器、驅(qū)動等,這就使得其他語言使用SQLite也成為可能。使用C語言API只需要三步。首先,提供文件名和訪問模式,來調(diào)用sqlite_open()連接數(shù)據(jù)庫。然后,執(zhí)行callback()函數(shù),SQLite通過對每個(gè)記錄執(zhí)行callback()函數(shù)獲得從數(shù)據(jù)庫那里得到的結(jié)果。最后,如果想執(zhí)行一個(gè)SQL查詢并

45、獲得一個(gè)callback()函數(shù)的指針,可以調(diào)用sqlite_exec()。另外還可以調(diào)用sqlite3_get_table()函數(shù)獲得數(shù)據(jù)表單的內(nèi)容。SQLite還提供了存取二進(jìn)制大對象(BLOB)的方法,同時(shí)在線程安全、數(shù)據(jù)庫管理、API的擴(kuò)展等方面也都提供了強(qiáng)大方便的技術(shù)支持。3 SQLite在ARM9開發(fā)板上的編譯及拷貝 在SQLite官方網(wǎng)wwwsqliteorg下載SQLite-338版本,在終端解壓生成SQLite-338目錄。進(jìn)入此目錄,對sqlitesrcsqliteInth作一定的修改,以確保btree(B樹)有正確的變量大小。不同體系結(jié)構(gòu)的Linux會有些差別。對于ARM

46、-Linux可找到如下部分:# ifndef INTPTR_TYPE# if SQLITE_PTR_SZ = 4# define INTPTR_TYPE int# else# define INTPTR_TYPE long long# endif在上面的代碼前加上# define SQLITE_PTR_SZ 4這樣后面的“typedef INTPTR_TYPE ptr;”就定義為“int”類型,而不是“l(fā)ong long”。修改configure文件的內(nèi)容,注釋掉相關(guān)代碼,讓系統(tǒng)不去檢查交叉編譯環(huán)境,否則會出現(xiàn)錯(cuò)誤,不能生成Makefile文件。然后新建一個(gè)文件夾sqlite-arm-linu

47、x來保存將要生成的庫文件,運(yùn)行以下命令進(jìn)行配置:./configure -disable-tcl-prefix=/./sqlite-arm-linux/-host-arm-linux將在本目錄下生成Makefile文件。修改Makefile文件中如下語句,指定主機(jī)編譯器為GCC:-#BCC = agrm-linux-gcc -g -O2BCC = gcc -g -O2這時(shí)就可以運(yùn)行make & & make install命令開始編譯,若無其他錯(cuò)誤提示,則會在sqlite-338sqlite-arm-linuxlib目錄下生成庫文件。主要有l(wèi)ibsqlite3so、libsqlite3soO、

48、libsqlite3soO86三個(gè)文件。同時(shí)在bin文件夾下生成了可執(zhí)行文件sqlite3。為了減小執(zhí)行文件大小,用strip命令處理去掉其中的調(diào)試信息。庫文件生成后,可以通過NFS(網(wǎng)絡(luò)文件系統(tǒng))把相關(guān)庫文件拷貝到ARM開發(fā)板上,設(shè)置好主機(jī)NFS服務(wù)器,啟動目標(biāo)板后,執(zhí)行:mount-t nfs01:/./sqlite-arm-linux/mnt -o nolockcp-arf/mnt/lib/libsqlite3.so libsqlite3.so.0. libsqlite3.so.0.8.6/usr/sqlite/libcp/mnt/lib/sqlite3/usr/sqlite/bin其中1921681101為NFS服務(wù)器IP,這樣就把sqlite庫文件所在文件夾掛載到了目標(biāo)板上,拷貝時(shí)注意加上-arf選項(xiàng),因?yàn)閘ibsqlite3so和libsqlite3soO是鏈接到libsqlite3soO86的。4 嵌入式數(shù)據(jù)庫系統(tǒng)設(shè)計(jì)及實(shí)現(xiàn)對嵌入式系統(tǒng)而言,強(qiáng)大的圖形用戶接口使系統(tǒng)的功能更加豐富。目前有眾多的GUI可供使用,考慮到授權(quán)和價(jià)格的因素,我們在QtEmbedded基礎(chǔ)上進(jìn)行數(shù)據(jù)庫界面程序的開發(fā),完成嵌入式數(shù)據(jù)庫系統(tǒng)的設(shè)計(jì)。Qt良好的封裝機(jī)制使Qt的模塊化程度非常高,可重用性較好。嵌入式數(shù)據(jù)庫系統(tǒng)的基本

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論