CN101110088A - Database access interface method based on caching technology - Google Patents

Database access interface method based on caching technology Download PDF

Info

Publication number
CN101110088A
CN101110088A CNA2007101378192A CN200710137819A CN101110088A CN 101110088 A CN101110088 A CN 101110088A CN A2007101378192 A CNA2007101378192 A CN A2007101378192A CN 200710137819 A CN200710137819 A CN 200710137819A CN 101110088 A CN101110088 A CN 101110088A
Authority
CN
China
Prior art keywords
record
mutual exclusion
exclusion lock
reference counter
index
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CNA2007101378192A
Other languages
Chinese (zh)
Other versions
CN100472539C (en
Inventor
张宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ho whale cloud computing Polytron Technologies Inc
Original Assignee
Nanjing Zhongxing Ruanchuang Sci & Tech LLC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Zhongxing Ruanchuang Sci & Tech LLC filed Critical Nanjing Zhongxing Ruanchuang Sci & Tech LLC
Priority to CNB2007101378192A priority Critical patent/CN100472539C/en
Publication of CN101110088A publication Critical patent/CN101110088A/en
Application granted granted Critical
Publication of CN100472539C publication Critical patent/CN100472539C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a highly effective and simple cache mechanism method, which aims to resolve the problems of great pressure in database system and great occupation of mainframe resource by existing telecom equipments. The invention comprises: A. Acquire data transparently from the database; B. Transparent mechanism for writing back asynchronous data to the database. Therefore, the invention has the advantages that it can greatly alleviate the pressure in database system, improve the performance of application system and reduce the cost of application system.

Description

Database access interface method based on caching technology
Technical field
The present invention relates to a kind of database access technology, especially a kind of access method of the data that relate in the field of telecommunications frequent visit such as remaining sum in the charge system and revise, specifically a kind of database access interface method based on caching technology.
Background technology
At present, along with the development of software engineering, a large amount of uses of database technology, real-time requires more and more higher, at this moment software systems have been proposed very high requirement in the efficient of accessing database, high traffic can cause very big pressure to Database Systems when handling.Some solutions are arranged in this respect, as updating apparatus, use memory database technology.
Updating apparatus, the cost of raising application system greatly.And use memory database also to have following shortcoming:
One, memory database need carry out operations such as SQL syntax parsing as a universal product, does not have what necessity for specific application program, and influences treatment effeciency;
Two, for ageing some very strong data, memory database still needs one-writing system daily record, disk mirroring file, and the treatment effeciency of influence has also increased the weight of the burden of system.
Three and the price of memory database product higher, can cause the application software cost significantly to rise.
Summary of the invention
The objective of the invention is easily to cause taking the many problems of host resource, a kind of efficient simple and clear database access interface method based on caching technology is provided at the frequent access database.
Technical scheme of the present invention is:
A kind of database access interface method based on caching technology is characterized in that it may further comprise the steps:
The first step at first increases buffer memory in the middle of application program and database access, be used to deposit the index of setting up according to visit, preserves the pointer of data in this index or quotes;
In second step, access interface at first passes through the index search of foundation according to key word in buffer memory, and carries out following search operation:
If one finds corresponding record then carries out query manipulation successively, upgrades the operation of operation, deletion action and band release mark, wherein:
1. query manipulation comprises:
A) ask the mutual exclusion lock of this record,
B) then directly from shared drive, take out record and return,
C) reference counter is added 1,
D) discharge mutual exclusion lock;
2. upgrading operation comprises:
A) ask the mutual exclusion lock of this record,
B) data increment of revising is updated in the data field of shared drive,
C) reference counter is added 1,
D) discharge mutual exclusion lock;
3. deletion action comprises:
A) ask the mutual exclusion lock of this record,
B) reference counter is changed to-1,
C) upgrade index,
D) discharge mutual exclusion lock;
4. the operation of band release mark comprises:
A) ask the mutual exclusion lock of this record,
B) reference counter put subtracted 1,
C) if reference counter be 0 then carried out following d, e step, otherwise directly carry out the following f step,
D) reference counter is changed to-2,
E) upgrade index,
F) discharge mutual exclusion lock;
If two search less than corresponding record, then carry out according to the following steps:
1. accessing database takes out corresponding record,
2. seeking a reference counter in buffer memory is zero record position,
3. ask the mutual exclusion lock of this record,
4. record is left in the 2nd and goes on foot the position of finding,
5. renewal index,
6. release mutual exclusion lock,
7. according to the aforesaid step that finds corresponding record record is carried out requested operation.
The present invention has the following advantages:
By using band data in buffer storehouse access interface, the immense pressure of bringing to Database Systems in the time of can significantly reducing unstable data access.For example be used to keep the information of session in the telecommunication apparatus.Usually, in payment system, a session (user dials a phone) needs information such as inquiry/renewal user balance 4.5 times, by using present technique, can alleviate Database Systems pressure 55%.
Embodiment
The present invention is further illustrated below in conjunction with embodiment.
A kind of database access interface method based on caching technology is characterized in that it may further comprise the steps:
The first step at first increases buffer memory in the middle of application program and database access, be used to deposit the index of setting up according to visit, preserves the pointer of data in this index or quotes;
In second step, access interface at first passes through the index search of foundation according to key word in buffer memory, and carries out following search operation:
If one finds corresponding record then carries out query manipulation successively, upgrades the operation of operation, deletion action and band release mark, wherein:
1. query manipulation comprises:
A) ask the mutual exclusion lock of this record,
B) then directly from shared drive, take out record and return,
C) reference counter is added 1,
D) discharge mutual exclusion lock;
2. upgrading operation comprises:
A) ask the mutual exclusion lock of this record,
B) data increment of revising is updated in the data field of shared drive,
C) reference counter is added 1,
D) discharge mutual exclusion lock;
3. deletion action comprises:
A) ask the mutual exclusion lock of this record,
B) reference counter is changed to-1,
C) upgrade index,
D) discharge mutual exclusion lock;
4. the operation of band release mark comprises:
A) ask the mutual exclusion lock of this record,
B) reference counter put subtracted 1,
C) if reference counter be 0 then carried out following d, e step, otherwise directly carry out the following f step,
D) reference counter is changed to-2,
E) upgrade index,
F) discharge mutual exclusion lock;
If two search less than corresponding record, then carry out according to the following steps:
1. accessing database takes out corresponding record,
2. seeking a reference counter in buffer memory is zero record position,
3. ask the mutual exclusion lock of this record,
4. record is left in the 2nd and goes on foot the position of finding,
5. renewal index,
6. release mutual exclusion lock,
7. according to the aforesaid step that finds corresponding record record is carried out requested operation.
Specifically describe as follows:
A kind of database access interface method based on caching technology increases buffer memory in the middle of application program and database access.Application program is preferentially sought in buffer memory when asking visit data, is reading from database in the time of non-existent, and is saving the data in the buffer memory so that use next time.
The step of implementation procedure is::
A. the data structure of cache table
Set up the cache table structure according to concrete database table structure, and increase following extra field:
1. extra field 1 (reference counter): integer, write down the number of times that this record is employed program reference
2. extra field 2 (rowid): character string, write down this and be recorded in physical location (as the rowid of oracle) in the database
3. extra field 3 (semaphore): the ID of record mutual exclusion lock
B. cache management process
1. according to the preparation parameter, distribute the shared drive of fixed size, be used to deposit data cached
2. search the minus record of reference counter in the buffer memory, it is synchronized to database
A) the whole data cached district of traversal takes out the minus record of reference counter
B) ask the mutual exclusion lock of this record
C) this record is updated to database
D) reference counter is changed to 0
E) discharge mutual exclusion lock
3. already used space in the inspection buffer memory, when the record number reaches critical value, seek automatically reference counter numerical value minimum force to write database
C. buffer memory index
We provide two kinds of index for using according to the characteristic of index field, when application program is passed through band data in buffer bank interface visit data, need to specify the index that uses
1.T-Tree index is for not accelerating the seek rate of data by the T-Tree index by the record of unique keyword search
2.Hash index is for using the HASH index to accelerate the seek rate of data by the record of unique keyword search
D. the table in the application access database
1. band data in buffer storehouse access interface at first passes through index search according to key word in buffer memory
2. if find,
A) query manipulation
1). ask the mutual exclusion lock of this record
2). then directly from shared drive, take out record and return
3). reference counter is added 1
4). discharge mutual exclusion lock
B) upgrade operation
1). ask the mutual exclusion lock of this record
2). the data increment of revising is updated in the data field of shared drive
3). reference counter is added 1
4). discharge mutual exclusion lock
C) deletion action
1). ask the mutual exclusion lock of this record
2). reference counter is changed to-1
3). upgrade index (removing)
4). discharge mutual exclusion lock
D) operation (inquiry/renewal/deletion) of band release mark
1). ask the mutual exclusion lock of this record
2). reference counter put subtract 1
3) if. reference counter has been 0 then has carried out the 4th, 5 steps, otherwise directly carried out for the 6th step
4). reference counter is changed to-2
5). upgrade index (removing)
6). discharge mutual exclusion lock
3. if do not find,
A) accessing database then takes out corresponding record
B) seeking a reference counter in buffer memory is zero record position
C) ask the mutual exclusion lock of this record
D) leave record in b) position found of step
E) upgrade index (increase)
F) discharge mutual exclusion lock
G) according to the method for 2 steps record is carried out requested operation.

