CN1858745A - Processing method for realizing consistency of internal storage data and data bank data service - Google Patents
Processing method for realizing consistency of internal storage data and data bank data service Download PDFInfo
- Publication number
- CN1858745A CN1858745A CN 200610066383 CN200610066383A CN1858745A CN 1858745 A CN1858745 A CN 1858745A CN 200610066383 CN200610066383 CN 200610066383 CN 200610066383 A CN200610066383 A CN 200610066383A CN 1858745 A CN1858745 A CN 1858745A
- Authority
- CN
- China
- Prior art keywords
- data
- database
- internal memory
- transaction
- issued transaction
- 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
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
This invention relates to a consistant process method for events of memory data and database data including: 1, when the memory and the database begin the envent, the event process objects of them are locked, 2, generating an exclusive event flow number of this time to register the number and the event kind in their journals, 3, processing the data of the events in the memory and registering the changing journal of the memory, 4, utilizing the memory data to refresh data of the database, 5, registering the successful process of this event and releasing the locks of the objects of event of the database, 6, releasing the lock of the process object of the memory.
Description
Technical field
The present invention relates to a kind of method of internal storage data issued transaction, when the uncontrollable abnormal conditions of application program especially take place, still can keep the method for the transactional integrity of internal storage data automatically.
Background technology
For database application system large-scale and that real-time is had relatively high expectations, in the processing procedure of data, utilize shared drive data cached, to quicken business processing speed.Because internal memory is compared the outer huge advantage that has aspect such as access speed such as hard disk, adopts the memory cache technology can greatly improve business processing speed.This disposal route requires in the processing procedure of db transaction, and data will keep consistency in data in the internal memory and the database.
The disposal route of present existing realization internal storage data and database data consistent affairs is as follows: internal memory and database all begin affairs; The application access internal storage data, the data in the updating memory, and record data change daily record in internal memory; After the data in the internal memory are finished business processing, utilize internal storage data to upgrade database data; After the database data renewal is finished, submit db transaction to; Clear up internal memory change daily record then, and submit internal storage data to.
In said process, application program detects to be handled when making a mistake, and at first carries out the rollback of db transaction, utilizes internal memory change daily record rollback internal storage data again, guarantees the integrality of affairs.
The shortcoming of prior art:
In the prior art, affairs are controlled by application program fully, take place to use controlledly when unusual, affairs can be guaranteed preferably, but take place to use uncontrollable when unusual, stopped by force as process etc., have no chance to carry out abnormality processing owing to use, cause the asynchronous of internal memory and database data, and application program self is not understood the performance of db transaction, be difficult to unusual automatic processing, generally need manual intervention to recover the synchronous of internal memory and database data.If using is the middle layer service of multilayer system, because affairs usually by client control, can't make internal memory and database that recovery internal storage data automatically takes place when asynchronous.
Summary of the invention
The objective of the invention is deficiency at the disposal route existence that realizes internal storage data and database data consistent affairs in the above-mentioned prior art, a kind of disposal route that realizes internal storage data and database data consistent affairs is provided, lock by issued transaction object in the issued transaction process to internal memory and database, and the serial number of record issued transaction, make in that application program takes place is uncontrollable when unusual, can be according to the performance of db transaction, recover the data in the internal memory automatically, keep the consistance of internal storage data and database data.
In order to realize the foregoing invention purpose, the invention provides a kind of disposal route that realizes internal storage data and database data consistent affairs, comprise the steps:
Step 1, when internal memory and database during in the beginning affairs, the issued transaction object of internal memory and database is locked;
Step 2, generate unique affairs serial number of these affairs, this serial number and transaction types are recorded in the transaction journal of internal memory and database;
Step 3, the data in the internal memory are carried out issued transaction, and record internal memory change daily record;
Step 4, when finish the data in the internal memory are carried out issued transaction after, utilize internal storage data to upgrade database data;
Step 5, when database data upgrade finish after, minute book secondary data storehouse issued transaction success in the transaction journal of database, and remove the lock of db transaction process object;
The lock of step 6, releasing internal memory issued transaction object.
By method provided by the invention, internal storage data and database data are kept synchronously, simplify the programming complexity of utilizing internal memory to accelerate the application program of business processing speed, can also when unusual the generation, recover internal storage data automatically by application program, especially in that application program takes place is uncontrollable when unusual, keep the consistance of internal storage data and database data.
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
Description of drawings
Fig. 1 is the process flow diagram of specific embodiment of the disposal route of realization internal storage data of the present invention and database data consistent affairs.
Embodiment
Internal storage data derives from database table, and visit and control for the ease of internal storage data are divided into key assignments table and tables of data by data type.The key assignments table is deposited the key message of business object, as the savings number of the account of banking system, the user number of telecom operation system etc.For accelerating key assignments table access speed, key assignments table organization can be become structures such as balanced binary tree, Hash table, key tree.Tables of data is deposited the Various types of data of business object correspondence, but by key assignments table fast access related data.
The key assignments table is as follows:
Sequence number | Title | Explanation |
1 | Key assignments | The key value of transaction object |
2 | Sign locks | Represent whether this memory object is locked, provide the row level to add lock function, be convenient to the concurrent visit of a plurality of processes and unify the piece internal storage data.Be to guarantee to lock and the integrality of release visit, the sign that locks read and change the atomic manipulation method that should use operating system to provide. |
3 | Transaction types | Current type of accepting affairs |
4 | The affairs serial number | Each affairs are accepted the generation unique serial number |
5 | The affairs handling time | |
6 | Tables of data 1 index | Locator data |
7 | Tables of data 2 index | Locator data |
Data list structure is decided according to concrete storage data, can be organized into unidirectional or doubly linked list.
Referring to Fig. 1, it is the process flow diagram of specific embodiment of the disposal route of realization internal storage data of the present invention and database data consistent affairs, comprises the steps:
The lock of step 106, releasing internal memory issued transaction object.Behind the lock of removing internal memory issued transaction object, can also comprise the operation of cleaning internal memory change daily record.
If in the process of above-mentioned issued transaction, in the controlled scope of application program, take place unusual, as upgrade failed database etc., then memory applications is recovered data in the internal memory according to internal storage data change daily record, and utilizes db transaction rollback mechanism restore data database data.
If in application program the unknown or uncontrollable scope, take place unusual, stopped by force as process etc., accept business once more when this issued transaction object and to handle and when locking, if to the failure that locks of the issued transaction object of database, expression issued transaction object is by other issued transaction, waits for then behind the certain hour that retry locks or reports locking failure to return.Issued transaction is then proceeded in the retry success that locks.
The failure if the issued transaction object of internal memory locks, then utilize the last transaction type and the affairs serial number that write down in the internal memory, the daily record that Query Database business diary last transaction is handled, whether the issued transaction of judging database last time is successful, if last time, the issued transaction of database was successful, represent that then last time, the internal storage data processing completed successfully, internal memory issued transaction object is locked again, proceed issued transaction then; If last time, db transaction was handled failure, then represent data in EMS memory have with database in the inconsistent possibility of data, utilize the data in the data recovery internal memory in the database, the issued transaction object to described internal memory after recovering locks again, proceeds issued transaction.
The present invention has following beneficial effect:
Reduce internal memory necessary in the prior art and submitted step to, guaranteed the consistance of internal memory and database data.And can be when unusual the generation, by memory applications isochronous memory and data of database again automatically, especially, keep the consistance of internal storage data and database data in that application program takes place is uncontrollable when unusual.And other utilize the application program of memory applications to need not the internal memory affairs are carried out any additional treatments, thereby realize the transparent management of internal memory affairs, have expanded the suitable application area of memory cache technology.
It should be noted last that, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although the present invention is had been described in detail with reference to preferred embodiment, those of ordinary skill in the art is to be understood that, can make amendment or be equal to replacement technical scheme of the present invention, and not break away from the spirit and scope of technical solution of the present invention.
Claims (5)
1, a kind of disposal route that realizes internal storage data and database data consistent affairs is characterized in that comprising the steps:
Step 1, when internal memory and database during in the beginning affairs, the issued transaction object of internal memory and database is locked;
Step 2, generate unique affairs serial number of these affairs, this serial number and transaction types are recorded in the transaction journal of internal memory and database;
Step 3, the data in the internal memory are carried out issued transaction, and record internal memory change daily record;
Step 4, when finish the data in the internal memory are carried out issued transaction after, utilize internal storage data to upgrade database data;
Step 5, when database data upgrade finish after, minute book secondary data storehouse issued transaction success in the transaction journal of database, and remove the lock of db transaction process object;
The lock of step 6, releasing internal memory issued transaction object.
2, method according to claim 1 is characterized in that in described step 6, also comprises the operation of cleaning internal memory change daily record behind the lock of removing internal memory issued transaction object.
3, method according to claim 1, it is characterized in that if in the process of issued transaction, in the controlled scope of application program, take place unusually,, and utilize db transaction rollback mechanism restore data database data then according to the data in the internal storage data change daily record recovery internal memory.
4, method according to claim 1 is characterized in that if to the failure that locks of the issued transaction object of database, waits for that then the back retry locks or reports locking failure to return.
5, method according to claim 1, it is characterized in that in described step 1, the failure if the issued transaction object of internal memory locks, then utilize the last transaction type and the affairs serial number that write down in the internal memory, the whether success of issued transaction of database last time is judged in the daily record that Query Database business diary last transaction is handled, if last time database issued transaction successfully, then the issued transaction object to described internal memory locks again, proceeds issued transaction then; If last time, db transaction was handled failure, then utilize the data in the data recovery internal memory in the database, the issued transaction object to described internal memory after recovering locks again, proceeds issued transaction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100663838A CN100365632C (en) | 2006-04-05 | 2006-04-05 | Processing method for realizing consistency of internal storage data and data bank data service |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100663838A CN100365632C (en) | 2006-04-05 | 2006-04-05 | Processing method for realizing consistency of internal storage data and data bank data service |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1858745A true CN1858745A (en) | 2006-11-08 |
CN100365632C CN100365632C (en) | 2008-01-30 |
Family
ID=37297654
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2006100663838A Active CN100365632C (en) | 2006-04-05 | 2006-04-05 | Processing method for realizing consistency of internal storage data and data bank data service |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100365632C (en) |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101136783B (en) * | 2007-10-15 | 2010-06-02 | 中兴通讯股份有限公司 | Backup, recovery method and apparatus for network management system to configure data |
CN101089857B (en) * | 2007-07-24 | 2011-05-11 | 中兴通讯股份有限公司 | Internal store data base transaction method and system |
CN101364217B (en) * | 2007-08-08 | 2011-06-22 | 华为技术有限公司 | Data maintenance method, equipment and system thereof in data-base |
CN102156928A (en) * | 2011-04-29 | 2011-08-17 | 浪潮通信信息系统有限公司 | Method for system concurrency control through business logic lock |
CN101699412B (en) * | 2009-10-15 | 2012-02-22 | 清华大学 | Computer transaction memory method |
CN102375892A (en) * | 2011-11-16 | 2012-03-14 | 北京握奇数据系统有限公司 | Large-capacity database card and office management method thereof, and system |
CN102693520A (en) * | 2011-03-24 | 2012-09-26 | 苏州乐盈科技有限公司 | Lottery bet method based on short message |
CN102779138A (en) * | 2011-05-13 | 2012-11-14 | 上海振华重工(集团)股份有限公司 | Hard disk access method of real time data |
CN103034636A (en) * | 2011-09-29 | 2013-04-10 | 盛乐信息技术(上海)有限公司 | Roll-back method, device and system of non relational database |
CN103186564A (en) * | 2011-12-28 | 2013-07-03 | 深圳市金蝶中间件有限公司 | Data object processing method and system |
CN103514164A (en) * | 2012-06-15 | 2014-01-15 | 阿里巴巴集团控股有限公司 | Data migration method and system |
CN104008133A (en) * | 2014-05-06 | 2014-08-27 | 烽火通信科技股份有限公司 | Row-level locking set achieving device and method based on collision detecting |
CN104750703A (en) * | 2013-12-26 | 2015-07-01 | 中国移动通信集团天津有限公司 | Method and device for improving data accuracy |
CN105426410A (en) * | 2015-11-02 | 2016-03-23 | 东软集团股份有限公司 | Data acquisition system and analytic method for same |
CN106446037A (en) * | 2016-08-31 | 2017-02-22 | 南威软件股份有限公司 | Method for realizing consistency of Redis and MYSQL data based on distributed lock |
CN106610865A (en) * | 2015-10-21 | 2017-05-03 | 阿里巴巴集团控股有限公司 | Data locking and unlocking method and apparatus |
CN109032774A (en) * | 2018-06-27 | 2018-12-18 | 中国建设银行股份有限公司 | Application recovery method and apparatus |
CN112416955A (en) * | 2020-11-18 | 2021-02-26 | 四川长虹电器股份有限公司 | Cache consistency problem solving method based on high concurrency environment |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5247672A (en) * | 1990-02-15 | 1993-09-21 | International Business Machines Corporation | Transaction processing system and method with reduced locking |
FR2762418B1 (en) * | 1997-04-17 | 1999-06-11 | Alsthom Cge Alcatel | METHOD FOR MANAGING A SHARED MEMORY |
SE521433C2 (en) * | 1998-07-22 | 2003-11-04 | Ericsson Telefon Ab L M | A method for managing the risk of a total lock between simultaneous transactions in a database |
CN100353325C (en) * | 2004-08-23 | 2007-12-05 | 华为技术有限公司 | Method for realing sharing internal stored data base and internal stored data base system |
-
2006
- 2006-04-05 CN CNB2006100663838A patent/CN100365632C/en active Active
Cited By (25)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101089857B (en) * | 2007-07-24 | 2011-05-11 | 中兴通讯股份有限公司 | Internal store data base transaction method and system |
CN101364217B (en) * | 2007-08-08 | 2011-06-22 | 华为技术有限公司 | Data maintenance method, equipment and system thereof in data-base |
CN101136783B (en) * | 2007-10-15 | 2010-06-02 | 中兴通讯股份有限公司 | Backup, recovery method and apparatus for network management system to configure data |
CN101699412B (en) * | 2009-10-15 | 2012-02-22 | 清华大学 | Computer transaction memory method |
CN102693520A (en) * | 2011-03-24 | 2012-09-26 | 苏州乐盈科技有限公司 | Lottery bet method based on short message |
CN102156928A (en) * | 2011-04-29 | 2011-08-17 | 浪潮通信信息系统有限公司 | Method for system concurrency control through business logic lock |
CN102779138A (en) * | 2011-05-13 | 2012-11-14 | 上海振华重工(集团)股份有限公司 | Hard disk access method of real time data |
CN102779138B (en) * | 2011-05-13 | 2016-04-13 | 上海振华重工(集团)股份有限公司 | The hard disk access method of real time data |
CN103034636A (en) * | 2011-09-29 | 2013-04-10 | 盛乐信息技术(上海)有限公司 | Roll-back method, device and system of non relational database |
CN102375892A (en) * | 2011-11-16 | 2012-03-14 | 北京握奇数据系统有限公司 | Large-capacity database card and office management method thereof, and system |
CN102375892B (en) * | 2011-11-16 | 2014-07-02 | 北京握奇数据系统有限公司 | Large-capacity database card and office management method thereof, and system |
CN103186564A (en) * | 2011-12-28 | 2013-07-03 | 深圳市金蝶中间件有限公司 | Data object processing method and system |
CN103514164B (en) * | 2012-06-15 | 2016-12-21 | 阿里巴巴集团控股有限公司 | Data migration method and system |
CN103514164A (en) * | 2012-06-15 | 2014-01-15 | 阿里巴巴集团控股有限公司 | Data migration method and system |
CN104750703A (en) * | 2013-12-26 | 2015-07-01 | 中国移动通信集团天津有限公司 | Method and device for improving data accuracy |
CN104750703B (en) * | 2013-12-26 | 2018-06-26 | 中国移动通信集团天津有限公司 | A kind of method and apparatus for improving data accuracy |
CN104008133A (en) * | 2014-05-06 | 2014-08-27 | 烽火通信科技股份有限公司 | Row-level locking set achieving device and method based on collision detecting |
CN104008133B (en) * | 2014-05-06 | 2017-08-01 | 烽火通信科技股份有限公司 | Device and method is realized in row level locking set based on collision detection |
CN106610865A (en) * | 2015-10-21 | 2017-05-03 | 阿里巴巴集团控股有限公司 | Data locking and unlocking method and apparatus |
CN105426410A (en) * | 2015-11-02 | 2016-03-23 | 东软集团股份有限公司 | Data acquisition system and analytic method for same |
CN105426410B (en) * | 2015-11-02 | 2018-11-09 | 东软集团股份有限公司 | Data collecting system and analysis method for data collecting system |
CN106446037A (en) * | 2016-08-31 | 2017-02-22 | 南威软件股份有限公司 | Method for realizing consistency of Redis and MYSQL data based on distributed lock |
CN109032774A (en) * | 2018-06-27 | 2018-12-18 | 中国建设银行股份有限公司 | Application recovery method and apparatus |
CN112416955A (en) * | 2020-11-18 | 2021-02-26 | 四川长虹电器股份有限公司 | Cache consistency problem solving method based on high concurrency environment |
CN112416955B (en) * | 2020-11-18 | 2022-02-22 | 四川长虹电器股份有限公司 | Cache consistency problem solving method based on high concurrency environment |
Also Published As
Publication number | Publication date |
---|---|
CN100365632C (en) | 2008-01-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN1858745A (en) | Processing method for realizing consistency of internal storage data and data bank data service | |
CN101477487B (en) | Multiple incremental files backup and recovery method | |
US7966298B2 (en) | Record-level locking and page-level recovery in a database management system | |
US7801846B2 (en) | Generating log sequence identifiers to apply a transaction to a storage system | |
US8650155B2 (en) | Apparatus and method for log based replication of distributed transactions using globally acknowledged commits | |
US7194489B2 (en) | System, method and computer program product for collaborative engineering using component and file oriented tools | |
Pedone et al. | Exploiting atomic broadcast in replicated databases | |
CN106021016A (en) | Virtual point in time access between snapshots | |
KR100556594B1 (en) | A method relating to databases | |
US6154847A (en) | Method and system for performing resource updates and recovering operational records within a fault-tolerant transaction-oriented data processing system | |
EP2825958B1 (en) | Systems and methods for supporting transaction recovery based on a strict ordering of two-phase commit calls | |
CN1589448A (en) | System and method for implementing journaling in a multi-node environment | |
Paxton | A client-based transaction system to maintain data integrity | |
CN101692226B (en) | Storage method of mass filing stream data | |
CN103455557B (en) | A kind of structural data synchronous method based on daily record | |
CN1653427A (en) | Method and apparatus for creating a virtual data copy | |
CN109923534A (en) | To the Multi version concurrency control with the data-base recording for not submitting affairs | |
CN107402981A (en) | A kind of data increment processing method and system based on distributed offline database | |
US20060184528A1 (en) | Distributed database with device-served leases | |
CN106777270A (en) | A kind of Heterogeneous Database Replication parallel execution system and method based on submission point time line locking | |
JP2017534986A (en) | Online scheme and data conversion | |
CN1553393A (en) | Data processing method and system for realizing bank uninterrupted service | |
EP1933236A1 (en) | Branch Office and remote server smart archiving based on mirroring and replication software | |
WO2022242372A1 (en) | Object processing method and apparatus, computer device, and storage medium | |
US20200409939A1 (en) | Systems and methods for scalable database technology |
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 |