CN100495396C - Database access realizing method - Google Patents

Database access realizing method Download PDF

Info

Publication number
CN100495396C
CN100495396C CNB2006100581984A CN200610058198A CN100495396C CN 100495396 C CN100495396 C CN 100495396C CN B2006100581984 A CNB2006100581984 A CN B2006100581984A CN 200610058198 A CN200610058198 A CN 200610058198A CN 100495396 C CN100495396 C CN 100495396C
Authority
CN
China
Prior art keywords
data
database
hard disc
memory mirror
visit process
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.)
Expired - Fee Related
Application number
CNB2006100581984A
Other languages
Chinese (zh)
Other versions
CN1851711A (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.)
PLA Information Engineering University
Original Assignee
PLA Information Engineering University
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 PLA Information Engineering University filed Critical PLA Information Engineering University
Priority to CNB2006100581984A priority Critical patent/CN100495396C/en
Publication of CN1851711A publication Critical patent/CN1851711A/en
Application granted granted Critical
Publication of CN100495396C publication Critical patent/CN100495396C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present invented method includes mirror imaging the to be accessed data in data base from hard disk memory, data base accessing progress to proceed accessing operation to said data through memory mirror image data, according to memory mirror image data variation to proceed hard disk data synchronizing. The present invention can greatly raise access speed in current hardware condition, through setting writing synchronization zone to memory mirror image data, supporting bidirectional data accessing, avoiding possible data write operation collision, realizing flexible accessing to memory mirror image data.

Description

