WO2019242437A1 - 分布式事务处理方法和相关装置 - Google Patents
分布式事务处理方法和相关装置 Download PDFInfo
- Publication number
- WO2019242437A1 WO2019242437A1 PCT/CN2019/087179 CN2019087179W WO2019242437A1 WO 2019242437 A1 WO2019242437 A1 WO 2019242437A1 CN 2019087179 W CN2019087179 W CN 2019087179W WO 2019242437 A1 WO2019242437 A1 WO 2019242437A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- distributed transaction
- transaction processing
- object database
- accounts
- processing device
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2379—Updates performed during online database operations; commit processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0751—Error or fault detection not based on redundancy
- G06F11/0754—Error or fault detection not based on redundancy by exceeding limits
- G06F11/0757—Error or fault detection not based on redundancy by exceeding limits by exceeding a time limit, i.e. time-out, e.g. watchdogs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1471—Saving, restoring, recovering or retrying involving logging of persistent data for recovery
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1474—Saving, restoring, recovering or retrying in transactions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3006—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/302—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0875—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with dedicated cache, e.g. instruction or stack
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/1865—Transactional file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2365—Ensuring data consistency and integrity
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/466—Transaction processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2201/00—Indexing scheme relating to error detection, to error correction, and to monitoring
- G06F2201/81—Threshold
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/16—General purpose computing application
- G06F2212/163—Server or database system
Definitions
- the present invention relates to the field of computers, and in particular, to a distributed transaction processing technology.
- transaction submission is often completed in accordance with established processing steps. If the submission process fails catastrophically and the above-mentioned established processing steps are interrupted, the submission process of the above transaction needs to be resumed.
- Embodiments of the present invention provide a distributed transaction processing method and device, a storage medium, and an electronic device, so as to at least solve the technical problem that the accuracy of distributed transaction processing cannot be guaranteed when a predetermined step of a distributed transaction is interrupted.
- a distributed transaction processing method which includes: a distributed transaction processing device obtains a distributed transaction processing request, wherein the distributed transaction processing request is used to request the Account data performs processing operations.
- the account data in the N accounts is located in M first object database sets, and the M first object database sets are included in the target database cluster.
- the N is an integer greater than 1 and the M is greater than 1.
- the distributed transaction processing device writes the submission log corresponding to the distributed transaction processing request into the second object database set, where the submission instruction result is recorded in the above submission log, and the submission instruction result is used to indicate whether the pair has been submitted.
- the second object database set is included in the target database cluster; after the distributed transaction processing device resumes the distributed transaction processing, the distributed transaction processing device may Get the commit log from the second object database set. Indicates the result indicates pay to submit, distributed transaction processing apparatus performs the above processing operation on the account data of the above-described process operation of the N in the account to the account is performed by the N data account.
- a distributed transaction processing apparatus is also provided, and the apparatus is configured to execute the distributed transaction processing method provided by the embodiment of the present invention.
- a storage medium is also provided, and the storage medium stores a computer program, wherein the computer program is configured to execute the above-mentioned distributed transaction processing method when running.
- an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the foregoing through the computer program.
- Distributed transaction processing method
- a computer program product including instructions that, when run on a computer, cause the computer to execute the foregoing distributed transaction processing method.
- the distributed transaction processing device After the distributed transaction processing device obtains a distributed transaction processing request for performing a processing operation on account data in N accounts, it writes a commit log corresponding to the distributed transaction request. Go to the second object database set, where the above submission log records a submission instruction result corresponding to the distributed transaction request, and the submission instruction result is used to indicate whether a processing operation performed on the account data in the N accounts has been submitted.
- the account data in the N accounts is located in M first object database sets included in the target database cluster, and the target database cluster further includes a second object database set for writing a commit log.
- the distributed transaction processing device After the distributed transaction processing device resumes the distributed transaction processing, the distributed transaction processing device obtains the commit log from the second object database set, and when the submission instruction result instructs to submit the foregoing processing operations performed on the account data in the N accounts, The foregoing processing operation is performed on the account data in the N accounts.
- the commit log corresponding to the distributed transaction request is written into the second object database set, instead of just caching the commit log to the local, so that in the case of a distributed transaction processing failure, it can also be used
- the commit log written in the second object database set restores the processing operations performed on the account data in the N accounts, so that the transaction processing status can be restored to be consistent in different distributed devices, thereby ensuring the accuracy of distributed transaction processing. Performance, thereby overcoming the problem of low accuracy of distributed transaction processing in related technologies.
- FIG. 1 is a schematic diagram of an application environment of a distributed transaction processing method according to an embodiment of the present invention
- FIG. 2 is a schematic flowchart of an optional distributed transaction processing method according to an embodiment of the present invention.
- FIG. 3 is a schematic diagram of an optional distributed transaction processing method according to an embodiment of the present invention.
- FIG. 4 is a schematic diagram of another optional distributed transaction processing method according to an embodiment of the present invention.
- FIG. 5 is a schematic diagram of another optional distributed transaction processing method according to an embodiment of the present invention.
- FIG. 6 is a schematic diagram of another optional distributed transaction processing method according to an embodiment of the present invention.
- FIG. 7 is a schematic diagram of another optional distributed transaction processing method according to an embodiment of the present invention.
- FIG. 8 is a schematic structural diagram of an optional distributed transaction processing apparatus according to an embodiment of the present invention.
- FIG. 9 is a schematic structural diagram of another optional distributed transaction processing apparatus according to an embodiment of the present invention.
- FIG. 10 is a schematic structural diagram of an optional electronic device according to an embodiment of the present invention.
- a distributed transaction processing method is provided.
- the distributed processing method provided in the embodiment of the present application may be, but is not limited to, being applied to the method shown in FIG. 1 Environment.
- the user equipment 104 is used to complete the human-machine interaction process with the user 102.
- the user 102 can perform a processing operation on the account data of the account running in the user equipment 104 through the human-machine interaction operation, where a memory is configured in the user equipment 104 106 ⁇ processor 108.
- the foregoing processing operation may include, but is not limited to, performing a processing operation on account data in the N accounts requested by the distributed transaction processing request, and the account data in the N accounts is located in the target database cluster 112. M of the first object database set 114.
- the submission log corresponding to the distributed transaction processing request may be written to the second object database set 116 included in the target database cluster 112 through the network 110, as in step S102. .
- the above-mentioned submission log is used to record the submission instruction result corresponding to the distributed transaction processing request, and the submission instruction result is used to indicate whether the processing operation performed on the account data in the N accounts has been submitted.
- the target database cluster 112 includes a first object database set 114 and a second object database 116.
- the M first object database sets 114 are used to store account data in N accounts, and the second object database set 116 is used to store the foregoing. Commit log.
- the user device 104 After the user device 104 resumes distributed transaction processing, it obtains the commit log from the second object database set.
- the submission instruction result in the commit log indicates that the processing operation can be submitted, the processing operation requested by the distributed transaction request is performed, that is, A processing operation is performed on the account data in the N accounts in the M first object database sets.
- a commit log corresponding to the distributed transaction request is written to In the second object database set, a commit instruction result corresponding to the distributed transaction request is recorded in the commit log.
- the account data in the above N accounts is located in the M first object database sets contained in the target database cluster, and the target database cluster further includes a second object database set for writing a commit log.
- the submission log is obtained from the second object database set. In the case where the submission instruction result in the submission log indicates submission, a processing operation is performed on the account data in the N accounts.
- the commit log corresponding to the distributed transaction request is written into the second object database set, instead of just caching the commit log to the local, so that in the case of a distributed transaction processing failure, it can also be used
- the commit log written in the second object database set restores the processing operations performed on the account data in the N accounts described above, so that the transaction processing status can be restored to be consistent in different distributed devices, thereby ensuring distributed transaction processing. Accuracy, thereby overcoming the problem of low accuracy of distributed transaction processing in related technologies.
- the above user equipment may be, but is not limited to, any hardware device capable of distributed transaction processing, such as a mobile phone, tablet computer, notebook computer, personal computer (PC), etc .; the above network may include, but is not limited to, Wired network.
- the wired network may include, but is not limited to, a wide area network, a metropolitan area network, and a local area network.
- the foregoing distributed transaction processing method includes:
- the distributed transaction processing request is used to request processing operations on account data in N accounts.
- the account data in N accounts are located in M first object database sets, and the M first object database sets are included in the target database cluster.
- N is an integer greater than 1
- M is an integer greater than 1.
- the submission log records a submission instruction result.
- the submission instruction result is used to indicate whether the processing operation performed on the account data in the N accounts has been submitted.
- the second object database set is included in the target database cluster.
- the foregoing distributed transaction processing method may be applied to, but not limited to, a distributed transaction processing system.
- the distributed transaction processing system may include: a financial system that involves distributed transaction processing, such as transferring funds between multiple accounts (such as fund transactions or fund payments held by an account); and may also include: A distributed transaction processing game system, such as transferring virtual resources between multiple accounts (such as transferring or exchanging personas, props, and equipment held by the account).
- a financial system that involves distributed transaction processing, such as transferring funds between multiple accounts (such as fund transactions or fund payments held by an account); and may also include: A distributed transaction processing game system, such as transferring virtual resources between multiple accounts (such as transferring or exchanging personas, props, and equipment held by the account).
- a distributed transaction processing game system such as transferring virtual resources between multiple accounts (such as transferring or exchanging personas, props, and equipment held by the account).
- the account data in the N accounts is located at M contained in the target database cluster.
- the commit log corresponding to the distributed transaction request is written into the second object database set included in the target database cluster, so as to use the result of the commit instruction recorded in the commit log to locate M
- the account data in the N accounts in the first object database set performs the processing operation requested by the distributed transaction request.
- the commit log corresponding to the distributed transaction request is written into the second object database set, instead of caching the commit log locally, so that in the case of a distributed transaction processing failure, it is also possible
- the submission log written in the second object database set is used to recover the processing operations performed on the account data in the N accounts, so as to ensure the accuracy of distributed transaction processing.
- the distributed transaction requested by the distributed transaction request is to perform a processing operation on account data in N accounts, where the account data in the N accounts is located in a target database cluster.
- the target database cluster includes M first object database sets for storing account data in N accounts and a second object database set for writing a commit log corresponding to the distributed transaction request.
- the number of accounts N of the N accounts involved in the distributed transaction processing request may be equal to or different from the number of databases M of the first object database set M.
- N the account data of each account is stored in a corresponding first object database set; when N is greater than M, the account data of at least two accounts is stored in the same one.
- the first object database set in a case where N is less than M, account data indicating that an account exists is distributedly stored in different first object database sets.
- the above-mentioned commit log corresponding to the distributed transaction request may, but is not limited to, recording two fields associated with the distributed transaction in the form of a data table: the identifier of the distributed transaction and the Submit the instruction result.
- the results of the above submission instructions include: submission and rollback. That is, in the case where the submission instruction result indicates "commit", the corresponding processing operation is performed on the account data of the N accounts requested by the distributed transaction request; in the case where the submission instruction result indicates "rollback” , The distributed transaction requested by the distributed transaction request is rolled back, the distributed transaction request is reacquired, and the commit operation for the distributed transaction is re-prepared.
- the foregoing second object database set includes a main database (also referred to as a main database instance) and a standby database (also referred to as a database instance).
- the database in the second object database set can achieve strong data synchronization, that is, the primary database is directly copied to the standby database to prevent data loss.
- the above-mentioned submission log is written into the second object database set, which can be, but is not limited to, being written into the main database, and then synchronously copied to the corresponding standby database.
- the commit log written in the second object database may be used to resume the processing of the distributed transaction. Assuming that the submitted commit log is i, you can sequentially read the first commit log to the i commit log, obtain the identifier of the distributed transaction to be processed according to the above commit log, and sequentially execute the corresponding distributed transaction. So as to avoid the inconsistent status of distributed transactions.
- the description is given with reference to the example shown in FIG. 3. It is assumed that the distributed transaction processing method can be applied to, but not limited to, the distributed transaction processing architecture shown in FIG. 3.
- the above object database set may be represented by, but not limited to, a backend set in the architecture, and the above-mentioned distributed transaction request may be, but is not limited to, generated in a gateway in the architecture.
- the gateway is provided with a Transaction Manager (TM) for coordinating the distributed transactions requested by the distributed transaction request, and the backend set is used to store account data related to the distributed transaction, which is equivalent Resource manager (RM).
- TM Transaction Manager
- RM Resource manager
- the target database cluster includes three object database sets, which are set1 to set3, respectively.
- the distributed transaction requested by the obtained distributed transaction request is to perform processing operations on account data of three accounts located in two first object database sets (such as set1 and set2), and the three accounts are account 1 to account 3.
- the account data in accounts 1 to 2 is stored in set1
- the account data in account 3 is stored in set2.
- the gateway 1 obtains a distributed transaction processing request as an example, for example, the distributed transaction requested by the distributed transaction request is: account 1 transfers 100 yuan to account 2 while the account 1 transfer 100 yuan to account 3.
- the total asset value of account 1 in set3 is reduced by 200 yuan, and the total asset value of account 2 and account 3 are increased by 100 yuan to complete the distributed transaction Requests the requested processing operation.
- the commit log can still be obtained from set3 without relying on the transaction manager TM in the gateway 1.
- the commit log cached in the server to avoid the problem of low processing accuracy caused by inconsistent data status between distributed devices due to faults.
- the commit log corresponding to the distributed transaction request is written into the second object database set, instead of caching the commit log locally, so as to realize the situation that the distributed transaction processing fails.
- writing the commit log corresponding to the distributed transaction processing request to the second object database set includes:
- the databases included in the second object database set include a primary database and a standby database.
- the above commit log can be cached in the transaction manager TM, but when the gateway where the transaction manager TM is located fails, the locally cached corresponding to the distributed transaction request cannot be obtained submission of logs, which causes problems with the transaction processing status of each distributed device involved in a distributed transaction.
- the cached commit log is written to the second object database set located at the back end in a distributed storage manner, and the commit log is performed between the primary database and the standby database included in the second object database set. Data synchronization to prevent data loss, thereby ensuring that the commit log can be read directly in the event of a failure, and the commit log is used to resume processing operations for distributed transactions.
- the above-mentioned submission log is recorded in the form of a data table, and each data row in the data table is used to record a submission log of a distributed transaction, where two fields are recorded in the submission log: distributed
- distributed The identity of the transaction and the commit indication result of the distributed transaction.
- the commit log can be shown in Table 1.
- the commit log described in each row shown in Table 1 may be written into the corresponding second object database set in turn in a distributed storage manner.
- the target database cluster includes 10 object database sets, which are set1 to set10, respectively.
- distributed transaction 1 is used to perform processing operations on account data in accounts 1 to 3, where the account data in accounts 1 to 2 is stored in set1, and the data in account 3 Account data is stored in set2;
- distributed transaction 2 is used to perform processing operations on account data in accounts 4 to 5, where account data in account 4 is stored in set3 and account data in account 5 is stored in set4 Medium;
- distributed transaction 4 is used to perform processing operations on account data in accounts 6 to 8, where account data in account 6 is stored in set5, account data in account 7 is stored in set6, and account 8 The account data is stored in set7 to set8.
- the The write results are as follows: The commit log of distributed transaction 1 will be written to set1, the commit log of distributed transaction 2 will be written to set3, and the commit log of distributed transaction 3 will be written to set5.
- the cached submission log is written to the corresponding second object database set in a distributed storage manner, and data is submitted to the submission log between the main database and the standby database in the second object database set. Synchronization can also prevent data loss while ensuring the accuracy of distributed transaction processing.
- writing the commit log to the second object database set in a distributed storage manner includes:
- the value of the shared key field may be, but is not limited to, a value in a shard key column specified in the commit log.
- the second object database set for writing to the commit log is determined based on the hash value. For example, the identifier of the second object database set is determined according to the end value of the hash value, or the identifier of the second object database set is determined according to the hash value of the specified parameter. Then, the above commit log is written into the set indicated by the determined identifier of the second object database set.
- FIG. 5 shows that the set indicated by the determined identifier of the second object database set is set1, and the commit log is written to set1.
- the second object database set determined according to the hash value may be one object database set in the M first object database sets, or may be another object other than the M first object database sets. Database set.
- the distributed transaction requested by the distributed transaction request is to perform processing operations on the account data in the accounts located in the two first object database sets (such as set1 and set2), assuming that the hash The hash value obtained by the operation indicates that set3 is the second object database set, and the commit log can be written to set3.
- the submission log is written into the second object database set in a distributed storage manner by using a hash value, thereby achieving the purpose of uniform writing, and avoiding the submission log being written into the same object database set in a centralized manner.
- writing the commit log to the second object database set in a distributed storage manner includes:
- a first object database set is designated as the second object database set in the M first object database sets, as shown in FIG. 6, the commit log of the distributed transaction can be written In set1, data synchronization is performed between the primary database and the standby database in set1.
- the submission log is written into the designated object database set of multiple first object database sets involved in the distributed transaction according to the configuration, thereby ensuring that the submission log is written uniformly to avoid the submission log from being concentrated. Write to the same object database set.
- a single insert statement (such as insert) can be used to implement batch writing of multiple submission logs, thereby achieving the effect of improving the submission log writing efficiency.
- the method includes:
- Caching the commit logs corresponding to the processing operations performed by the account data in the N accounts includes caching the commit logs corresponding to the processing operations performed by the account data in the N accounts into the internal cache queue.
- Writing the commit log to the second object database set in a distributed storage manner includes: when the number of commit logs cached in the internal cache queue reaches a first threshold, using a single insert statement to cache the commit logs in the internal cache queue The commit log is written into the corresponding second object database set in turn.
- the foregoing first threshold may be set to different values according to a specific scenario, but is not limited thereto.
- a single insert statement is used to sequentially write the commit logs cached in the internal cache queue into the corresponding second object database set.
- the background thread can assemble the 5 submission logs in the internal cache queue into a single insert statement. And sent to the second object database set. If the number of cached commit logs does not reach five, you need to enter the wait-for-commit state until the cached commit logs reach five.
- the writing process of the commit log is controlled by the first threshold.
- the commit is read from the internal cache queue.
- the log is written into the second object database set in batches, thereby simplifying the process of writing the commit log and improving the efficiency of writing the commit log.
- the method before writing the commit log to the second object database set in a distributed storage manner, the method further includes:
- a write operation is performed. That is, in this embodiment, the timestamp of the insert time in a single insert statement (such as an insert statement) is compared with the timeout time. If the write has timed out, an illegal value is written in the commit log so that The insert fails, thus avoiding storing the timeout commit log in the second object database set of the backend.
- each commit log carries an insertion time.
- five submission logs are Log1 to Log5.
- the insertion time of Log1 is 18:00:00
- the insertion time of Log2 is 21:40:00
- the insertion time of Log3 is 21:20:00
- the insertion time of Log4 is 21:50:00
- the insertion time of Log5 is The insertion time is 21:55:00
- the timeout condition is that the time stored in the internal buffer queue exceeds two hours. That is, in the above example, if the above Log1 has reached the timeout condition, an illegal value will be written in Log1. Assuming that 0 is an illegal value, an illegal value 0 can be written in Log1.
- the insertion time of the commit log by judging the insertion time of the commit log, it is determined whether the commit log to be written currently reaches the timeout condition. If the timeout condition is reached, an illegal value is written in the commit log, which can guarantee The timeliness of the commit log prevents timed-out commit logs from being written to the second object database set, which can improve the accuracy of writing commit logs.
- the method further includes:
- obtaining the first to i-th submission logs that have been successfully written includes: obtaining the successfully written data through an agent control device corresponding to a database included in the second object database set. Articles 1 to i of the submission log, where the agent control device is used to resume processing operations.
- a database in each object database set is configured with a corresponding agent control device agent, which is used to monitor data in the database and provide services for the databases to which it belongs.
- the agent control device in the case of detecting a write failure, can use the monitoring result to read the submission log that has been successfully written from the database, thereby recovering operations in the distributed transaction according to the submission log. In order to avoid the problem of inconsistent transaction processing status in the distributed equipment caused by the failure.
- the processing operation is performed on the account data in the N accounts located in the M first object database set include:
- the above-mentioned distributed transaction processing method includes a first commit mode (also referred to as an automatic commit mode) and a second commit mode (also referred to as an instruction commit mode).
- a first submission mode a corresponding automatic submission instruction can be automatically generated every time the operation is completed, wherein the automatic submission instruction carries an automatic submission time, and when the automatic submission time is reached, the first The account data in the object database set performs corresponding processing operations.
- a corresponding processing operation is performed on the account data in the first object database set only after receiving a submission instruction (such as commit).
- the operation instruction for performing a processing operation on the account data may include, but is not limited to, at least one of the following: an insert / update / delete statement and the like.
- processing operations are performed on the account data in the account according to the submission log, thereby achieving the effect of improving the flexibility of processing operations.
- the processing operation is performed on the account data in the N accounts located in the M first object database set include:
- the operation result indicates that the total operation value of the first processing operation is equal to the total operation value of the second processing operation.
- the first processing operation and the second processing operation are reverse operations, and i is an integer greater than or equal to 1 and less than or equal to N. ;
- the above-mentioned distributed transactions can, but are not limited to, instructing to perform fund deduction operations on account data in some accounts, and account data in other accounts involved in a distributed transaction. Perform fund increase operations. In order to ensure financial capital balance, the total operation value of the deduction operation and the increase operation are equal.
- performing a first processing operation on account data in i accounts, and performing a second processing operation on account data in N-i accounts includes:
- a numerical value reduction operation is performed on the account data in the i accounts, and a numerical value increase operation is performed on the account data in the N-i accounts.
- the decrease operation is a first processing operation
- the increase operation is a second processing operation.
- increasing the numerical operation is the first processing operation
- decreasing the numerical operation is the second processing operation.
- the distributed transaction request is used to request the following operations: the total asset value of account 1 needs to be reduced by 200 yuan, while the account 2 and account 3 The total value of assets needs to be increased by 100 yuan.
- the respective application clients are notified of the changes in the total asset value in the above account 1 to account 3.
- the accuracy of the submission processing operation is improved by performing the same processing operations on the account data in the account as the operations recorded in the submission log.
- the method according to the above embodiments can be implemented by means of software plus a necessary universal hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is Better implementation.
- the technical solution of the present invention in essence, or a part that contributes to the existing technology, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, The optical disc) includes several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of the embodiments of the present invention.
- the device includes:
- An obtaining unit 802 is configured to obtain a distributed transaction processing request, where the distributed transaction processing request is used to request a processing operation on account data in N accounts, where the account data in the N accounts is located M first object database sets, where the M first object database sets are included in the target database cluster, where N is an integer greater than 1, and M is an integer greater than 1;
- the writing unit 804 is configured to write the submission log corresponding to the distributed transaction processing request into the second object database set, where the submission instruction result is recorded in the submission log, and the submission instruction result is used to indicate whether the pair has been submitted.
- the obtaining unit 802 is further configured to obtain the commit log from the second object database set after the distributed transaction processing is resumed;
- a processing unit 806 configured to: when the submission instruction result in the submission log instructs to submit the processing operation performed on the account data in the N accounts, execute the account data in the N accounts The processing operation.
- the above writing unit includes:
- a cache module 902 configured to cache a submission log corresponding to a processing operation performed on account data in N accounts;
- the first writing module 904 is configured to write the commit log into the second object database set in a distributed storage manner
- a data synchronization module 906 is configured to perform data synchronization on the submission log in a database included in the second object database set, where the databases included in the second object database set include a main database and a standby database.
- the first writing module includes:
- an operation submodule configured to perform a hash operation on the shared key field value recorded in the submission log to obtain a hash value corresponding to the shared key field value
- a first determining submodule configured to determine a second object database set corresponding to the shared key field value from the target database cluster according to the hash value
- the first writing submodule is used to write the commit log into the second object database set corresponding to the shared key field value.
- the first writing module includes:
- a second determination submodule configured to determine a second object database set from the M first object database sets
- a second writing sub-module is used to write the commit log into the second object database set.
- the above cache module includes: a cache submodule, configured to cache a commit log corresponding to a processing operation performed on account data in N accounts into an internal cache queue;
- the first writing module includes: a third writing sub-module, configured to: if the number of commit logs cached in the internal cache queue reaches a first threshold, use a single insert statement to The commit log is written into the corresponding second object database set in turn.
- the writing unit further includes:
- a first obtaining module configured to obtain the insertion time of a single insert statement before writing the commit log to the second object database set in a distributed storage manner
- a second writing module is used to sequentially write illegal values in the commit log buffered in the internal cache queue when it is determined that the insertion time reaches the timeout condition, wherein the illegal values are used to prevent the internal cache from being cached.
- the commit logs cached in the queue are written to the second object database set.
- the writing unit further includes:
- a second acquisition module is used to write a commit log to the second object database set in a distributed storage manner, if a write failure is detected, and the i-th commit log cached in the internal cache queue has been Successfully write the corresponding second object database set, and obtain the first to i-th submission logs that have been successfully written into the second object database set;
- the first execution module is used to submit logs to perform processing operations according to Articles 1 to i.
- obtaining the first to i-th submission logs that have been successfully written includes: obtaining the successfully-written ones through an agent control device corresponding to a database included in the second object database set.
- Articles 1 to i submit logs where the agent control device is used to resume processing operations.
- the processing unit includes:
- a third acquisition module configured to acquire the automatic submission time in the first submission mode; and when the automatic submission time is reached, automatically perform processing operations on the account data in the N accounts;
- a fourth acquisition module configured to acquire a submission instruction in the second submission mode; and perform processing operations on the account data in the N accounts according to the submission instruction.
- the processing unit includes:
- a second execution module configured to perform a first processing operation on account data in i accounts, and perform a second processing operation on account data in Ni accounts to obtain an operation result, where the operation result indicates the first processing
- the total operation value of the operation is equal to the total operation value of the second processing operation.
- the first processing operation and the second processing operation are reverse operations, and i is an integer greater than or equal to 1 and less than or equal to N;
- performing a first processing operation on account data in i accounts, and performing a second processing operation on account data in N-i accounts includes:
- a numerical value increasing operation is performed on the account data in the i accounts, and a numerical value reducing operation is performed on the account data in the N-i accounts.
- the numerical value increasing operation is a first processing operation, and the numerical value reducing operation is a second processing operation.
- an electronic device for implementing the distributed transaction processing method includes a memory and a processor, and the computer program is stored in the memory.
- the processor is configured to execute the steps in any one of the foregoing method embodiments by using a computer program.
- the foregoing electronic device may be located in at least one network device among a plurality of network devices in a computer network.
- the foregoing processor may be configured to execute the following steps by a computer program:
- the submission log corresponding to the distributed transaction processing request is written into the second object database set, where a submission instruction result is recorded in the submission log, and the submission instruction result is used to indicate whether the account in the N accounts has been submitted.
- the processing operations performed by the data; the second object database set is contained in the target database cluster;
- the structure shown in FIG. 10 is only for illustration, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, and a mobile Internet device Internet devices (MID), PAD and other terminal equipment.
- FIG. 10 does not limit the structure of the electronic device.
- the electronic device may further include more or fewer components (such as a network interface, etc.) than those shown in FIG. 10, or have a different configuration from that shown in FIG. 10.
- the memory 1002 may be used to store software programs and modules, such as program instructions / modules corresponding to the distributed transaction processing method and device in the embodiments of the present invention.
- the processor 1004 runs the software programs and modules stored in the memory 1002, thereby Perform various functional applications and data processing, that is, implement the distributed transaction processing method described above.
- the memory 1002 may include a high-speed random access memory, and may further include a non-volatile memory, such as one or more magnetic storage devices, a flash memory, or other non-volatile solid-state memory.
- the memory 1002 may include, in a possible implementation manner, a memory remotely set relative to the processor 1004, and these remote memories may be connected to the terminal through a network.
- the above network examples include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
- the memory 1002 may be, but is not limited to, used to store content such as a commit log.
- the foregoing memory 1002 may include, but is not limited to, an obtaining unit 802, a writing unit 804, and a processing unit 806 in the above-mentioned distributed transaction processing apparatus.
- it may also include, but is not limited to, other module units in the above-mentioned distributed transaction processing apparatus, which will not be repeated in this example.
- the transmission device 1006 is used to receive or send data via a network.
- Specific examples of the foregoing network may include a wired network and a wireless network.
- the transmission device 1006 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network devices and routers through a network cable so as to communicate with the Internet or a local area network.
- the transmission device 1006 is a radio frequency (RF) module, which is used to communicate with the Internet in a wireless manner.
- RF radio frequency
- the electronic device further includes: a display 1008 for displaying a submission log and the like; and a connection bus 1010 for connecting various module components in the electronic device.
- a storage medium stores a computer program, and the computer program is configured to execute the steps in any one of the foregoing method embodiments when running.
- the foregoing storage medium may be configured to store a computer program for performing the following steps:
- the submission log corresponding to the distributed transaction processing request is written into the second object database set, where a submission instruction result is recorded in the submission log, and the submission instruction result is used to indicate whether the account in the N accounts has been submitted.
- the processing operations performed by the data; the second object database set is contained in the target database cluster;
- the foregoing storage medium may be configured to store a computer program for performing the following steps:
- the databases included in the second object database set include a primary database and a standby database.
- the foregoing storage medium may be configured to store a computer program for performing the following steps:
- S1 Perform a hash operation on the shared key field value recorded in the submission log to obtain a hash value corresponding to the shared key field value;
- the foregoing storage medium may be configured to store a computer program for performing the following steps:
- the foregoing storage medium may be configured to store a computer program for performing the following steps:
- Caching the submission logs corresponding to the processing operations performed by the account data in the N accounts includes: caching the submission logs corresponding to the processing operations performed by the account data in the N accounts into the internal cache queue;
- Writing the commit log to the second object database set in a distributed storage manner includes: when the number of commit logs cached in the internal cache queue reaches a first threshold, using a single insert statement to cache the commit logs in the internal cache queue The commit log is written into the corresponding second object database set in turn.
- the foregoing storage medium may be configured to store a computer program for performing the following steps:
- the foregoing storage medium may be configured to store a computer program for performing the following steps:
- the foregoing storage medium may be configured to store a computer program for performing the following steps:
- the foregoing storage medium may be configured to store a computer program for performing the following steps:
- the foregoing storage medium may be configured to store a computer program for performing the following steps:
- the foregoing storage medium may be configured to store a computer program for performing the following steps:
- the increase value operation is a first processing operation
- the decrease value operation is a second processing operation.
- the storage medium may include: a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
- sequence numbers of the foregoing embodiments of the present invention are merely for description, and do not represent the superiority or inferiority of the embodiments.
- the integrated unit in the foregoing embodiment When the integrated unit in the foregoing embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in the computer-readable storage medium.
- the technical solution of the present invention essentially or part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium.
- Several instructions are included to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present invention.
- the disclosed client can be implemented in other ways.
- the device embodiments described above are only schematic.
- the division of the unit is only a logical function division.
- multiple units or components may be combined or may be combined. Integration into another system, or some features can be ignored or not implemented.
- the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, units or modules, and may be electrical or other forms.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objective of the solution of this embodiment.
- each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist separately physically, or two or more units may be integrated into one unit.
- the above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- Quality & Reliability (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明公开了一种分布式事务处理方法和相关装置。该方法包括:获取分布式事务处理请求,分布式事务处理请求用于请求对N个账户中的账户数据执行处理操作,N个账户中的账户数据位于目标数据库集群中所包含的M个第一对象数据库集中;将与分布式事务处理请求对应的提交日志写入第二对象数据库集中,其中,提交日志中记录有提交指示结果,第二对象数据库集包含在目标数据库集群中;在恢复分布式事务处理后,从第二对象数据库集中获取提交日志,当提交指示结果指示提交对N个账户中的账户数据所执行的处理操作,对N个账户中的账户数据执行处理操作。本发明解决了当分布式事务的既定步骤被中断时无法保证分布式事务处理的准确性的技术问题。
Description
本申请要求于2018年6月20日提交中国专利局、申请号201810636987.4、申请名称为“分布式事务处理方法和装置、存储介质及电子装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及计算机领域,具体而言,涉及一种分布式事务处理技术。
在计算机数据库中,对所包含的数据项执行访问或修改等事务的过程中,往往都是按照既定处理步骤来完成事务提交。如果提交流程出现灾难性故障,上述既定处理步骤被中断,则需重新恢复上述事务的提交流程。
然而,对于分布式事务,由于涉及到分布式系统中的不同分布式设备,因而一旦出现处理步骤被中断的情况,将使得在不同分布式设备中事务处理状态出现不一致,从而导致无法保证分布式事务处理的准确性的问题。
针对上述的问题,目前尚未提出有效的解决方案。
发明内容
本发明实施例提供了一种分布式事务处理方法和装置、存储介质及电子装置,以至少解决当分布式事务的既定步骤被中断时无法保证分布式事务处理的准确性的技术问题。
根据本发明实施例的一个方面,提供了一种分布式事务处理方法,包括:分布式事务处理设备获取分布式事务处理请求,其中,上述分布式事务处理请求用于请求对N个账户中的账户数据执行处理操作,上述N个账户中的账户数据位于M个第一对象数据库集中,M个第一对象数据库集包含在目标数据库集群中,上述N为大于1的整数,上述M为大于1的整数;分布式事务处理设备将与上述分布式事务处理请求对应的提交日志写入第二对象数据库集中,其中,上述提交日志中记录有提交指示结果,提交指示结果用于指示是否已提交对所述N个账户中的账户数据所执行的所述处理操作,上述第二对象数据库集包含在上述目标数据库集群中;在分布式事务处理设备恢复分布式事务处理后,分布式事务处理设备可以从第二对象数据库集中获取提交日志,当提交日志中的提交指示结果指示提交对上述N个账户中的账户数据所执行的上述处理操作,分布式事务处理设备对该N个账户中的账户数据执行上述处理操作。
根据本发明实施例的另一方面,还提供了一种分布式事务处理装置,该装置用于执行本发明实施例提供的分布式事务处理方法。根据本发明实施例的又一方面,还提供了一种 存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述分布式事务处理方法。
根据本发明实施例的又一方面,还提供了一种电子装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,上述处理器通过计算机程序执行上述的分布式事务处理方法。
根据本发明实施例的又一方面,还提供了一种计算机程序产品,包括指令,当其在计算机上运行时,使得计算机执行上述的分布式事务处理方法。
在本发明实施例中,在分布式事务处理设备获取到用于请求对N个账户中的账户数据执行处理操作的分布式事务处理请求之后,将与该分布式事务请求对应的提交日志写入到第二对象数据库集中,其中,上述提交日志中记录有与分布式事务请求对应的提交指示结果,提交指示结果用于指示是否已提交对N个账户中的账户数据所执行的处理操作。上述N个账户中的账户数据位于目标数据库集群中所包含的M个第一对象数据库集,该目标数据库集群中还包含用于写入提交日志的第二对象数据库集。在分布式事务处理设备恢复分布式事务处理后,分布式事务处理设备从第二对象数据库集中获取提交日志,当提交指示结果指示提交对上述N个账户中的账户数据所执行的上述处理操作,对该N个账户中的账户数据执行上述处理操作。通过上述将与分布式事务请求对应的提交日志写入到第二对象数据库集中,而不再仅仅是将提交日志缓存到本地,从而实现在分布式事务处理过程出现故障的情况下,也可以利用第二对象数据库集中所写入的提交日志,恢复对N个账户中的账户数据所执行的处理操作,使在不同分布式设备中事务处理状态可以恢复一致,从而实现保证分布式事务处理的准确性,进而克服相关技术中分布式事务处理的准确性较低的问题。
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据本发明实施例的一种分布式事务处理方法的应用环境的示意图;
图2是根据本发明实施例的一种可选的分布式事务处理方法的流程示意图;
图3是根据本发明实施例的一种可选的分布式事务处理方法示意图;
图4是根据本发明实施例的另一种可选的分布式事务处理方法示意图;
图5是根据本发明实施例的又一种可选的分布式事务处理方法示意图;
图6是根据本发明实施例的又一种可选的分布式事务处理方法示意图;
图7是根据本发明实施例的又一种可选的分布式事务处理方法示意图;
图8是根据本发明实施例的一种可选的分布式事务处理装置结构示意图;
图9是根据本发明实施例的另一种可选的分布式事务处理装置结构示意图;
图10是根据本发明实施例的一种可选的电子装置的结构示意图。
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
根据本发明实施例的一个方面,提供了一种分布式事务处理方法,作为一种可选的实施方式,本申请实施例提供的分布式处理方法可以但不限于应用于如图1所示的环境中。
用户设备104用于与用户102完成人机交互过程,如用户102可以通过人机交互操作,实现对用户设备104中所运行账户的账户数据执行处理操作,其中,该用户设备104中配置有存储器106与处理器108。在本实施例中,上述处理操作可以包括但不限于对分布式事务处理请求所请求的N个账户中的账户数据执行处理操作,上述N个账户中的账户数据位于目标数据库集群112中所包含的M个第一对象数据库集114中。在用户设备104获取到分布式事务处理请求之后,可以将与上述分布式事务处理请求对应的提交日志通过网络110,写入到目标数据库集群112包含的第二对象数据库集116中,如步骤S102。其中,上述提交日志用于记录与分布式事务处理请求对应的提交指示结果,提交指示结果用于指示是否已提交对N个账户中的账户数据所执行的处理操作。在上述目标数据库集群112中包括第一对象数据库集114及第二对象数据库116,M个第一对象数据库集114用于存储N个账户中的账户数据,第二对象数据库集116用于存储上述提交日志。在用户设备104恢复分布式事务处理后,从第二对象数据库集中获取提交日志,当提交日志中的提交指示结果指示可以提交处理操作时,则执行上述分布式事务请求所请求的处理操作,即对M个第一对象数据库集中N个账户中的账户数据执行处理操作。
需要说明的是,在本实施例中,在获取到用于请求对N个账户中的账户数据执行处理操作的分布式事务处理请求之后,将与该分布式事务请求对应的提交日志写入到第二对象数据库集中,其中,上述提交日志中记录有与分布式事务请求对应的提交指示结果。上述N个账户中的账户数据位于目标数据库集群中所包含的M个第一对象数据库集,该目标数 据库集群中还包含用于写入提交日志的第二对象数据库集。在恢复分布式事务处理后,从第二对象数据库集中获取提交日志,在上述提交日志中的提交指示结果指示提交的情况下,则对上述N个账户中的账户数据执行处理操作。通过上述将与分布式事务请求对应的提交日志写入到第二对象数据库集中,而不再仅仅是将提交日志缓存到本地,从而实现在分布式事务处理过程出现故障的情况下,也可以利用第二对象数据库集中所写入的提交日志,恢复对上述N个账户中的账户数据所执行的处理操作,使在不同分布式设备中事务处理状态可以恢复一致,从而实现保证分布式事务处理的准确性,进而克服相关技术中分布式事务处理的准确性较低的问题。
可选地,上述用户设备可以但不限于为任何可以进行分布式事务处理的硬件设备,例如手机、平板电脑、笔记本电脑、个人计算机(personal computer,简称PC)等;上述网络可以包括但不限于有线网络。上述有线网络可以包括但不限于:广域网、城域网、局域网。
作为一种可选的实施方式,如图2所示,上述分布式事务处理方法包括:
S202,获取分布式事务处理请求。
其中,分布式事务处理请求用于请求对N个账户中的账户数据执行处理操作,N个账户中的账户数据位于M个第一对象数据库集中,M个第一对象数据库集包含在目标数据库集群中,N为大于1的整数,M为大于1的整数。
S204,将与分布式事务处理请求对应的提交日志写入第二对象数据库集中。
其中,提交日志中记录有提交指示结果,提交指示结果用于指示是否已提交对所述N个账户中的账户数据所执行的所述处理操作,第二对象数据库集包含在目标数据库集群中。
S206,在恢复分布式事务处理后,从第二对象数据库集中获取提交日志。
S208,当提交日志中的提交指示结果指示提交对N个账户中的账户数据所执行的处理操作,对N个账户中的账户数据执行处理操作。
可选地,在本实施例中,上述分布式事务处理方法可以但不限于应用于分布式事务处理系统中。其中,该分布式事务处理系统可以包括:涉及分布式事务处理的金融系统,如在多个账户之间进行资金转移(如账户所持有的资金交易或资金支付等);还可以包括:涉及分布式事务处理的游戏系统,如在多个账户之间进行虚拟资源转移(如账户所持有的人物角色、道具及装备等进行转移或交换)。上述仅是一种示例,本实施例中对此不做任何限定。
需要说明的是,在本实施例中,在获取到对N个账户中的账户数据执行处理操作的分布式事务处理请求之后,上述N个账户中的账户数据位于目标数据库集群中所包含的M个第一对象数据库中,将与分布式事务请求对应的提交日志写入包含在目标数据库集群中的第二对象数据库集中,从而实现利用提交日志中所记录的提交指示结果,来对位于M个第一对象数据库集中的N个账户中的账户数据执行上述分布式事务请求所请求的处理操作。 也就是说,将与分布式事务请求对应的提交日志写入第二对象数据库集中,而不再是将该提交日志缓存在本地,从而实现在分布式事务处理过程出现故障的情况下,也可以利用第二对象数据库集中所写入的提交日志,对上述N个账户中的账户数据所执行的处理操作进行恢复,从而实现保证分布式事务处理的准确性。
可选地,在本实施例中,上述分布式事务请求所请求的分布式事务为对N个账户中的账户数据执行处理操作,其中,上述N个账户中的账户数据位于目标数据库集群。该目标数据库集群中包括用于存储N个账户中的账户数据的M个第一对象数据库集和用于写入与上述分布式事务请求对应的提交日志的第二对象数据库集。
需要说明的是,在本实施例中,分布式事务处理请求中所涉及的N个账户的账户数量N与M个第一对象数据库集的数据库数量M可以相等,也可以不等。例如,在N等于M的情况下,表示每个账户的账户数据分别存储在一个对应的第一对象数据库集中;在N大于M的情况下,表示存在至少两个账户的账户数据存储在同一个第一对象数据库集中;在N小于M的情况下,表示存在一个账户的账户数据分布式存储在不同的第一对象数据库集中。
可选地,在本实施例中,上述与分布式事务请求对应的提交日志可以但不限于以数据表的形式记录分布式事务相关联的两个字段:分布式事务的标识和分布式事务的提交指示结果。其中,上述提交指示结果包括:提交、回滚。也就是说,在提交指示结果指示“提交”的情况下,则对分布式事务请求所请求的对N个账户的账户数据执行相应的处理操作;在提交指示结果指示“回滚”的情况下,则回滚分布式事务请求所请求的分布式事务,重新获取分布式事务请求,重新准备对分布式事务的提交操作。
可选地,在本实施例中,上述第二对象数据库集中包括主数据库(也可称主数据库实例)和备数据库(也可称被数据库实例)。其中第二对象数据库集中的数据库可以实现数据强同步,也就是说,主数据库会被直接复制到备数据库中,以防止数据丢失。在本实施例中,上述提交日志被写入第二对象数据库集中,可以但不限于被写入主数据库,再同步复制到相应的备数据库中。
可选地,在本实施例中,在分布式事务处理过程中出现故障的情况下,则可以利用上述第二对象数据库中所写入的提交日志来恢复对分布式事务的处理过程。假设写入的提交日志为i条,则可以依次读取第1条提交日志至第i条提交日志,根据上述提交日志获取待处理的分布式事务的标识,并依次执行对应的分布式事务,从而避免分布式事务状态不一致的情况。
结合图3所示示例进行说明。假设分布式事务处理方法可以但不限于应用于如图3所示的分布式事务处理架构中。上述对象数据库集可以但不限于通过该架构中的后端set表示,上述分布式事务请求可以但不限于在该架构中的网关中生成。其中,上述网关中设置有事务管理器(Transaction Manager,简称TM)用于协调上述分布式事务请求所请求的分 布式事务,上述后端set用于存储分布式事务所涉及的账户数据,相当于资源管理器(Resource Manager,简称RM)。
在一种可能的实现方式中,如图3所示,假设目标数据库集群中包括3个对象数据库集,分别为set1至set3。获取到的分布式事务请求所请求的分布式事务为对位于2个第一对象数据库集(如set1和set2)中的3个账户的账户数据执行处理操作,3个账户分别为账户1至账户3。其中,账户1至账户2中的账户数据存储在set1中,账户3中的账户数据存储在set2中。
以分布式处理设备是网关1为例,若网关1获取到分布式事务处理请求为例,例如,该分布式事务请求所请求的分布式事务为:账户1向账户2转账100元,同时账户1向账户3转账100元。获取与该分布式事务处理请求对应的提交日志,并将提交日志写入到上述目标数据库集群中所包含的第二对象数据库集中,假设选定第二对象数据库集为set3,则将上述提交日志写入set3中。在提交日志中的提交指示结果为“提交”的情况下,对set3中账户1的资产总值减去200元,对账户2与账户3的资产总值分别增加100元,以完成分布式事务请求所请求的处理操作。
在一种可能的实现方式中,假设在网关1出现断电故障的情况下,通过本实施例提供的方式,仍可以从set3中获取到提交日志,而无需依赖于网关1中事务管理器TM中所缓存的提交日志,从而避免因故障导致分布式设备之间数据状态不一致所导致的处理准确性较低的问题。
通过本申请提供的实施例,将与分布式事务请求对应的提交日志写入第二对象数据库集中,而不再是将提交日志缓存在本地,从而实现在分布式事务处理过程出现故障的情况下,也可以利用第二对象数据库集中所写入的提交日志,恢复对M个第一对象数据库集中的上述N个账户中的账户数据所执行的处理操作,从而实现保证分布式事务处理的准确性。
作为一种可选的方案,将与分布式事务处理请求对应的提交日志写入第二对象数据库集中包括:
S1,缓存与N个账户中的账户数据所执行的处理操作相对应的提交日志。
S2,将提交日志按照分布存储方式写入第二对象数据库集。
S3,在第二对象数据库集所包含的数据库中,对提交日志进行数据同步,其中,第二对象数据库集所包含的数据库包括主数据库和备数据库。
需要说明的是,在相关技术中,上述提交日志可以缓存在事务管理器TM中,但当事务管理器TM所在网关出现故障的情况下,将无法获取本地所缓存的与分布式事务请求对应的提交日志,从而导致分布式事务所涉及的各个分布式设备中事务处理状态的问题。
而在本实施例中,通过将缓存的提交日志按照分布式存储方式写入位于后端的第二对象数据库集中,并将提交日志在第二对象数据库集中所包含的主数据库和备数据库之间进 行数据同步,以防止数据丢失,从而保证故障时可以直接读取提交日志,并利用该提交日志恢复分布式事务的处理操作。
可选地,在本实施例中,上述提交日志以数据表形式记录,数据表中每一条数据行用于记录一个分布式事务的提交日志,其中,提交日志中记录有两个字段:分布式事务的标识和分布式事务的提交指示结果。例如,提交日志可以如表1所示。
表1
分布式事务的标识(ID) | 提交指示结果 |
1 | 提交 |
2 | 回滚 |
3 | 提交 |
在本实施例中,可以按照分布式存储方式,依次将表1所示的每一行中所记载的提交日志依次写入对应的第二对象数据库集中。
结合以下示例进行说明,如图4所示,假设目标数据库集群中包括10个对象数据库集,分别为set1至set10。在一种可能的实现方式中,假设分布式事务1用于对账户1至账户3中的账户数据执行处理操作,其中,账户1至账户2中的账户数据存储在set1中,账户3中的账户数据存储在set2中;假设分布式事务2用于对账户4至账户5中的账户数据执行处理操作,其中,账户4中的账户数据存储在set3中,账户5中的账户数据存储在set4中;假设分布式事务4用于对账户6至账户8中的账户数据执行处理操作,其中,账户6中的账户数据存储在set5中,账户7中的账户数据存储在set6中,账户8中的账户数据存储在set7至set8中。
在一种可能的实现方式中,假设指定第二对象数据库集为每个分布式事务所涉及的多个第一对象数据库集中的第1个对象数据库集,则上述表1所示的提交日志的写入结果如下:分布式事务1的提交日志将被写入set1中,分布式事务2的提交日志将被写入set3中,分布式事务3的提交日志将被写入set5中。
通过本申请提供的实施例,将缓存的提交日志按照分布式存储方式写入到对应的第二对象数据库集中,并在第二对象数据库集中的主数据库和备数据库之间,对提交日志进行数据同步,在保证分布式事务处理的准确性的情况下,还可以防止数据丢失。
作为一种可选的方案,将提交日志按照分布存储方式写入第二对象数据库集包括:
S1,对提交日志中所记录的共享关键字段值进行哈希运算,得到与共享关键字段值对应的哈希值。
S2,根据哈希值从目标数据库集群中确定出与共享关键字段值相对应的第二对象数据库集。
S3,将提交日志写入与共享关键字段值相对应的第二对象数据库集。
可选地,在本实施例中,上述共享关键字段值可以但不限于为提交日志中所指定的shard key列中的数值。
结合图5所示进行说明,假设以提交日志中所记录的分布式事务的标识所在列为所指定的shard key列,则可以依次对分布式事务的标识ID进行哈希运算,得到哈希值。根据哈希值确定用于写入提交日志的第二对象数据库集。例如,根据哈希值的末尾值确定第二对象数据库集的标识,或根据哈希值对指定参数取余后的结果确定第二对象数据库集的标识。然后,再将上述提交日志写入确定出的第二对象数据库集的标识所指示的set中。图5示出了确定出的第二对象数据库集的标识所指示的set为set1,则将提交日志写入到set1中。
需要说明的是,上述根据哈希值所确定出的第二对象数据库集可以为M个第一对象数据库集中的一个对象数据库集,也可以为M个第一对象数据库集之外的另一个对象数据库集。
仍以上述图3示例为例,分布式事务请求所请求的分布式事务为对位于2个第一对象数据库集(如set1和set2)中的账户中的账户数据执行处理操作,假设经过哈希运算得到的哈希值指示set3为第二对象数据库集,则可以将提交日志写入set3中。
通过本申请提供的实施例,利用哈希值对提交日志按照分布式存储方式写入第二对象数据库集中,从而实现均匀写入的目的,以避免提交日志被集中写入到同一个对象数据库集。
作为一种可选的方案,将提交日志按照分布存储方式写入第二对象数据库集包括:
S1,从M个第一对象数据库集中确定出第二对象数据库集。
S2,将提交日志写入第二对象数据库集。
结合图6所示示例进行说明,假设指定M个第一对象数据库集中的一个第一个对象数据库集作为第二对象数据库集,则如图6所示,可以将分布式事务的提交日志写入set1中,并在set1中的主数据库和备数据库之间进行数据同步。
通过本申请提供的实施例,通过将提交日志按照配置写入分布式事务所涉及的多个第一对象数据库集中的指定对象数据库集中,从而保证提交日志被均匀写入,以避免提交日志被集中写入到同一个对象数据库集。
作为一种可选的方案,在本实施例中,可以利用单条插入语句(如insert),实现对多条提交日志进行批量写入,从而实现提升提交日志写入效率的效果。该方法包括:
S1,缓存与N个账户中的账户数据所执行的处理操作相对应的提交日志包括:将与N个账户中的账户数据所执行的处理操作相对应的提交日志缓存至内部缓存队列中。
S2,将提交日志按照分布存储方式写入第二对象数据库集包括:在内部缓存队列中所缓存的提交日志的数量达到第一阈值的情况下,利用单条插入语句,将内部缓存队列中所缓存的提交日志依次写入对应的第二对象数据库集中。
可选地,在本实施例中,上述第一阈值可以但不限于根据具体场景设置为不同取值。在已缓存的提交日志的数量达到上述第一阈值的情况下,则利用单条插入语句,将内部缓存队列中所缓存的提交日志依次写入对应的第二对象数据库集中。
假设第一阈值以5为例,则在缓存提交日志的过程中,当内部缓存队列中缓存至5个提交日志时,后台线程可以将内部缓存队列中的5个提交日志组装成单条insert语句,并发送到第二对象数据库集中。如果缓存的提交日志未达到5个的情况下,则需进入等待提交状态,直到缓存的提交日志到达5个。
通过本申请提供的实施例,通过第一阈值控制对提交日志的写入过程,在内部缓存队列中所缓存的提交日志的数量达到第一阈值的情况下,则从内部缓存队列中读取提交日志,并将其批量写入第二对象数据库集中,从而达到简化提交日志的写入操作的流程,提高写入提交日志的效率。
作为一种可选的方案,在将提交日志按照分布存储方式写入第二对象数据库集之前,还包括:
S1,获取单条插入语句的插入时间。
S2,在确定出插入时间达到超时条件的情况下,在内部缓存队列中所缓存的提交日志中依次写入非法值,其中,非法值用于阻止将内部缓存队列中所缓存的提交日志写入第二对象数据库集。
在插入时间未达到超时条件的情况下,执行写入操作。也就是说,在本实施例中,在单条插入语句(如insert语句)中插入时间的时间戳与超时时间比较得到,写入已超时的情况下,则在提交日志中写入非法值以使插入失败,从而避免将超时的提交日志存储到后端的第二对象数据库集中。
结合以下示例进行说明,如图7所示,在内部缓存队列中已经缓存5条提交日志的情况下,每一个提交日志都携带有插入时间。其中,5条提交日志分别为Log1至Log5。例如,假设Log1的插入时间为18:00:00,Log2的插入时间为21:40:00,Log3的插入时间为21:20:00,Log4的插入时间为21:50:00,而Log5的插入时间为21:55:00,则Log1已经插入到内部缓冲队列达到4个小时。在一种可能的实现方式中,假设超时条件为存储到内部缓冲队列的时间超过两个小时。也就是说,在上述示例中,上述Log1已达到超时条件,则在Log1中将写入非法值,假设0为非法值,可在Log1中写入非法值0。
在一种可能的实现方式中,在利用单条插入语句将上述5条提交日志写入第二对象数据库集的过程中,若检测到Log1至Log5中存在携带有非法值的Log1,则上述5条提交日志将无法被顺利写入第二对象数据库集。
通过本申请提供的实施例,通过缓存提交日志的插入时间,判定当前所要写入的提交日志是否达到超时条件,在达到超时条件的情况下,则在提交日志中写入非法值,从而可以保证提交日志的时效性,阻止超时的提交日志写入第二对象数据库集,从而可以提高写入提交日志的准确性。
作为一种可选的方案,在将提交日志按照分布存储方式写入第二对象数据库集的过程中,还包括:
S1,在检测出写入故障,且内部缓存队列中所缓存的第i条提交日志已成功写入对应的第二对象数据库集的情况下,获取已成功写入的第1条至第i条提交日志。
S2,根据第1条至第i条提交日志执行处理操作。
可选地,在本实施例中,获取已成功写入的第1条至第i条提交日志包括:通过与第二对象数据库集所包含的数据库相对应的代理控制设备,获取已成功写入的第1条至第i条提交日志,其中,代理控制设备用于恢复处理操作。
需要说明的是,在本实施例中,每个对象数据库集中的数据库均配置有相应的代理控制设备agent,该代理控制设备用于监控数据库中的数据,为其所从属的数据库提供服务。
通过本申请提供的实施例,在检测到写入故障的情况下,代理控制设备可以利用监控结果,从数据库中读取已成功写入的提交日志,从而按照提交日志恢复分布式事务中的操作,以避免故障所导致的分布式设备中事务处理状态出现不一致的问题。
作为一种可选的方案,在提交指示结果指示提交N个账户中的账户数据所执行的处理操作的情况下,对位于M个第一对象数据库集中的N个账户中的账户数据执行处理操作包括:
1)在第一提交模式下,获取自动提交时刻;在达到自动提交时刻的情况下,自动对位于M个第一对象数据库集中的N个账户中的账户数据执行处理操作;
2)在第二提交模式下,获取提交指令;根据提交指令,对位于M个第一对象数据库集中的N个账户中的账户数据执行处理操作。
可选地,在本实施例中,上述分布式事务处理方法包括:第一提交模式(也可称作自动提交模式),第二提交模式(也可称作指令提交模式)。其中,在第一提交模式下,每次完成操作均可自动生成对应的自动提交指令,其中,该自动提交指令中携带有自动提交时刻,在达到自动提交时刻的情况下,则自动对第一对象数据库集中的账户数据执行对应的处理操作。在第二提交模式下,在接收到提交指令(如commit)后,才会对第一对象数据库集中的账户数据执行对应的处理操作。
可选地,在本实施例中,对账户数据执行处理操作的操作指令可以包括但不限于以下至少之一:insert/update/delete语句等。
通过本申请提供的实施例,在不同的提交模式下,分别根据提交日志对账户中的账户数据执行处理操作,从而达到了提高执行处理操作的灵活性的效果。
作为一种可选的方案,在提交指示结果指示提交N个账户中的账户数据所执行的处理操作的情况下,对位于M个第一对象数据库集中的N个账户中的账户数据执行处理操作包括:
S1,对i个账户中的账户数据执行第一处理操作,对N-i个账户中的账户数据执行第二处理操作,得到操作结果。
其中,操作结果指示第一处理操作的总操作数值与第二处理操作的总操作数值相等,第一处理操作与第二处理操作为反向操作,i为大于等于1,且小于等于N的整数;
S2,将操作结果通知N个账户所对应的应用客户端。
以金融系统在多个账户之间进行资金转移为例,上述分布式事务可以但不限于指示对部分账户中的账户数据执行资金扣除操作,而对分布式事务所涉及的其他账户中的账户数据执行资金增加操作。为了保证金融资金平衡,扣除操作与增加操作的总操作数值相等。
可选地,在本实施例中,对i个账户中的账户数据执行第一处理操作,对N-i个账户中的账户数据执行第二处理操作包括:
1)对i个账户中的账户数据执行减少数值操作,对N-i个账户中的账户数据执行增加数值操作。其中,减少数值操作为第一处理操作,增加数值操作为第二处理操作。
或者,
2)对i个账户中的账户数据执行增加数值操作,对N-i个账户中的账户数据执行减少数值操作。
其中,增加数值操作为第一处理操作,减少数值操作为第二处理操作。
结合以下示例进行说明,假设N=3,i=1,N-i=2,此外,分布式事务请求用于请求执行以下操作:账户1的资产总值需要减少200元,同时账户2与账户3的资产总值分别需增加100元。则在获取到与上述分布式事务请求对应的提交日志后,对上述账户1至账户3中的账户数据执行以下操作:将上述账户1资产总值减少200元,同时账户2与账户3的资产总值分别增加100元。然后,将上述账户1至账户3中的资产总值的变化,通知给各自的应用客户端。
通过本申请提供的实施例,通过对账户中的账户数据执行与提交日志中所记载的操作相同的处理操作,从而提高了提交处理操作的准确性。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例的方法。
根据本发明实施例的另一个方面,还提供了一种用于实施上述分布式事务处理方法的分布式事务处理装置,该装置用于执行前述实施例提供的任一分布式事务处理方法。如图8所示,该装置包括:
(1)获取单元802,用于获取分布式事务处理请求,其中,所述分布式事务处理请求用于请求对N个账户中的账户数据执行处理操作,所述N个账户中的账户数据位于M个第一对象数据库集中,所述M个第一对象数据库集包含在目标数据库集群中,所述N为大于1的整数,所述M为大于1的整数;
(2)写入单元804,用于将与分布式事务处理请求对应的提交日志写入第二对象数据库集中,其中,提交日志中记录有提交指示结果,提交指示结果用于指示是否已提交对所述N个账户中的账户数据所执行的所述处理操作;第二对象数据库集包含在目标数据库集群中;
(3)获取单元802,还用于在恢复分布式事务处理后,从第二对象数据库集中获取所述提交日志;
(4)处理单元806,用于当提交日志中的所述提交指示结果指示提交对所述N个账户中的账户数据所执行的所述处理操作,对所述N个账户中的账户数据执行所述处理操作。
作为一种可选的实施方案,如图9所示,上述写入单元包括:
(1)缓存模块902,用于缓存与N个账户中的账户数据所执行的处理操作相对应的提交日志;
(2)第一写入模块904,用于将提交日志按照分布存储方式写入第二对象数据库集;
(3)数据同步模块906,用于在第二对象数据库集所包含的数据库中,对提交日志进行数据同步,其中,第二对象数据库集所包含的数据库包括主数据库和备数据库。
作为一种可选的实施方案,上述第一写入模块包括:
(1)运算子模块,用于对提交日志中所记录的共享关键字段值进行哈希运算,得到与共享关键字段值对应的哈希值;
(2)第一确定子模块,用于根据哈希值从目标数据库集群中确定出与共享关键字段值相对应的第二对象数据库集;
(3)第一写入子模块,用于将提交日志写入与共享关键字段值相对应的第二对象数据库集。
作为一种可选的实施方案,上述第一写入模块包括:
(1)第二确定子模块,用于从M个第一对象数据库集中确定出第二对象数据库集;
(2)第二写入子模块,用于将提交日志写入第二对象数据库集。
作为一种可选的实施方案,
(1)上述缓存模块包括:缓存子模块,用于将与N个账户中的账户数据所执行的处理操作相对应的提交日志缓存至内部缓存队列中;
(2)上述第一写入模块包括:第三写入子模块,用于若内部缓存队列中所缓存的提交日志的数量达到第一阈值,利用单条插入语句,将内部缓存队列中所缓存的提交日志依次写入对应的第二对象数据库集中。
作为一种可选的实施方案,上述写入单元还包括:
(1)第一获取模块,用于在将提交日志按照分布存储方式写入第二对象数据库集之前,获取单条插入语句的插入时间;
(2)第二写入模块,用于在确定出插入时间达到超时条件的情况下,在内部缓存队列中所缓存的提交日志中依次写入非法值,其中,非法值用于阻止将内部缓存队列中所缓存的提交日志写入第二对象数据库集。
作为一种可选的实施方案,上述写入单元还包括:
(1)第二获取模块,用于在将提交日志按照分布存储方式写入第二对象数据库集的过程中,若检测出写入故障,且内部缓存队列中所缓存的第i条提交日志已成功写入对应的第二对象数据库集,获取已成功写入第二对象数据库集中的第1条至第i条提交日志;
(2)第一执行模块,用于根据第1条至第i条提交日志执行处理操作。
可选地,在本实施例中,获取已成功写入的第1条至第i条提交日志包括:通过与第二对象数据库集所包含的数据库对应的代理控制设备,获取已成功写入的第1条至第i条提交日志,其中,代理控制设备用于恢复处理操作。
作为一种可选的实施方案,处理单元包括:
(1)第三获取模块,用于在第一提交模式下,获取自动提交时刻;在达到自动提交时刻的情况下,自动对N个账户中的账户数据执行处理操作;
(2)第四获取模块,用于在第二提交模式下,获取提交指令;根据提交指令,对N个账户中的账户数据执行处理操作。
作为一种可选的实施方案,上述处理单元包括:
(1)第二执行模块,用于对i个账户中的账户数据执行第一处理操作,对N-i个账户中的账户数据执行第二处理操作,得到操作结果,其中,操作结果指示第一处理操作的总操作数值与第二处理操作的总操作数值相等,第一处理操作与第二处理操作为反向操作,i为大于等于1,且小于等于N的整数;
(2)通知模块,用于将操作结果通知N个账户所对应的应用客户端。
可选地,在本实施例中,对i个账户中的账户数据执行第一处理操作,对N-i个账户中的账户数据执行第二处理操作包括:
1)对i个账户中的账户数据执行减少数值操作,对N-i个账户中的账户数据执行增加数值操作;所述减少数值操作为第一处理操作,所述增加数值操作为第二处理操作;
或者,
2)对i个账户中的账户数据执行增加数值操作,对N-i个账户中的账户数据执行减少数值操作,所述增加数值操作为第一处理操作,所述减少数值操作为第二处理操作。
根据本发明实施例的又一个方面,还提供了一种用于实施上述分布式事务处理方法的电子装置,如图10所示,该电子装置包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为通过计算机程序执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述电子装置可以位于计算机网络的多个网络设备中的至少一个网络设备。
可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:
S1,获取分布式事务处理请求,其中,所述分布式事务处理请求用于请求对N个账户中的账户数据执行处理操作,所述N个账户中的账户数据位于M个第一对象数据库集中,所述M个第一对象数据库集包含在目标数据库集群中,所述N为大于1的整数,所述M为大于1的整数;
S2,将与分布式事务处理请求对应的提交日志写入第二对象数据库集中,其中,提交日志中记录有提交指示结果,提交指示结果用于指示是否已提交对所述N个账户中的账户数据所执行的所述处理操作;第二对象数据库集包含在目标数据库集群中;
S3,在恢复分布式事务处理后,从所述第二对象数据库集中获取所述提交日志;
S4,当所述提交日志中的提交指示结果指示提交对所述N个账户中的账户数据所执行的所述处理操作,对所述N个账户中的账户数据执行所述处理操作。
可选地,本领域普通技术人员可以理解,图10所示的结构仅为示意,电子装置也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图10其并不对上述电子装置的结构造成限定。例如,电子装置还可包括比图10中所示更多或者更少的组件(如网络接口等),或者具有与图10所示不同的配置。
其中,存储器1002可用于存储软件程序以及模块,如本发明实施例中的分布式事务处理方法和装置对应的程序指令/模块,处理器1004通过运行存储在存储器1002内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的分布式事务处理方法。存储器1002可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器1002可在一种可能的实现方式中包括相对于处理器1004远程设置的存储器,这些远程存储器可以通过网络连接至终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。其中,具体地,存储器1002可以但不限于用于存储提交日志等内容。作为一种示例,如图10所示,上述存储器1002中可以但不限于包括上述分布式事务处理装置中的获取单元802、写入单元804及处理单元806。此外,还可以包括但不限于上述分布式事务处理装置中的其他模块单元,本示例中不再赘述。
上述的传输装置1006用于经由一个网络接收或者发送数据。上述的网络具体实例可包括有线网络及无线网络。在一个实例中,传输装置1006包括一个网络适配器(Network Interface Controller,简称NIC),其可通过网线与其他网络设备与路由器相连从而可与互联网或局域网进行通讯。在一个实例中,传输装置1006为射频(Radio Frequency,简称RF)模块,其用于通过无线方式与互联网进行通讯。
此外,上述电子装置还包括:显示器1008,用于显示提交日志等内容;和连接总线1010,用于连接上述电子装置中的各个模块部件。
根据本发明的实施例的又一方面,还提供了一种存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,获取分布式事务处理请求,其中,所述分布式事务处理请求用于请求对N个账户中的账户数据执行处理操作,所述N个账户中的账户数据位于M个第一对象数据库集中,所述M个第一对象数据库集包含在目标数据库集群中,所述N为大于1的整数,所述M为大于1的整数;
S2,将与分布式事务处理请求对应的提交日志写入第二对象数据库集中,其中,提交日志中记录有提交指示结果,提交指示结果用于指示是否已提交对所述N个账户中的账户数据所执行的所述处理操作;第二对象数据库集包含在目标数据库集群中;
S3,在恢复分布式事务处理后,从所述第二对象数据库集中获取所述提交日志;
S4,当所述提交日志中的提交指示结果指示提交对所述N个账户中的账户数据所执行的所述处理操作,对所述N个账户中的账户数据执行所述处理操作。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,缓存与N个账户中的账户数据所执行的处理操作相对应的提交日志;
S2,将提交日志按照分布存储方式写入第二对象数据库集;
S3,在第二对象数据库集所包含的数据库中,对提交日志进行数据同步,其中,第二对象数据库集所包含的数据库包括主数据库和备数据库。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,对提交日志中所记录的共享关键字段值进行哈希运算,得到与共享关键字段值对应的哈希值;
S2,根据所述哈希值从所述目标数据库集群中确定出与所述共享关键字段值相对应的所述第二对象数据库集;
S3,将提交日志写入与共享关键字段值相对应的第二对象数据库集。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,从M个第一对象数据库集中确定出第二对象数据库集;
S2,将提交日志写入第二对象数据库集。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,缓存与N个账户中的账户数据所执行的处理操作相对应的提交日志包括:将与N个账户中的账户数据所执行的处理操作相对应的提交日志缓存至内部缓存队列中;
S2,将提交日志按照分布存储方式写入第二对象数据库集包括:在内部缓存队列中所缓存的提交日志的数量达到第一阈值的情况下,利用单条插入语句,将内部缓存队列中所缓存的提交日志依次写入对应的第二对象数据库集中。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,获取单条插入语句的插入时间;
S2,在确定出插入时间达到超时条件的情况下,在内部缓存队列中所缓存的提交日志中依次写入非法值,其中,非法值用于阻止将内部缓存队列中所缓存的提交日志写入第二对象数据库集。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,当检测出写入故障,且所述内部缓存队列中所缓存的第i条提交日志已成功写入对应的所述第二对象数据库集,获取已成功写入第二对象数据库集中的第1条至第i条提交日志;
S2,根据第1条至第i条提交日志执行处理操作。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,通过与第二对象数据库集所包含的数据库对应的代理控制设备,获取已成功写入第二对象数据库集中的第1条至第i条提交日志,其中,代理控制设备用于恢复处理操作。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,在第一提交模式下,获取自动提交时刻;在达到自动提交时刻的情况下,自动对N个账户中的账户数据执行处理操作;
S2,在第二提交模式下,获取提交指令;根据提交指令,对N个账户中的账户数据执行处理操作。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,对i个账户中的账户数据执行第一处理操作,对N-i个账户中的账户数据执行第二处理操作,得到操作结果,其中,操作结果指示第一处理操作的总操作数值与第二处理操作的总操作数值相等,第一处理操作与第二处理操作为反向操作,i为大于等于1,且小于等于N的整数;
S2,将操作结果通知N个账户所对应的应用客户端。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,对i个账户中的账户数据执行减少数值操作,对N-i个账户中的账户数据执行增加数值操作;所述减少数值操作为第一处理操作,所述增加数值操作为第二处理操作;
或者,
S2,对i个账户中的账户数据执行增加数值操作,对N-i个账户中的账户数据执行减少数值操作,所述增加数值操作为第一处理操作,所述减少数值操作为第二处理操作。
可选地,在本实施例中,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,简称ROM)、随机存取器(Random Access Memory,简称RAM)、磁盘或光盘等。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
上述实施例中的集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在上述计算机可读取的存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在存储介质中,包括若干指令用以使得一台或多台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的客户端,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。
Claims (15)
- 一种分布式事务处理方法,包括:分布式事务处理设备获取分布式事务处理请求,其中,所述分布式事务处理请求用于请求对N个账户中的账户数据执行处理操作,所述N个账户中的账户数据位于M个第一对象数据库集中,所述M个第一对象数据库集包含在目标数据库集群中,所述N为大于1的整数,所述M为大于1的整数;所述分布式事务处理设备将与所述分布式事务处理请求对应的提交日志写入第二对象数据库集中,其中,所述提交日志中记录有提交指示结果,所述提交指示结果用于指示是否已提交对所述N个账户中的账户数据所执行的所述处理操作;所述第二对象数据库集包含在所述目标数据库集群中;在所述分布式事务处理设备恢复分布式事务处理后,所述分布式事务处理设备从所述第二对象数据库集中获取所述提交日志;当所述提交日志中的提交指示结果指示提交对所述N个账户中的账户数据所执行的所述处理操作,所述分布式事务处理设备对所述N个账户中的账户数据执行所述处理操作。
- 根据权利要求1所述的方法,所述分布式事务处理设备将与所述分布式事务处理请求对应的提交日志写入第二对象数据库集中,包括:所述分布式事务处理设备缓存与所述N个账户中的账户数据所执行的所述处理操作相对应的所述提交日志;所述分布式事务处理设备将所述提交日志按照分布存储方式写入所述第二对象数据库集;所述分布式事务处理设备在所述第二对象数据库集所包含的数据库中,对所述提交日志进行数据同步,其中,所述第二对象数据库集所包含的数据库包括主数据库和备数据库。
- 根据权利要求2所述的方法,所述分布式事务处理设备将所述提交日志按照分布存储方式写入所述第二对象数据库集,包括:所述分布式事务处理设备对所述提交日志中所记录的共享关键字段值进行哈希运算,得到与所述共享关键字段值对应的哈希值;所述分布式事务处理设备根据所述哈希值从所述目标数据库集群中确定出与所述共享关键字段值相对应的所述第二对象数据库集;所述分布式事务处理设备将所述提交日志写入与所述共享关键字段值相对应的所述第二对象数据库集。
- 根据权利要求2所述的方法,所述分布式事务处理设备将所述提交日志按照分布存储方式写入所述第二对象数据库集,包括:所述分布式事务处理设备从所述M个第一对象数据库集中确定出所述第二对象数据库集;所述分布式事务处理设备将所述提交日志写入所述第二对象数据库集。
- 根据权利要求2所述的方法,所述分布式事务处理设备缓存与所述N个账户中的账户数据所执行的所述处理操作相对应的所述提交日志,包括:所述分布式事务处理设备将与所述N个账户中的账户数据所执行的所述处理操作相对应的所述提交日志缓存至内部缓存队列中;所述分布式事务处理设备将所述提交日志按照分布存储方式写入所述第二对象数据库集,包括:若所述内部缓存队列中所缓存的所述提交日志的数量达到第一阈值,所述分布式事务处理设备利用单条插入语句,将所述内部缓存队列中所缓存的所述提交日志依次写入对应的所述第二对象数据库集中。
- 根据权利要求5所述的方法,在所述分布式事务处理设备将所述提交日志按照分布存储方式写入所述第二对象数据库集之前,还包括:所述分布式事务处理设备获取所述单条插入语句的插入时间;在确定出所述插入时间达到超时条件的情况下,所述分布式事务处理设备在所述内部缓存队列中所缓存的所述提交日志中依次写入非法值,其中,所述非法值用于阻止将所述内部缓存队列中所缓存的提交日志写入所述第二对象数据库集。
- 根据权利要求5所述的方法,在所述分布式事务处理设备将所述提交日志按照分布存储方式写入所述第二对象数据库集的过程中,还包括:当检测出写入故障,且所述内部缓存队列中所缓存的第i条提交日志已成功写入对应的所述第二对象数据库集,所述分布式事务处理设备获取已成功写入所述第二对象数据库集中的第1条至第i条提交日志;所述分布式事务处理设备根据所述第1条至第i条提交日志执行所述处理操作。
- 根据权利要求7所述的方法,所述分布式事务处理设备获取已成功写入所述第二对象数据库集中的第1条至第i条所述提交日志,包括:所述分布式事务处理设备通过与所述第二对象数据库集所包含的数据库对应的代理控制设备,获取已成功写入所述第二对象数据库集中的第1条至第i条提交日志,其中,所述代理控制设备用于恢复所述处理操作。
- 根据权利要求1至8中任一项所述的方法,当所述提交日志中的提交指示结果指示提交对所述N个账户中的账户数据所执行的所述处理操作,所述分布式事务处理设备对所述N个账户中的账户数据执行所述处理操作,包括:在第一提交模式下,所述分布式事务处理设备获取自动提交时刻;在达到所述自动提交时刻的情况下,所述分布式事务处理设备自动对所述N个账户中的账户数据执行所述处理操作;在第二提交模式下,所述分布式事务处理设备获取提交指令;所述分布式事务处理设备根据所述提交指令,对所述N个账户中的账户数据执行所述处理操作。
- 根据权利要求1至8中任一项所述的方法,当所述提交日志中的提交指示结果指示提交对所述N个账户中的账户数据所执行的所述处理操作,所述分布式事务处理设备对所述N个账户中的账户数据执行所述处理操作,包括:所述分布式事务处理设备对i个账户中的账户数据执行第一处理操作,对N-i个账户中的账户数据执行第二处理操作,得到操作结果,其中,所述操作结果指示所述第一处理操作的总操作数值与所述第二处理操作的总操作数值相等,所述第一处理操作与所述第二处理操作为反向操作,所述i为大于等于1,且小于等于N的整数;所述分布式事务处理设备将所述操作结果通知所述N个账户所对应的应用客户端。
- 根据权利要求10所述的方法,所述分布式事务处理设备对i个账户中的账户数据执行第一处理操作,对N-i个账户中的账户数据执行第二处理操作,包括:所述分布式事务处理设备对所述i个账户中的账户数据执行减少数值操作,对所述N-i个账户中的账户数据执行增加数值操作,所述减少数值操作为第一处理操作,所述增加数值操作为第二处理操作;或者,所述分布式事务处理设备对所述i个账户中的账户数据执行增加数值操作,对所述N-i个账户中的账户数据执行减少数值操作,所述增加数值操作为第一处理操作,所述减少数值操作为第二处理操作。
- 一种分布式事务处理装置,所述装置用于执行权利要求1-11任一项中所述的方法。
- 一种存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行所述权利要求1至11任一项中所述的方法。
- 一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为通过所述计算机程序执行所述权利要求1至11任一项中所述的方法。
- 一种计算机程序产品,包括指令,当其在计算机上运行时,使得计算机执行如权利要求1-11中任一项所述的方法。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP19821902.4A EP3812930A4 (en) | 2018-06-20 | 2019-05-16 | DISTRIBUTED TRANSACTION PROCESSING METHOD AND ASSOCIATED DEVICE |
US16/939,815 US11803538B2 (en) | 2018-06-20 | 2020-07-27 | Distributed transaction processing method and related apparatus |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810636987.4 | 2018-06-20 | ||
CN201810636987.4A CN110196759B (zh) | 2018-06-20 | 2018-06-20 | 分布式事务处理方法和装置、存储介质及电子装置 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US16/939,815 Continuation US11803538B2 (en) | 2018-06-20 | 2020-07-27 | Distributed transaction processing method and related apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019242437A1 true WO2019242437A1 (zh) | 2019-12-26 |
Family
ID=67751344
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/087179 WO2019242437A1 (zh) | 2018-06-20 | 2019-05-16 | 分布式事务处理方法和相关装置 |
Country Status (4)
Country | Link |
---|---|
US (1) | US11803538B2 (zh) |
EP (1) | EP3812930A4 (zh) |
CN (1) | CN110196759B (zh) |
WO (1) | WO2019242437A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118568114A (zh) * | 2024-07-31 | 2024-08-30 | 济南浪潮数据技术有限公司 | 缓存刷新方法、装置、设备、计算机程序产品及存储介质 |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110765144B (zh) * | 2019-10-11 | 2022-02-18 | 口碑(上海)信息技术有限公司 | 分布式异构数据库数据处理方法及装置 |
CN111309262B (zh) * | 2020-02-16 | 2021-01-29 | 西安奥卡云数据科技有限公司 | 一种分布式存储缓存读取和写入方法 |
CN111930830B (zh) * | 2020-06-22 | 2024-04-16 | 心有灵犀科技股份有限公司 | 一种基于共享数据库的分布式事务数据处理方法及系统 |
CN113377502B (zh) * | 2021-06-10 | 2024-06-14 | 上海达梦数据库有限公司 | 事务处理方法、装置、服务器、数据库管理系统及介质 |
CN114510495B (zh) * | 2022-04-21 | 2022-07-08 | 北京安华金和科技有限公司 | 一种数据库业务数据一致性处理方法和系统 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101089857A (zh) * | 2007-07-24 | 2007-12-19 | 中兴通讯股份有限公司 | 一种内存数据库事务管理方法及系统 |
US7421430B2 (en) * | 2001-05-14 | 2008-09-02 | International Business Machines Corporation | Method for processing real-time mobile transactions in a three-tier distributed database system |
CN102368210A (zh) * | 2011-10-25 | 2012-03-07 | 曙光信息产业(北京)有限公司 | 一种分布式系统中基于流水线的元数据日志的方法 |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7028187B1 (en) * | 1991-11-15 | 2006-04-11 | Citibank, N.A. | Electronic transaction apparatus for electronic commerce |
EP0758114A4 (en) * | 1995-02-28 | 1998-08-26 | Ntt Data Tsushin Kk | COOPERATIVE DISTRIBUTED SYSTEM, NEWSPAPER PROCESSING AND RECOVERY PROCESSING IN THE SAME |
US5799305A (en) * | 1995-11-02 | 1998-08-25 | Informix Software, Inc. | Method of commitment in a distributed database transaction |
WO2004055674A1 (ja) * | 2002-12-18 | 2004-07-01 | Fujitsu Limited | 分散トランザクション処理装置、分散トランザクション処理プログラム、分散トランザクション処理方法および分散トランザクション処理システム |
US7707181B2 (en) * | 2003-02-19 | 2010-04-27 | Microsoft Corporation | System and method of distributing replication commands |
WO2006057061A1 (ja) * | 2004-11-29 | 2006-06-01 | Fujitsu Limited | 分散トランザクション処理方法、装置、及びプログラム |
CN102831156B (zh) * | 2012-06-29 | 2014-12-31 | 浙江大学 | 一种云计算平台上的分布式事务处理方法 |
US10474493B2 (en) * | 2014-02-28 | 2019-11-12 | Red Hat, Inc. | Systems and methods for semi-durable transaction log storage in two-phase commit protocol transaction processing |
US10817500B2 (en) * | 2014-03-13 | 2020-10-27 | Sybase, Inc. | Reduce log contention by batching log record transfers to the log |
CN107797850B (zh) | 2016-08-30 | 2021-09-21 | 阿里巴巴集团控股有限公司 | 分布式事务处理的方法、装置与系统 |
-
2018
- 2018-06-20 CN CN201810636987.4A patent/CN110196759B/zh active Active
-
2019
- 2019-05-16 WO PCT/CN2019/087179 patent/WO2019242437A1/zh unknown
- 2019-05-16 EP EP19821902.4A patent/EP3812930A4/en active Pending
-
2020
- 2020-07-27 US US16/939,815 patent/US11803538B2/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7421430B2 (en) * | 2001-05-14 | 2008-09-02 | International Business Machines Corporation | Method for processing real-time mobile transactions in a three-tier distributed database system |
CN101089857A (zh) * | 2007-07-24 | 2007-12-19 | 中兴通讯股份有限公司 | 一种内存数据库事务管理方法及系统 |
CN102368210A (zh) * | 2011-10-25 | 2012-03-07 | 曙光信息产业(北京)有限公司 | 一种分布式系统中基于流水线的元数据日志的方法 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118568114A (zh) * | 2024-07-31 | 2024-08-30 | 济南浪潮数据技术有限公司 | 缓存刷新方法、装置、设备、计算机程序产品及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN110196759B (zh) | 2022-12-06 |
US11803538B2 (en) | 2023-10-31 |
EP3812930A1 (en) | 2021-04-28 |
US20200356549A1 (en) | 2020-11-12 |
EP3812930A4 (en) | 2021-07-14 |
CN110196759A (zh) | 2019-09-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019242437A1 (zh) | 分布式事务处理方法和相关装置 | |
US11349940B2 (en) | Server side data cache system | |
JP6602369B2 (ja) | 記憶不具合後の安全なデータアクセス | |
US8539160B2 (en) | Asynchronous cache refresh for systems with a heavy load | |
US9866654B2 (en) | Managing communications in a multi-client; multi-server environment | |
CN106302595B (zh) | 一种对服务器进行健康检查的方法及设备 | |
US20150039712A1 (en) | Direct access persistent memory shared storage | |
US20140115251A1 (en) | Reducing Memory Overhead of Highly Available, Distributed, In-Memory Key-Value Caches | |
US10331499B2 (en) | Method, apparatus, and chip for implementing mutually-exclusive operation of multiple threads | |
WO2021147935A1 (zh) | 一种日志回放方法及装置 | |
WO2022142781A1 (zh) | 区块链的异步落账方法、装置、介质及电子设备 | |
US20200274943A1 (en) | Data Processing Method and Apparatus, Server, and Controller | |
US20230098190A1 (en) | Data processing method, apparatus, device and medium based on distributed storage | |
US20170155741A1 (en) | Server, method, and system for providing service data | |
CN109462631A (zh) | 数据处理方法、装置、存储介质及电子装置 | |
WO2022048358A1 (zh) | 数据处理方法、装置及存储介质 | |
WO2017101731A1 (zh) | 数据库的服务提供方法和系统 | |
CN105373563B (zh) | 数据库切换方法及装置 | |
US11275601B2 (en) | System and method for auto recovery of deleted virtual machines identified through comparison of virtual machine management application snapshots and having corresponding backups at a storage device | |
US11940917B2 (en) | System and method for network interface controller based distributed cache | |
US11977636B2 (en) | Storage transaction log | |
CN113824675B (zh) | 管理登录态的方法和装置 | |
CN111988195B (zh) | 用于分组测试的应答方案确定方法、装置、设备及介质 | |
CN109857523B (zh) | 一种用于实现数据库高可用性的方法及装置 | |
US10848554B2 (en) | Memory efficient asynchronous high availability replication |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19821902 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
ENP | Entry into the national phase |
Ref document number: 2019821902 Country of ref document: EP Effective date: 20210120 |