CN101089857B - Internal store data base transaction method and system - Google Patents

Internal store data base transaction method and system Download PDF

Info

Publication number
CN101089857B
CN101089857B CN2007101194451A CN200710119445A CN101089857B CN 101089857 B CN101089857 B CN 101089857B CN 2007101194451 A CN2007101194451 A CN 2007101194451A CN 200710119445 A CN200710119445 A CN 200710119445A CN 101089857 B CN101089857 B CN 101089857B
Authority
CN
China
Prior art keywords
affairs
transaction
record
management module
data
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
CN2007101194451A
Other languages
Chinese (zh)
Other versions
CN101089857A (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.)
Nanjing Golden Bee Software Technology Co ltd
Shenzhen Shangge Intellectual Property Service Co ltd
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN2007101194451A priority Critical patent/CN101089857B/en
Publication of CN101089857A publication Critical patent/CN101089857A/en
Application granted granted Critical
Publication of CN101089857B publication Critical patent/CN101089857B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

A method for managing affairs of internal memory databank includes setting up affairs management module, processing and submitting affairs, setting up journal execution affairs based on journal manage module, finalizing execution process of said affairs in affairs execution process by affairs management module after sub-affairs is executed and finalized if sub-affairs corresponding to said affairs is existed and using journal management module to set up journal corresponding to affairs set-up and processed as well as submitted by affairs management module. The system used for realizing said method is also disclosed.

Description