The implementation method of database access
Technical field
The present invention relates to computer database system, relate in particular to a kind of implementation method of database access and use SCP (Service Control Point, the service control point) server of this method.
Background technology
In the middle-size and small-size increment service system that telecom operators provide, be included as the accounting card service that the user provides.After opening accounting card service, dial access code on any phone of user in telecom operators' network, input record keeping card number, password behind purview certification, just can be called, and cost of the phone call is deducted from credit card in real time.
Network side in operator to accounting card service, is deposited business datums such as record keeping card number, password, telephone expenses remaining sum, the term of validity on SCP.As SSP (Service Switch Point, Service Switching Point) information such as the record keeping card number that the user is imported, password are submitted among the SCP, by SCP the validity of card number is checked, password in SCP checking card number correspondence is correct, telephone expenses still have remaining sum and when surpassing the term of validity as yet, think that this user passes through purview certification, indication SSP plays voice, and the prompting user can call.
The inquiry of the business datum of credit card and modification all realize in the database server of SCP.The SCP server adopts PC (Personal Computer usually, personal computer) server, because the processing power problem of PC server, when the business datum of credit card is increased to a certain degree, considerable time need be expended to access of database, the user is not felt well, when serious even can cause system unavailable because of wait.
Usually adopt following several method to improve the access speed in Large Volume Data storehouse in the prior art:
The first is selected more excellent Database Systems; This method need be changed the database server that adapts with high performance Database Systems, and cost is very high;
Its two recall precision that is to use the view that can compile in advance and optimize and storing process to improve database; This method is subject to its processing power on the PC server, be difficult to obtain obvious effects, still needs to use simultaneously with high performance server to improve access efficiency;
It three is the time to avoid using image (image), the text big fields of data volume such as (texts) in the table design of carrying out database, and the form of these data with file left on the file server, in database, only place access path, bear the input and output service of these files by file server associated documents; Making needs to dispose special file server in this way, and cost is higher.
As seen, all need interpolation or replacing hardware to improve access of database speed in the prior art.
Summary of the invention
The present invention will solve is to improve access of database speed in the prior art need improve hardware and cause the too high problem of cost.
The implementation method of database access of the present invention may further comprise the steps:
In data to be visited in the database were from the hard disk mirror-image to the internal memory, described data to be visited comprised at least one table;
The database access process is carried out accessing operation to described data by the memory mirror data, and described database access process comprises internal storage data visit process and hard disc data visit process, and described accessing operation comprises:
Write the synchronization zone for the memory mirror data are provided with in internal memory, be specially to being write synchronization field by field setting in the table of hard disc data visit process modification;
When described internal storage data visit process is visited described memory mirror data, directly the internal memory mirror image data is carried out read-write operation by internal storage data visit process, according to the variation of memory mirror data carry out hard disc data synchronously;
When described hard disc data visit process is carried out write operation to described memory mirror data, carry out following steps: hard disc data visit process will write the synchronization zone to the change indication of internal memory mirror image data, be specially the synchronization field of writing that hard disc data visit process writes the change indication of data in the his-and-hers watches this data place list item; Internal storage data visit process is indicated the write operation that carries out the memory mirror data according to the change of writing in the synchronization zone, be specially internal storage data visit process writes change indication in writing synchronization field after, carry out the write operation of its place list item corresponding data according to the change indication, remove this change indication afterwards, carry out the synchronous of hard disc data according to the variation of memory mirror data;
When described hard disc data visit process was carried out the read operation of database, it carried out read operation to database by hard disc data.
Preferably, described database is the accounting card service database; Comprise credit card card number field in the described table, the credit card card number of each list item has identical eigenwert in each table.
Preferably, described method is also comprising after will be during data to be visited are from the hard disk mirror-image to the internal memory: with the cryptographic hash of the credit card card number memory mirror data as each table of index organization.
Preferably, described method also comprises before operation that the credit card data of database is conducted interviews: determine that according to the eigenwert of credit card card number a table is as the object of carrying out accessing operation.
Preferably, described credit card card number generates according to pseudo-random algorithm, has the eigenwert that is evenly distributed.
Preferably, described table also comprises password field and remaining sum field, is used for storing the password and the remaining sum of credit card respectively.
The present invention will by the frequent access data by hard disk mirror-image to internal memory, finish the visit of these data by internal memory rather than hard disk, simultaneously data variation is synchronized in the hard disk in real time, under existing hardware condition, greatly improved access speed;
Further, the present invention is by writing the synchronization zone for the setting of memory mirror data, hard disc data visit process can only be made amendment to the internal memory mirror image data by the internal storage data process of visiting, and has avoided possible data write operation conflict, has realized the flexible visit to the internal memory mirror image data.
Description of drawings
Fig. 1 is the process flow diagram of database access implementation method of the present invention;
Fig. 2 is the process flow diagram that database access implementation method of the present invention is used example.
Embodiment
The client that database is conducted interviews, as the credit card user, the time-delay during to operation is more responsive, need obtain the answer of system as early as possible, and when more new database is then and be indifferent to system.DBMS (DataBase Manage System, data base management system (DBMS)) in internal memory, offers the data buffer, be used for depositing current accessed data, the data that will visit when the database access process are not in buffer zone the time, and DBMS need call in buffer zone with it from hard disk.That is to say, if the data of client-access in internal memory, just can obtain the result very soon, and if not in internal memory, will need the long period.
Therefore, can keep the mirror image of the process institute visit data of delay sensitive in internal memory, these processes are finished the database accessing operation by the memory mirror data, and client can obtain visiting the result in a short period of time like this; Simultaneously, the modification of these processes to the internal memory mirror image data is synchronized in the hard disk in real time, to keep the integrality of data.
If in addition the insensitive process of time delay is also needed to visit identical data simultaneously, both access memory mirror image datas equally, also can the access hard disk data so that guarantee the response time of delay sensitive process better.And the operation that conducts interviews may cause access conflict to the internal memory mirror image data with to hard disc data respectively by different processes, thereby can only the data that are mirrored in the internal memory be made amendment, again the result who revises synchronously.
To be referred to as internal storage data visit process by the process that the memory mirror data are carried out database access herein, will visit the process that is mirrored to the data in the internal memory by hard disk and be called hard disc data visit process.
The flow process of database access implementation method of the present invention as shown in Figure 1.At step S110, the data image that the internal storage data process of visiting is visited is in internal memory.Being mirrored to data in the internal memory and can being all data in the database, also can be partial data.
If there is hard disc data visit process need visit the data of mirror image simultaneously, execution in step S120 writes the synchronization zone for the setting of memory mirror data in internal memory.Writing the synchronization zone is one section address space by internal storage data visit process and the common use of hard disc data visit process in the internal memory, is used for avoiding possible data write operation conflict.
When internal storage data visit process visit data, execution in step S130 directly carries out read-write operation to the internal memory mirror image data, changes step S170.
When hard disc data visit process is carried out write operation to mirror image data, can not directly revise the data in the hard disk, but execution in step S140 will write the synchronization zone to the change indication of internal memory mirror image data.The realization of change indication can be determined according to concrete applicable cases by the user, for example, can according to the mode that is similar to executable statement can locate the data that will change information, how to change and write the synchronization zone, adopt writing the synchronization zone and only need taking quite few address space and just can realize unidirectional write operation of this method for lot of data; For another example, the synchronization zone of writing of a special use can also be set for each data that needs simultaneously carry out write operation by hard disc data visit process and internal storage data visit process, then hard disc data visit process only needs to write the information how to change in the synchronization zone writing of this special use and get final product, this method bigger address space of needs but can improve the efficient of write operation.
At step S150, internal storage data visit process is carried out the write operation of memory mirror data according to the change indication of writing the synchronization zone.After writing the synchronization zone and having write change indication, internal storage data visit process is made corresponding modification according to the change indication to corresponding memory mirror data, changes step S170.
At step S160, when hard disc data visit process was carried out read operation, execution in step S160 directly carried out read operation by hard disc data.
At step S170, when the memory mirror data change, the variation of memory mirror data is synchronized on the hard disk.
To not comprising the applicable cases of hard disc data visit process, step S140, S150 and S160 can omit.If being mirrored in the internal memory is the part of database, identical to the visit of not carrying out the mirror image part with implementation method of the prior art, repeat no more herein.
Below to be example to the accounting card service access of database in the telecom value-added service system, concrete application of the present invention is described.In the accounting card service system, the database access operation directly related with the user all carried out with internal storage data visit process, to guarantee the response time that other and access of database operation are carried out with hard disc data visit process.
The flow process of accounting card service database access implementation method as shown in Figure 2.At step S201, generate the credit card card number according to pseudo-random algorithm, the condition of selecting pseudo-random algorithm is to make the card number that generates at random have the eigenwert that is evenly distributed.Consider the convenience of visit accounting card service database, a part of preferably selecting card number or card number is as eigenwert, for example, with the position, end of card number as eigenwert, the accounting card service database can be split as 10 tables, correspond respectively to 0 to 9 of position, credit card card number end.
At step S202, the accounting card service database is divided at least two tables according to eigenwert.Like this, when accessing database, can be the different table of index accesses, thereby improve the speed of data query with the eigenwert.
At step S203, with needing to be mirrored in the internal memory in each table or each table by the part of internal storage data visit process visit, comprising credit card card number field, and password field and remaining sum field.
At step S204, be the memory mirror data of each table of index organization with the cryptographic hash of credit card card number.Cryptographic hash with certain field in the table is that index is realized the existing in the prior art multiple implementation method of the fast query of list item is repeated no more among the present invention.
Be example as the situation of eigenwert still, in internal memory, set up the data that 10 Hash tables are deposited 10 tables of accounting card service database with card number end position, with the data image of 10 tables in internal memory, with the data addressing in the card number his-and-hers watches.
At step S205, for synchronization field is write in field setting in the table that needs in the memory mirror data to be revised by hard disc data visit process.Each writes synchronization field corresponding to the field that need be revised by hard disc data visit process in the same table.
At step S206, when visit accounting card service database, no matter by internal storage data visit process still by hard disc data visit process, be that index determines that a table is as the object operation that conducts interviews according to the eigenwert of credit card card number earlier all.
To internal storage data visit process, execution in step S207 is that data in the index his-and-hers watches are carried out read-write operation with the cryptographic hash of credit card card number, changes step S211.
To the write operation of hard disc data visit process, execution in step S208, hard disc data visit process writes the change indication of data in the his-and-hers watches synchronization field of writing of this data place list item with the data that the credit card card number is an index search in the table.Because the synchronization field of writing of each list item all has field in the table corresponding with it, hard disc data visit process only needs change indicated and write this and write synchronization field and get final product.
At step S209, internal storage data visit process is revised data field corresponding in this list item according to changing indication and writing the synchronization field that change is indicated, and removes this change indication after the data field modification is finished; Change step S211 afterwards.
To the read operation of hard disc data visit process, execution in step S210 is that index carries out read operation to each table on the hard disk with the credit card card number.
At step S211,, it is synchronized in the table corresponding on the hard disk the variation that takes place in the internal memory mirror image data.
Like this, the user is undertaken by the table of memory mirror accounting card service access of database operation, and these accessing operations comprise that the accounting card service system carries out purview certification and inquiry into balance to the user, and the visit directly carried out of user.When user's modification password or talk-through query the balance because the memory mirror data are directly upgraded by internal storage data visit process, therefore the user can be conversed without delay, again can real time perception to the variation of telephone expenses remaining sum or password.
In the present invention, the credit card data are divided into a plurality of tables according to eigenwert, to data library inquiry and renewal the time, can directly navigate on the concrete little table, thereby improve the access speed in Large Volume Data storehouse; Set up data image in internal memory, the delay when making low configuration PC Server visit Large Volume Data storehouse reduces system's construction cost to user transparent; Internal memory mirror image data and hard disc data are carried out synchronously, can guarantee the consistent of internal storage data and hard disc data, and can carry out on the backstage synchronously, improve utilization ratio greatly low-cost PC Server; By the sync direction of internal memory, can avoid the operating collision of internal storage data and hard disc data by fields specify in the his-and-hers watches to hard disk; Hardware configuration is required low, make common PCServer can be competent at the work that minicomputer is generally finished.
After using the present invention, 1,000 ten thousand credit card data on the PC Server of identical configuration are inquired about, can with query time by second level bring up to Millisecond.
Above-described embodiment of the present invention does not constitute the qualification to protection domain of the present invention.Any any modification of being done within the spirit and principles in the present invention, be equal to and replace and improvement etc., all should be included within the claim protection domain of the present invention.

