Business handling method and device, computer equipment, readable storage medium and program product

By executing global transactions in the blockchain system and off-chain business system and adopting different rollback mechanisms, the problem of data inconsistency between the blockchain system and off-chain business system is solved, ensuring the accuracy and reliability of business processing sex.

CN119202092APending Publication Date: 2024-12-27CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411520028.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Maintaining data consistency between blockchain systems and associated business systems is a challenge, especially during business processing, inconsistency between blockchain systems and off-chain business systems may lead to confusion in business data and failure in transferring digital assets.

Method used

When receiving the business processing instructions, global transactions are obtained and executed in the blockchain system and off-chain business system respectively. If the execution fails, a synchronous rollback mechanism based on the memory stack or an asynchronous rollback mechanism of the database stack is used for the execution. Transaction rollback to ensure data consistency.

Benefits of technology

Effectively prevent data inconsistency, ensure data consistency between blockchain system and off-chain business system, improve the accuracy and real-timeness of transaction rollback, and ensure the accuracy and reliability of business processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202092A_ABST
    Figure CN119202092A_ABST
Patent Text Reader

Abstract

The invention relates to a business handling method and device, computer equipment, a readable storage medium and a program product, and relates to the technical field of block chains. The method comprises the steps of obtaining a global transaction of a target service; executing the global transaction through the block chain system and the out-of-chain business system to obtain a first transaction execution result and a second transaction execution result; and when the first transaction execution result and / or the second transaction execution result represent execution failure, performing transaction rollback based on a transaction rollback mechanism including a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack through a block chain system and an out-of-chain service system. Obtaining a first transaction rollback result and a second transaction rollback result; and when both the first transaction rollback result and the second transaction rollback result represent successful rollback, generating an abnormal transaction result for the target business. By adopting the method, the data consistency between the block chain system and the business system can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a business processing method, apparatus, computer equipment, readable storage medium and program product. Background Art

[0002] Blockchain is a decentralized distributed ledger that is tamper-proof, secure and reliable. With the rapid development of blockchain technology, more and more businesses are gradually transferred to blockchain to achieve transparent business processing and improve the security of business processing.

[0003] However, different businesses have different business handling requirements and business handling processes. It is precisely because of the diversity of business handling requirements and the complexity of business handling processes that most businesses have multiple related business systems. In this context, how to ensure data consistency between blockchain systems and related business systems has become a key issue in the industry. Summary of the invention

[0004] Based on this, it is necessary to provide a business processing method, device, computer equipment, computer-readable storage medium and computer program product that can ensure data consistency between the blockchain system and the business system in response to the above technical problems.

[0005] In a first aspect, the present application provides a business processing method, comprising: upon receiving a processing instruction for a target business, obtaining a global transaction of the target business; executing the global transaction through a blockchain system that processes the target business and an off-chain business system that has an associated relationship with the target business, respectively, to obtain a first transaction execution result of the blockchain system and a second transaction execution result of the off-chain business system; when the first transaction execution result and / or the second transaction execution result indicates an execution failure, respectively rolling back the transaction through the blockchain system and the off-chain business system based on a transaction rollback mechanism, to obtain a first transaction rollback result of the blockchain system and a second transaction rollback result of the off-chain business system; the transaction rollback mechanism includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack; the database stack refers to a stack obtained by transferring the memory stack to a database; when both the first transaction rollback result and the second transaction rollback result indicate a successful rollback, generating an abnormal processing result for the target business.

[0006] In one of the embodiments, the method also includes: updating the global transaction based on the first transaction execution result and / or the second transaction execution result to obtain an updated global transaction; executing the updated global transaction through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, respectively, to obtain a first updated execution result of the blockchain system and a second updated execution result of the off-chain business system; when both the first updated execution result and the second updated execution result indicate successful execution, generating a normal handling result for the target business.

[0007] In one of the embodiments, the first transaction rollback result includes the first transaction synchronous rollback result and the first transaction asynchronous rollback result; the second transaction rollback result includes the second transaction synchronous rollback result and the second transaction asynchronous rollback result; the transaction rollback is performed through the blockchain system and the off-chain business system based on the transaction rollback mechanism, and the first transaction rollback result of the blockchain system and the second transaction rollback result of the off-chain business system are obtained, including: the transaction rollback is performed through the blockchain system and the off-chain business system based on the synchronous rollback mechanism, and the first transaction synchronous rollback result of the blockchain system and the second transaction synchronous rollback result of the off-chain business system are obtained; when the first transaction synchronous rollback result and / or the second transaction synchronous rollback result indicate a rollback failure, the transaction rollback is performed through the blockchain system and the off-chain business system based on the asynchronous rollback mechanism, and the first transaction asynchronous rollback result of the blockchain system and the second transaction asynchronous rollback result of the off-chain business system are obtained.

[0008] In one of the embodiments, the method also includes: obtaining business load information, and determining a transaction scanning frequency that matches the business load information based on the business load information; performing transaction rollback based on an asynchronous rollback mechanism through a blockchain system and an off-chain business system, respectively, including: performing transaction rollback based on an asynchronous rollback mechanism and a transaction scanning frequency through a blockchain system and an off-chain business system, respectively.

[0009] In one of the embodiments, the method further includes: obtaining a transaction identifier of the global transaction and a handling scenario identifier of the target business; based on the transaction identifier and the handling scenario identifier, calling a callback function to update the business status of the target business.

[0010] In one embodiment, the global transaction includes a first branch transaction for the blockchain system and a second branch transaction for the off-chain business system; the global transaction is executed through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, respectively, to obtain the first transaction execution result of the blockchain system and the second transaction execution result of the off-chain business system, including: executing the first branch transaction through the blockchain system to obtain the first transaction execution result of the blockchain system; executing the second branch transaction through the off-chain business system to obtain the second transaction execution result of the off-chain business system.

[0011] In the second aspect, the present application also provides a business processing device, including: a transaction generation module, which is used to obtain the global transaction of the target business when receiving a processing instruction for the target business; a transaction execution module, which is used to execute the global transaction through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, respectively, to obtain a first transaction execution result of the blockchain system and a second transaction execution result of the off-chain business system; a transaction rollback module, which is used to roll back the transaction based on the transaction rollback mechanism through the blockchain system and the off-chain business system respectively when the first transaction execution result and / or the second transaction execution result indicate that the execution failed, and obtain the first transaction rollback result of the blockchain system and the second transaction rollback result of the off-chain business system; the transaction rollback mechanism includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack; the database stack refers to the stack obtained by transferring the memory stack to the database; a processing result generation module, which is used to generate an abnormal processing result for the target business when both the first transaction rollback result and the second transaction rollback result indicate that the rollback is successful.

[0012] In one of the embodiments, the device is also used to: update the global transaction based on the first transaction execution result and / or the second transaction execution result to obtain an updated global transaction; execute the updated global transaction through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, respectively, to obtain a first updated execution result of the blockchain system and a second updated execution result of the off-chain business system; when both the first updated execution result and the second updated execution result indicate successful execution, generate a normal handling result for the target business.

