Transaction processing method, device, equipment and system
By receiving transaction requests on the blockchain node and calling smart contracts to lock resources, and sending resource transfer instructions to the second financial institution, the problem of dissonance between on-chain and off-chain processing in blockchain remittance transactions is solved, and the transaction efficiency and simplicity is achieved.
Patent Information
- Application Number
- CN202411822785.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-01
- Publication Date
- 2025-04-11
AI Technical Summary
In blockchain-based remittance transactions, the on-chain remittance processing is inconsistent with the off-chain remittance processing, resulting in transaction failure, and the transaction is cumbersome because the blockchain data cannot be tampered with, which increases the cumbersomeness of the transaction.
By receiving a transaction request sent by the first financial institution on the blockchain node, calling a smart contract to lock the transfer resource, and sending resource transfer instructions to the second financial institution to ensure the success or rollback processing of the resource transfer processing.
It solves the problem of incoordination between on-chain and off-chain transaction processing, avoids tedious operations caused by the failure of off-chain transactions due to the success of on-chain transactions, and improves the efficiency and simplicity of transactions.
Smart Images

Figure CN119809821A_ABST
Abstract
Description
[0001] This invention patent application is a divisional application of the Chinese invention patent application with application date of June 1, 2020, application number 2020104857993, and name “Transaction Processing Methods, Devices, Equipment and Systems”. Technical Field
[0002] This document relates to the field of computer technology, and in particular to a transaction processing method, device, equipment and system. Background Art
[0003] Blockchain is widely used in various industries due to its openness, transparency and immutability. Remittance transactions based on blockchain are not unfamiliar to people. Usually, a remittance transaction based on blockchain includes remittance processing on the chain and remittance processing by related financial institutions outside the chain. Only when both are successful, a remittance transaction based on blockchain is considered successful. However, in the actual application process, there is a problem of incoordination between the remittance processing on the chain and the remittance processing outside the chain, which leads to transaction failure; and because the data on the blockchain is immutable, hedging transactions and other processing are also required, which increases the complexity of the transaction. Summary of the invention
[0004] One or more embodiments of the present specification provide a transaction processing method, which is applied to a blockchain node. The method includes receiving a transaction request sent by a first financial institution. The transaction request is sent based on a resource transfer request sent by a first user to transfer resources to a second user. The transaction request includes resource transfer information. The first user is a user served by the first financial institution, and the second user is a user served by the second financial institution. The smart contract in the blockchain is called, and the first user's to-be-transferred resources are locked based on the smart contract according to the resource transfer information. Resource transfer-in instruction information is sent to the second financial institution according to the resource transfer information. So that the second financial institution performs the resource transfer-in processing corresponding to the resource transfer information to transfer resources to the second user. If it is determined that the resource transfer-in processing is successful, a resource transfer-out processing is performed on the locked resources to be transferred, so as to transfer the resources to be transferred to the second financial institution. If it is determined that the resource transfer-in processing fails, the locked resources to be transferred are rolled back.
[0005] One or more embodiments of the present specification provide a transaction processing device, which is applied to a blockchain node. The device includes a receiving module, which receives a transaction request sent by a first financial institution. The transaction request is sent based on a resource transfer request sent by a first user to transfer resources to a second user. The transaction request includes resource transfer information. The first user is a user served by the first financial institution, and the second user is a user served by the second financial institution. The device also includes a locking module, which calls a smart contract in the blockchain. Based on the smart contract, the first user's to-be-transferred resources are locked according to the resource transfer information. The device also includes a sending module, which sends resource transfer-in indication information to the second financial institution according to the resource transfer information. So that the second financial institution performs the resource transfer-in processing corresponding to the resource transfer information to transfer resources to the second user. The device also includes a first processing module, which, if it is determined that the resource transfer-in processing is successful, performs a resource transfer-out processing on the locked resources to be transferred, so as to transfer the resources to be transferred to the second financial institution. The device also includes a second processing module, which, if it is determined that the resource transfer-in processing fails, performs a rollback processing on the locked resources to be transferred.
[0006] One or more embodiments of the present specification provide a transaction processing system. The system includes a first financial institution, a blockchain, and a second financial institution. The first financial institution receives a resource transfer request sent by a first user to transfer resources to a second user. The resource transfer request includes resource transfer information; a transaction request is sent to a blockchain node in the blockchain according to the resource transfer information. The blockchain node receives the transaction request sent by the first financial institution. The smart contract in the blockchain is called, and the first user's to-be-transferred resources are locked according to the resource transfer information based on the smart contract. And, resource transfer-in indication information is sent to the second financial institution according to the resource transfer information. If it is determined that the resource transfer-in processing of the second financial institution is successful, a resource transfer-out processing is performed on the locked resource to be transferred, so as to transfer the resource to the second financial institution. If it is determined that the resource transfer-in processing of the second financial institution fails, a rollback processing is performed on the locked resource to be transferred. The second financial institution receives the resource transfer-in indication information sent by the blockchain node. According to the resource transfer-in indication information, a resource transfer-in processing corresponding to the resource transfer information is performed to transfer resources to the second user.
[0007] One or more embodiments of the present specification provide a transaction processing device. The device includes a processor. The device also includes a memory arranged to store computer executable instructions. When the computer executable instructions are executed, they receive a transaction request sent by a first financial institution. The transaction request is sent based on a resource transfer request sent by a first user to transfer resources to a second user. The transaction request includes resource transfer information. The first user is a user served by the first financial institution, and the second user is a user served by a second financial institution. The smart contract in the blockchain is called, and the first user's to-be-transferred resources are locked based on the smart contract according to the resource transfer information. Resource transfer-in indication information is sent to the second financial institution according to the resource transfer information. So that the second financial institution performs the resource transfer-in processing corresponding to the resource transfer information to transfer resources to the second user. If it is determined that the resource transfer-in processing is successful, a resource transfer-out processing is performed on the locked resources to be transferred, so as to transfer the resources to be transferred to the second financial institution. If it is determined that the resource transfer-in processing fails, the locked resources to be transferred are rolled back.
[0008] One or more embodiments of the present specification provide a storage medium. The storage medium is used to store computer executable instructions. When the computer executable instructions are executed, they receive a transaction request sent by a first financial institution. The transaction request is sent based on a resource transfer request sent by a first user to transfer resources to a second user. The transaction request includes resource transfer information. The first user is a user served by the first financial institution, and the second user is a user served by the second financial institution. The smart contract in the blockchain is called, and the first user's to-be-transferred resources are locked based on the smart contract according to the resource transfer information. Resource transfer-in instruction information is sent to the second financial institution according to the resource transfer information. So that the second financial institution performs the resource transfer-in processing corresponding to the resource transfer information to transfer resources to the second user. If it is determined that the resource transfer-in processing is successful, the resource transfer-out processing is performed on the locked resources to be transferred, so as to transfer the resources to be transferred to the second financial institution. If it is determined that the resource transfer-in processing fails, the locked resources to be transferred are rolled back. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate one or more embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0010] Figure 1 A schematic diagram of a first scenario of a transaction processing method provided in one or more embodiments of this specification; Figure 2 A second scenario schematic diagram of a transaction processing method provided in one or more embodiments of this specification; Figure 3 A first flow chart of a transaction processing method provided for one or more embodiments of this specification; Figure 4 A second flow chart of a transaction processing method provided for one or more embodiments of this specification; Figure 5 A third flow chart of a transaction processing method provided in one or more embodiments of this specification; Figure 6 A fourth flow chart of a transaction processing method provided for one or more embodiments of this specification; Figure 7 A fifth flow chart of a transaction processing method provided for one or more embodiments of this specification; Figure 8 A sixth flow chart of a transaction processing method provided for one or more embodiments of this specification; Fig. 9 A seventh flow chart of a transaction processing method provided for one or more embodiments of this specification; Fig.10 An eighth flow chart of a transaction processing method provided for one or more embodiments of this specification; Fig.11 A schematic diagram of the module composition of a transaction processing device provided for one or more embodiments of this specification; Fig.12 A schematic diagram of the composition of a transaction processing system provided for one or more embodiments of this specification; Fig.13 A schematic diagram of the structure of a transaction processing device provided for one or more embodiments of this specification. DETAILED DESCRIPTION
[0011] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the following will be combined with the drawings in one or more embodiments of this specification to clearly and completely describe the technical solutions in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.
[0012] Figure 1 A schematic diagram of an application scenario of a transaction method provided in one or more embodiments of this specification, such as Figure 1 As shown, the scenario includes: a terminal device of a first user, a first financial institution, a second financial institution, a blockchain node connected to a blockchain, and a second user. The terminal device may be a mobile phone, a tablet computer, a desktop computer, a portable notebook computer, etc. ( Figure 1 Only a mobile phone is shown); the first user is a user served by the first financial institution, and the second user is a user served by the second financial institution.
[0013] Specifically, when the first user transfers resources to the second user, the first user operates his terminal device, and the terminal device responds to the resource transfer operation of the first user and sends a resource transfer request to the first financial institution according to the acquired resource transfer information. When the first financial institution receives the resource transfer request sent by the terminal device, it sends a transaction request to the blockchain node according to the resource transfer information. The blockchain node receives the transaction request sent by the first financial institution, calls the smart contract in the blockchain, and locks the first user's to-be-transferred resources based on the smart contract according to the resource transfer information in the transaction request; and sends resource transfer-in instruction information to the second financial institution according to the resource transfer information; when the second financial institution receives the resource transfer-in instruction information, it performs the corresponding resource transfer-in processing according to the resource transfer information in the resource transfer-in instruction information to transfer resources to the second user, and sends the resource transfer-in result information to the blockchain node. The blockchain node determines whether the resource transfer-in processing is successful based on the received resource transfer-in result information. If so, it performs resource transfer-out processing on the locked resources to be transferred to transfer the resources to be transferred to the second financial institution; if not, it rolls back the locked resources to be transferred to transfer the resources to be transferred to the resource transfer-out account of the first user through the first financial institution.
[0014] Further, such as Figure 2As shown, the first financial institution and the second financial institution can also deploy devices connected to the blockchain to become blockchain nodes; accordingly, when the first financial institution receives a resource transfer request sent by the terminal device of the first user, it broadcasts the resource transfer request in the blockchain network, calls the smart contract in the blockchain, and locks the first user's to-be-transferred resources based on the resource transfer information in the transaction request based on the smart contract; when the second financial institution obtains the resource transfer request broadcast by the first financial institution, it performs corresponding resource transfer-in processing according to the resource transfer information in the resource transfer request to transfer resources to the second user; when the first financial institution determines that the resource transfer-in processing of the second financial institution is successful, it performs resource transfer-out processing on the locked resources to be transferred to transfer the resources to be transferred to the second financial institution; when the first financial institution determines that the resource transfer-in processing of the second financial institution fails, it rolls back the locked resources to be transferred to transfer the resources to be transferred to the resource transfer-out account of the first user.
[0015] Therefore, the blockchain node locks the resources to be transferred, and when it is determined that the off-chain resource transfer process performed by the second financial institution is successful, the locked resources to be transferred are transferred to the second financial institution, and when it is determined that the off-chain resource transfer process performed by the second financial institution fails, the locked resources to be transferred are rolled back. In this way, the matching of the transaction processing on the chain and the transaction processing off the chain is ensured, the problem of the incoordination between the transaction processing on the chain and the transaction processing off the chain is solved, and the subsequent cumbersome operations caused by the success of the transaction processing on the chain and the failure of the transaction processing off the chain are avoided.
[0016] Figure 3 A flowchart of a transaction processing method provided in one or more embodiments of this specification, Figure 3 The method in can be Figure 1 The blockchain node in is executed, such as Figure 3 As shown, the method comprises the following steps: Step S102, receiving a transaction request sent by a first financial institution; wherein the transaction request is sent based on a resource transfer request sent by a first user to transfer resources to a second user, and the transaction request includes resource transfer information; the first user is a user served by the first financial institution, and the second user is a user served by the second financial institution; Specifically, when the terminal device of the first user responds to the first user's resource transfer operation to the second user, it sends a resource transfer request to the first financial institution according to the obtained resource transfer information. When the first financial institution receives the resource transfer request sent by the terminal device, it transfers the corresponding resources to be transferred from the first user's resource transfer-out account to the first account of the first financial institution according to the resource transfer information included in the resource transfer request; and sends a transaction request to the blockchain node according to the resource transfer information. Among them, the transaction request may also include a transaction identifier, the first identifier information of the first financial institution, etc., and the resource transfer information includes resource transfer-out account information, resource transfer-in account information, the first quantity of resources to be transferred, etc.; resources may be physical resources, such as currency, etc., or virtual resources, such as points, etc.
[0017] Step S104, calling the smart contract in the blockchain, and locking the to-be-transferred resources of the first user according to the resource transfer information based on the smart contract; Step S106, sending resource transfer instruction information to the second financial institution according to the resource transfer information, so that the second financial institution performs resource transfer processing corresponding to the resource transfer information to transfer resources to the second user; Step S108, if it is determined that the resource transfer-in process is successful, then performing a resource transfer-out process on the locked resources to be transferred, so as to transfer the resources to be transferred to the second financial institution; Step S110: If it is determined that the resource transfer process fails, the locked resources to be transferred are rolled back.
[0018] In one or more embodiments of the present specification, by locking the resources to be transferred, and transferring the locked resources to be transferred to the second financial institution when it is determined that the off-chain resource transfer process performed by the second financial institution is successful, and rolling back the locked resources to be transferred when it is determined that the off-chain resource transfer process performed by the second financial institution fails. This ensures that the transaction processing on the chain matches the transaction processing off the chain, solves the problem of incoordination between the transaction processing on the chain and the transaction processing off the chain, and avoids the subsequent cumbersome operations caused by the success of the transaction processing on the chain and the failure of the transaction processing off the chain.
[0019] In order to effectively lock the resources to be transferred, in one or more embodiments of this specification, multiple intermediate accounts are pre-set, and the resources to be transferred are transferred to the intermediate accounts to achieve the locking of the resources to be transferred. Figure 4 As shown, step S104 includes: Step S104-2, calling the smart contract in the blockchain, and determining the intermediate account corresponding to the first financial institution and the first account of the first financial institution based on the smart contract; In order to facilitate the rapid determination of the account of the corresponding financial institution during the transaction processing, in one or more embodiments of this specification, the account information of each financial institution is obtained in advance, and the account information is associated with the identification information of the financial institution to obtain a first association relationship. Accordingly, step S104-2 includes: calling the smart contract in the blockchain, based on the smart contract, obtaining the associated account information from the specified first association relationship according to the first identification information included in the transaction request, and determining the account corresponding to the obtained account information as the first account of the first financial institution; and randomly assigning the corresponding intermediate account to the first financial institution from the specified multiple intermediate accounts; or, obtaining the associated account information from the specified second association relationship according to the first identification information, and determining the intermediate account corresponding to the obtained account information as the intermediate account corresponding to the first financial institution; wherein the second association relationship includes the association relationship between the identification information of multiple institutions and the account information of the intermediate account.
[0020] Step S104-4, transferring the resources to be transferred in the first account to the intermediate account; wherein the resources to be transferred in the first account are transferred from the resource transfer account corresponding to the corresponding resource transfer account information to the first account by the first financial institution based on the resource transfer information.
[0021] Therefore, by determining the intermediate account corresponding to the first financial institution and transferring the resources to be transferred in the first account of the first financial institution to the intermediate account, not only the resources to be transferred are effectively locked, but also compared with the existing blockchain-based resource transfer architecture, only the intermediate account is added. Not only is the system architecture simple and low-cost, but it also effectively solves the problem of incoordination between on-chain transaction processing and off-chain transaction processing.
[0022] Further, in order to provide an effective processing basis for subsequent resource transfer processing and rollback processing, in one or more embodiments of this specification, as Figure 5 As shown, after step S104, the following steps are further included: Step S105, generating resource locking record information according to the transaction identification information in the transaction request and the first quantity of the resources to be transferred, the determined account information of the first account and the account information of the intermediate account, and saving the resource locking record information in the blockchain.
[0023] Specifically, transaction identification information and a first quantity of resources to be transferred are obtained from the transaction request, the obtained transaction identification information and the first quantity are associated with the account information of the determined first account and the account information of the intermediate account, and the recorded information is determined as resource locking record information, and the resource locking record information is saved in the blockchain.
[0024] In order to ensure that the transaction processing on the chain is coordinated with the transaction processing off the chain, in one or more embodiments of this specification, after the blockchain node locks the resources to be transferred, it instructs the second financial institution to transfer the first amount of resources from the second account of the second financial institution to the resource transfer account. Figure 6 As shown, step S106 includes: Step S106-2, sending resource transfer instruction information to the second financial institution based on the resource transfer account information in the resource transfer information and the first quantity of resources to be transferred, so that the second financial institution transfers the first quantity of resources from the second account of the second financial institution to the resource transfer account corresponding to the resource transfer account information.
[0025] Specifically, the blockchain node sends resource transfer indication information to the second financial institution based on the resource transfer account information and the first quantity of resources to be transferred in the resource transfer information, and the transaction identifier included in the transaction request; when the second financial institution receives the resource transfer indication information sent by the blockchain node, it obtains the resource transfer account information and the first quantity from the resource transfer indication information, and transfers the first quantity of resources from the second account of the second financial institution to the resource transfer account corresponding to the resource transfer account information; and sends resource transfer result information to the blockchain node based on the transaction identifier in the resource transfer indication information; the blockchain node performs corresponding processing according to the received resource transfer result information.
[0026] Further, such as Figure 7 As shown, step S108 includes: Step S108-2, if the resource transfer success information sent by the second financial institution is received, it is determined that the resource transfer process is successful; Step S108-4, if the associated resource locking record information is queried from the blockchain according to the transaction identification information included in the resource transfer success information, then the second account of the second financial institution is determined; Specifically, the transaction identification information included in the resource transfer success information is matched with the transaction identification information in each resource locking record information stored in the blockchain. If the match is successful, it is determined that the associated resource locking record information is queried; according to the second identification information of the second financial institution, the associated account information is obtained from the specified first association relationship, and the account corresponding to the obtained account information is determined to be the second account of the first financial institution. Further, if the match fails, an error message is sent to the second financial institution.
[0027] Step S108-6: transferring the resources to be transferred in the intermediate account to the determined second account.
[0028] Therefore, when the second financial institution receives the resource transfer indication information, it transfers the first amount of resources from its second account to the resource transfer account to complete the off-chain transaction processing, and when the off-chain transaction processing is successful, the blockchain node transfers the resources to be transferred in the intermediate account to the second account of the second financial institution to complete the on-chain transaction processing; at this point, a resource transfer transaction is successful, and during the transaction processing process, the subsequent tedious operations caused by the successful on-chain transaction processing and the failure of the off-chain transaction processing are effectively avoided.
[0029] In order to facilitate the subsequent tracing of transactions, Figure 8 As shown, in one or more embodiments of this specification, after step S108, the following steps are further included: Step S109, generating transaction success record information according to the transaction identifier, the account information of the intermediate account, the account information of the second account and the first quantity, and saving the transaction success record information in the blockchain.
[0030] Specifically, the transaction identifier, the account information of the intermediate account, the account information of the second account and the first quantity are associated and recorded, and the recorded information is determined as the successful transaction record information, and the successful transaction record information is saved in the blockchain. By saving the successful transaction record information in the blockchain, the integrity of the transaction information is ensured, and an effective basis is provided for the tracing of the transaction.
[0031] Furthermore, in order to let the first user know the resource transfer result, step S109 may also include: sending resource transfer success information to the first financial institution, so that the first financial institution sends the resource transfer success information to the terminal device of the first user.
[0032] Furthermore, when the resource transfer process of the second financial institution fails, that is, the transaction fails, the locked resources to be transferred are returned to the first user. Fig. 9 As shown, step S110 includes: Step S110-2, if the resource transfer failure information sent by the second financial institution is received, it is determined that the resource transfer process has failed; Step S110-4: if the associated resource locking record information is queried from the blockchain according to the transaction identifier included in the resource transfer failure information, the account information of the first account and the account information of the intermediate account are obtained from the queried resource locking record information; The process of querying resource locking record information according to the transaction identifier can be found in the above-mentioned related description, and the repeated parts will not be repeated here.
[0033] Step S110 - 6 , transferring the resources to be transferred in the corresponding intermediate account to the first account according to the acquired account information, so that the first financial institution transfers the resources to be transferred in the first account to the resource transfer-out account.
[0034] It should be pointed out that the first financial institution can use an intermediate account alone, or share the same intermediate account with other financial institutions; accordingly, when the first financial institution uses an intermediate account alone, all resources to be transferred in the intermediate account are transferred to the first account; when the first financial institution shares the same intermediate account with other financial institutions, the first quantity of resources to be transferred is transferred from the intermediate account to the first account.
[0035] When the resource transfer processing of the second financial institution fails, that is, the transaction processing off-chain fails, the transaction failure is determined, and based on the corresponding resource locking record information in the blockchain, the locked resources are released to return the locked resources to the first user; thus, based on the transaction processing results off-chain, the transaction processing method on the chain is determined, effectively avoiding the subsequent tedious operations caused by the successful transaction processing on the chain and the failure of the transaction processing off-chain.
[0036] In order to facilitate the subsequent tracing of transactions, Fig.10 As shown, in one or more embodiments of this specification, after step S110, the following steps are further included: Step S112: Generate transaction failure record information based on the transaction identification information, the account information of the intermediate account, the account information of the first account, and the first quantity, and save the transaction failure record information in the blockchain.
[0037] Furthermore, in order to let the first user know the resource transfer result, step S112 may also include: sending resource transfer failure information to the first financial institution, so that the first financial institution sends the resource transfer failure information to the terminal device of the first user.
[0038] In one or more embodiments of the present specification, by locking the resources to be transferred, and transferring the locked resources to be transferred to the second financial institution when it is determined that the off-chain resource transfer process performed by the second financial institution is successful, and rolling back the locked resources to be transferred when it is determined that the off-chain resource transfer process performed by the second financial institution fails. This ensures that the transaction processing on the chain matches the transaction processing off the chain, solves the problem of incoordination between the transaction processing on the chain and the transaction processing off the chain, and avoids the subsequent cumbersome operations caused by the success of the transaction processing on the chain and the failure of the transaction processing off the chain.
[0039] Corresponding to the above Figures 3 to 10 The transaction processing method described is based on the same technical concept, and one or more embodiments of this specification also provide a transaction processing device. Fig.11 A schematic diagram of the module composition of a transaction processing device provided in one or more embodiments of this specification, the device is used to execute Figures 3 to 10 Describes the transaction processing method, such as Fig.11 As shown, the device comprises: A receiving module 201 receives a transaction request sent by a first financial institution; wherein the transaction request is sent based on a resource transfer request sent by a first user to transfer resources to a second user, and the transaction request includes resource transfer information; the first user is a user served by the first financial institution, and the second user is a user served by the second financial institution; A locking module 202, which calls a smart contract in the blockchain, and locks the to-be-transferred resources of the first user according to the resource transfer information based on the smart contract; A sending module 203, which sends resource transfer instruction information to the second financial institution according to the resource transfer information, so that the second financial institution performs resource transfer processing corresponding to the resource transfer information to transfer resources to the second user; The first processing module 204 performs a resource transfer-out process on the locked resources to be transferred, so as to transfer the resources to be transferred to the second financial institution if it is determined that the resource transfer-in process is successful; The second processing module 205 performs a rollback process on the locked resources to be transferred if it is determined that the resource transfer process fails.
[0040] The transaction processing device provided in one or more embodiments of this specification locks the resources to be transferred, and when it is determined that the off-chain resource transfer processing performed by the second financial institution is successful, the locked resources to be transferred are transferred to the second financial institution, and when it is determined that the off-chain resource transfer processing performed by the second financial institution fails, the locked resources to be transferred are rolled back. Thus, the matching of the transaction processing on the chain and the transaction processing off the chain is ensured, the problem of the incoordination between the transaction processing on the chain and the transaction processing off the chain is solved, and the subsequent cumbersome operations caused by the success of the transaction processing on the chain and the failure of the transaction processing off the chain are avoided.
[0041] Optionally, the resource transfer information includes: resource transfer-out account information; The locking module 202 calls the smart contract in the blockchain and determines the intermediate account corresponding to the first financial institution and the first account of the first financial institution based on the smart contract; and The resources to be transferred in the first account are transferred to the intermediate account; wherein the resources to be transferred in the first account are transferred from the resource transfer account corresponding to the resource transfer account information to the first account by the first financial institution based on the resource transfer information.
[0042] Optionally, the transaction request further includes: first identification information of the first financial institution; The locking module 202, based on the smart contract, obtains associated account information from a specified first association relationship according to the first identification information, and determines the account corresponding to the obtained account information as a first account of the first financial institution; wherein the first association relationship includes an association relationship between identification information of multiple institutions and account information of the institutions; and Randomly assign a corresponding intermediate account to the first financial institution from a plurality of designated intermediate accounts; or, obtain associated account information from a designated second association relationship according to the first identification information, and determine the intermediate account corresponding to the obtained account information as the intermediate account corresponding to the first financial institution; wherein the second association relationship includes an association relationship between identification information of a plurality of institutions and account information of the intermediate account.
[0043] Optionally, the resource transfer information includes: a first quantity of resources to be transferred; the transaction request also includes: transaction identification information; the device also includes: a first generating module; The first generating module generates resource locking record information according to the transaction identification information, the first quantity, the account information of the first account, and the account information of the intermediate account after the locking module 202 locks the to-be-transferred resources of the first user according to the resource transfer information based on the smart contract; and The resource locking record information is saved in the blockchain.
[0044] Optionally, the resource transfer information further includes: resource transfer account information; The sending module 203 sends resource transfer instruction information to the second financial institution based on the resource transfer account information and the first quantity, so that the second financial institution transfers the first quantity of resources from the second account of the second financial institution to the resource transfer account corresponding to the resource transfer account information.
[0045] Optionally, the first processing module 204 determines that the resource transfer process is successful if the resource transfer success information sent by the second financial institution is received; and If the associated resource locking record information is found from the blockchain according to the transaction identification information included in the resource transfer success information, the second account of the second financial institution is determined; The resources to be transferred in the intermediate account are transferred to the second account.
[0046] Optionally, the second processing module 205 determines that the resource transfer process has failed if the resource transfer failure information sent by the second financial institution is received; and If the associated resource locking record information is queried from the blockchain according to the transaction identifier included in the resource transfer failure information, the account information of the first account and the account information of the intermediate account are obtained from the queried resource locking record information; According to the acquired account information, the resources to be transferred in the corresponding intermediate account are transferred to the first account, so that the first financial institution transfers the resources to be transferred in the first account to the resource transfer-out account.
[0047] Optionally, the device further comprises: a second generating module; the second generating module, after the second processing module 205 performs rollback processing on the locked resources to be transferred, generates transaction failure record information according to the transaction identification information, the account information of the intermediate account, the account information of the first account and the first amount; and The transaction failure record information is saved in the blockchain.
[0048] The transaction processing device provided in one or more embodiments of this specification locks the resources to be transferred, and when it is determined that the off-chain resource transfer processing performed by the second financial institution is successful, the locked resources to be transferred are transferred to the second financial institution, and when it is determined that the off-chain resource transfer processing performed by the second financial institution fails, the locked resources to be transferred are rolled back. Thus, the matching of the transaction processing on the chain and the transaction processing off the chain is ensured, the problem of the incoordination between the transaction processing on the chain and the transaction processing off the chain is solved, and the subsequent cumbersome operations caused by the success of the transaction processing on the chain and the failure of the transaction processing off the chain are avoided.
[0049] It should be noted that the embodiments of the transaction processing device in this specification and the embodiments of the transaction processing method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding transaction processing method mentioned above, and the repeated parts will not be repeated.
[0050] Furthermore, corresponding to the transaction processing method described above, based on the same technical concept, one or more embodiments of this specification also provide a transaction processing system. Fig.12 A schematic diagram of a transaction processing system provided in one or more embodiments of this specification, such as Fig.12 As shown, the system includes: a first financial institution 301, a blockchain 302, and a second financial institution 303; The first financial institution 301 receives a resource transfer request sent by the first user to transfer resources to the second user, wherein the resource transfer request includes resource transfer information; and sends a transaction request to a blockchain node in the blockchain 302 according to the resource transfer information; The blockchain node receives the transaction request sent by the first financial institution 301; calls the smart contract in the blockchain, and locks the first user's to-be-transferred resources based on the smart contract and the resource transfer information; and sends resource transfer-in instruction information to the second financial institution 303 according to the resource transfer information; if it is determined that the resource transfer-in process of the second financial institution 303 is successful, performs resource transfer-out process on the locked resources to be transferred, so as to transfer the resources to be transferred to the second financial institution 303; if it is determined that the resource transfer-in process of the second financial institution 303 fails, performs rollback process on the locked resources to be transferred; The second financial institution 303 receives the resource transfer indication information sent by the blockchain node, and executes the resource transfer processing corresponding to the resource transfer information according to the resource transfer indication information to transfer resources to the second user.
[0051] In the transaction processing system provided by one or more embodiments of the present specification, when a blockchain node in a blockchain receives a transaction request sent by a first financial institution, it locks the resources to be transferred, and when it is determined that the off-chain resource transfer processing performed by the second financial institution is successful, it transfers the locked resources to be transferred to the second financial institution, and when it is determined that the off-chain resource transfer processing performed by the second financial institution fails, it rolls back the locked resources to be transferred. In this way, the matching of the transaction processing on the chain and the transaction processing off the chain is ensured, the problem of the incoordination between the transaction processing on the chain and the transaction processing off the chain is solved, and the subsequent cumbersome operations caused by the success of the transaction processing on the chain and the failure of the transaction processing off the chain are avoided.
[0052] It should be noted that the embodiments of the transaction processing system in this specification and the embodiments of the transaction processing method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding transaction processing method mentioned above, and the repeated parts will not be repeated.
[0053] Furthermore, corresponding to the transaction processing method described above, based on the same technical concept, one or more embodiments of this specification also provide a transaction processing device, which is used to execute the transaction processing method described above. Fig.13 A schematic diagram of the structure of a transaction processing device provided for one or more embodiments of this specification.
[0054] like Fig.13 As shown, the transaction processing device may have relatively large differences due to different configurations or performances, and may include one or more processors 401 and memory 402, and the memory 402 may store one or more storage applications or data. Among them, the memory 402 can be a short-term storage or a persistent storage. The application stored in the memory 402 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the transaction processing device. Furthermore, the processor 401 can be configured to communicate with the memory 402 to execute a series of computer executable instructions in the memory 402 on the transaction processing device. The transaction processing device may also include one or more power supplies 403, one or more wired or wireless network interfaces 404, one or more input and output interfaces 405, one or more keyboards 406, etc.
[0055] In a specific embodiment, the transaction processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the transaction processing device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following: Receiving a transaction request sent by a first financial institution; wherein the transaction request is sent based on a resource transfer request sent by a first user to transfer resources to a second user, and the transaction request includes resource transfer information; the first user is a user served by the first financial institution, and the second user is a user served by the second financial institution; Calling a smart contract in the blockchain, and locking the resources to be transferred of the first user based on the smart contract and the resource transfer information; sending resource transfer instruction information to the second financial institution according to the resource transfer information, so that the second financial institution performs resource transfer processing corresponding to the resource transfer information to transfer resources to the second user; If it is determined that the resource transfer-in process is successful, performing a resource transfer-out process on the locked resource to be transferred, so as to transfer the resource to be transferred to the second financial institution; If it is determined that the resource transfer process fails, the locked resources to be transferred are rolled back.
[0056] The transaction processing device provided by one or more embodiments of this specification, upon receiving a transaction request sent by a first financial institution, locks the resources to be transferred, and upon determining that the off-chain resource transfer processing performed by the second financial institution is successful, transfers the locked resources to be transferred to the second financial institution, and upon determining that the off-chain resource transfer processing performed by the second financial institution fails, rolls back the locked resources to be transferred. Thus, the matching of the transaction processing on the chain and the transaction processing off the chain is ensured, the problem of the incoordination between the transaction processing on the chain and the transaction processing off the chain is solved, and the subsequent cumbersome operations caused by the success of the transaction processing on the chain and the failure of the transaction processing off the chain are avoided.
[0057] Optionally, when the computer executable instructions are executed, the resource transfer information includes: resource transfer-out account information; The calling of the smart contract in the blockchain, and locking the to-be-transferred resources of the first user according to the resource transfer information based on the smart contract, includes: Calling a smart contract in the blockchain, and determining an intermediate account corresponding to the first financial institution and a first account of the first financial institution based on the smart contract; The resources to be transferred in the first account are transferred to the intermediate account; wherein the resources to be transferred in the first account are transferred from the resource transfer account corresponding to the resource transfer account information to the first account by the first financial institution based on the resource transfer information.
[0058] Optionally, when the computer executable instructions are executed, the transaction request further includes: first identification information of the first financial institution; The determining, based on the smart contract, the first account of the first financial institution and the intermediate account corresponding to the first financial institution includes: Based on the smart contract, the associated account information is obtained from the specified first association relationship according to the first identification information, and the account corresponding to the obtained account information is determined as the first account of the first financial institution; wherein the first association relationship includes the association relationship between the identification information of multiple institutions and the account information of the institutions; and, Randomly assign a corresponding intermediate account to the first financial institution from a plurality of designated intermediate accounts; or, obtain associated account information from a designated second association relationship according to the first identification information, and determine the intermediate account corresponding to the obtained account information as the intermediate account corresponding to the first financial institution; wherein the second association relationship includes an association relationship between identification information of a plurality of institutions and account information of the intermediate account.
[0059] Optionally, when the computer executable instructions are executed, the resource transfer information includes: a first quantity of resources to be transferred; the transaction request also includes: transaction identification information; After locking the to-be-transferred resources of the first user according to the resource transfer information based on the smart contract, the method further includes: Generate resource locking record information according to the transaction identification information, the first amount, the account information of the first account, and the account information of the intermediate account; The resource locking record information is saved in the blockchain.
[0060] Optionally, when the computer executable instructions are executed, the resource transfer information further includes: resource transfer account information; The sending resource transfer instruction information to the second financial institution according to the resource transfer information so that the second financial institution performs the resource transfer processing corresponding to the resource transfer information includes: Send resource transfer instruction information to the second financial institution based on the resource transfer account information and the first quantity, so that the second financial institution transfers the first quantity of resources from the second account of the second financial institution to the resource transfer account corresponding to the resource transfer account information.
[0061] Optionally, when the computer executable instructions are executed, determining that the resource transfer process is successful includes: If the resource transfer success information sent by the second financial institution is received, it is determined that the resource transfer process is successful; The performing resource transfer-out processing on the locked resources to be transferred so as to transfer the resources to be transferred to the second financial institution includes: If the associated resource locking record information is found from the blockchain according to the transaction identification information included in the resource transfer success information, the second account of the second financial institution is determined; The resources to be transferred in the intermediate account are transferred to the second account.
[0062] Optionally, when the computer executable instructions are executed, after performing resource transfer-out processing on the locked resources to be transferred, the steps further include: Generate transaction success record information according to the transaction identifier, the account information of the intermediate account, the account information of the second account and the first amount; The transaction success record information is saved in the blockchain.
[0063] Optionally, when the computer executable instructions are executed, determining that the resource transfer-in process fails includes: If the resource transfer failure information sent by the second financial institution is received, determining that the resource transfer process has failed; The rolling back of the locked resources to be transferred includes: If the associated resource locking record information is queried from the blockchain according to the transaction identifier included in the resource transfer failure information, the account information of the first account and the account information of the intermediate account are obtained from the queried resource locking record information; According to the acquired account information, the resources to be transferred in the corresponding intermediate account are transferred to the first account, so that the first financial institution transfers the resources to be transferred in the first account to the resource transfer-out account.
[0064] Optionally, when the computer executable instructions are executed, after rolling back the locked resources to be transferred, the instructions further include: Generate transaction failure record information according to the transaction identification information, the account information of the intermediate account, the account information of the first account and the first amount; The transaction failure record information is saved in the blockchain.
[0065] The transaction processing device provided by one or more embodiments of this specification, upon receiving a transaction request sent by a first financial institution, locks the resources to be transferred, and upon determining that the off-chain resource transfer processing performed by the second financial institution is successful, transfers the locked resources to be transferred to the second financial institution, and upon determining that the off-chain resource transfer processing performed by the second financial institution fails, rolls back the locked resources to be transferred. Thus, the matching of the transaction processing on the chain and the transaction processing off the chain is ensured, the problem of the incoordination between the transaction processing on the chain and the transaction processing off the chain is solved, and the subsequent cumbersome operations caused by the success of the transaction processing on the chain and the failure of the transaction processing off the chain are avoided.
[0066] It should be noted that the embodiments of the transaction processing device in this specification and the embodiments of the transaction processing method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding transaction processing method mentioned above, and the repeated parts will not be repeated.
[0067] Furthermore, corresponding to the transaction processing method described above, based on the same technical concept, one or more embodiments of this specification further provide a storage medium for storing computer executable instructions. In a specific embodiment, the storage medium may be a USB flash drive, an optical disk, a hard disk, etc. When the computer executable instructions stored in the storage medium are executed by the processor, the following process can be implemented: Receiving a transaction request sent by a first financial institution; wherein the transaction request is sent based on a resource transfer request sent by a first user to transfer resources to a second user, and the transaction request includes resource transfer information; the first user is a user served by the first financial institution, and the second user is a user served by the second financial institution; Calling a smart contract in the blockchain, and locking the resources to be transferred of the first user based on the smart contract and the resource transfer information; sending resource transfer instruction information to the second financial institution according to the resource transfer information, so that the second financial institution performs resource transfer processing corresponding to the resource transfer information to transfer resources to the second user; If it is determined that the resource transfer-in process is successful, performing a resource transfer-out process on the locked resource to be transferred, so as to transfer the resource to be transferred to the second financial institution; If it is determined that the resource transfer process fails, the locked resources to be transferred are rolled back.
[0068] When the computer executable instructions stored in the storage medium provided in one or more embodiments of this specification are executed by the processor, upon receiving the transaction request sent by the first financial institution, the resources to be transferred are locked, and when it is determined that the off-chain resource transfer process performed by the second financial institution is successful, the locked resources to be transferred are transferred to the second financial institution, and when it is determined that the off-chain resource transfer process performed by the second financial institution fails, the locked resources to be transferred are rolled back. In this way, the matching of the transaction processing on the chain and the transaction processing off the chain is ensured, the problem of the incoordination between the transaction processing on the chain and the transaction processing off the chain is solved, and the subsequent cumbersome operations caused by the success of the transaction processing on the chain and the failure of the transaction processing off the chain are avoided.
[0069] Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, the resource transfer information includes: resource transfer-out account information; The calling of the smart contract in the blockchain, and locking the to-be-transferred resources of the first user according to the resource transfer information based on the smart contract, includes: Calling a smart contract in the blockchain, and determining an intermediate account corresponding to the first financial institution and a first account of the first financial institution based on the smart contract; The resources to be transferred in the first account are transferred to the intermediate account; wherein the resources to be transferred in the first account are transferred from the resource transfer account corresponding to the resource transfer account information to the first account by the first financial institution based on the resource transfer information.
[0070] Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, the transaction request further includes: first identification information of the first financial institution; The determining, based on the smart contract, the first account of the first financial institution and the intermediate account corresponding to the first financial institution includes: Based on the smart contract, the associated account information is obtained from the specified first association relationship according to the first identification information, and the account corresponding to the obtained account information is determined as the first account of the first financial institution; wherein the first association relationship includes the association relationship between the identification information of multiple institutions and the account information of the institutions; and, Randomly assign a corresponding intermediate account to the first financial institution from a plurality of designated intermediate accounts; or, obtain associated account information from a designated second association relationship according to the first identification information, and determine the intermediate account corresponding to the obtained account information as the intermediate account corresponding to the first financial institution; wherein the second association relationship includes an association relationship between identification information of a plurality of institutions and account information of the intermediate account.
[0071] Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, the resource transfer information includes: a first quantity of resources to be transferred; the transaction request also includes: transaction identification information; After locking the to-be-transferred resources of the first user according to the resource transfer information based on the smart contract, the method further includes: Generate resource locking record information according to the transaction identification information, the first amount, the account information of the first account, and the account information of the intermediate account; The resource locking record information is saved in the blockchain.
[0072] Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, the resource transfer information further includes: resource transfer account information; The sending resource transfer instruction information to the second financial institution according to the resource transfer information so that the second financial institution performs the resource transfer processing corresponding to the resource transfer information includes: Send resource transfer instruction information to the second financial institution based on the resource transfer account information and the first quantity, so that the second financial institution transfers the first quantity of resources from the second account of the second financial institution to the resource transfer account corresponding to the resource transfer account information.
[0073] Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, determining that the resource transfer process is successful includes: If the resource transfer success information sent by the second financial institution is received, it is determined that the resource transfer process is successful; The performing resource transfer-out processing on the locked resources to be transferred so as to transfer the resources to be transferred to the second financial institution includes: If the associated resource locking record information is found from the blockchain according to the transaction identification information included in the resource transfer success information, the second account of the second financial institution is determined; The resources to be transferred in the intermediate account are transferred to the second account.
[0074] Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, after performing resource transfer-out processing on the locked resource to be transferred, the steps further include: Generate transaction success record information according to the transaction identifier, the account information of the intermediate account, the account information of the second account and the first amount; The transaction success record information is saved in the blockchain.
[0075] Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, the determining that the resource transfer-in process fails includes: If the resource transfer failure information sent by the second financial institution is received, determining that the resource transfer process has failed; The rolling back of the locked resources to be transferred includes: If the associated resource locking record information is queried from the blockchain according to the transaction identifier included in the resource transfer failure information, the account information of the first account and the account information of the intermediate account are obtained from the queried resource locking record information; According to the acquired account information, the resources to be transferred in the corresponding intermediate account are transferred to the first account, so that the first financial institution transfers the resources to be transferred in the first account to the resource transfer-out account.
[0076] Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, after rolling back the locked resources to be transferred, the instructions further include: Generate transaction failure record information according to the transaction identification information, the account information of the intermediate account, the account information of the first account and the first amount; The transaction failure record information is saved in the blockchain.
[0077] When the computer executable instructions stored in the storage medium provided in one or more embodiments of this specification are executed by the processor, upon receiving the transaction request sent by the first financial institution, the resources to be transferred are locked, and when it is determined that the off-chain resource transfer process performed by the second financial institution is successful, the locked resources to be transferred are transferred to the second financial institution, and when it is determined that the off-chain resource transfer process performed by the second financial institution fails, the locked resources to be transferred are rolled back. In this way, the matching of the transaction processing on the chain and the transaction processing off the chain is ensured, the problem of the incoordination between the transaction processing on the chain and the transaction processing off the chain is solved, and the subsequent cumbersome operations caused by the success of the transaction processing on the chain and the failure of the transaction processing off the chain are avoided.
[0078] It should be noted that the embodiments of the storage medium in this specification and the embodiments of the transaction processing method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding transaction processing method mentioned above, and the repeated parts will not be repeated.
[0079] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0080] In the 1930s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements to method flows). However, with the development of technology, many of today's method flow improvements can be regarded as direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and produce dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0081] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.
[0082] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0083] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing the embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0084] It should be understood by those skilled in the art that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0085] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0086] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0088] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0089] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0090] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0091] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0092] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0093] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0094] The above description is only an embodiment of this document and is not intended to limit this document. For those skilled in the art, this document may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.
Claims
1. A transaction processing method, applied to a blockchain node, comprising: Receiving a transaction request sent by a first financial institution; wherein the transaction request is sent based on a resource transfer request sent by a first user to transfer resources to a second user, and the transaction request includes resource transfer information; the first user is a user served by the first financial institution, and the second user is a user served by the second financial institution; Invoke a smart contract in the blockchain, and transfer the resources to be transferred of the first user to an intermediate account pre-set by the first financial institution based on the smart contract, so as to lock the resources to be transferred; sending resource transfer instruction information to the second financial institution according to the resource transfer information, so that the second financial institution performs resource transfer processing corresponding to the resource transfer information to transfer resources to the second user; If it is determined that the resource transfer-in process is successful, a resource transfer-out process is performed on the locked resources to be transferred, so as to transfer the resources to be transferred to the second financial institution.
2. The method according to claim 1, wherein the resource transfer information comprises: Resource transfer-out account information, the calling of the smart contract in the blockchain, transferring the first user's to-be-transferred resources to an intermediate account pre-set by the first financial institution based on the smart contract, so as to lock the to-be-transferred resources, including: Calling a smart contract in the blockchain, and determining an intermediate account corresponding to the first financial institution and a first account of the first financial institution based on the smart contract; The resources to be transferred in the first account are transferred to the intermediate account; wherein the resources to be transferred in the first account are transferred from the resource transfer account corresponding to the resource transfer account information to the first account by the first financial institution based on the resource transfer information.
3. The method according to claim 2, wherein the transaction request further comprises: first identification information of the first financial institution; The determining, based on the smart contract, the first account of the first financial institution and the intermediate account corresponding to the first financial institution includes: Based on the smart contract, the associated account information is obtained from the specified first association relationship according to the first identification information, and the account corresponding to the obtained account information is determined as the first account of the first financial institution; wherein the first association relationship includes the association relationship between the identification information of multiple institutions and the account information of the institutions; and, Randomly assign a corresponding intermediate account to the first financial institution from a plurality of designated intermediate accounts; or, obtain associated account information from a designated second association relationship according to the first identification information, and determine the intermediate account corresponding to the obtained account information as the intermediate account corresponding to the first financial institution; wherein the second association relationship includes an association relationship between identification information of a plurality of institutions and account information of the intermediate account.
4. The method according to claim 2, wherein the resource transfer information comprises: a first quantity of resources to be transferred; The transaction request also includes: transaction identification information; After locking the to-be-transferred resources of the first user according to the resource transfer information based on the smart contract, the method further includes: Generate resource locking record information according to the transaction identification information, the first amount, the account information of the first account, and the account information of the intermediate account; The resource locking record information is saved in the blockchain.
5. The method according to claim 4, wherein the resource transfer information further comprises: Resource transfer account information; The sending resource transfer instruction information to the second financial institution according to the resource transfer information so that the second financial institution performs the resource transfer processing corresponding to the resource transfer information includes: Send resource transfer instruction information to the second financial institution based on the resource transfer account information and the first quantity, so that the second financial institution transfers the first quantity of resources from the second account of the second financial institution to the resource transfer account corresponding to the resource transfer account information.
6. The method according to claim 5, wherein determining that the resource transfer-in process is successful comprises: If the resource transfer success information sent by the second financial institution is received, it is determined that the resource transfer process is successful; The performing resource transfer-out processing on the locked resources to be transferred so as to transfer the resources to be transferred to the second financial institution includes: If the associated resource locking record information is found from the blockchain according to the transaction identification information included in the resource transfer success information, the second account of the second financial institution is determined; The resources to be transferred in the intermediate account are transferred to the second account.
7. The method according to claim 6, after performing resource transfer-out processing on the locked resource to be transferred, further comprising: Generate transaction success record information according to the transaction identifier, the account information of the intermediate account, the account information of the second account and the first amount; The transaction success record information is saved in the blockchain.
8. The method according to claim 4, wherein determining that the resource transfer-in process fails comprises: If the resource transfer failure information sent by the second financial institution is received, determining that the resource transfer process has failed; If the associated resource locking record information is queried from the blockchain according to the transaction identifier included in the resource transfer failure information, the account information of the first account and the account information of the intermediate account are obtained from the queried resource locking record information; According to the acquired account information, the resources to be transferred in the corresponding intermediate account are transferred to the first account, so that the first financial institution transfers the resources to be transferred in the first account to the resource transfer-out account.
9. The method according to claim 8, after rolling back the locked resources to be transferred, further comprising: Generate transaction failure record information according to the transaction identification information, the account information of the intermediate account, the account information of the first account and the first amount; The transaction failure record information is saved in the blockchain.
10. A transaction processing device, applied to a blockchain node, comprising: a receiving module, which receives a transaction request sent by a first financial institution; wherein the transaction request is sent based on a resource transfer request sent by a first user to transfer resources to a second user, and the transaction request includes resource transfer information; the first user is a user served by the first financial institution, and the second user is a user served by the second financial institution; A locking module, which calls a smart contract in the blockchain and transfers the resources to be transferred of the first user to an intermediate account preset by the first financial institution based on the smart contract, so as to lock the resources to be transferred; a sending module, which sends resource transfer instruction information to the second financial institution according to the resource transfer information, so that the second financial institution performs resource transfer processing corresponding to the resource transfer information to transfer resources to the second user; The first processing module performs resource transfer-out processing on the locked resources to be transferred, so as to transfer the resources to be transferred to the second financial institution if it is determined that the resource transfer-in processing is successful.
11. The device according to claim 10, wherein the resource transfer information comprises: Resource transfer account information; The locking module calls the smart contract in the blockchain and determines the intermediate account corresponding to the first financial institution and the first account of the first financial institution based on the smart contract; as well as, The resources to be transferred in the first account are transferred to the intermediate account; wherein the resources to be transferred in the first account are transferred from the resource transfer account corresponding to the resource transfer account information to the first account by the first financial institution based on the resource transfer information.
12. The apparatus according to claim 11, wherein the resource transfer information comprises: a first quantity of resources to be transferred; The transaction request further includes: transaction identification information; the device further includes: a first generating module; The first generating module generates resource locking record information according to the transaction identification information, the first quantity, the account information of the first account, and the account information of the intermediate account after the locking module locks the to-be-transferred resources of the first user according to the resource transfer information based on the smart contract; and The resource locking record information is saved in the blockchain.
13. The apparatus according to claim 12, wherein the resource transfer information further comprises: Resource transfer account information; The sending module sends resource transfer instruction information to the second financial institution according to the resource transfer account information and the first quantity, so that the second financial institution transfers the first quantity of resources from the second account of the second financial institution to the resource transfer account corresponding to the resource transfer account information.
14. The device according to claim 13, The first processing module determines that the resource transfer process is successful if the resource transfer success information sent by the second financial institution is received; and If the associated resource locking record information is found from the blockchain according to the transaction identification information included in the resource transfer success information, the second account of the second financial institution is determined; The resources to be transferred in the intermediate account are transferred to the second account.
15. The apparatus according to claim 12, further comprising: A second processing module; The second processing module determines that the resource transfer process has failed if it receives the resource transfer failure information sent by the second financial institution; as well as, If the associated resource locking record information is queried from the blockchain according to the transaction identifier included in the resource transfer failure information, the account information of the first account and the account information of the intermediate account are obtained from the queried resource locking record information; According to the acquired account information, the resources to be transferred in the corresponding intermediate account are transferred to the first account, so that the first financial institution transfers the resources to be transferred in the first account to the resource transfer-out account.
16. A transaction processing system comprising: The first financial institution, the blockchain, and the second financial institution; The first financial institution receives a resource transfer request sent by the first user to transfer resources to the second user, wherein the resource transfer request includes resource transfer information; and sends a transaction request to a blockchain node in the blockchain according to the resource transfer information; The blockchain node receives the transaction request sent by the first financial institution; calls the smart contract in the blockchain, and transfers the first user's to-be-transferred resources to an intermediate account preset by the first financial institution based on the smart contract, so as to lock the to-be-transferred resources; and sends resource transfer-in instruction information to the second financial institution according to the resource transfer information, and if it is determined that the resource transfer-in processing of the second financial institution is successful, performs resource transfer-out processing on the locked to-be-transferred resources, so as to transfer the to-be-transferred resources to the second financial institution; if it is determined that the resource transfer-in processing of the second financial institution fails, performs rollback processing on the locked to-be-transferred resources; The second financial institution receives the resource transfer indication information sent by the blockchain node, and executes the resource transfer processing corresponding to the resource transfer information according to the resource transfer indication information to transfer resources to the second user.
17. A transaction processing device, comprising: processor; as well as, a memory arranged to store computer executable instructions which, when executed, cause the processor to: Receiving a transaction request sent by a first financial institution; wherein the transaction request is sent based on a resource transfer request sent by a first user to transfer resources to a second user, and the transaction request includes resource transfer information; the first user is a user served by the first financial institution, and the second user is a user served by the second financial institution; Invoke a smart contract in the blockchain, and transfer the resources to be transferred of the first user to an intermediate account pre-set by the first financial institution based on the smart contract, so as to lock the resources to be transferred; sending resource transfer instruction information to the second financial institution according to the resource transfer information, so that the second financial institution performs resource transfer processing corresponding to the resource transfer information to transfer resources to the second user; If it is determined that the resource transfer-in process is successful, a resource transfer-out process is performed on the locked resources to be transferred, so as to transfer the resources to be transferred to the second financial institution.
18. A storage medium for storing computer executable instructions, wherein the computer executable instructions implement the following process when executed: A transaction request sent by a first financial institution is received; wherein, The transaction request is sent based on a resource transfer request sent by a first user to transfer resources to a second user, and the transaction request includes resource transfer information; the first user is a user served by the first financial institution, and the second user is a user served by the second financial institution; Invoke a smart contract in the blockchain, and transfer the resources to be transferred of the first user to an intermediate account pre-set by the first financial institution based on the smart contract, so as to lock the resources to be transferred; sending resource transfer instruction information to the second financial institution according to the resource transfer information, so that the second financial institution performs resource transfer processing corresponding to the resource transfer information to transfer resources to the second user; If it is determined that the resource transfer-in process is successful, a resource transfer-out process is performed on the locked resources to be transferred, so as to transfer the resources to be transferred to the second financial institution.