Method of securely accessing sqlite by multiple processes

A secure access, multi-process technology, applied in the field of multi-process secure access to sqlite, can solve problems such as high system overhead, long time consumption, and no database access type distinction, to avoid receiving confusion, high-performance access efficiency, and ensure orderliness. Effectiveness

Inactive Publication Date: 2018-12-18
北京天地和兴科技有限公司
View PDF6 Cites 10 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] 1. This method uses inter-process file locks. When the number of accesses is large, the lock competition will be very fierce, and the system overhead will become very large, causing the system to run very slowly or even crash
[0006] 2. This method does not distinguish the access types of the database, and cannot achieve the priority distinction of database operations. At the same time, it does not treat the same type of operations of the database as a transaction, resulting in low efficiency of database operations.
[0007] 3. If a database operation takes a long time, other database operations need to wait all the time, resulting in the system not being able to continue to run and making full use of resources

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
  • Method of securely accessing sqlite by multiple processes
  • Method of securely accessing sqlite by multiple processes
  • Method of securely accessing sqlite by multiple processes

Examples

Experimental program
Comparison scheme
Effect test

specific Embodiment approach

[0048] refer to Figure 1-4 , a specific embodiment of the present invention comprises the following steps:

[0049] A. The access to the database is divided into read thread, write thread and file thread;

[0050] Before accessing the database, the process described in B, step A queries the state of the database lock. If the database is locked, the thread preparing to access the database is in a waiting state. After the lock is released, the thread preparing to access the database acquires the control of the lock right to operate the database;

[0051] C. The above-mentioned threads adopt the first-come-first-served principle to acquire the lock. After the thread completes the operation on the database, the lock is released, and other threads acquire the lock state at this time and then operate on the database.

[0052] Add a random code before each database operation statement, and the server returns the result with this random code. If the random code corresponds, the ret...

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 discloses a method for accessing sqlite safely by multiple processes, which comprises the following steps: A, accessing of a database is divided into a read thread, a write thread and afile thread; B, the process in the step A queries the state of the database lock before accessing the database, if the database is locked, the thread preparing to access the database is in a waiting state, and after the lock is released, the thread preparing to access the database obtains the control right of the lock to operate on the database; C, the thread adopts the first-come-first-served principle to obtain the locks, after the operation of the thread to the database is completed, the locks are released, other thread obtains the lock state at this time and then operates on the database.The invention can improve the shortage of the prior art, creates an independent database access channel, solves the problem of concurrent access of the database, and avoids the situation that the database lock cannot be accessed.

Description

technical field [0001] The invention relates to the technical field of databases, in particular to a method for multi-process safe access to sqlite. Background technique [0002] SQLite, a lightweight database, is an ACID-compliant relational database management system contained in a relatively small C library. It is a public domain project established by D. Richard Hipp. Its design target is embedded, and it has been used in many embedded products. It occupies very low resources. In embedded devices, only a few hundred K of memory may be enough. Unlike the common client-server paradigm, the SQLite engine is not a separate process that the program communicates with, but is instead linked into the program as an integral part of it. So the main communication protocol is direct API calls within the programming language. This has a positive effect on total consumption, latency and overall simplicity. The entire database (definitions, tables, indexes, and the data itself) is ...

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
Inventor 王小东熊传宇
Owner 北京天地和兴科技有限公司
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