[0013] In one of the embodiments, the first transaction rollback result includes the first transaction synchronous rollback result and the first transaction asynchronous rollback result; the second transaction rollback result includes the second transaction synchronous rollback result and the second transaction asynchronous rollback result; the transaction rollback module also includes: a synchronous rollback unit, which is used to perform transaction rollback through the blockchain system and the off-chain business system based on the synchronous rollback mechanism, and obtain the first transaction synchronous rollback result of the blockchain system and the second transaction synchronous rollback result of the off-chain business system; an asynchronous rollback unit, which is used to perform transaction rollback through the blockchain system and the off-chain business system based on the asynchronous rollback mechanism when the first transaction synchronous rollback result and / or the second transaction synchronous rollback result indicate a rollback failure, and obtain the first transaction asynchronous rollback result of the blockchain system and the second transaction asynchronous rollback result of the off-chain business system.

[0014] In one of the embodiments, the device is also used to: obtain business load information, and based on the business load information, determine a transaction scanning frequency that matches the business load information; the asynchronous rollback unit is also used to: perform transaction rollback based on the asynchronous rollback mechanism and the transaction scanning frequency through the blockchain system and the off-chain business system respectively.

[0015] In one of the embodiments, the device is also used to: obtain the transaction identifier of the global transaction and the processing scenario identifier of the target business; based on the transaction identifier and the processing scenario identifier, call the callback function to update the business status of the target business.

[0016] In one embodiment, the global transaction includes a first branch transaction for the blockchain system and a second branch transaction for the off-chain business system; the transaction execution module is also used to: execute the first branch transaction through the blockchain system to obtain the first transaction execution result of the blockchain system; execute the second branch transaction through the off-chain business system to obtain the second transaction execution result of the off-chain business system.

[0017] In a third aspect, the present application also provides a computer device, including a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program: upon receiving a processing instruction for a target business, obtaining a global transaction of the target business; executing the global transaction through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, respectively, to obtain a first transaction execution result of the blockchain system and a second transaction execution result of the off-chain business system; when the first transaction execution result and / or the second transaction execution result indicates an execution failure, respectively, through the blockchain system and the off-chain business system, based on a transaction rollback mechanism, to roll back the transaction, to obtain a first transaction rollback result of the blockchain system and a second transaction rollback result of the off-chain business system; the transaction rollback mechanism includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack; the database stack refers to a stack obtained by transferring the memory stack to the database; when both the first transaction rollback result and the second transaction rollback result indicate a successful rollback, an abnormal processing result for the target business is generated.

[0018] In a fourth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, which implements the following steps when executed by a processor: upon receiving a processing instruction for a target business, obtaining a global transaction of the target business; executing the global transaction through a blockchain system that processes the target business and an off-chain business system that has an associated relationship with the target business, respectively, to obtain a first transaction execution result of the blockchain system and a second transaction execution result of the off-chain business system; when the first transaction execution result and / or the second transaction execution result indicates an execution failure, performing a transaction rollback based on a transaction rollback mechanism through the blockchain system and the off-chain business system, respectively, to obtain a first transaction rollback result of the blockchain system and a second transaction rollback result of the off-chain business system; the transaction rollback mechanism includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack; the database stack refers to a stack obtained by transferring the memory stack to a database; when both the first transaction rollback result and the second transaction rollback result indicate a successful rollback, generating an abnormal processing result for the target business.

[0019] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the following steps when executed by a processor: upon receiving a processing instruction for a target business, obtaining a global transaction of the target business; executing the global transaction through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, respectively, to obtain a first transaction execution result of the blockchain system and a second transaction execution result of the off-chain business system; when the first transaction execution result and / or the second transaction execution result indicates an execution failure, respectively, through the blockchain system and the off-chain business system, based on a transaction rollback mechanism, to roll back the transaction, to obtain a first transaction rollback result of the blockchain system and a second transaction rollback result of the off-chain business system; the transaction rollback mechanism includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack; the database stack refers to a stack obtained by transferring the memory stack to the database; when both the first transaction rollback result and the second transaction rollback result indicate a successful rollback, an abnormal processing result for the target business is generated.

[0020] The above-mentioned business handling method, device, computer equipment, computer-readable storage medium and computer program product, when receiving the handling instruction for the target business, first obtain the global transaction of the target business. Thus, the global transaction is executed by the blockchain system for handling the target business and the off-chain business system with an associated relationship with the target business, respectively, to obtain the first transaction execution result of the blockchain system and the second transaction execution result of the off-chain business system. When the first transaction execution result and / or the second transaction execution result indicate that the execution failed, the transaction is rolled back by the blockchain system and the off-chain business system, respectively, based on the transaction rollback mechanism, to obtain the first transaction rollback result of the blockchain system and the second transaction rollback result of the off-chain business system, and when the first transaction rollback result and the second transaction rollback result both indicate that the rollback is successful, an abnormal handling result for the target business is generated. It can be understood that transaction rollback refers to rolling back the transaction to the state before the start, thereby preventing data inconsistency from occurring. That is to say, in the case where the blockchain system and / or the off-chain business system fail to execute a transaction, the present application rolls back the transaction to ensure data consistency between the blockchain system and the off-chain business system. In addition, the transaction rollback mechanism in the present application includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack. The database stack refers to the stack obtained by transferring the memory stack to the database. It can be understood that due to the fast access speed to the memory stack, the synchronous correction based on the memory stack has high real-time performance. The system can roll back quickly after detecting an error. The database can persistently store the memory stack, so the system can read the corresponding memory stack from the database and perform asynchronous correction operations. That is, the present application performs transaction rollbacks by configuring different transaction rollback mechanisms, thereby improving the accuracy of transaction rollbacks and further ensuring data consistency between the blockchain system and the off-chain business system. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0022] FIG1 is an application environment diagram of a business handling method in one embodiment;

[0023] FIG2 is a schematic diagram of a process flow of a business handling method in one embodiment;

[0024] FIG3 is a schematic diagram of the execution flow of a global transaction in one embodiment;

[0025] FIG4 is a schematic diagram of a process flow of global transaction update in one embodiment;

[0026] FIG5 is a schematic diagram of a transaction rollback process in one embodiment;

[0027] FIG6 is a flowchart of a callback process in one embodiment;

[0028] FIG7 is a schematic diagram of the execution flow of a branch transaction in one embodiment;

[0029] FIG8 is a framework diagram of a business handling method in a specific embodiment;

[0030] FIG9 is a flow chart of a business handling method in a specific embodiment;

[0031] FIG10 is a block diagram of a business processing device in one embodiment;

[0032] FIG. 11 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0034] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations. The acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with relevant provisions of national laws and regulations.

[0035] Blockchain, with its characteristics of decentralization, immutability and transparency, has gradually been used in various business operations, such as digital asset transfer business on blockchain. However, for each business, it is not only related to blockchain, but also to certain business systems outside the blockchain, such as off-chain account systems. These off-chain business systems reflect the flow of business data in reality. If the business data on the blockchain system is inconsistent with the business data of the off-chain business system for the same business, it will lead to confusion of business data, which will in turn affect the accuracy of business processing. For the digital asset transfer business, the digital asset transfer may fail. Therefore, how to ensure the data consistency between the blockchain system and the related business system has become a key issue in the industry.

