Multi-threading parallel-based rapid loading method for SQLite database

A data loading and database technology, which is applied in relational databases, database models, structured data retrieval, etc., can solve the problem of long time consumption of data loading, achieve the effects of improving operating efficiency, reducing data loading time, and increasing reading speed

Inactive Publication Date: 2015-04-01
HARBIN INST OF TECH
View PDF2 Cites 15 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] The purpose of the present invention is to solve the problem that data loading in the prior art consumes a large amount of time, and proposes a method for quickly loading SQLite databases based on multi-threaded parallelism

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Multi-threading parallel-based rapid loading method for SQLite database
  • Multi-threading parallel-based rapid loading method for SQLite database
  • Multi-threading parallel-based rapid loading method for SQLite database

Examples

Experimental program
Comparison scheme
Effect test

specific Embodiment approach 1

[0022] Specific embodiment one: a kind of SQLite database fast loading method based on multi-threaded parallelism, it is characterized in that: a kind of SQLite database fast loading method based on multithreaded parallelism is specifically carried out according to the following steps:

[0023] Step 1. In the process of loading the SQLite database, create the SQLite database to quickly load the main thread, and start the main thread to enter the working state; if the main thread fails to start, restart it;

[0024] Creating an SQLite database and quickly loading the main thread is achieved by calling the thread creation command in the process; SQLite is an open source embedded relational database;

[0025] like image 3 The SQLite database is quickly loaded into the running process of the main thread; firstly, in the main thread that has entered the working state, create a thread completion flag array with a length of N and a data type of Boolean, and name it M_Flag; the estab...

specific Embodiment approach 2

[0050] Specific embodiment two: the difference between this embodiment and specific embodiment one is: in the described step 4, obtain the size of the data table that needs to be loaded into the file of the SQLite database, and will need to load the data table N that the file of the SQLite database contains Equally divided and assigned to the N sub-threads created in the previous step SQLite database fast loading sub-threads to load data synchronously; the specific process is: run the sqlite3_get_table data table query function in the main thread to obtain all the data contained in the SQLite database file that needs to be loaded The size of the stored data table, where the total number of rows in the data table is set to Row, and the total number of columns is set to Col; at this time, the amount of loaded data is Row*Col; N sub-threads realize the synchronous loading of the database, so the total number of rows in the data table is N, etc. points, assigned to each sub-thread ...

Embodiment 1

[0054] The present invention is based on a multi-threaded parallel SQLite database fast loading method,

[0055] Load a SQLite database file named WLANRadiomap140821.db3 using the traditional loading method and the multi-threaded concurrency-based SQLite database fast loading method, and compare the performance by comparing the length of the loading time;

[0056] Using the Visual Studio 2008 development environment under the Windows platform, a class named Mydatabase is written based on the object-oriented C++ programming language, so as to realize the fast loading method of the SQLite database based on multi-threaded concurrency. Encapsulating this method in a class also effectively improves the convenience and portability of the method;

[0057] Step 1. In the process of loading the SQLite database, create the SQLite database to quickly load the main thread, and start the main thread to enter the working state; if the main thread fails to start, restart it;

[0058] First,...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to a multi-threading parallel-based rapid loading method for an SQLite database. The multi-threading parallel-based rapid loading method aims at solving the problem that data loading consumes a large amount of time in the prior art. The multi-threading parallel-based rapid loading method for the SQLite database specifically comprises the following steps: step one, in the process that the SQLite database needs to be loaded, creating a rapid loading main thread of the SQLite database, and starting the main thread to enter a working state; step two, establishing a loading completion identification array of N sub-threads; step three, creating rapid loading sub-threads for the SQLite database of the N sub-threads; step four, synchronously carrying out data loading; step five, starting the sub-threads from Load1 to LoadN; step six, when each thread is TRUE, ending the main thread. The multi-threading parallel-based rapid loading method is applied to the field of network communication.

Description

technical field [0001] The invention relates to a method for quickly loading an SQLite database based on multi-thread parallelism. Background technique [0002] The SQLite database is a file database designed based on relational types, and its design purpose is mainly used in embedded development. Because of its advantages of small operating space, low resource occupation, and simple installation and configuration, it is widely used in embedded device development, smart phone software development and other fields. [0003] SQLite database supports multiple development languages, such as C, C++, PHP, Perl, Java, C#, Python, Ruby, etc., which is convenient for users to develop personal applications according to actual needs. Different from some popular databases at this stage, SQLite databases and applications developed by individual users do not work in a client-server interaction mode. Instead, it forms a combination mode that connects the operation engine of the SQLite da...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
CPCG06F9/3818G06F16/284
Inventor 韩帅刘猛孟维晓邹德岳李毅张晗
Owner HARBIN INST OF TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products