Claims (6)

1. the implementation method of a database access is characterized in that, may further comprise the steps:
In data to be visited in the database were from the hard disk mirror-image to the internal memory, described data to be visited comprised at least one table;
The database access process is carried out accessing operation to described data by the memory mirror data, and described database access process comprises internal storage data visit process and hard disc data visit process, and described accessing operation comprises:
Write the synchronization zone for the memory mirror data are provided with in internal memory, be specially to being write synchronization field by field setting in the table of hard disc data visit process modification;
When described internal storage data visit process is visited described memory mirror data, directly the internal memory mirror image data is carried out read-write operation by internal storage data visit process, according to the variation of memory mirror data carry out hard disc data synchronously;
When described hard disc data visit process is carried out write operation to described memory mirror data, carry out following steps: hard disc data visit process will write the synchronization zone to the change indication of internal memory mirror image data, be specially the synchronization field of writing that hard disc data visit process writes the change indication of data in the his-and-hers watches this data place list item; Internal storage data visit process is indicated the write operation that carries out the memory mirror data according to the change of writing in the synchronization zone, be specially internal storage data visit process writes change indication in writing synchronization field after, carry out the write operation of its place list item corresponding data according to the change indication, remove this change indication afterwards, carry out the synchronous of hard disc data according to the variation of memory mirror data;
When described hard disc data visit process was carried out the read operation of database, it carried out read operation to database by hard disc data.
2. the implementation method of database access according to claim 1, it is characterized in that: described database is the accounting card service database; Comprise credit card card number field in the described table, the credit card card number of each list item has identical eigenwert in each table.
3. as the implementation method of database access as described in the claim 2, it is characterized in that described method is also comprising after will be during data to be visited are from the hard disk mirror-image to the internal memory: with the cryptographic hash of credit card card number memory mirror data as each table of index organization.
4. as the implementation method of database access as described in the claim 2, it is characterized in that described method also comprises before operation that the credit card data of database is conducted interviews: determine that according to the eigenwert of credit card card number a table is as the object of carrying out accessing operation.
5. as the implementation method of database access as described in the claim 2, it is characterized in that: described credit card card number generates according to pseudo-random algorithm, has the eigenwert that is evenly distributed.
6. as the implementation method of database access as described in the claim 2, it is characterized in that: described table also comprises password field and remaining sum field, is used for storing the password and the remaining sum of credit card respectively.
CNB2006100581984A 2006-03-10 2006-03-10 Database access realizing method Expired - Fee Related CN100495396C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100581984A CN100495396C (en) 2006-03-10 2006-03-10 Database access realizing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100581984A CN100495396C (en) 2006-03-10 2006-03-10 Database access realizing method

