Detailed Description
In order to make those skilled in the art better understand the technical solutions in one or more embodiments of the present disclosure, the technical solutions in one or more embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in one or more embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all embodiments. All other embodiments that can be derived by a person skilled in the art from one or more of the embodiments described herein without making any inventive step shall fall within the scope of protection of this document.
Fig. 1 is a schematic view of an application scenario of a transaction method according to one or more embodiments of the present specification, as shown in fig. 1, the scenario includes: the system comprises a terminal device of a first user, a first financial institution, a second financial institution, a blockchain node of an access blockchain and a second user. The terminal device may be a mobile phone, a tablet computer, a desktop computer, a portable notebook computer, or the like (only the mobile phone is shown in fig. 1); the first user is a user served by a first financial institution and the second user is a user served by a second financial institution.
Specifically, when a first user transfers resources to a second user, the first user operates a terminal device thereof, and the terminal device responds to the resource transfer operation of the first user and sends a resource transfer request to a first financial institution according to the acquired resource transfer information. And when the first financial institution receives the resource transfer request sent by the terminal equipment, sending a transaction request to the block link node according to the resource transfer information. The block chain node receives a transaction request sent by a first financial institution, invokes an intelligent contract in a block chain, and locks a resource to be transferred of a first user based on the intelligent contract according to resource transfer information in the transaction request; sending resource transfer indication information to a second financial institution according to the resource transfer information; and when the second financial institution receives the resource transfer indication information, executing corresponding resource transfer processing according to the resource transfer information in the resource transfer indication information so as to transfer resources to the second user, and sending resource transfer result information to the block link points. The block chain node determines whether the resource transfer-in processing is successful according to the received resource transfer-in result information, if so, the resource transfer-out processing is executed on the locked resource to be transferred so as to transfer the resource to be transferred to a second financial institution; and if not, performing rollback processing on the locked resource to be transferred so as to transfer the resource to be transferred to the resource transfer-out account of the first user through the first financial institution.
Further, as shown in fig. 2, the first financial institution and the second financial institution may also deploy equipment accessing the blockchain to become blockchain nodes; correspondingly, when the first financial institution receives a resource transfer request sent by the terminal equipment of the first user, the first financial institution broadcasts the resource transfer request in the blockchain network, invokes an intelligent contract in the blockchain, and locks the resource to be transferred of the first user based on the intelligent contract according to the resource transfer information in the transaction request; when the second financial institution acquires the resource transfer request broadcast by the first financial institution, executing corresponding resource transfer-in processing according to the resource transfer information in the resource transfer request so as 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, executing resource transfer-out processing on the locked resource to be transferred so as to transfer the resource to be transferred to the second financial institution; and when the first financial institution determines that the resource transfer-in processing of the second financial institution fails, performing rollback processing on the locked resource to be transferred so as to transfer the resource to be transferred to the resource transfer-out account of the first user.
Therefore, the block link point locks the resource to be transferred, transfers the locked resource to the second financial institution when determining that the resource transfer-in processing under the chain performed by the second financial institution is successful, and performs rollback processing on the locked resource to be transferred when determining that the resource transfer-in processing under the chain performed by the second financial institution is failed. Therefore, the matching of the transaction processing on the chain and the transaction processing under the chain is ensured, the problem that the transaction processing on the chain and the transaction processing under the chain are not coordinated is solved, and the subsequent complicated operation caused by the failure of the transaction processing under the chain due to the successful transaction processing on the chain is avoided.
Fig. 3 is a flow diagram illustrating a transaction processing method according to one or more embodiments of the present disclosure, where the method in fig. 3 can be performed by the block chain node in fig. 1, as shown in fig. 3, and the method includes the following steps:
step S102, 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 and used for transferring resources to a second user, and the transaction request comprises resource transfer information; the first user is a user served by a first financial institution, and the second user is a user served by a second financial institution;
specifically, when the terminal device of the first user responds to the resource transfer operation of the first user to the second user, the resource transfer request is sent to the first financial institution according to the acquired resource transfer information. When a first financial institution receives a resource transfer request sent by terminal equipment, transferring corresponding resources to be transferred from a resource transfer-out account of a first user to a first account of the first financial institution according to resource transfer information included in the resource transfer request; and sending a transaction request to the block link node according to the resource transfer information. The transaction request can also comprise a transaction identifier, first identifier information of a first financial institution and the like, and the resource transfer information comprises resource transfer-out account information, resource transfer-in account information, a first quantity of resources to be transferred and the like; the resource may be an entity resource, such as currency, or may be a virtual resource, such as an integral.
Step S104, calling an intelligent contract in the block chain, and locking the resource to be transferred of the first user according to the resource transfer information based on the intelligent 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 executes resource transfer processing corresponding to the resource transfer information to transfer resources to the second user;
step S108, if the resource transferring process is determined to be successful, executing resource transferring process on the locked resource to be transferred so as to transfer the resource to be transferred to the second financial institution;
and step S110, if the resource transfer processing is determined to fail, performing rollback processing on the locked resource to be transferred.
In one or more embodiments of the present specification, a resource to be transferred is locked, and when it is determined that the resource transfer-in process performed by the second financial institution under the link is successful, the resource to be transferred is transferred to the second financial institution, and when it is determined that the resource transfer-in process performed by the second financial institution under the link is failed, the resource to be transferred that is locked is rolled back. Therefore, the matching of the transaction processing on the chain and the transaction processing under the chain is ensured, the problem that the transaction processing on the chain and the transaction processing under the chain are not coordinated is solved, and the subsequent complicated operation caused by the failure of the transaction processing under the chain due to the successful transaction processing on the chain is avoided.
In order to effectively lock the resource to be transferred, in one or more embodiments of the present specification, a plurality of intermediate accounts are preset, and the resource to be transferred is transferred to the intermediate accounts, so as to lock the resource to be transferred. Specifically, as shown in fig. 4, step S104 includes:
step S104-2, calling an intelligent contract in the block chain, and determining an intermediate account corresponding to the first financial institution and a first account of the first financial institution based on the intelligent contract;
in order to facilitate rapid determination of accounts of corresponding financial institutions during transaction processing, in one or more embodiments of the present disclosure, account information of each financial institution is obtained in advance, and an association relationship is established between the account information and identification information of the financial institution to obtain a first association relationship. Accordingly, step S104-2 includes: calling an intelligent contract in the block chain, acquiring related account information from a specified first association relation according to first identification information included in the transaction request based on the intelligent contract, and determining an account corresponding to the acquired account information as a first account of the first financial institution; randomly allocating a corresponding intermediate account for the first financial institution from the designated plurality of intermediate accounts; or acquiring associated account information from the specified second association relation according to the first identification information, and determining an intermediate account corresponding to the acquired account information as an intermediate account corresponding to the first financial institution; the second association relationship comprises association relationships between the identification information of the plurality of institutions and the account information of the intermediate account.
Step S104-4, transferring the resource to be transferred in the first account to an intermediate account; and the resource to be transferred in the first account is transferred from the resource transfer-out account corresponding to the corresponding resource transfer-out account information to the first account by the first financial institution based on the resource transfer information.
Therefore, by determining the intermediate account corresponding to the first financial institution and transferring the resource to be transferred in the first account of the first financial institution to the intermediate account, not only is the effective locking of the resource to be transferred realized, but also compared with the existing resource transfer architecture based on the block chain, only the intermediate account is added, the system architecture is simple and low in cost, and the problem of non-cooperation between transaction processing on the chain and transaction processing under the chain is effectively solved.
Further, in order to provide an effective processing basis for the subsequent resource roll-out processing and roll-back processing, in one or more embodiments of the present specification, as shown in fig. 5, step S104 further includes:
step S105, according to the transaction identification information and the first quantity of the resources to be transferred in the transaction request, the determined account information of the first account and the determined account information of the intermediate account, resource locking record information is generated, and the resource locking record information is stored in the block chain.
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 recorded in association with the determined account information of the first account, the account information of the middle account and the like, the recorded information is determined to be resource locking record information, and the resource locking record information is stored in the block chain.
To ensure that transaction processing on the chain is coordinated with transaction processing off the chain, in one or more embodiments of the present description, after the block link point locks the resource to be transferred, the second financial institution is instructed to transfer the first amount of resource from the second account of the second financial institution to the resource transfer account. Specifically, as shown in fig. 6, step S106 includes:
and S106-2, sending resource transfer indication information to the second financial institution according to the resource transfer account information in the resource transfer information and the first quantity of the resources to be transferred, so that the second financial institution transfers the first quantity of the resources from the second account of the second financial institution to the resource transfer account corresponding to the resource transfer account information.
Specifically, the block link point sends resource transfer indication information to the second financial institution according to the resource transfer account information in the resource transfer information, the first quantity of the resources to be transferred and the transaction identifier included in the transaction request; when the second financial institution receives the resource transfer indication information sent by the block chain node, acquiring the resource transfer account information and the first quantity from the resource transfer indication information, and transferring the first quantity of resources from a second account of the second financial institution to the resource transfer account corresponding to the resource transfer account information; and according to the transaction identification in the resource transfer indication information, sending resource transfer result information to the block link points; and the block chain node executes corresponding processing according to the received resource transfer result information.
Further, as shown in fig. 7, step S108 includes:
step S108-2, if the resource transfer success information sent by the second financial institution is received, determining that the resource transfer processing is successful;
step S108-4, if the related resource locking record information is inquired from the block chain according to the transaction identification information included in the resource transfer success information, determining a second account of a second financial institution;
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 block chain, and if the matching is successful, the associated resource locking record information is determined to be inquired; and acquiring associated account information from the specified first association relation according to the second identification information of the second financial institution, and determining an account corresponding to the acquired account information as the second account of the first financial institution. Further, if the matching fails, an error message is sent to the second financial institution.
And step S108-6, transferring the resource to be transferred in the intermediate account to the determined second account.
Therefore, when the second financial institution receives the resource transfer indication information, the second financial institution transfers the resources with the first quantity from the second account to the resource transfer account to complete the transaction processing under the chain, and when the transaction processing under the chain is successful, the block link point transfers the resources to be transferred in the intermediate account to the second account of the second financial institution to complete the transaction processing on the chain; therefore, a resource transfer transaction is successful, and in the transaction processing process, subsequent complicated operations caused by the fact that the transaction processing on the chain is successful and the transaction processing under the chain is failed are effectively avoided.
In order to facilitate the subsequent tracing of the transaction, as shown in fig. 8, in one or more embodiments of the present specification, the step S108 further includes:
step S109, transaction success record information is generated according to the transaction identification, the account information of the intermediate account, the account information of the second account and the first quantity, and the transaction success record information is stored in the block chain.
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, the recorded information is determined as transaction success recording information, and the transaction success recording information is stored in the block chain. By storing the transaction success record information to the block chain, the integrity of the transaction information is ensured, and an effective basis is provided for tracing the transaction.
Further, in order to make the first user know the resource transfer result, step S109 may further include: and sending the resource transfer success information to the first financial institution so that the first financial institution sends the resource transfer success information to the terminal equipment of the first user.
Further, when the resource transfer processing of the second financial institution fails, namely the transaction fails, the locked resource to be transferred is returned to the first user. Specifically, as shown in fig. 9, step S110 includes:
step S110-2, if the resource transfer-in failure information sent by the second financial institution is received, determining that the resource transfer-in processing fails;
step S110-4, if the associated resource locking record information is inquired from the block chain according to the transaction identifier included in the resource transfer failure information, acquiring the account information of the first account and the account information of the intermediate account from the inquired resource locking record information;
the process of querying the resource locking record information according to the transaction identifier may refer to the foregoing related description, and repeated details are omitted here.
And 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.
It should be noted that the first financial institution may use one intermediate account by itself, or may share the same intermediate account with other financial institutions; correspondingly, when the first financial institution solely uses one intermediate account, all the resources to be transferred in the intermediate account are transferred to the first account; when the first financial institution and other financial institutions share the same intermediate account, transferring a first amount of resources to be transferred from the intermediate account to the first account.
When the resource transfer processing of the second financial institution fails, namely the transaction processing under the chain fails, determining that the transaction fails, and releasing the locked resource based on the corresponding resource locking record information in the block chain to return the locked resource to the first user; therefore, the transaction processing mode on the chain is determined based on the transaction processing result under the chain, and the subsequent complicated operation caused by the failure of the transaction processing under the chain due to the successful transaction processing on the chain is effectively avoided.
In order to facilitate the subsequent tracing of the transaction, as shown in fig. 10, in one or more embodiments of the present specification, the step S110 further includes:
step S112, generating 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 quantity, and storing the transaction failure record information into the block chain.
Further, in order to make the first user aware of the resource transfer result, step S112 may further include: and sending the resource transfer failure information to the first financial institution so that the first financial institution sends the resource transfer failure information to the terminal equipment of the first user.
In one or more embodiments of the present specification, a resource to be transferred is locked, and when it is determined that the resource transfer-in process performed by the second financial institution under the link is successful, the resource to be transferred is transferred to the second financial institution, and when it is determined that the resource transfer-in process performed by the second financial institution under the link is failed, the resource to be transferred that is locked is rolled back. Therefore, the matching of the transaction processing on the chain and the transaction processing under the chain is ensured, the problem that the transaction processing on the chain and the transaction processing under the chain are not coordinated is solved, and the subsequent complicated operation caused by the failure of the transaction processing under the chain due to the successful transaction processing on the chain is avoided.
On the basis of the same technical concept, corresponding to the transaction processing methods described in fig. 3 to 10, one or more embodiments of the present disclosure further provide a transaction processing apparatus. Fig. 11 is a schematic block diagram of a transaction processing apparatus according to one or more embodiments of the present disclosure, the apparatus being configured to execute the transaction processing method described in fig. 3 to 10, and as shown in fig. 11, the apparatus includes:
a receiving module 201, 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 for transferring resources to a second user, and the transaction request comprises 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 locking module 202 is used for calling an intelligent contract in a block chain and locking the resource to be transferred of the first user according to the resource transfer information based on the intelligent contract;
a sending module 203, configured to send resource transfer instruction information to the second financial institution according to the resource transfer information, so that the second financial institution executes resource transfer processing corresponding to the resource transfer information to transfer resources to the second user;
a first processing module 204, configured to, if it is determined that the resource transfer-in process is successful, perform 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;
and the second processing module 205, if it is determined that the resource transfer-in process fails, performs rollback processing on the locked resource to be transferred.
One or more embodiments of the present specification provide a transaction processing apparatus, which performs locking processing on a resource to be transferred, and when it is determined that an offline resource transfer processing performed by a second financial institution is successful, transfers the locked resource to be transferred to the second financial institution, and when it is determined that the offline resource transfer processing performed by the second financial institution is failed, performs rollback processing on the locked resource to be transferred. Therefore, the matching of the transaction processing on the chain and the transaction processing under the chain is ensured, the problem that the transaction processing on the chain and the transaction processing under the chain are not coordinated is solved, and the subsequent complicated operation caused by the failure of the transaction processing under the chain due to the successful transaction processing on the chain is avoided.
Optionally, the resource transfer information includes: transferring account information from the resource;
the locking module 202 is configured to invoke an intelligent contract in the blockchain, and determine an intermediate account corresponding to the first financial institution and a first account of the first financial institution based on the intelligent contract; and the number of the first and second groups,
transferring the resource to be transferred in the first account to the intermediate account; and the resource to be transferred in the first account is transferred from the resource transfer-out account corresponding to the resource transfer-out account information to the first account by the first financial institution based on the resource transfer information.
Optionally, the transaction request further comprises: first identification information of the first financial institution;
the locking module 202, based on the smart contract, acquires associated account information from a specified first association relationship according to the first identification information, and determines an account corresponding to the acquired account information as a first account of the first financial institution; the first incidence relation comprises incidence relations between identification information of a plurality of organizations and account information of the organizations; and the number of the first and second groups,
randomly assigning a corresponding intermediate account from a designated plurality of intermediate accounts to the first financial institution; or acquiring associated account information from a specified second association relation according to the first identification information, and determining an intermediate account corresponding to the acquired account information as an intermediate account corresponding to the first financial institution; and the second incidence relation comprises incidence relations between the identification information of the plurality of organizations and the account information of the intermediate account.
Optionally, the resource transfer information includes: a first number of resources to be transferred; the transaction request further comprises: transaction identification information; the device further comprises: a first generation module;
the first generation module, after the locking module 202 locks the resource to be transferred of the first user according to the resource transfer information based on the intelligent contract, 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; and the number of the first and second groups,
and saving the resource locking record information to the block chain.
Optionally, the resource transfer information further includes: transferring the resource into account information;
the sending module 203 sends resource transfer instruction information to the second financial institution according to the resource transfer account information and the first amount, so that the second financial institution transfers the first amount of resources from a second account of the second financial institution to a resource transfer account corresponding to the resource transfer account information.
Optionally, the first processing module 204 determines that the resource transfer-in processing is successful if the resource transfer-in success information sent by the second financial institution is received; and the number of the first and second groups,
if the associated resource locking record information is inquired from the block chain according to the transaction identification information included in the resource transfer success information, determining a second account of the second financial institution;
transferring the resource to be transferred in the intermediate account to the second account.
Optionally, the second processing module 205, if receiving the resource transfer-in failure information sent by the second financial institution, determines that the resource transfer-in processing fails; and the number of the first and second groups,
if the associated resource locking record information is inquired from the block chain according to the transaction identifier included in the resource transfer failure information, acquiring the account information of the first account and the account information of the intermediate account from the inquired resource locking record information;
and 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.
Optionally, the apparatus further comprises: a second generation module;
the second generating module, after the second processing module 205 performs rollback processing on the locked resource 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 quantity; and the number of the first and second groups,
and storing the transaction failure record information into the block chain.
One or more embodiments of the present specification provide a transaction processing apparatus, which performs locking processing on a resource to be transferred, and when it is determined that an offline resource transfer processing performed by a second financial institution is successful, transfers the locked resource to be transferred to the second financial institution, and when it is determined that the offline resource transfer processing performed by the second financial institution is failed, performs rollback processing on the locked resource to be transferred. Therefore, the matching of the transaction processing on the chain and the transaction processing under the chain is ensured, the problem that the transaction processing on the chain and the transaction processing under the chain are not coordinated is solved, and the subsequent complicated operation caused by the failure of the transaction processing under the chain due to the successful transaction processing on the chain is avoided.
It should be noted that the embodiment of the transaction processing apparatus in this specification and the embodiment of the transaction processing method in this specification are based on the same inventive concept, and therefore, for specific implementation of this embodiment, reference may be made to implementation of the corresponding transaction processing method, and repeated details are not described again.
Further, on the basis of the same technical concept, corresponding to the above-described transaction processing method, one or more embodiments of the present specification further provide a transaction processing system. Fig. 12 is a schematic diagram of a transaction processing system according to one or more embodiments of the present disclosure, and as shown in fig. 12, 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 a first user to transfer a resource to a second user, where the resource transfer request includes resource transfer information; sending a transaction request to a block link node in the block chain 302 according to the resource transfer information;
the blockchain node receives the transaction request sent by the first financial institution 301; calling an intelligent contract in the block chain, and locking the resource to be transferred of the first user according to the resource transfer information based on the intelligent contract; sending resource transfer-in indication information to the second financial institution 303 according to the resource transfer information, and if the resource transfer-in processing of the second financial institution 303 is determined to be successful, executing resource transfer-out processing on the locked resource to be transferred so as to transfer the resource to be transferred to the second financial institution 303; if the resource transfer processing of the second financial institution 303 is determined to fail, performing rollback processing on the locked resource to be transferred;
the second financial institution 303 receives the resource transfer-in indication information sent by the blockchain node, and executes resource transfer-in processing corresponding to the resource transfer information according to the resource transfer-in indication information, so as to transfer resources to the second user.
In the transaction processing system provided in one or more embodiments of the present specification, when a transaction request sent by a first financial institution is received, a block link point in a block chain locks a resource to be transferred, and when it is determined that a resource transfer-in process performed by a second financial institution is successful, transfers the resource to be transferred to the second financial institution, and when it is determined that the resource transfer-in process performed by the second financial institution is failed, performs a rollback process on the locked resource to be transferred. Therefore, the matching of the transaction processing on the chain and the transaction processing under the chain is ensured, the problem that the transaction processing on the chain and the transaction processing under the chain are not coordinated is solved, and the subsequent complicated operation caused by the failure of the transaction processing under the chain due to the successful transaction processing on the chain is avoided.
It should be noted that the embodiment of the transaction processing system in this specification and the embodiment of the transaction processing method in this specification are based on the same inventive concept, and therefore, for specific implementation of this embodiment, reference may be made to implementation of the corresponding transaction processing method, and repeated details are not described again.
Further, corresponding to the above-described transaction processing method, based on the same technical concept, one or more embodiments of the present specification further provide a transaction processing device, which is configured to execute the above-described transaction processing method, and fig. 13 is a schematic structural diagram of the transaction processing device provided in one or more embodiments of the present specification.
As shown in fig. 13, the transaction processing device may have a relatively large difference due to different configurations or performances, and may include one or more processors 401 and a memory 402, where one or more stored applications or data may be stored in the memory 402. Wherein memory 402 may be transient or persistent. The application program stored in memory 402 may include one or more modules (not shown), each of which may include a series of computer-executable instructions in a transaction processing device. Still further, the processor 401 may 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-output interfaces 405, one or more keyboards 406, etc.
In one particular embodiment, the transaction processing apparatus 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 apparatus, and the one or more programs configured to be executed by the one or more processors include computer-executable instructions for:
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 for transferring resources to a second user, and the transaction request comprises 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;
calling an intelligent contract in a block chain, and locking the resource to be transferred of the first user according to the resource transfer information based on the intelligent contract;
sending resource transfer indication information to the second financial institution according to the resource transfer information so that the second financial institution executes resource transfer processing corresponding to the resource transfer information to transfer resources to the second user;
if the resource transferring-in process is determined to be successful, executing resource transferring-out process on the locked resource to be transferred so as to transfer the resource to be transferred to the second financial institution;
and if the resource transfer-in processing fails, performing rollback processing on the locked resource to be transferred.
The transaction processing device provided in one or more embodiments of the present specification performs, when receiving a transaction request sent by a first financial institution, locking processing on a resource to be transferred, and when determining that a resource transfer-in processing performed by a second financial institution under a link is successful, transfers the resource to be transferred to the second financial institution in a locked manner, and when determining that the resource transfer-in processing performed by the second financial institution under the link is failed, performs rollback processing on the resource to be transferred in a locked manner. Therefore, the matching of the transaction processing on the chain and the transaction processing under the chain is ensured, the problem that the transaction processing on the chain and the transaction processing under the chain are not coordinated is solved, and the subsequent complicated operation caused by the failure of the transaction processing under the chain due to the successful transaction processing on the chain is avoided.
Optionally, the resource transfer information comprises, when executed, computer-executable instructions for: transferring account information from the resource;
the intelligent contract in the calling block chain is used for locking the resource to be transferred of the first user according to the resource transfer information based on the intelligent contract, and the method comprises the following steps:
calling an intelligent 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 intelligent contract;
transferring the resource to be transferred in the first account to the intermediate account; and the resource to be transferred in the first account is transferred from the resource transfer-out account corresponding to the resource transfer-out account information to the first account by the first financial institution based on the resource transfer information.
Optionally, the computer executable instructions, when executed, further comprise: first identification information of the first financial institution;
the determining a first account of the first financial institution and an intermediate account corresponding to the first financial institution based on the smart contract comprises:
acquiring associated account information from a specified first association relation according to the first identification information based on the intelligent contract, and determining an account corresponding to the acquired account information as a first account of the first financial institution; the first incidence relation comprises incidence relations between identification information of a plurality of organizations and account information of the organizations; and the number of the first and second groups,
randomly assigning a corresponding intermediate account from a designated plurality of intermediate accounts to the first financial institution; or acquiring associated account information from a specified second association relation according to the first identification information, and determining an intermediate account corresponding to the acquired account information as an intermediate account corresponding to the first financial institution; and the second incidence relation comprises incidence relations between the identification information of the plurality of organizations and the account information of the intermediate account.
Optionally, the resource transfer information comprises, when executed, computer-executable instructions for: a first number of resources to be transferred; the transaction request further comprises: transaction identification information;
after the resource to be transferred of the first user is locked according to the resource transfer information based on the intelligent contract, the method also comprises the following steps;
generating 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;
and saving the resource locking record information to the block chain.
Optionally, when executed by computer-executable instructions, the resource transfer information further comprises: transferring the resource into account information;
the sending of the resource transfer instruction information to the second financial institution according to the resource transfer information to enable the second financial institution to execute the resource transfer processing corresponding to the resource transfer information includes:
and sending resource transfer indication information to the second financial institution according to the resource transfer account information and the first quantity so as to enable the second financial institution to transfer the first quantity of resources from a second account of the second financial institution to a resource transfer account corresponding to the resource transfer account information.
Optionally, the computer-executable instructions, when executed, said determining that the resource transfer-in process was successful comprises:
if the resource transfer-in success information sent by the second financial institution is received, determining that the resource transfer-in processing is successful;
the executing resource transfer-out processing on the locked resource to be transferred to transfer the resource to be transferred to the second financial institution comprises the following steps:
if the associated resource locking record information is inquired from the block chain according to the transaction identification information included in the resource transfer success information, determining a second account of the second financial institution;
transferring the resource to be transferred in the intermediate account to the second account.
Optionally, when executed, the computer-executable instructions, after performing resource roll-out processing on the locked resource to be transferred, further include:
generating transaction success record information according to the transaction identification, 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 into the block chain.
Optionally, the computer-executable instructions, when executed, determine that the resource transfer-in process failed, comprising:
if the resource transfer-in failure information sent by the second financial institution is received, determining that the resource transfer-in processing fails;
the rollback processing of the locked resource to be transferred includes:
if the associated resource locking record information is inquired from the block chain according to the transaction identifier included in the resource transfer failure information, acquiring the account information of the first account and the account information of the intermediate account from the inquired resource locking record information;
and 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.
Optionally, when executed, the computer-executable instructions, after performing rollback processing on the locked resource to be transferred, further include:
generating 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 quantity;
and storing the transaction failure record information into the block chain.
The transaction processing device provided in one or more embodiments of the present specification performs, when receiving a transaction request sent by a first financial institution, locking processing on a resource to be transferred, and when determining that a resource transfer-in processing performed by a second financial institution under a link is successful, transfers the resource to be transferred to the second financial institution in a locked manner, and when determining that the resource transfer-in processing performed by the second financial institution under the link is failed, performs rollback processing on the resource to be transferred in a locked manner. Therefore, the matching of the transaction processing on the chain and the transaction processing under the chain is ensured, the problem that the transaction processing on the chain and the transaction processing under the chain are not coordinated is solved, and the subsequent complicated operation caused by the failure of the transaction processing under the chain due to the successful transaction processing on the chain is avoided.
It should be noted that the embodiment of the transaction processing device in this specification and the embodiment of the transaction processing method in this specification are based on the same inventive concept, and therefore, for specific implementation of this embodiment, reference may be made to implementation of the corresponding transaction processing method, and repeated details are not described again.
Further, corresponding to the above-described transaction processing method, based on the same technical concept, one or more embodiments of the present specification further provide a storage medium for storing computer-executable instructions, where in a specific embodiment, the storage medium may be a usb disk, an optical disk, a hard disk, and the like, and the computer-executable instructions stored in the storage medium, when being executed by the processor, can implement the following processes:
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 for transferring resources to a second user, and the transaction request comprises 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;
calling an intelligent contract in a block chain, and locking the resource to be transferred of the first user according to the resource transfer information based on the intelligent contract;
sending resource transfer indication information to the second financial institution according to the resource transfer information so that the second financial institution executes resource transfer processing corresponding to the resource transfer information to transfer resources to the second user;
if the resource transferring-in process is determined to be successful, executing resource transferring-out process on the locked resource to be transferred so as to transfer the resource to be transferred to the second financial institution;
and if the resource transfer-in processing fails, performing rollback processing on the locked resource to be transferred.
One or more embodiments of the present disclosure provide a storage medium storing computer-executable instructions that, when executed by a processor, perform a locking process on a resource to be transferred upon receiving a transaction request sent by a first financial institution, and upon determining that an offline resource transfer process performed by a second financial institution is successful, transfer the locked resource to be transferred to the second financial institution, and upon determining that the offline resource transfer process performed by the second financial institution is unsuccessful, perform a rollback process on the locked resource to be transferred. Therefore, the matching of the transaction processing on the chain and the transaction processing under the chain is ensured, the problem that the transaction processing on the chain and the transaction processing under the chain are not coordinated is solved, and the subsequent complicated operation caused by the failure of the transaction processing under the chain due to the successful transaction processing on the chain is avoided.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, cause the resource transfer information to include: transferring account information from the resource;
the intelligent contract in the calling block chain is used for locking the resource to be transferred of the first user according to the resource transfer information based on the intelligent contract, and the method comprises the following steps:
calling an intelligent 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 intelligent contract;
transferring the resource to be transferred in the first account to the intermediate account; and the resource to be transferred in the first account is transferred from the resource transfer-out account corresponding to the resource transfer-out account information to the first account by the first financial institution based on the resource transfer information.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, the transaction request further comprises: first identification information of the first financial institution;
the determining a first account of the first financial institution and an intermediate account corresponding to the first financial institution based on the smart contract comprises:
acquiring associated account information from a specified first association relation according to the first identification information based on the intelligent contract, and determining an account corresponding to the acquired account information as a first account of the first financial institution; the first incidence relation comprises incidence relations between identification information of a plurality of organizations and account information of the organizations; and the number of the first and second groups,
randomly assigning a corresponding intermediate account from a designated plurality of intermediate accounts to the first financial institution; or acquiring associated account information from a specified second association relation according to the first identification information, and determining an intermediate account corresponding to the acquired account information as an intermediate account corresponding to the first financial institution; and the second incidence relation comprises incidence relations between the identification information of the plurality of organizations and the account information of the intermediate account.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, cause the resource transfer information to include: a first number of resources to be transferred; the transaction request further comprises: transaction identification information;
after the resource to be transferred of the first user is locked according to the resource transfer information based on the intelligent contract, the method also comprises the following steps;
generating 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;
and saving the resource locking record information to the block chain.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, further comprise: transferring the resource into account information;
the sending of the resource transfer instruction information to the second financial institution according to the resource transfer information to enable the second financial institution to execute the resource transfer processing corresponding to the resource transfer information includes:
and sending resource transfer indication information to the second financial institution according to the resource transfer account information and the first quantity so as to enable the second financial institution to transfer the first quantity of resources from a second account of the second financial institution to a resource transfer account corresponding to the resource transfer account information.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, determine that the resource transfer-in process is successful, comprising:
if the resource transfer-in success information sent by the second financial institution is received, determining that the resource transfer-in processing is successful;
the executing resource transfer-out processing on the locked resource to be transferred to transfer the resource to be transferred to the second financial institution comprises the following steps:
if the associated resource locking record information is inquired from the block chain according to the transaction identification information included in the resource transfer success information, determining a second account of the second financial institution;
transferring the resource to be transferred in the intermediate account to the second account.
Optionally, the storage medium stores computer-executable instructions, which when executed by the processor, further include, after performing resource roll-out processing on the locked resource to be transferred:
generating transaction success record information according to the transaction identification, 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 into the block chain.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, determine that the resource transfer process failed, comprising:
if the resource transfer-in failure information sent by the second financial institution is received, determining that the resource transfer-in processing fails;
the rollback processing of the locked resource to be transferred includes:
if the associated resource locking record information is inquired from the block chain according to the transaction identifier included in the resource transfer failure information, acquiring the account information of the first account and the account information of the intermediate account from the inquired resource locking record information;
and 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.
Optionally, the storage medium stores computer-executable instructions, which when executed by the processor, further include, after performing rollback processing on the locked resource to be transferred:
generating 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 quantity;
and storing the transaction failure record information into the block chain.
One or more embodiments of the present disclosure provide a storage medium storing computer-executable instructions that, when executed by a processor, perform a locking process on a resource to be transferred upon receiving a transaction request sent by a first financial institution, and upon determining that an offline resource transfer process performed by a second financial institution is successful, transfer the locked resource to be transferred to the second financial institution, and upon determining that the offline resource transfer process performed by the second financial institution is unsuccessful, perform a rollback process on the locked resource to be transferred. Therefore, the matching of the transaction processing on the chain and the transaction processing under the chain is ensured, the problem that the transaction processing on the chain and the transaction processing under the chain are not coordinated is solved, and the subsequent complicated operation caused by the failure of the transaction processing under the chain due to the successful transaction processing on the chain is avoided.
It should be noted that the embodiment of the storage medium in this specification and the embodiment of the transaction processing method in this specification are based on the same inventive concept, and therefore, for specific implementation of this embodiment, reference may be made to implementation of the corresponding transaction processing method, and repeated details are not described again.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
In the 30 s of the 20 th century, improvements in a technology could clearly be distinguished between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), HDCal, JHDL (Java Hardware Description Language), langue, Lola, HDL, laspam, hardsradware (Hardware Description Language), vhjhd (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, 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, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, 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.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the units may be implemented in the same software and/or hardware or in multiple software and/or hardware when implementing the embodiments of the present description.
One skilled in the art will recognize that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
One or more embodiments of the present description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of this document and is not intended to limit this document. Various modifications and changes may occur to those skilled in the art from this document. Any modifications, equivalents, improvements, etc. which come within the spirit and principle of the disclosure are intended to be included within the scope of the claims of this document.