[0036] The business handling method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the business handling system 102 is connected to the blockchain system 104 and the off-chain business system 106 respectively. When the business handling system 102 receives the handling instruction for the target business, the global transaction of the target business is first obtained. Then, the global transaction is executed respectively through the blockchain system 104 that handles the target business and the off-chain business system 106 that has an association with the target business, and the first transaction execution result of the blockchain system 104 and the second transaction execution result of the off-chain business system 106 are obtained. When the first transaction execution result and / or the second transaction execution result indicate that the execution fails, the transaction is rolled back based on the transaction rollback mechanism through the blockchain system 104 and the off-chain business system 106, respectively, to obtain the first transaction rollback result of the blockchain system and the second transaction rollback result of the off-chain business system. The transaction rollback mechanism includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack. The database stack refers to the stack obtained by transferring the memory stack to the database. When the first transaction rollback result and the second transaction rollback result both indicate that the rollback is successful, the business processing system 102 generates an exception processing result for the target business.

[0037] In an exemplary embodiment, as shown in FIG. 2 , a business processing method is provided, which is described by taking the application of the method to the business processing system 102 in FIG. 1 as an example, and includes steps S202 to S208, wherein:

[0038] Step S202: upon receiving a processing instruction for a target business, obtaining a global transaction of the target business.

[0039] Among them, the target business may refer to the business that needs to be handled. In a preferred example, the target business may refer to the business whose business data will change and needs to be handled on the blockchain system. It can be understood that if only a simple business query is performed on the blockchain system, it is not necessary to synchronize the data of the off-chain business system. Only for businesses where business data will change, such as digital asset transfer, digital asset increase, addition, deletion and modification of digital asset information, it is necessary to maintain data consistency between the blockchain system and the off-chain business system. The handling instruction may refer to the instruction for handling the target business. The global transaction is a transaction that controls and coordinates the execution of sub-transactions on each computer node to complete the entire transaction processing task. In this embodiment, the global transaction can be understood as the overall handling process of the target business. In an example, the global transaction may include a first branch transaction for the blockchain system and a second branch transaction for the off-chain business system. The blockchain system and the off-chain business system complete the handling operation for the target business by executing their respective branch transactions, either all succeeding or all failing, thereby ensuring the consistency of the business data.

[0040] Exemplarily, when the business processing system receives a processing instruction for the target business initiated by the terminal, the global transaction manager deployed in the business processing system can generate a global transaction for the target business, that is, the overall processing flow of the target business, including transactions for the blockchain system and branch transactions for the off-chain business system. The control center of the business processing system obtains the global transaction from the global transaction manager to instruct the blockchain system and the off-chain business system to execute the transaction.

[0041] In one example, the global transaction manager refers to the component responsible for coordinating and managing global transactions in the business processing system. The global transaction manager can define the scope of global transactions, generate and start global transactions, commit or roll back global transactions, and coordinate various branch transactions in global transactions. Reference may be made to Figure 3, which shows a process diagram of business processing. First, the global transaction manager starts the global transaction, and the blockchain system and the off-chain business system execute the transaction. When the transaction execution results of the blockchain system and the off-chain business system are both successful, the global transaction manager commits the global transaction, indicating that the business processing is completed. In the case where the transaction execution results of the blockchain system and / or the off-chain business system fail, the global transaction manager can roll back the global transaction. At this time, the blockchain system and the off-chain business system will perform internal transaction rollbacks to roll back the transactions executed by each to the original state, thereby ensuring data consistency between the blockchain system and the off-chain business system in the event of abnormal business processing.

[0042] In one example, the global transaction manager can also generate a unique transaction sequence number for the global transaction during the process of generating the global transaction, and establish a mapping relationship between the unique transaction sequence number and the target business to facilitate subsequent transaction callback.

[0043] Step S204, execute the global transaction through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, and obtain the first transaction execution result of the blockchain system and the second transaction execution result of the off-chain business system.

[0044] Among them, the association relationship can be understood as the association relationship between the target business and the off-chain business system. The off-chain business system can refer to other business systems outside the blockchain system. Taking the digital asset transfer business as an example, assuming that there is an account A on the blockchain for this business, and there is also a corresponding account B on the off-chain system, account B is the off-chain business system that has an association relationship with the business. When a digital asset is transferred on the blockchain, account A will update the business data, and account B also needs to update the business data. The first transaction execution result may refer to the result obtained by the blockchain system executing the transaction, which may include successful execution and failed execution. The second transaction execution result may refer to the result obtained by the off-chain business system executing the transaction, which may also include successful execution and failed execution.

[0045] For example, after the global transaction manager in the business processing system starts a global transaction, the control center of the business processing system can instruct the blockchain system and the off-chain business system to execute their respective transactions based on the global transaction, thereby obtaining corresponding transaction execution results.

[0046] Step S206, when the first transaction execution result and / or the second transaction execution result indicates execution failure, the transaction is rolled back through the blockchain system and the off-chain business system respectively based on the transaction rollback mechanism to obtain the first transaction rollback result of the blockchain system and the second transaction rollback result of the off-chain business system; the transaction rollback mechanism includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack.

[0047] Among them, the transaction rollback mechanism may refer to a mechanism for transaction rollback, and transaction rollback refers to an operation of rolling back a transaction to its original state. The first transaction rollback result may refer to the result obtained by the blockchain system for transaction rollback, which may include rollback success and rollback failure. In one example, the first transaction rollback result may include the first transaction synchronous rollback result and the first transaction asynchronous rollback result. The second transaction execution result may refer to the result obtained by the off-chain business system for transaction rollback, which may also include rollback success and rollback failure. In one example, the second transaction rollback result may include the second transaction synchronous rollback result and the second transaction asynchronous rollback result. A memory stack is a data structure that can be used to store relevant data during the execution of a transaction. The stack follows the principle of first-in, last-out, that is, the last element added is removed first, and the earliest added element is removed last. The synchronous rollback mechanism refers to the immediate transaction rollback when the first transaction execution result and / or the second transaction execution result indicate that the execution failed. The database stack refers to the stack obtained by transferring the memory stack to the database, that is, the memory stack is persistently stored in the database. The database can be a relational database, a non-relational database or other types of storage systems. The purpose of this is to ensure that the transaction execution data will not be lost and can be reloaded and used when needed. The asynchronous rollback mechanism means that when the first transaction execution result and / or the second transaction execution result indicate an execution failure, the transaction rollback is delayed.

[0048] Exemplarily, when at least one of the first transaction execution result and the second transaction execution result indicates execution failure, the global transaction manager in the business processing system starts rolling back the global transaction. That is, based on the synchronous rollback mechanism or the asynchronous rollback mechanism, the blockchain system and the off-chain business system are instructed to respectively roll back the internal transactions, thereby obtaining the transaction rollback results of the blockchain system and the off-chain business system.

[0049] Step S208, when the first transaction rollback result and the second transaction rollback result both indicate that the rollback is successful, an exception handling result for the target business is generated.

[0050] Among them, the abnormal handling result is used to indicate that an abnormality occurs during the handling process of the target business.