Claims (1)

1. database access interface method based on caching technology is characterized in that it may further comprise the steps:
The first step at first increases buffer memory in the middle of application program and database access, be used to deposit the index of setting up according to visit, preserves the pointer of data in this index or quotes;
In second step, access interface at first passes through the index search of foundation according to key word in buffer memory, and carries out following search operation:
If one finds corresponding record then carries out query manipulation successively, upgrades the operation of operation, deletion action and band release mark, wherein:
1. query manipulation comprises:
A) ask the mutual exclusion lock of this record,
B) then directly from shared drive, take out record and return,
C) reference counter is added 1,
D) discharge mutual exclusion lock;
2. upgrading operation comprises:
A) ask the mutual exclusion lock of this record,
B) data increment of revising is updated in the data field of shared drive,
C) reference counter is added 1,
D) discharge mutual exclusion lock;
3. deletion action comprises:
A) ask the mutual exclusion lock of this record,
B) reference counter is changed to-1,
C) upgrade index,
D) discharge mutual exclusion lock;
4. the operation of band release mark comprises:
A) ask the mutual exclusion lock of this record,
B) reference counter put subtracted 1,
C) if reference counter be 0 then carried out following d, e step, otherwise straight
Connect and carry out the following f step,
D) reference counter is changed to-2,
E) upgrade index,
F) discharge mutual exclusion lock;
If two search less than corresponding record, then carry out according to the following steps:
1. accessing database takes out corresponding record,
2. seeking a reference counter in buffer memory is zero record position,
3. ask the mutual exclusion lock of this record,
4. record is left in the 2nd and goes on foot the position of finding,
5. renewal index,
6. release mutual exclusion lock,
7. according to the aforesaid step that finds corresponding record record is carried out requested operation.
CNB2007101378192A 2007-04-17 2007-07-20 Database access interface method based on caching technology Active CN100472539C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2007101378192A CN100472539C (en) 2007-04-17 2007-07-20 Database access interface method based on caching technology

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN200710020894 2007-04-17
CN200710020894.0 2007-04-17
CNB2007101378192A CN100472539C (en) 2007-04-17 2007-07-20 Database access interface method based on caching technology