A kind of internal store data base transaction method and system
Technical field
The present invention relates to the Computer Database field, relate in particular to a kind of internal store data base transaction method and system.
Background technology
Memory database (MDB, Memory Database) is different from traditional magnetic disc type database, and its all data access, data flow are handled all to reside in the internal memory and realized.Therefore, with respect to traditional magnetic disc type database, the treatment effeciency of memory database is higher.
In the system that data access frequency and efficient are had relatively high expectations, especially in some device systems of the communications field, memory database is an inevitable choice, its efficiently the access process ability provide reliable assurance for the performance of device systems.Raising along with the application system processing power, requirement to memory database deal with data ability is also more and more higher, flow chart of data processing also becomes increasingly complex, in the process of carrying out complicated flow processing, in case fail in the process of handling, the data of revising will influence the normal process of other flow process so before.Therefore, in order to guarantee the integrality of visit data, memory database just need possess transaction processing facility.
Telecommunication system, particularly in the telecommunication system of distributed data, memory database is distributed on several processing units of system, a lot of flow chart of data processing all need to cross over different processing units access memory database, hereinafter to be referred as be the great-leap-forward visit, therefore, also need business machine on distributed system, to guarantee the integrality of visit data.The patent No. is US6457021; the name be called " In-memory databasesystem " patent disclosure a kind of implementation of memory database issued transaction; but this patent only proposes the implementation of memory database issued transaction in a kind of uniprocessor; do not relate to method by multiprocessor distributed memory database issued transaction; and the implementation relative complex of the uniprocessor memory database issued transaction of this patent proposition; also not to the guard method of the unusual deadlock of affairs; therefore, this patent and the exploitation that is not suitable for memory database system in the telecommunication system are used.
In addition, in memory database issued transaction process, comprise an important issued transaction mode, be called data rewind.Memory database is in carrying out the data rollback process, often need to take its a large amount of memory headroom and store the historical record of data, because memory database is a kind of shared formula database, when realizing transaction system, also should reduce its taking to very valuable memory source as far as possible, therefore, how the balance memory source take with this contradiction of issued transaction efficient be the subject matter that the memory database issued transaction need solve.
Summary of the invention
In view of this, the object of the present invention is to provide a kind of internal store data base transaction method and system.These method and system overcome the difficulty that lacks transacter in the existing memory database and can't satisfy transactional processing requirements in the distributed data system, for the consistance and the security of data in the memory database provides reliable guarantee, and significantly reduce the storage space of the shared memory database of data rewind.
The invention provides a kind of internal store data base transaction method, comprising:
Transaction management module creation, processing and submission affairs, and carry out affairs according to the daily record that log management module is created, in the affairs implementation, if exist and the corresponding subtransaction of these affairs, the transaction management module need be finished the implementation of these affairs after subtransaction is complete;
Log management module establishment and management and transaction management module creation, processing and the corresponding daily record of submission affairs; Wherein the described daily record of this method comprises Operation Log and data logging, wherein, and all operations of access memory database in the operation log recording affairs implementation; Data logging is distributed in the interior tables of data of memory database disposal system, is used to preserve the historical record of data, and the recording mode of data logging depends on the Operation Log corresponding with it.
The described processing transactions of this method comprises and reads, revises, deletes and insert what write down in the memory database.
The process of the described transaction management resume module of this method affairs comprises:
The transaction management module receives the transaction request message that the user sends, and returns acknowledge message and affairs and numbers to the user; The transaction management module receives the beginning processing transactions message that the user sends according to the affairs numbering, the beginning processing transactions.
The described transaction management module of this method submits to the process of affairs to comprise:
The transaction management module receives the affairs submission request message that the user sends, and carries out affairs and submits to;
The transaction management module is according to affairs numbering search operation daily record, and the operation note that all are relevant with these affairs is taken out;
The transaction management module is according to the tables of data of storing in operation note sign, and data recording number navigates to target record;
If the transaction operation of target record is designated the affairs deletion, then delete this target record;
If the transaction operation of target record is designated transactions modify, the then sign of the transaction operation in the delete data record number, and deletion and data recording number are expanded corresponding target record;
If the transaction operation of target record is designated affairs and reads, the sign of the transaction operation in the delete data record number then;
If the transaction operation of target record is designated affairs and inserts, the transaction operation sign in the delete data record number then;
The all operations log record of transaction management module deletion affairs correspondence, and deletion transaction information, affairs are submitted to and are finished.
After the failure of the described transaction management resume module of this method affairs, carry out data rewind, process is as follows:
The transaction management module receives the rollback request message that the user sends, and carries out rollback;
The transaction management module is according to affairs numbering search operation daily record, and the operation note that all are relevant with these affairs is taken out;
The transaction management module is according to the tables of data of storing in operation note sign, and data recording number navigates to target record;
If the transaction operation of target record is designated affairs and inserts, then delete this target record;
If the transaction operation of target record is designated transactions modify, then delete this target record, with the content replication in the data recording number expansion in data recording number, and the content in the delete data record expansion;
If the transaction operation of target record is designated affairs deletions, the transaction operation sign in the delete data record number then;
If the transaction operation of target record is designated affairs and reads, the sign of the transaction operation in the delete data record number then;
The all operations log record of transaction management module deletion affairs correspondence, and deletion transaction information, transaction rollback finishes.
After the described transaction management module of this method receives the request message of user's transmission, start the affairs keepalive mechanism, by the time-to-live of affairs time to live control affairs is set.
The described log management module admin log of this method comprises:
If target record has been carried out read operation, then the transaction operation sign with target record is changed to the affairs reading state, and records in the Operation Log;
If to the target record operation of making amendment, then preserve the duplicated record of a this target record earlier, on former target record, make amendment then, transaction operation sign at target record and duplicated record all is changed to the transactions modify state, and record in the Operation Log, and with the content replication in the duplicated record number in data recording number expansion;
If target record has been carried out deletion action, then the transaction operation sign with target record is changed to affairs deletion state, and records in the Operation Log;
If target record has been carried out inserting operation, then the transaction operation sign with target record is changed to affairs insertion state, and records in the Operation Log.
The present invention also provides a kind of internal store data base transaction system, comprising:
The transaction management module is used for creating, handles and submits to affairs, and carries out affairs according to the daily record that log management module is created, in the affairs implementation, if exist and the corresponding subtransaction of these affairs, the transaction management module need be finished the implementation of these affairs after subtransaction is complete;
Log management module is used for establishment and management and transaction management module creation, processing and the corresponding daily record of submission affairs; Wherein, the described log management module of this system comprises Operation Log Management module and data logging administration module, wherein,
The Operation Log Management module is used for writing down all operations of affairs implementation access memory database;
The data logging administration module is distributed in the tables of data in the memory database disposal system, is used to preserve the historical record of data, and the recording mode of data logging depends on the Operation Log corresponding with it.
Internal store data base transaction method of the present invention and system, solved the needs of problems that existing memory database system is handled the memory database transactional effectively, for the consistance and the security of data in the memory database provides reliable guarantee, for the flow chart of data processing of follow-up complexity provides reliable guarantee, and significantly reduced the storage space of the shared memory database of data rewind.
Description of drawings
Fig. 1 is the structural representation of internal store data base transaction of the present invention system;
Fig. 2 is the structural representation of the transaction information of transaction management module in the internal store data base transaction of the present invention system;
Fig. 3 is the structural drawing of the Operation Log Management module of log management module in the internal store data base transaction of the present invention system;
Fig. 4 is the structural drawing of the data logging administration module of log management module in the internal store data base transaction of the present invention system;
Fig. 5 carries out the process flow diagram of issued transaction with the great-leap-forward access mode for internal store data base transaction system among the present invention;
Fig. 6 carries out the process flow diagram that affairs are submitted to for internal store data base transaction system among the present invention;
Fig. 7 be father office memory database MDB_1 on initiate the processing flow chart of transaction rollback.
Fig. 8 is the processing flow chart of initiating transaction rollback on the memory database MDB_3 at subtransaction place.
Embodiment
Below in conjunction with accompanying drawing the specific embodiment of the present invention is described.
Fig. 1 is the structural representation of internal store data base transaction of the present invention system, comprising:
Transaction management module 101, be used for creating, handle and submit to affairs, and carry out affairs according to the daily record that log management module 102 is created, in the affairs implementation, if exist and the corresponding subtransaction of these affairs, transaction management module 101 need be finished the implementation of these affairs after subtransaction is complete;
Log management module 102 is used for establishment and management and the corresponding daily record of affairs is created, handles and submitted to transaction management module 101.Log management module 101 comprises Operation Log Management module 1011 and data logging administration module 1012, wherein,
Operation Log Management module 1011 is used for writing down all operations of affairs implementation access memory database;
Data logging administration module 1012 is distributed in the tables of data in the memory database disposal system, is used to preserve the historical record of data, and the recording mode of data logging depends on the Operation Log corresponding with it.
The memory database transaction system is carried out processing transactions and is at first carried out the affairs establishment, when creating affairs, need store the information of these affairs.Fig. 2 is the structural representation of the transaction information of transaction management module in the internal store data base transaction of the present invention system, and transaction information comprises affairs numbering 201, affairs priority 2 02, affairs life cycle 203, affairs founder's information 204 and subtransaction information 205.
Affairs numbering 201 unique identifications as affairs, effective in the total system.
Affairs priority 2 02 is used for the processing sequencing of control affairs, the processing priority of reflection affairs.
Be used for the affairs keep-alive affairs life cycle 203, avoids the affairs deadlock problem that causes unusually.
Affairs founder's information 204 is used for store transaction founder's information, is needing this information by transaction system in that initiate and the interaction process process affairs founder.
Subtransaction information 205 is stored in the subtransaction of current memory database establishment.Below the relation of concise and to the point descriptor, father's affairs:
Father's affairs also can be called the root affairs, are created in the memory database transacter by the user.
Subtransaction is to carry out great-leap-forward when visit, the affairs of creating by father's affairs in purpose memory database transacter.
Concerning a memory database transacter, father's affairs can only be created unique subtransaction therein, and each subtransaction has and have only unique father's affairs.
As shown in Figure 3, Fig. 3 is the structural drawing of the Operation Log Management module of log management module in the internal store data base transaction of the present invention system, comprises affairs numbering 201, tables of data sign 301, data recording numbers 302 and data recording number expansion 303 among the figure.Wherein,
Tables of data sign 301 is used for identifying a tables of data of memory database transacter.
Data recording numbers 302 is the recording mechanisms in the tables of data 301, is used for identifying a transaction journal of a tables of data.
Data recording expansion 303 also is the recording mechanism in the tables of data 301, and the auxiliary data recording mechanism as data recording numbers 302 is used for identifying a transaction journal of a tables of data.
In the memory database, comprise a plurality of Transaction Information tables, comprise many transaction journals in each Transaction Information table, the user finds corresponding Transaction Information table by tables of data sign 301, then, find transaction journal corresponding in this tables of data by the data recording in this Transaction Information table numbers 302, therefore, tables of data sign 301 and data recording numbers 302 united a unique transaction journal in the expression memory database transacter, and this transaction journal is called target record.
Fig. 4 is the structural drawing of the data logging administration module of log management module in the internal store data base transaction of the present invention system, comprises among the figure:
Transaction operation sign 401 is used for the current state of recording operation record, comprises that affairs read, transactions modify, affairs deletion, affairs are inserted and do not have the affairs operation.Transaction operation sign 401 is used to finish follow-up affairs and submits operations such as data rewind to also as the data logging of every transaction operation.
Recorded content 402 is used to preserve the information of every transaction operation process, comprises the information of operating process such as affairs read, transactions modify, affairs deletion, affairs insertion.
In conjunction with Fig. 3 and structure shown in Figure 4, the log management module of whole affairs gets final product clear foundation, and transaction journal difference because of action type in management is different, specific as follows:
Affairs read: in the implementation of affairs, if target record has been carried out read operation, then the transaction operation sign with target record is changed to the affairs reading state, and records in the Operation Log.
Transactions modify: in the implementation of affairs, if to the target record operation of making amendment, then preserve the duplicated record of a this target record earlier, on former target record, make amendment then, transaction operation sign at target record and duplicated record all is changed to the transactions modify state, and record in the Operation Log, and with the content replication in the duplicated record number in data recording number expansion, when needs are carried out the data rolling back action, then the content in the data recording number expansion is copied to again in the data recording number, be about to data recording and number revert to the data recording carried out before the retouching operation number, after data rewind is complete, the content in the delete data record expansion.
The affairs deletion: in the implementation of affairs, if target record has been carried out deletion action, then the transaction operation sign with target record is changed to affairs deletion state, and records in the Operation Log.
Affairs are inserted: in the implementation of affairs, if target record has been carried out inserting operation, then the transaction operation sign with target record is changed to affairs insertion state, and records in the Operation Log.
After affairs finish, transaction journal need be removed, and no affairs action type on the relevant transaction operation identity marking of all these affairs.
Introduce the affairs keepalive mechanism, transaction commitment processing detailed rules and regulations and the transaction rollback that occur in the above-mentioned steps below respectively and handle detailed rules and regulations.
The keepalive mechanism of affairs: in the transacter that a plurality of memory databases constitute; the transactional deadlock that may exist some to cause unusually; particularly for striding processing unit or striding the situation that memory database carries out issued transaction; its potential danger is bigger, therefore needs a kind of keepalive mechanism to prevent the transactional deadlock.Detailed process is as follows:
The user provides the affairs time to live when creating affairs; When the time-to-live of affairs surpasses the affairs time to live, illustrate that then these affairs are overtime unusually, need carry out the affairs release and handle, promptly memory database will force these affairs to carry out rollback, realize release.
The transaction commitment processing detailed rules and regulations:
At first, the memory database disposal system is searched the transaction operation daily record according to the affairs numbering, and the operation note that all are relevant with these affairs is taken out.
Then, the memory database disposal system is according to the tables of data of storing in operation note sign, and data recording number navigates to target record.
If the transaction operation of target record is designated the affairs deletion, then delete this target record;
If the transaction operation of target record is designated transactions modify, the then sign of the transaction operation in the delete data record number, and deletion and data recording number are expanded corresponding target record;
If the transaction operation of target record is designated affairs and reads, the sign of the transaction operation in the delete data record number then;
If the transaction operation of target record is designated affairs and inserts, the transaction operation sign in the delete data record number then;
At last, all operations log record of memory database disposal system deletion affairs correspondence, and deletion transaction information, affairs are submitted to and are finished.
Transaction rollback is handled detailed rules and regulations:
At first, the memory database disposal system is searched the transaction operation daily record according to the affairs numbering, and the operation note that all are relevant with these affairs is taken out.
Then, the memory database disposal system is according to the tables of data of storing in operation note sign, and data recording number navigates to target record.
If the transaction operation of target record is designated affairs and inserts, then delete this target record;
If the transaction operation of target record is designated transactions modify, then delete this target record, with the content replication in the data recording number expansion in data recording number, and the content in the delete data record expansion;
If the transaction operation of target record is designated affairs deletions, the transaction operation sign in the delete data record number then;
If the transaction operation of target record is designated affairs and reads, the sign of the transaction operation in the delete data record number then;
At last, all operations log record of memory database disposal system deletion affairs correspondence, and deletion transaction information, transaction rollback finishes.
In DATA DISTRIBUTION formula system, under the unknowable situation of affairs user, transaction system is created corresponding subtransaction automatically, carries out the great-leap-forward visit, thereby finishes the overall process of issued transaction.Fig. 5 carries out the process flow diagram of issued transaction with the great-leap-forward access mode for internal store data base transaction system among the present invention.Concrete steps are as follows:
Step 501, the user sends to MDB_1 and creates first transaction request message.
Step 502, MDB_1 receives and creates first transaction request message, returns acknowledge message and affairs numbering, and the first affairs time to live that provides according to the user starts keepalive mechanism, preserves the information of these first affairs.
Step 503, the user receives first affairs numbering, sends to MDB_1 according to first affairs numbering to begin to carry out first transaction message.
Step 504, MDB_1 is in the first affairs implementation, and discovery need be carried out the great-leap-forward visit to MDB_2, so initiate to create second transaction request message to MDB_2.
Step 505, MDB_1 also need to find MDB_3 is carried out the great-leap-forward visit in the first affairs implementation, so initiate to create the 3rd transaction request message to MDB_3.
Step 506, MDB_3 receives and creates the 3rd transaction request message, carries out the processing of the 3rd affairs; In the 3rd issued transaction process, discovery need be carried out the great-leap-forward visit to MDB_4, so initiate to create the 4th transaction request message to MDB_4.
Step 507, MDB_4 receives and creates the 4th transaction request message, carries out the processing of the 4th affairs, after MDB4 finishes the processing of the 4th affairs, sends and finishes dealing with message to MDB_3.
Step 508, MDB_3 receives the message of finishing dealing with that MDB_4 sends, finish the processing of the 3rd affairs after, send and finish dealing with message to MDB_1.
Step 509 after MDB_2 finishes the processing of second affairs, sends and finishes dealing with message to MDB_1.
Step 510, MDB_1 receives the message of finishing dealing with of MDB_2 and MDB_3 transmission, finishes the processing of first affairs.
According to the definition of aforementioned father's affairs and subtransaction, in the above-mentioned steps, first affairs are father's affairs of second affairs and the 3rd affairs, and the 3rd affairs are father's affairs of the 4th affairs; In other words, second affairs and the 3rd affairs are subtransactions of first affairs, and the 4th affairs are subtransactions of the 3rd affairs.
Handle in the implementation procedure in actual transaction, can handle more subtransaction in the manner described above in conjunction with concrete condition, thereby finally finish processing first affairs.For subtransaction second affairs and the 3rd affairs that first affairs are created respectively in MDB_2 and MDB_3, both sides relation is a coordination, and after the two issued transaction was finished, what send to MDB_1 finished dealing with message in no particular order, following three kinds of situations all can:
MDB_3 sends earlier and finishes dealing with message to MDB_1, sends behind the MDB_2 and finishes dealing with message to MDB_1;
MDB_2 sends earlier and finishes dealing with message to MDB_1, sends behind the MDB_3 and finishes dealing with message to MDB_1;
MDB_2 and MDB_3 send the message of finishing dealing with simultaneously to MDB_1.
MDB_1 only after the message of finishing dealing with that the subtransaction place MDB that receives all first affairs returns, just can finish the processing of first affairs.
In memory database, the submission of affairs can only be initiated by the user, and for the user, have only first affairs as seen, therefore, the user at first notifies memory database to carry out the submission of first affairs, if there be the subtransaction corresponding, after then needing to finish the submission of this subtransaction earlier, finish the submission of these first affairs again with these first affairs, therefore, in actual transaction submission process, if there is multistage son, the situation that father's affairs are nested then must be carried out affairs by father's transaction notification at different levels subtransaction corresponding with it in order and submit to, after subtransactions at different levels are finished the affairs submission in order, finally finish the submission of whole affairs.
Fig. 6 carries out the process flow diagram that affairs are submitted to for internal store data base transaction system among the present invention.Concrete steps are as follows:
Step 601, the user sends first affairs to MDB_1 and submits request message to.
Step 602 after MDB_1 receives that first affairs are submitted request message to, is deleted the transaction journal of this memory database correspondence, notifies its second subtransaction and the 3rd subtransaction of creating respectively in MDB_2 and MDB_3 to submit to, and waits for its response.
Step 603 after MDB_2 and MDB_3 receive the submission request message of first affairs, is deleted the transaction journal of this memory database correspondence, carries out affairs and submits to, and return to submit to and finish message to MDB_1.
In this step, for there not being subtransaction second affairs, MDB_2 finishes to return after the submission to submit to and finishes message and give MDB_1.For the 3rd affairs, owing to there are corresponding subtransaction the 4th affairs, therefore, MDB_3 needs to send to MDB_4 earlier to submit request message to, receiving after MDB_4 finishes the submission of returning after the 4th affairs are submitted to and finish message, just can finish the affairs of himself and submit to, after MDB_3 finishes the submission of the 3rd affairs, return to submit to and finish message to MDB_1.
Step 604, MDB_1 receives that the submission of MDB_2 finishes message, but does not receive that as yet the submission of MDB_3 finishes message, continues to wait for that the submission of MDB_3 finishes message.
Step 605, MDB_4 finishes the submission of the 4th affairs, returns to submit to and finishes message to MDB_3.
Step 606, MDB_3 receives after MDB_4 finishes the submission of returning after the 4th affairs are submitted to and finish message, finishes the submission of the 3rd affairs, and returns to submit to and finish message and give MDB_1.
Step 607, MDB_1 receives that the submission that MDB_2 and MDB_3 return finishes message, carries out first affairs and submits to, thereby finish the submission of whole affairs.
In the above-mentioned steps, the asynchronous access owing to existing between a plurality of memory databases can adopt some security measures in the asynchronous access process, as adopting the affairs keepalive mechanism of memory database, deals with the abnormal conditions that may occur in the affairs submission process.
Fig. 7 be father office memory database MDB_1 on initiate the processing flow chart of transaction rollback.Its treatment scheme is similar to affairs and submits to, just need carry out data rewind according to transaction journal, deletes transaction journal then, and the deletion affairs are finished rollback.Concrete steps are as follows:
Step 701, the user sends the first transaction rollback request message to MDB_1.
Step 702 after MDB_1 receives the first transaction rollback request message, is deleted the transaction journal of this memory database correspondence, notifies its second subtransaction and the 3rd subtransaction of creating respectively in MDB_2 and MDB_3 to carry out rollback, and waits for its response.
Step 703, after MDB_2 and MDB_3 received second, third transaction rollback request message of MDB_1, transaction rollback was carried out in first transaction journal of correspondence among deletion MDB_2 and the MDB_3, and returned rollback and finish message to MDB_1.
In this step, for there not being subtransaction second affairs, MDB_2 finishes and returns rollback after the rollback and finish message and give MDB_1.For the 3rd affairs, owing to there are corresponding subtransaction the 4th affairs, therefore, MDB_3 needs to send the 4th transaction rollback request message to MDB_4 earlier, receiving after the 4th transaction rollback that returns after MDB_4 finishes the 4th transaction rollback finishes message, just can finish the transaction rollback of himself, after MDB_3 finishes the rollback of the 3rd affairs, return the 3rd transaction rollback and finish message to MDB_1.
Step 704, MDB_1 receives that second transaction rollback of MDB_2 finishes message, but does not receive that as yet the 3rd transaction rollback that MDB_3 returns finishes message, continues to wait for that MDB_3 returns the 3rd transaction rollback and finishes message.
Step 705, MDB_4 finishes the rollback of the 4th affairs, returns the 4th transaction rollback and finishes message to MDB_3.
Step 706, MDB_3 receives after MDB_4 finishes the 4th transaction rollback that returns behind the 4th transaction rollback and finish message, finishes the rollback of the 3rd affairs, and returns the 3rd transaction rollback and finish message and give MDB_1.
Step 707, MDB_1 receives that second, third rollback that MDB_2 and MDB_3 return finishes message, carries out first transaction rollback, thereby finishes the rollback of whole affairs.
Fig. 8 is the processing flow chart of initiating transaction rollback on the memory database MDB_3 at subtransaction place.Concrete steps are as follows:
Step 801, the user sends the 3rd transaction rollback request message to MDB_3.
Step 802 after MDB_3 receives the 3rd transaction rollback request message, sends the first transaction rollback request message to MDB_1, and sends the 4th transaction rollback request message to MDB_4.
Because there are father's affairs in the 3rd affairs, be first affairs among the MDB_1, and subtransaction the 4th affairs of in MDB_4, creating, therefore, MDB_3 need send the rollback request message to first office memory database MDB_1 and the 4th office memory database MDB_4, carry out the rollback of first affairs and the 4th affairs respectively, rollback for its subtransaction the 4th affairs, MDB_3 need wait for that the 4th transaction rollback that MDB_4 returns finishes message, and for the rollback of his father's affairs first affairs, MDB_3 does not need then to wait for that first transaction rollback that MDB_1 returns finishes message.
Step 803, MDB_1 receives the 3rd transaction rollback request message that MDB_3 sends, carry out the rollback of first affairs, because first affairs have also been created subtransaction second affairs in MDB_2, therefore, MDB_1 sends the rollback request message to MDB_2, carry out the rollback of second affairs, and wait for that second transaction rollback that MDB_2 returns finishes message, and receiving after second transaction rollback finishes message, MDB_1 just can carry out the rollback of first affairs.
In this step, MDB_1 will no longer send the rollback request message for the MDB_3 that initiates transaction rollback.
Step 804, MDB_4 receives the 4th transaction rollback request message that MDB_3 sends, and carries out the rollback of the 4th affairs, and returns the 4th transaction rollback and finish message to MDB_3.
Step 805, MDB_3 carries out the rollback of the 3rd affairs after receiving that the 4th transaction rollback is finished message, the 3rd transaction journal that deletion is wherein corresponding, and return the 3rd rollback and finish message to MDB_1.
Step 806, after MDB_2 received the second rollback request message of MDB_1, transaction rollback was carried out in second transaction journal that deletion is wherein corresponding, and returned second rollback and finish message to MDB_1.
Step 807, MDB_1 receives that second transaction rollback that MDB_2 returns finishes the 3rd transaction rollback that message and MDB_3 return and finish message, carries out the rollback of first affairs, thereby finishes the rollback of whole affairs.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (8)