[0051] For example, when the first transaction rollback result and the second transaction rollback result both indicate a successful rollback, it means that the transactions executed by the blockchain system and the off-chain business system have been rolled back to their original states, that is, the global transaction has been rolled back to its original state. At this time, the control center of the business processing system can feedback an abnormal processing result for the target business to the terminal, indicating that an abnormality has occurred in this business processing and the processing has been stopped. The terminal can be further asked whether to re-process the business. When the terminal confirms the re-processing instruction, the target business can be re-processed by updating the global transaction.

[0052] In this embodiment, when the business handling system receives the handling instruction for the target business, it first obtains the global transaction of the target business. Thus, the global transaction is executed by the blockchain system for handling the target business and the off-chain business system with an associated relationship with the target business, respectively, to obtain the first transaction execution result of the blockchain system and the second transaction execution result of the off-chain business system. When the first transaction execution result and / or the second transaction execution result indicate that the execution failed, the transaction is rolled back by the blockchain system and the off-chain business system based on the transaction rollback mechanism, and the first transaction rollback result of the blockchain system and the second transaction rollback result of the off-chain business system are obtained, and when the first transaction rollback result and the second transaction rollback result both indicate that the rollback is successful, an abnormal handling result for the target business is generated. It can be understood that transaction rollback refers to rolling back the transaction to the state before the start, thereby preventing data inconsistency from occurring. That is to say, in the case where the blockchain system and / or the off-chain business system fail to execute a transaction, the transaction is rolled back to ensure data consistency between the blockchain system and the off-chain business system. In addition, the transaction rollback mechanism in this embodiment includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack. The database stack refers to the stack obtained by transferring the memory stack to the database. It can be understood that since the access speed to the memory stack is fast, the synchronous reversal based on the memory stack has high real-time performance. The system can roll back quickly after detecting an error. The database can persistently store the memory stack, so the system can read the corresponding memory stack from the database and perform asynchronous reversal operations. That is, this embodiment performs transaction rollback by configuring different transaction rollback mechanisms, thereby improving the accuracy of transaction rollback and further ensuring data consistency between the blockchain system and the off-chain business system.

[0053] In an exemplary embodiment, as shown in FIG4 , the business handling method further includes steps S402 to S406, wherein:

[0054] Step S402: based on the first transaction execution result and / or the second transaction execution result, update the global transaction to obtain an updated global transaction.

[0055] When the first transaction execution result and / or the second transaction execution result indicates execution failure, the first transaction execution result and / or the second transaction execution result may include corresponding error information for updating the global transaction.

[0056] Exemplarily, when the business processing system receives an instruction from the terminal to confirm re-processing, the global transaction manager may update the global transaction based on the error information recorded in the first transaction execution result and / or the second transaction execution result to obtain an updated global transaction, thereby realizing the re-processing of the target business based on the updated global transaction.

[0057] Step S404, execute the updated global transaction through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, and obtain the first updated execution result of the blockchain system and the second updated execution result of the off-chain business system.

[0058] The first update execution result refers to the transaction execution result obtained by the blockchain system based on the updated global transaction. The second update execution result refers to the transaction execution result obtained by the off-chain business system based on the updated global transaction.

[0059] For example, after the business processing system obtains the updated global transaction, it can instruct the blockchain system and the off-chain business system respectively to execute the updated global transaction, thereby obtaining the transaction execution results of the blockchain system and the off-chain business system respectively.

[0060] Step S406: When both the first update execution result and the second update execution result indicate successful execution, a normal processing result for the target business is generated.

[0061] Among them, the normal processing result is used to indicate that the target business has been processed normally.

[0062] For example, when both the first update execution result and the second update execution result indicate successful execution, it means that the blockchain system and the off-chain business system have successfully executed their respective transactions. At this time, the global transaction manager can submit the global transaction, and the control center of the business processing system can feedback a normal processing result for the target business to the terminal, indicating that the business processing has been completed.

[0063] In this embodiment, the global transaction is updated based on the transaction execution results of the blockchain system and the off-chain business system to reprocess the target business, thereby improving the accuracy of the reprocessing of the business.

[0064] In an exemplary embodiment, as shown in FIG5 , a transaction rollback is performed based on a transaction rollback mechanism through the blockchain system and the off-chain business system, respectively, to obtain a first transaction rollback result of the blockchain system and a second transaction rollback result of the off-chain business system, including steps S502 to S504, wherein:

[0065] Step S502, respectively, through the blockchain system and the off-chain business system, based on the synchronous rollback mechanism, the transaction rollback is performed to obtain the first transaction synchronous rollback result of the blockchain system and the second transaction synchronous rollback result of the off-chain business system.

[0066] The first transaction synchronization rollback result refers to the result obtained by the blockchain system performing transaction rollback based on the synchronization rollback mechanism. The second transaction synchronization rollback result refers to the result obtained by the off-chain business system performing transaction rollback based on the synchronization rollback mechanism.

[0067] For example, when a transaction is rolled back, a synchronous rollback mechanism is first used. That is, the global transaction manager of the business processing system will sequentially pop the memory stack, and based on the elements popped (which can be understood as transactions that need to be rolled back), instruct the blockchain system and the off-chain business system to roll back their internal transactions, thereby obtaining the corresponding synchronous rollback results of the transactions.

[0068] In one example, transactions executed on a blockchain can be serialized into a sequence of bytes for transmission and storage in a blockchain network. Therefore, when a blockchain system rolls back an internal transaction, it needs to first obtain the serialized result of the transaction and deserialize it into an operable object entity, which contains all the information and logic required to perform the rollback operation, such as the unique transaction sequence number of the global transaction, the reason for the rollback, and any additional information required to perform the rollback operation. Then the agent is called to implement the call of the reverse smart contract, where the agent refers to an intermediate agent. During the rollback process, the blockchain system needs to call a reverse smart contract corresponding to the original transaction to perform the rollback operation. This reverse smart contract contains all the logic and rules required to revoke the executed transaction. By calling this smart contract, the system can ensure that the transaction is correctly revoked. In addition, during the entire rollback process, the system will record the processing status of each step, which helps to ensure the smooth execution of the rollback operation and conduct auditing and tracking when necessary.

[0069] In one example, the off-chain business system can roll back the internal transaction based on the received transaction rollback message and record the processing status of each step, which helps to ensure the smooth execution of the rollback operation and conduct auditing and tracking when necessary. The transaction rollback message can be generated by the outbound call service, which is a service interface for accessing the business system. The outbound call service first obtains the original request message of the transaction executed by the off-chain business system, changes the transaction type of the original request message to a rollback transaction, and sends it to the off-chain business system.

[0070] Step S504, when the first transaction synchronous rollback result and / or the second transaction synchronous rollback result indicate a rollback failure, the transaction is rolled back based on the asynchronous rollback mechanism through the blockchain system and the off-chain business system, respectively, to obtain the first transaction asynchronous rollback result of the blockchain system and the second transaction asynchronous rollback result of the off-chain business system.

[0071] The first transaction asynchronous rollback result refers to the result obtained by the blockchain system performing transaction rollback based on the asynchronous rollback mechanism. The second transaction asynchronous rollback result refers to the result obtained by the off-chain business system performing transaction rollback based on the asynchronous rollback mechanism.