Publications (2)

Publication Number Publication Date
CN101110088A true CN101110088A (en) 2008-01-23
CN100472539C CN100472539C (en) 2009-03-25

Family

ID=39042156

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2007101378192A Active CN100472539C (en) 2007-04-17 2007-07-20 Database access interface method based on caching technology

Country Status (1)

Country Link
CN (1) CN100472539C (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591864A (en) * 2011-01-06 2012-07-18 上海银晨智能识别科技有限公司 Data updating method and device in comparison system
CN102609466A (en) * 2012-01-13 2012-07-25 广州从兴电子开发有限公司 Method and system for controlling shared memory
CN102708323A (en) * 2012-05-15 2012-10-03 中科方德软件有限公司 Method for preventing file object from being reused in safety operation system
CN102902730A (en) * 2012-09-10 2013-01-30 新浪网技术(中国)有限公司 Method and device for reading data based on data cache
CN102929943A (en) * 2012-09-28 2013-02-13 五八有限公司 Data output method and device
CN102004728B (en) * 2009-09-01 2013-03-27 三星电子(中国)研发中心 Method for storing and resetting cursor position of database
CN102117309B (en) * 2010-01-06 2013-04-17 卓望数码技术(深圳)有限公司 Data caching system and data query method
CN103188297A (en) * 2011-12-29 2013-07-03 北大方正集团有限公司 Method and system for storing and obtaining information
CN103631869A (en) * 2013-11-05 2014-03-12 北京奇虎科技有限公司 Method and device for releasing access pressure of server-side database
CN104021192A (en) * 2014-06-13 2014-09-03 北京联时空网络通信设备有限公司 Database renewing method and device
CN104216901A (en) * 2013-05-31 2014-12-17 北京新媒传信科技有限公司 Information searching method and system
CN105045789A (en) * 2015-02-15 2015-11-11 北京乐动卓越信息技术有限公司 Game server database buffer memory method and system
CN105608197A (en) * 2015-12-25 2016-05-25 Tcl集团股份有限公司 Method and system for obtaining Memcache data under high concurrency
CN106790115A (en) * 2016-12-27 2017-05-31 北京天融信网络安全技术有限公司 Nginx upstream agents service system and implementation method
CN103870511B (en) * 2012-12-18 2017-11-03 中国银联股份有限公司 Information inquiry device and method based on shared drive
CN107451252A (en) * 2017-07-30 2017-12-08 深圳有麦科技有限公司 Method for quickly querying and its system based on API
CN111026771A (en) * 2019-11-19 2020-04-17 拉货宝网络科技有限责任公司 Method for ensuring consistency of cache and database data

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102004728B (en) * 2009-09-01 2013-03-27 三星电子(中国)研发中心 Method for storing and resetting cursor position of database
CN102117309B (en) * 2010-01-06 2013-04-17 卓望数码技术(深圳)有限公司 Data caching system and data query method
CN102591864B (en) * 2011-01-06 2015-03-25 上海银晨智能识别科技有限公司 Data updating method and device in comparison system
CN102591864A (en) * 2011-01-06 2012-07-18 上海银晨智能识别科技有限公司 Data updating method and device in comparison system
CN103188297B (en) * 2011-12-29 2016-05-18 北大方正集团有限公司 A kind of message stores and acquisition methods and system
CN103188297A (en) * 2011-12-29 2013-07-03 北大方正集团有限公司 Method and system for storing and obtaining information
CN102609466A (en) * 2012-01-13 2012-07-25 广州从兴电子开发有限公司 Method and system for controlling shared memory
CN102609466B (en) * 2012-01-13 2014-12-24 从兴技术有限公司 Method and system for controlling shared memory
CN102708323A (en) * 2012-05-15 2012-10-03 中科方德软件有限公司 Method for preventing file object from being reused in safety operation system
CN102708323B (en) * 2012-05-15 2015-08-12 中科方德软件有限公司 The method of file object reuse is prevented in secure operating system
CN102902730A (en) * 2012-09-10 2013-01-30 新浪网技术(中国)有限公司 Method and device for reading data based on data cache
CN102902730B (en) * 2012-09-10 2016-04-20 新浪网技术(中国)有限公司 Based on data reading method and the device of data buffer storage
CN102929943A (en) * 2012-09-28 2013-02-13 五八有限公司 Data output method and device
CN102929943B (en) * 2012-09-28 2016-03-30 五八有限公司 data output method and device
CN103870511B (en) * 2012-12-18 2017-11-03 中国银联股份有限公司 Information inquiry device and method based on shared drive
CN104216901B (en) * 2013-05-31 2017-12-05 北京新媒传信科技有限公司 The method and system of information search
CN104216901A (en) * 2013-05-31 2014-12-17 北京新媒传信科技有限公司 Information searching method and system
CN103631869A (en) * 2013-11-05 2014-03-12 北京奇虎科技有限公司 Method and device for releasing access pressure of server-side database
CN103631869B (en) * 2013-11-05 2018-04-17 北京奇虎科技有限公司 A kind of method and apparatus for alleviating server-side database access pressure
CN104021192A (en) * 2014-06-13 2014-09-03 北京联时空网络通信设备有限公司 Database renewing method and device
CN105045789A (en) * 2015-02-15 2015-11-11 北京乐动卓越信息技术有限公司 Game server database buffer memory method and system
CN105608197A (en) * 2015-12-25 2016-05-25 Tcl集团股份有限公司 Method and system for obtaining Memcache data under high concurrency
CN105608197B (en) * 2015-12-25 2019-09-10 Tcl集团股份有限公司 The acquisition methods and system of Memcache data under a kind of high concurrent
CN106790115A (en) * 2016-12-27 2017-05-31 北京天融信网络安全技术有限公司 Nginx upstream agents service system and implementation method
CN106790115B (en) * 2016-12-27 2019-11-05 北京天融信网络安全技术有限公司 Nginx upstream agent service system and implementation method
CN107451252A (en) * 2017-07-30 2017-12-08 深圳有麦科技有限公司 Method for quickly querying and its system based on API
CN111026771A (en) * 2019-11-19 2020-04-17 拉货宝网络科技有限责任公司 Method for ensuring consistency of cache and database data
CN111026771B (en) * 2019-11-19 2023-11-07 拉货宝网络科技有限责任公司 Method for ensuring consistency of cache and database data

Also Published As

Publication number Publication date
CN100472539C (en) 2009-03-25

Similar Documents

Publication Publication Date Title
CN100472539C (en) Database access interface method based on caching technology
US11593337B2 (en) Data processing method, device, and a storage medium
US10853340B2 (en) Static sorted index replication
CN110799960B (en) System and method for database tenant migration
CN106575297B (en) High throughput data modification using blind update operations
US10067958B2 (en) Supporting transient snapshot with coordinated/uncoordinated commit protocol
US7451290B2 (en) Method and mechanism for on-line data compression and in-place updates
US9047330B2 (en) Index compression in databases
JP2022534215A (en) Hybrid indexing method, system and program
CN101499069A (en) Internal memory database file updating method and apparatus
US10430406B2 (en) Enhanced high performance real-time relational database system and methods for using same
WO2013144720A2 (en) Improved performance for large versioned databases
WO2012068110A1 (en) Safely transporting legacy data to an object semantic form data grid
EP3814930B1 (en) System and method for bulk removal of records in a database
CN107766374B (en) Optimization method and system for storage and reading of massive small files
US11599503B2 (en) Path name cache for notifications of file changes
CN104021145A (en) Mixed service concurrent access method and device
US8380663B2 (en) Data integrity in a database environment through background synchronization
CN109690522B (en) Data updating method and device based on B+ tree index and storage device
CN101042703A (en) Method for managing metadata of file system using dbms
CN110309233A (en) Method, apparatus, server and the storage medium of data storage
CN102314506A (en) Distributed buffer management method based on dynamic index
US20200241951A1 (en) Application crash analysis techniques when memory dump and debug symbols are not co-located
CN107704573A (en) A kind of intelligent buffer method coupled with business
CN102737082A (en) Method and system for dynamically updating file data indexes

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee

Owner name: NANJING ZTESOFT TECHNOLOGY CO., LTD.

Free format text: FORMER NAME: NANJING ZTESOFT TECHNOLOGY LIMITED LIABILITY COMPANY

CP01 Change in the name or title of a patent holder

Address after: 210012 Zhongxing building, No. 68, Bauhinia Road, Yuhuatai District, Nanjing, Jiangsu

Patentee after: Nanjing ZTEsoft Technology Co., Ltd.

Address before: 210012 Zhongxing building, No. 68, Bauhinia Road, Yuhuatai District, Nanjing, Jiangsu

Patentee before: Nanjing Zhongxing Ruanchuang Sci. & Tech. LLC

EE01 Entry into force of recordation of patent licensing contract

Assignee: Nanjing Zhongxing soft Creation Software Technology Co., Ltd.

Assignor: Nanjing ZTEsoft Technology Co., Ltd.

Contract record no.: 2010320001129

Denomination of invention: Database access interface method based on caching technology

Granted publication date: 20090325

License type: Exclusive License

Open date: 20080123

Record date: 20100915

C56 Change in the name or address of the patentee
CP01 Change in the name or title of a patent holder

Address after: 210012 Zhongxing building, No. 68, Bauhinia Road, Yuhuatai District, Nanjing, Jiangsu

Patentee after: ZTEsoft Technology Co., Ltd.

Address before: 210012 Zhongxing building, No. 68, Bauhinia Road, Yuhuatai District, Nanjing, Jiangsu

Patentee before: Nanjing ZTEsoft Technology Co., Ltd.

CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 210012 room 627, Ning Shuang Road, Yuhuatai District, Nanjing, Jiangsu, 627

Patentee after: Ho whale cloud computing Polytron Technologies Inc

Address before: 210012 Zhongxing building, No. 68, Bauhinia Road, Yuhuatai District, Nanjing, Jiangsu

Patentee before: ZTEsoft Technology Co., Ltd.