1. an internal store data base transaction method is characterized in that, comprising:
Transaction management module creation, processing and submission affairs, and carry out affairs according to the daily record that log management module is created, in the affairs implementation, if exist and the corresponding subtransaction of these affairs, the transaction management module need be finished the implementation of these affairs after subtransaction is complete;
Log management module establishment and management and transaction management module creation, processing and the corresponding daily record of submission affairs, wherein, described daily record comprises Operation Log and data logging, wherein, and all operations of access memory database in the operation log recording affairs implementation; Data logging is distributed in the interior tables of data of memory database disposal system, is used to preserve the historical record of data, and the recording mode of data logging depends on the Operation Log corresponding with it.
2. method according to claim 1 is characterized in that, described processing transactions comprises and reads, revises, deletes and insert what write down in the memory database.
3. method according to claim 2 is characterized in that, the process of described transaction management resume module affairs comprises:
The transaction management module receives the transaction request message that the user sends, and returns acknowledge message and affairs and numbers to the user; The transaction management module receives the beginning processing transactions message that the user sends according to the affairs numbering, the beginning processing transactions.
4. method according to claim 2 is characterized in that, described transaction management module submits to the process of affairs to comprise:
The transaction management module receives the affairs submission request message that the user sends, and carries out affairs and submits to;
The transaction management module is according to affairs numbering search operation daily record, and the operation note that all are relevant with these affairs is taken out;
The transaction management module is according to the tables of data of storing in operation note sign, and data recording number navigates to target record;
If the transaction operation of target record is designated the affairs deletion, then delete this target record;
If the transaction operation of target record is designated transactions modify, the then sign of the transaction operation in the delete data record number, and deletion and data recording number are expanded corresponding target record;
If the transaction operation of target record is designated affairs and reads, the sign of the transaction operation in the delete data record number then;
If the transaction operation of target record is designated affairs and inserts, the transaction operation sign in the delete data record number then;
The all operations log record of transaction management module deletion affairs correspondence, and deletion transaction information, affairs are submitted to and are finished.
5. method according to claim 2 is characterized in that, after the described transaction management resume module affairs failure, carries out data rewind, and process is as follows:
The transaction management module receives the rollback request message that the user sends, and carries out rollback;
The transaction management module is according to affairs numbering search operation daily record, and the operation note that all are relevant with these affairs is taken out;
The transaction management module is according to the tables of data of storing in operation note sign, and data recording number navigates to target record;
If the transaction operation of target record is designated affairs and inserts, then delete this target record;
If the transaction operation of target record is designated transactions modify, then delete this target record, with the content replication in the data recording number expansion in data recording number, and the content in the delete data record expansion;
If the transaction operation of target record is designated affairs deletions, the transaction operation sign in the delete data record number then;
If the transaction operation of target record is designated affairs and reads, the sign of the transaction operation in the delete data record number then;
The all operations log record of transaction management module deletion affairs correspondence, and deletion transaction information, transaction rollback finishes.
6. according to claim 3,4 or 5 described methods, it is characterized in that, after described transaction management module receives the request message of user's transmission, start the affairs keepalive mechanism, by the time-to-live of affairs time to live control affairs is set.
7. method according to claim 1 is characterized in that, described log management module admin log comprises:
If target record has been carried out read operation, then the transaction operation sign with target record is changed to the affairs reading state, and records in the Operation Log;
If to the target record operation of making amendment, then preserve the duplicated record of a this target record earlier, on former target record, make amendment then, transaction operation sign at target record and duplicated record all is changed to the transactions modify state, and record in the Operation Log, and with the content replication in the duplicated record number in data recording number expansion;
If target record has been carried out deletion action, then the transaction operation sign with target record is changed to affairs deletion state, and records in the Operation Log;
If target record has been carried out inserting operation, then the transaction operation sign with target record is changed to affairs insertion state, and records in the Operation Log.
8. an internal store data base transaction system is characterized in that, comprising:
The transaction management module is used for creating, handles and submits to affairs, and carries out affairs according to the daily record that log management module is created, in the affairs implementation, if exist and the corresponding subtransaction of these affairs, the transaction management module need be finished the implementation of these affairs after subtransaction is complete;
Log management module is used for establishment and management and transaction management module creation, processing and the corresponding daily record of submission affairs; Wherein, described log management module comprises Operation Log Management module and data logging administration module, wherein,
The Operation Log Management module is used for writing down all operations of affairs implementation access memory database;
The data logging administration module is distributed in the tables of data in the memory database disposal system, is used to preserve the historical record of data, and the recording mode of data logging depends on the Operation Log corresponding with it.
CN2007101194451A 2007-07-24 2007-07-24 Internal store data base transaction method and system Expired - Fee Related CN101089857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101194451A CN101089857B (en) 2007-07-24 2007-07-24 Internal store data base transaction method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101194451A CN101089857B (en) 2007-07-24 2007-07-24 Internal store data base transaction method and system