[0072] Exemplarily, when the synchronous rollback result of the first transaction and / or the synchronous rollback result of the second transaction indicates a rollback failure, it indicates that the synchronous rollback has failed, and the asynchronous rollback is automatically entered at this time. That is, the global transaction manager of the business processing system will transfer the memory stack to the database to form a database stack. At the specified time, the database stack is popped sequentially, and based on the elements popped, the blockchain system and the off-chain business system are respectively instructed to roll back their internal transactions, thereby obtaining the corresponding transaction asynchronous rollback results. It should be noted that the internal transaction rollback of the blockchain system and the off-chain business system in this example is the same as the operation of the internal transaction rollback in step S502, and will not be repeated here.

[0073] In one example, when the asynchronous rollback result of the first transaction and / or the asynchronous rollback result of the second transaction indicates rollback failure, it means that both synchronous rollback and asynchronous rollback fail. At this time, manual rollback is performed, that is, after querying by the business personnel, the transaction information is recorded and asynchronous rollback is waited again.

[0074] In one example, the synchronous rollback result of the first transaction and the synchronous rollback result of the second transaction may also include their respective cumulative rollback times and total rollback durations, so that after the cumulative rollback times or the total rollback duration reaches a specified threshold, the transaction automatically enters asynchronous rollback. Similarly, the asynchronous rollback result of the first transaction and the asynchronous rollback result of the second transaction may also include their respective cumulative rollback times and total rollback durations, and after the cumulative rollback times or the total rollback duration reaches a specified threshold, the transaction enters manual rollback.

[0075] In this embodiment, a synchronous rollback mechanism and an asynchronous rollback mechanism are used to implement transaction rollback between the blockchain system and the off-chain business system, further ensuring data consistency between the blockchain system and the off-chain business system.

[0076] In an exemplary embodiment, the service processing method further includes: acquiring service load information, and determining a transaction scanning frequency matching the service load information based on the service load information.

[0077] Among them, the business load information may refer to the number of businesses currently handled by the business processing system. It is understandable that the more businesses to be handled, the higher the business load, and a faster transaction scanning frequency can be configured to achieve transaction scanning corresponding to a large number of businesses, thereby improving the efficiency of transaction rollback. Conversely, the fewer businesses to be handled, the lower the business load, and a slower transaction scanning frequency can be configured to save system resources. The transaction scanning frequency may refer to the frequency of transaction scanning during the asynchronous rollback process, such as scanning once every two minutes.

[0078] For example, transaction rollback under the asynchronous rollback mechanism needs to be performed at a specified time, which can be the transaction scanning frequency. In other words, the business processing system will obtain the current number of pending businesses to evaluate the business load of the system, and thus configure a suitable transaction scanning frequency according to the business load.

[0079] In an exemplary embodiment, transaction rollback is performed based on an asynchronous rollback mechanism through the blockchain system and the off-chain business system, including: transaction rollback is performed based on an asynchronous rollback mechanism and a transaction scanning frequency through the blockchain system and the off-chain business system, respectively.

[0080] Exemplarily, transaction scanning is performed by the blockchain system and the off-chain business system according to the transaction scanning frequency, and the scanned transaction is rolled back based on the asynchronous rollback mechanism.

[0081] In this embodiment, by configuring a suitable transaction scanning frequency based on the business load situation, the efficiency of transaction scanning is improved, thereby improving the efficiency of transaction rollback.

[0082] In an exemplary embodiment, as shown in FIG6 , the business handling method further includes steps S602 to S604, wherein:

[0083] Step S602, obtaining the transaction identifier of the global transaction and the processing scenario identifier of the target business.

[0084] Step S604: Based on the transaction identifier and the handling scenario identifier, a callback function is called to update the business status of the target business.

[0085] The transaction identifier may refer to a unique identifier of a global transaction, such as a unique transaction sequence number of a global transaction. The processing scenario identifier may refer to an identifier of a processing scenario of a target business. The callback function may be understood as allowing a section of code to be automatically executed when a specific event or condition occurs. In this embodiment, the callback function is used to process the update of the business status.

[0086] Exemplarily, after the blockchain system and the off-chain business system complete the synchronous transaction rollback or the asynchronous transaction rollback, the business processing system can obtain the unique identifier of the global transaction and the processing scenario identifier of the target business, and query and call the correct callback function based on the unique identifier and the processing scenario identifier to update the business status of the target business.

[0087] In actual applications, the business processing system can also deploy corresponding callback functions at any other nodes of business processing to update the business status in a timely manner, thereby facilitating real-time understanding of the business processing status.

[0088] In this embodiment, by calling the callback function, the business status of the target business is updated in time, so that business personnel can understand the business handling status in time, thereby improving the reliability and intelligence of business handling.

[0089] In an exemplary embodiment, as shown in FIG7 , a global transaction is executed by respectively executing a blockchain system for handling a target business and an off-chain business system associated with the target business, and obtaining a first transaction execution result of the blockchain system and a second transaction execution result of the off-chain business system, including:

[0090] Step S702: Execute the first branch transaction through the blockchain system to obtain the first transaction execution result of the blockchain system.

[0091] Step S704: execute the second branch transaction through the off-chain business system to obtain the second transaction execution result of the off-chain business system.

[0092] The first branch transaction can be understood as the transaction that the blockchain system needs to execute, and the second branch transaction can be understood as the transaction that the off-chain business system needs to execute. The first branch transaction and the second branch transaction together constitute the global transaction.

[0093] Exemplarily, the business processing system instructs the blockchain system to execute the first branch transaction. The blockchain system can first generate a unique step number for each step of the execution process of the first branch transaction. The business processing system will execute the forward smart contract call on the blockchain by calling the agent. The agent is an intermediate agent responsible for establishing communication and interaction between the blockchain system and the business processing system. By calling the blockchain agent, the business processing system can send the request for the smart contract call to the blockchain system and receive the response result returned by the blockchain network. In each step of the blockchain forward processing transaction, the business processing system needs to record the processing status of the step, and this status information may include whether the operation is successful, whether an error is encountered, whether a retry is required, etc. At the same time, the business processing system instructs the off-chain business system to execute the second branch transaction. Like the blockchain system type, the off-chain business system also needs to generate a unique step number for each step of the execution process of the second branch transaction. In each step of the off-chain business system executing the transaction, the business processing system also needs to record the processing status of the step.

[0094] In this embodiment, the first branch transaction is executed by the blockchain system, and the second branch transaction is executed by the off-chain business system, thereby ensuring data consistency between the blockchain system and the off-chain business system.

[0095] In a specific embodiment, referring to FIG8 , FIG8 shows an architecture diagram of business processing, including a global transaction manager, a synchronous rollback module, an asynchronous rollback module, a data persistence module, a blockchain processing module, an off-chain business system processing module, and a callback processing module in the business processing system.

[0096] Further referring to the business handling flow chart of FIG9 , specifically, when the business handling system receives the handling instruction for the target business, it first opens the global transaction of the target business through the global transaction manager. Through the blockchain processing module, that is, through the blockchain system that handles the target business, the first branch transaction is executed to obtain the first transaction execution result. And through the off-chain business system processing module, that is, through the off-chain business system that has an associated relationship with the target business, the second branch transaction is executed to obtain the second transaction execution result. When the first transaction execution result and the second transaction execution result indicate successful execution, the global transaction manager commits the global transaction and the business handling is successful.