Publications (2)

Publication Number Publication Date
CN1851711A CN1851711A (en) 2006-10-25
CN100495396C true CN100495396C (en) 2009-06-03

Family

ID=37133190

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100581984A Expired - Fee Related CN100495396C (en) 2006-03-10 2006-03-10 Database access realizing method

Country Status (1)

Country Link
CN (1) CN100495396C (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101847162B (en) * 2010-05-25 2013-03-27 中国电力科学研究院 Electric system simulation centre data processing method based on file and database exchange
CN102945251A (en) * 2012-10-12 2013-02-27 浪潮电子信息产业股份有限公司 Method for optimizing performance of disk database by memory database technology
CN102981829B (en) * 2012-11-01 2015-10-21 宁波电业局 A kind of graph data exhibiting method based on Outage Management Systems and device
CN105825371A (en) 2015-01-07 2016-08-03 阿里巴巴集团控股有限公司 Method and device for processing service

Also Published As

Publication number Publication date
CN1851711A (en) 2006-10-25

Similar Documents

Publication Publication Date Title
CN108874971B (en) Tool and method applied to mass tagged entity data storage
CN100334583C (en) Smart card enabled mobile personal computing environment system
CN101477516B (en) Electronic data processing method and system
CN103902623A (en) Method and system for accessing files on a storage system
CN102982130A (en) Synchronized method for not only structured query language (NOSQL) and relational database management system (RDBMS) database and system thereof
CN104750740A (en) Data renewing method and device
CN106934048A (en) Online data moving method, agent node
CN109542907A (en) Database caches construction method, device, computer equipment and storage medium
CN100495396C (en) Database access realizing method
CN109271449A (en) A kind of distributed storage inquiry system file-based and querying method
CN109358874B (en) Business rule updating method, business rule updating device, computer equipment and storage medium
CN108319608A (en) The method, apparatus and system of access log storage inquiry
CN101576854A (en) File access method, device and system
CN108269131A (en) A kind of user information based on ASCII character is registered method and device
CN109241057B (en) Digital ID generation method for distributed system
WO2022009162A1 (en) Archiving accelerator-only database tables
KR100365261B1 (en) Web drive system
KR20120082176A (en) Data processing method of database management system and system thereof
CN109558082B (en) Distributed file system
CN104394518A (en) Short message sending method and short message platform
CN111026755A (en) Transaction serial number obtaining method and device based on full-quantity serial number generator
CN114185934B (en) Indexing and query method and system based on Tiandun database column storage
CN100454844C (en) Method of increment synchronization for multipoint restoring software environment of computer room
CN102722543A (en) Method for storing files
JP3769775B2 (en) Distributed link information maintenance method

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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090603

Termination date: 20160310