Publications (2)

Publication Number Publication Date
CN101089857A CN101089857A (en) 2007-12-19
CN101089857B true CN101089857B (en) 2011-05-11

Family

ID=38943215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101194451A Expired - Fee Related CN101089857B (en) 2007-07-24 2007-07-24 Internal store data base transaction method and system

Country Status (1)

Country Link
CN (1) CN101089857B (en)

Families Citing this family (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101699412B (en) * 2009-10-15 2012-02-22 清华大学 Computer transaction memory method
CN102279855A (en) * 2010-06-10 2011-12-14 三星电子(中国)研发中心 Device and method for treating transactions with database
CN102693520A (en) * 2011-03-24 2012-09-26 苏州乐盈科技有限公司 Lottery bet method based on short message
CN102955801B (en) * 2011-08-25 2017-06-16 中兴通讯股份有限公司 Data control method and system based on distributed data base system
US8725882B2 (en) * 2011-09-09 2014-05-13 Oracle International Corporation Masking database outages from clients and applications
US11841844B2 (en) * 2013-05-20 2023-12-12 Amazon Technologies, Inc. Index update pipeline
US10216768B1 (en) 2014-02-17 2019-02-26 Amazon Technologies, Inc. Table and index communications channels
US10102228B1 (en) 2014-02-17 2018-10-16 Amazon Technologies, Inc. Table and index communications channels
CN103902479A (en) * 2014-03-27 2014-07-02 浪潮电子信息产业股份有限公司 Quick reconstruction mechanism for metadata cache on basis of metadata log
CN104317850B (en) * 2014-10-14 2017-11-14 北京国双科技有限公司 Data processing method and device
EP3229147A4 (en) 2014-12-24 2017-12-27 Huawei Technologies Co., Ltd. Transaction processing method, device and computer system
CN104731943B (en) * 2015-03-31 2019-09-13 华为技术有限公司 A kind of server and data processing method
CN106155775B (en) * 2015-04-28 2020-02-21 菜鸟智能物流控股有限公司 Message processing method, device and system
CN105183879A (en) * 2015-09-22 2015-12-23 浪潮集团有限公司 Method for distributed database to keep transactional consistency under cloud computation
CN105426234B (en) * 2015-10-30 2019-02-19 小米科技有限责任公司 Database deadlocks detection method and device
CN105938446B (en) * 2016-01-12 2019-01-25 上海交通大学 The data supported based on RDMA and hardware transactional memory replicate fault-tolerance approach
CN107665219B (en) * 2016-07-28 2021-01-29 华为技术有限公司 Log management method and device
CN107797850B (en) * 2016-08-30 2021-09-21 阿里巴巴集团控股有限公司 Method, device and system for distributed transaction processing
CN106776076B (en) * 2016-12-27 2019-04-26 国网信息通信产业集团有限公司 A kind of method and system for realizing MongoDB transaction management
CN107784055A (en) * 2017-02-17 2018-03-09 平安科技(深圳)有限公司 Transaction methods and device based on non-relational database
CN107332906A (en) * 2017-06-30 2017-11-07 郑州云海信息技术有限公司 Distributed system office management method and device
CN110019112B (en) * 2017-08-25 2023-10-31 阿里巴巴集团控股有限公司 Data transaction processing method and device and electronic equipment
CN107590286B (en) * 2017-10-10 2021-03-09 苏州浪潮智能科技有限公司 Method and device for managing transaction information in cluster file system
CN110019050A (en) * 2017-10-19 2019-07-16 中兴通讯股份有限公司 A kind of data rewind method, system, equipment and computer readable storage medium
CN110196759B (en) * 2018-06-20 2022-12-06 腾讯科技(深圳)有限公司 Distributed transaction processing method and device, storage medium and electronic device
CN110134735A (en) * 2019-04-10 2019-08-16 阿里巴巴集团控股有限公司 The storage method and device of distributed transaction log
CN111813783B (en) * 2020-07-27 2024-03-26 南方电网数字电网研究院有限公司 Data processing method, device, computer equipment and storage medium
US20230195582A1 (en) * 2021-12-16 2023-06-22 International Business Machines Corporation Rolling back a database transaction
CN116244041B (en) * 2022-12-02 2023-10-27 湖南亚信安慧科技有限公司 Performance optimization method for database sub-transaction

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1507597A (en) * 2001-05-15 2004-06-23 �Ҵ���˾ Method for managing distributed savepoints across multiple DBMS's within a distributed transaction
US6981004B2 (en) * 2002-09-16 2005-12-27 Oracle International Corporation Method and mechanism for implementing in-memory transaction logging records
CN1858745A (en) * 2006-04-05 2006-11-08 华为技术有限公司 Processing method for realizing consistency of internal storage data and data bank data service

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1507597A (en) * 2001-05-15 2004-06-23 �Ҵ���˾ Method for managing distributed savepoints across multiple DBMS's within a distributed transaction
US6981004B2 (en) * 2002-09-16 2005-12-27 Oracle International Corporation Method and mechanism for implementing in-memory transaction logging records
CN1858745A (en) * 2006-04-05 2006-11-08 华为技术有限公司 Processing method for realizing consistency of internal storage data and data bank data service

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
施胜盛.内存数据库事务管理研究与实现.中国优秀硕士学位论文全文数据库.2006,全文. *
王意洁,王勇军,王志英,胡守仁.嵌套事务模型下的恢复策略.计算机工程25 2.1999,25(2),42-44.
王意洁,王勇军,王志英,胡守仁.嵌套事务模型下的恢复策略.计算机工程25 2.1999,25(2),42-44. *
王玮.分布式内存数据库管理的设计与实现.中国优秀硕士学位论文全文数据库.2006,11,15,18-22,27,36-37,40-41. *
陈安龙.内存数据库中数据恢复技术的研究与实现.中国优秀硕士学位论文全文数据库.2006,全文. *

Also Published As

Publication number Publication date
CN101089857A (en) 2007-12-19

Similar Documents

Publication Publication Date Title
CN101089857B (en) Internal store data base transaction method and system
US5724581A (en) Data base management system for recovering from an abnormal condition
CN111143389B (en) Transaction execution method and device, computer equipment and storage medium
US6564215B1 (en) Update support in database content management
EP3117349B1 (en) System and method for massively parallel processing database
CN101046821B (en) Generic database manipulator
AU2003231837B2 (en) High-performance change capture for data warehousing
US8572027B2 (en) Performing synchronization among relational database tables with minimal contention
US7698319B2 (en) Database system management method, database system, database device, and backup program
EP2380090B1 (en) Data integrity in a database environment through background synchronization
EP1387269A1 (en) Backup system and method of generating a checkpoint for a database
CN102955792A (en) Method for implementing transaction processing for real-time full-text search engine
EP4006740A1 (en) Method for indexing data in storage engines, and related device
US20060136443A1 (en) Method and apparatus for initializing data propagation execution for large database replication
KR102038529B1 (en) System for processing real-time data modification of in-memory database
US7464091B2 (en) Method and software for processing data objects in business applications
US8521682B2 (en) Transfer of data from transactional data sources to partitioned databases in restartable environments
CN109918393A (en) The data platform and its data query and multilist conjunctive query method of Internet of Things
US7225302B2 (en) Method and software application for avoiding data loss
US7051051B1 (en) Recovering from failed operations in a database system
US20040148587A1 (en) Data element and structure for data processing
US20060004846A1 (en) Low-overhead relational database backup and restore operations
US7430569B2 (en) Computerized replication of data objects
JPH033046A (en) Log record control system
JP2011013910A (en) System and method for update processing of corporate information, and corporate information update program

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
TR01 Transfer of patent right

Effective date of registration: 20210317

Address after: Room 625, nuopao Plaza, 269 Qianjin 1st Road, Xin'an street, Bao'an District, Shenzhen City, Guangdong Province

Patentee after: SHENZHEN SHANGGE INTELLECTUAL PROPERTY SERVICE Co.,Ltd.

Address before: 518057 Ministry of justice, Zhongxing building, South Science and technology road, Nanshan District hi tech Industrial Park, Shenzhen, Guangdong

Patentee before: ZTE Corp.

Effective date of registration: 20210317

Address after: Room 801, 391 Tianyuan East Road, Jiangning District, Nanjing City, Jiangsu Province, 211100

Patentee after: Nanjing Golden Bee Software Technology Co.,Ltd.

Address before: Room 625, nuopao Plaza, 269 Qianjin 1st Road, Xin'an street, Bao'an District, Shenzhen City, Guangdong Province

Patentee before: SHENZHEN SHANGGE INTELLECTUAL PROPERTY SERVICE Co.,Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20110511

CF01 Termination of patent right due to non-payment of annual fee