[0097] When the execution result of the first transaction and / or the execution result of the second transaction indicates that the execution fails, the global transaction manager commits the transaction rollback. First, the memory stack is sequentially popped. Then, the transaction is rolled back through the blockchain processing module and the synchronous rollback module, that is, the blockchain system rolls back the transaction based on the synchronous rollback mechanism, and obtains the first transaction synchronous rollback result of the blockchain system. And through the off-chain business system processing module and the synchronous rollback module, the transaction is rolled back to obtain the second transaction synchronous rollback result of the off-chain business system. When the first transaction synchronous rollback result and / or the second transaction synchronous rollback result indicate that the rollback fails, the memory stack is transferred to the database to form a database stack, and the database stack is sequentially popped. Then, the blockchain processing module and the off-chain business system processing module are respectively used, based on the asynchronous rollback module, that is, based on the asynchronous rollback mechanism, to roll back the transaction, and obtain the first transaction asynchronous rollback result of the blockchain system and the second transaction asynchronous rollback result of the off-chain business system. The synchronous rollback mechanism is a rollback mechanism based on the memory stack, and the asynchronous rollback mechanism is a rollback mechanism based on the database stack. The database stack refers to the stack obtained by transferring the memory stack to the database. When the first transaction rollback result and the second transaction rollback result both indicate a successful rollback, an exception handling result for the target business is generated, and the business handling process ends. When the asynchronous rollback result of the first transaction and / or the asynchronous rollback result of the second transaction indicate a rollback failure, it means that both the synchronous rollback and the asynchronous rollback have failed. At this time, manual rollback is initiated, that is, the business personnel query and record the transaction information, and wait for asynchronous rollback again. In addition, the business handling system will also obtain business load information to determine the transaction scanning frequency that matches the business load information, so as to perform asynchronous transaction rollback according to the transaction scanning frequency through the asynchronous rollback module. For the synchronous rollback module and the asynchronous rollback module, after the two modules complete the rollback, the transaction identifier of the global transaction and the handling scenario identifier of the target business are obtained through the callback processing module. Therefore, based on the transaction identifier and the handling scenario identifier, the callback function is called to update the business status of the target business.

[0098] In this embodiment, when the business handling system receives the handling instruction for the target business, it first obtains the global transaction of the target business. Thus, the global transaction is executed by the blockchain system for handling the target business and the off-chain business system with an associated relationship with the target business, respectively, to obtain the first transaction execution result of the blockchain system and the second transaction execution result of the off-chain business system. When the first transaction execution result and / or the second transaction execution result indicate that the execution failed, the transaction is rolled back by the blockchain system and the off-chain business system based on the transaction rollback mechanism, and the first transaction rollback result of the blockchain system and the second transaction rollback result of the off-chain business system are obtained, and when the first transaction rollback result and the second transaction rollback result both indicate that the rollback is successful, an abnormal handling result for the target business is generated. It can be understood that transaction rollback refers to rolling back the transaction to the state before the start, thereby preventing data inconsistency from occurring. That is to say, in the case where the blockchain system and / or the off-chain business system fail to execute a transaction, the transaction is rolled back to ensure data consistency between the blockchain system and the off-chain business system. In addition, the transaction rollback mechanism in this embodiment includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack. The database stack refers to the stack obtained by transferring the memory stack to the database. It can be understood that since the access speed to the memory stack is fast, the synchronous reversal based on the memory stack has high real-time performance. The system can roll back quickly after detecting an error. The database can persistently store the memory stack, so the system can read the corresponding memory stack from the database and perform asynchronous reversal operations. That is, this embodiment performs transaction rollback by configuring different transaction rollback mechanisms, thereby improving the accuracy of transaction rollback and further ensuring data consistency between the blockchain system and the off-chain business system.

[0099] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0100] Based on the same inventive concept, the embodiment of the present application also provides a business processing device for implementing the business processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more business processing device embodiments provided below can refer to the limitations on the business processing method above, and will not be repeated here.

[0101] In an exemplary embodiment, as shown in FIG. 10 , a business handling device is provided, including: a transaction generation module 1002, for obtaining a global transaction of a target business upon receiving a handling instruction for a target business; a transaction execution module 1004, for executing a global transaction through a blockchain system for handling the target business and an off-chain business system associated with the target business, respectively, to obtain a first transaction execution result of the blockchain system and a second transaction execution result of the off-chain business system; a transaction rollback module 1006, for performing a transaction rollback through the blockchain system and the off-chain business system based on a transaction rollback mechanism when the first transaction execution result and / or the second transaction execution result indicate an execution failure, respectively, to obtain a first transaction rollback result of the blockchain system and a second transaction rollback result of the off-chain business system; the transaction rollback mechanism includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack; the database stack refers to a stack obtained by transferring the memory stack to a database; a handling result generation module 1008, for generating an abnormal handling result for the target business when both the first transaction rollback result and the second transaction rollback result indicate a successful rollback.

[0102] In one of the embodiments, the device is also used to: update the global transaction based on the first transaction execution result and / or the second transaction execution result to obtain an updated global transaction; execute the updated global transaction through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, respectively, to obtain a first updated execution result of the blockchain system and a second updated execution result of the off-chain business system; when both the first updated execution result and the second updated execution result indicate successful execution, generate a normal handling result for the target business.

[0103] In one of the embodiments, the first transaction rollback result includes the first transaction synchronous rollback result and the first transaction asynchronous rollback result; the second transaction rollback result includes the second transaction synchronous rollback result and the second transaction asynchronous rollback result; the transaction rollback module 1006 also includes: a synchronous rollback unit, which is used to perform transaction rollback through the blockchain system and the off-chain business system based on the synchronous rollback mechanism, and obtain the first transaction synchronous rollback result of the blockchain system and the second transaction synchronous rollback result of the off-chain business system; an asynchronous rollback unit, which is used to perform transaction rollback through the blockchain system and the off-chain business system based on the asynchronous rollback mechanism when the first transaction synchronous rollback result and / or the second transaction synchronous rollback result indicate a rollback failure, and obtain the first transaction asynchronous rollback result of the blockchain system and the second transaction asynchronous rollback result of the off-chain business system.

[0104] In one of the embodiments, the device is also used to: obtain business load information, and based on the business load information, determine a transaction scanning frequency that matches the business load information; the asynchronous rollback unit is also used to: perform transaction rollback based on the asynchronous rollback mechanism and the transaction scanning frequency through the blockchain system and the off-chain business system respectively.

[0105] In one of the embodiments, the device is also used to: obtain the transaction identifier of the global transaction and the processing scenario identifier of the target business; based on the transaction identifier and the processing scenario identifier, call the callback function to update the business status of the target business.

[0106] In one embodiment, the global transaction includes a first branch transaction for the blockchain system and a second branch transaction for the off-chain business system; the transaction execution module 1004 is also used to: execute the first branch transaction through the blockchain system to obtain the first transaction execution result of the blockchain system; execute the second branch transaction through the off-chain business system to obtain the second transaction execution result of the off-chain business system.

[0107] Each module in the above-mentioned business processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0108] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG11. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store business processing data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a business processing method is implemented.

[0109] Those skilled in the art will understand that the structure shown in FIG. 11 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0110] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: upon receiving a processing instruction for a target business, obtaining a global transaction of the target business; executing the global transaction through a blockchain system that processes the target business and an off-chain business system that has an associated relationship with the target business, respectively, to obtain a first transaction execution result of the blockchain system and a second transaction execution result of the off-chain business system; when the first transaction execution result and / or the second transaction execution result indicates an execution failure, performing a transaction rollback through the blockchain system and the off-chain business system based on a transaction rollback mechanism, respectively, to obtain a first transaction rollback result of the blockchain system and a second transaction rollback result of the off-chain business system; the transaction rollback mechanism includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack; the database stack refers to a stack obtained by transferring the memory stack to a database; when both the first transaction rollback result and the second transaction rollback result indicate a successful rollback, generating an abnormal processing result for the target business.

[0111] In one embodiment, when the processor executes the computer program, the following steps are also implemented: based on the first transaction execution result and / or the second transaction execution result, the global transaction is updated to obtain an updated global transaction; the updated global transaction is executed through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, respectively, to obtain a first updated execution result of the blockchain system and a second updated execution result of the off-chain business system; when both the first updated execution result and the second updated execution result indicate successful execution, a normal handling result for the target business is generated.

[0112] In one embodiment, when the processor executes the computer program, the following steps are also implemented: transaction rollback is performed based on the synchronous rollback mechanism through the blockchain system and the off-chain business system respectively, to obtain the first transaction synchronous rollback result of the blockchain system and the second transaction synchronous rollback result of the off-chain business system; when the first transaction synchronous rollback result and / or the second transaction synchronous rollback result indicate a rollback failure, transaction rollback is performed based on the asynchronous rollback mechanism through the blockchain system and the off-chain business system respectively, to obtain the first transaction asynchronous rollback result of the blockchain system and the second transaction asynchronous rollback result of the off-chain business system.

[0113] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining business load information, and determining a transaction scanning frequency that matches the business load information based on the business load information; performing transaction rollback based on an asynchronous rollback mechanism through the blockchain system and an off-chain business system, respectively, including: performing transaction rollback based on an asynchronous rollback mechanism and a transaction scanning frequency through the blockchain system and an off-chain business system, respectively.

[0114] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining the transaction identifier of the global transaction and the processing scenario identifier of the target business; based on the transaction identifier and the processing scenario identifier, calling the callback function to update the business status of the target business.

[0115] In one embodiment, when the processor executes the computer program, the following steps are also implemented: executing a first branch transaction through the blockchain system to obtain a first transaction execution result of the blockchain system; executing a second branch transaction through an off-chain business system to obtain a second transaction execution result of the off-chain business system.

[0116] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: when a processing instruction for a target business is received, a global transaction of the target business is obtained; the global transaction is executed through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, respectively, to obtain a first transaction execution result of the blockchain system and a second transaction execution result of the off-chain business system; when the first transaction execution result and / or the second transaction execution result indicates that the execution fails, the transaction is rolled back through the blockchain system and the off-chain business system based on a transaction rollback mechanism, respectively, to obtain a first transaction rollback result of the blockchain system and a second transaction rollback result of the off-chain business system; the transaction rollback mechanism includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack; the database stack refers to a stack obtained by transferring the memory stack to the database; when the first transaction rollback result and the second transaction rollback result both indicate that the rollback is successful, an abnormal processing result for the target business is generated.

[0117] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the first transaction execution result and / or the second transaction execution result, the global transaction is updated to obtain an updated global transaction; the updated global transaction is executed through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, respectively, to obtain the first updated execution result of the blockchain system and the second updated execution result of the off-chain business system; when both the first updated execution result and the second updated execution result indicate successful execution, a normal handling result for the target business is generated.

[0118] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: transaction rollback is performed based on the synchronous rollback mechanism through the blockchain system and the off-chain business system respectively, to obtain the first transaction synchronous rollback result of the blockchain system and the second transaction synchronous rollback result of the off-chain business system; when the first transaction synchronous rollback result and / or the second transaction synchronous rollback result indicate a rollback failure, transaction rollback is performed based on the asynchronous rollback mechanism through the blockchain system and the off-chain business system respectively, to obtain the first transaction asynchronous rollback result of the blockchain system and the second transaction asynchronous rollback result of the off-chain business system.

[0119] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining business load information, and determining a transaction scanning frequency that matches the business load information based on the business load information; performing transaction rollback based on an asynchronous rollback mechanism through the blockchain system and an off-chain business system, including: performing transaction rollback based on an asynchronous rollback mechanism and a transaction scanning frequency through the blockchain system and an off-chain business system, respectively.

[0120] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining the transaction identifier of the global transaction and the processing scenario identifier of the target business; based on the transaction identifier and the processing scenario identifier, calling the callback function to update the business status of the target business.

[0121] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: executing a first branch transaction through the blockchain system to obtain a first transaction execution result of the blockchain system; executing a second branch transaction through an off-chain business system to obtain a second transaction execution result of the off-chain business system.

[0122] In one embodiment, a computer program product is provided, including a computer program, which implements the following steps when executed by a processor: upon receiving a handling instruction for a target business, obtaining a global transaction of the target business; executing the global transaction through a blockchain system that handles the target business and an off-chain business system that has an associated relationship with the target business, respectively, to obtain a first transaction execution result of the blockchain system and a second transaction execution result of the off-chain business system; when the first transaction execution result and / or the second transaction execution result indicates an execution failure, performing a transaction rollback through the blockchain system and the off-chain business system based on a transaction rollback mechanism, respectively, to obtain a first transaction rollback result of the blockchain system and a second transaction rollback result of the off-chain business system; the transaction rollback mechanism includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack; the database stack refers to a stack obtained by transferring the memory stack to a database; when both the first transaction rollback result and the second transaction rollback result indicate a successful rollback, generating an abnormal handling result for the target business.

[0123] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the first transaction execution result and / or the second transaction execution result, the global transaction is updated to obtain an updated global transaction; the updated global transaction is executed through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, respectively, to obtain the first updated execution result of the blockchain system and the second updated execution result of the off-chain business system; when both the first updated execution result and the second updated execution result indicate successful execution, a normal handling result for the target business is generated.

[0124] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: transaction rollback is performed based on the synchronous rollback mechanism through the blockchain system and the off-chain business system respectively, to obtain the first transaction synchronous rollback result of the blockchain system and the second transaction synchronous rollback result of the off-chain business system; when the first transaction synchronous rollback result and / or the second transaction synchronous rollback result indicate a rollback failure, transaction rollback is performed based on the asynchronous rollback mechanism through the blockchain system and the off-chain business system respectively, to obtain the first transaction asynchronous rollback result of the blockchain system and the second transaction asynchronous rollback result of the off-chain business system.

[0125] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining business load information, and determining a transaction scanning frequency that matches the business load information based on the business load information; performing transaction rollback based on an asynchronous rollback mechanism through the blockchain system and an off-chain business system, including: performing transaction rollback based on an asynchronous rollback mechanism and a transaction scanning frequency through the blockchain system and an off-chain business system, respectively.

[0126] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining the transaction identifier of the global transaction and the processing scenario identifier of the target business; based on the transaction identifier and the processing scenario identifier, calling the callback function to update the business status of the target business.

[0127] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: executing a first branch transaction through the blockchain system to obtain a first transaction execution result of the blockchain system; executing a second branch transaction through an off-chain business system to obtain a second transaction execution result of the off-chain business system.

[0128] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0129] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0130] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A business handling method, characterized in that: The method comprises: When receiving a processing instruction for a target business, obtaining a global transaction of the target business; Executing the global transaction through the blockchain system that handles the target business and the off-chain business system that is associated with the target business, respectively, to obtain a first transaction execution result of the blockchain system and a second transaction execution result of the off-chain business system; When the first transaction execution result and / or the second transaction execution result indicates execution failure, the transaction is rolled back through the blockchain system and the off-chain business system respectively based on the transaction rollback mechanism to obtain the first transaction rollback result of the blockchain system and the second transaction rollback result of the off-chain business system; the transaction rollback mechanism includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack; the database stack refers to a stack obtained by transferring the memory stack to a database; When the first transaction rollback result and the second transaction rollback result both indicate that the rollback is successful, an exception handling result for the target business is generated.

2. The method according to claim 1, characterized in that The method further comprises: Based on the first transaction execution result and / or the second transaction execution result, updating the global transaction to obtain an updated global transaction; Execute the updated global transaction through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, respectively, to obtain a first update execution result of the blockchain system and a second update execution result of the off-chain business system; When both the first update execution result and the second update execution result indicate successful execution, a normal processing result for the target business is generated.

3. The method according to claim 1, characterized in that The first transaction rollback result includes the first transaction synchronous rollback result and the first transaction asynchronous rollback result; the second transaction rollback result includes the second transaction synchronous rollback result and the second transaction asynchronous rollback result; The transaction rollback is performed based on the transaction rollback mechanism by the blockchain system and the off-chain business system respectively, to obtain a first transaction rollback result of the blockchain system and a second transaction rollback result of the off-chain business system, including: Through the blockchain system and the off-chain business system, respectively, based on the synchronous rollback mechanism, a transaction rollback is performed to obtain a first transaction synchronous rollback result of the blockchain system and a second transaction synchronous rollback result of the off-chain business system; When the first transaction synchronous rollback result and / or the second transaction synchronous rollback result indicate a rollback failure, the transaction is rolled back through the blockchain system and the off-chain business system respectively based on the asynchronous rollback mechanism to obtain the first transaction asynchronous rollback result of the blockchain system and the second transaction asynchronous rollback result of the off-chain business system.

4. The method according to claim 3, characterized in that The method further comprises: Acquire business load information, and determine, based on the business load information, a transaction scanning frequency that matches the business load information; The transaction rollback is performed respectively through the blockchain system and the off-chain business system based on the asynchronous rollback mechanism, including: Transaction rollback is performed through the blockchain system and the off-chain business system respectively based on the asynchronous rollback mechanism and the transaction scanning frequency.

5. The method according to claim 1, characterized in that The method further comprises: Obtaining a transaction identifier of the global transaction and a processing scenario identifier of the target business; Based on the transaction identifier and the handling scenario identifier, a callback function is called to update the business status of the target business.

6. The method according to claim 1, characterized in that The global transaction includes a first branch transaction for the blockchain system and a second branch transaction for the off-chain business system; The executing the global transaction by respectively handling the blockchain system for the target business and the off-chain business system associated with the target business, and obtaining the first transaction execution result of the blockchain system and the second transaction execution result of the off-chain business system, includes: Executing the first branch transaction through the blockchain system to obtain a first transaction execution result of the blockchain system; The second branch transaction is executed through the off-chain business system to obtain the second transaction execution result of the off-chain business system.

7. A business handling device, characterized in that: The device comprises: A transaction generation module, configured to obtain a global transaction of a target business upon receiving a processing instruction for the target business; A transaction execution module, used to execute the global transaction through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, respectively, to obtain a first transaction execution result of the blockchain system and a second transaction execution result of the off-chain business system; A transaction rollback module, configured to, when the first transaction execution result and / or the second transaction execution result indicates execution failure, respectively perform a transaction rollback through the blockchain system and the off-chain business system based on a transaction rollback mechanism, to obtain a first transaction rollback result of the blockchain system and a second transaction rollback result of the off-chain business system; the transaction rollback mechanism includes a synchronous rollback mechanism based on a memory stack and an asynchronous rollback mechanism based on a database stack; the database stack refers to a stack obtained by transferring the memory stack to a database; The processing result generating module is used to generate an exception processing result for the target business when the first transaction rollback result and the second transaction rollback result both indicate that the rollback is successful.

8. The device according to claim 7, characterized in that The device is also used to: update the global transaction based on the first transaction execution result and / or the second transaction execution result to obtain an updated global transaction; execute the updated global transaction through the blockchain system that handles the target business and the off-chain business system that has an associated relationship with the target business, respectively, to obtain a first updated execution result of the blockchain system and a second updated execution result of the off-chain business system; when the first updated execution result and the second updated execution result both indicate successful execution, generate a normal handling result for the target business.

9. The device according to claim 7, characterized in that The first transaction rollback result includes the first transaction synchronous rollback result and the first transaction asynchronous rollback result; the second transaction rollback result includes the second transaction synchronous rollback result and the second transaction asynchronous rollback result; The transaction rollback module also includes: A synchronous rollback unit, used to perform transaction rollback through the blockchain system and the off-chain business system based on the synchronous rollback mechanism, respectively, to obtain a first transaction synchronous rollback result of the blockchain system and a second transaction synchronous rollback result of the off-chain business system; The asynchronous rollback unit is used to perform transaction rollback based on the asynchronous rollback mechanism through the blockchain system and the off-chain business system respectively when the first transaction synchronous rollback result and / or the second transaction synchronous rollback result indicate a rollback failure, so as to obtain the first transaction asynchronous rollback result of the blockchain system and the second transaction asynchronous rollback result of the off-chain business system.

10. The device according to claim 9, characterized in that The device is also used to: obtain business load information, and determine a transaction scanning frequency matching the business load information based on the business load information; The asynchronous rollback unit is also used to: perform transaction rollback through the blockchain system and the off-chain business system respectively based on the asynchronous rollback mechanism and the transaction scanning frequency.

11. The device according to claim 7, characterized in that The device is also used to: obtain the transaction identifier of the global transaction and the processing scenario identifier of the target business; based on the transaction identifier and the processing scenario identifier, call a callback function to update the business status of the target business.

12. The device according to claim 7, characterized in that The global transaction includes a first branch transaction for the blockchain system and a second branch transaction for the off-chain business system; the transaction execution module is also used to: execute the first branch transaction through the blockchain system to obtain a first transaction execution result of the blockchain system; execute the second branch transaction through the off-chain business system to obtain a second transaction execution result of the off-chain business system.

13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.