Disclosure of Invention
In view of the above, the present invention has been made to provide a transaction processing method and apparatus that overcomes or at least partially solves the above problems.
A transaction processing method is applied to an accounting node in a sub-block chain partition corresponding to a transfer party account, and comprises the following steps:
receiving a transaction request initiated by a client;
acquiring an account number of a transfer-in party from the transaction request;
acquiring relevant information of each sub-block chain partition from the main block chain partition;
determining the sub-block chain partition corresponding to the transfer-in party account according to the relevant information of each sub-block chain partition;
judging whether the sub-block chain partition corresponding to the transferring party account is the same as the sub-block chain partition corresponding to the transferring party account;
if the sub-block chain partition corresponding to the transferring-in party account number is different from the sub-block chain partition corresponding to the transferring-out party account number, determining a billing node in the sub-block chain partition corresponding to the transferring-in party account number according to the related information of each sub-block chain partition;
after the transaction request is processed by the accounting node in the sub-blockchain partition corresponding to the transferring-out party account number, the transaction request is forwarded to the accounting node in the sub-blockchain partition corresponding to the transferring-in party account number, so that the transaction request is processed by the accounting node in the sub-blockchain partition corresponding to the transferring-in party account number.
Optionally, the processing of the transaction request by the accounting node in the sub-blockchain partition corresponding to the transfer-out party account includes:
determining the asset amount corresponding to the transaction request;
deducting the amount of the asset from the asset corresponding to the transfer party account;
and after the asset amount is deducted from the asset corresponding to the transfer party account, recording the cross-partition synchronization information into a merkle tree in a subarea of the subarea chain corresponding to the transfer party account.
Optionally, the forwarding the transaction request to an accounting node in a sub-block chain partition corresponding to the transfer-in party account includes:
and forwarding the transaction request and the cross-partition synchronization information to a billing node in a sub-block chain partition corresponding to the transferring-in party account number, and adding the asset amount in the asset corresponding to the transferring-in party account number after confirming that the asset amount is deducted from the asset corresponding to the transferring-out party account number by the billing node in the sub-block chain partition corresponding to the transferring-in party account number according to the cross-partition synchronization information.
Optionally, after forwarding the transaction request and the cross-partition synchronization information to an accounting node in a sub-partition chain partition corresponding to the transfer-in party account, the method further includes:
receiving transaction completion receipt information sent by a billing node in a sub-block chain partition corresponding to the transferring-in party account;
and deleting the cross-partition synchronization information from a merkle tree in the sub-partition chain partition corresponding to the transfer-out party account.
Optionally, the method further includes:
and if the sub-block chain partition corresponding to the transfer-in party account number is different from the sub-block chain partition corresponding to the transfer-out party account number, processing the transaction request by an accounting node in the sub-block chain partition corresponding to the transfer-out party account number.
A transaction processing method is applied to a client, and comprises the following steps:
generating a transaction request;
acquiring relevant information of each sub-block chain partition from the main block chain partition;
determining the sub-blockchain subarea corresponding to the transfer-out party account number in the transaction request according to the relevant information of each sub-blockchain subarea;
and sending the transaction request to a sub-block chain subarea corresponding to the transfer-out party account number so that an accounting node in the sub-block chain subarea corresponding to the transfer-out party account number processes the transaction request.
A transaction processing arrangement for use at a billing node within a sub-blockchain partition corresponding to a transferee account number, the arrangement comprising:
a receiving unit, configured to receive a transaction request initiated by a client;
the acquisition unit is used for acquiring a transfer-in party account from the transaction request;
the acquiring unit is further configured to acquire relevant information of each sub-blockchain partition from the main blockchain partition;
a determining unit, configured to determine, according to the relevant information of each sub-block chain partition, a sub-block chain partition corresponding to the transferring-to-party account;
a judging unit, configured to judge whether the sub-block chain partition corresponding to the transferring-in party account is the same as the sub-block chain partition corresponding to the transferring-out party account;
if the sub-blockchain partition corresponding to the transferring-in party account number is different from the sub-blockchain partition corresponding to the transferring-out party account number, the determining unit is further configured to determine a billing node in the sub-blockchain partition corresponding to the transferring-in party account number according to the related information of each sub-blockchain partition;
and the sending unit is used for forwarding the transaction request to the accounting node in the sub-blockchain partition corresponding to the transferring-in party account number after the processing unit processes the transaction request by the accounting node in the sub-blockchain partition corresponding to the transferring-out party account number, so that the transaction request is processed by the accounting node in the sub-blockchain partition corresponding to the transferring-in party account number.
A transaction processing apparatus applied to a client, the apparatus comprising:
a generating unit for generating a transaction request;
the acquiring unit is further configured to acquire relevant information of each sub-blockchain partition from the main blockchain partition;
the determining unit is used for determining the sub-block chain partitions corresponding to the transfer party account in the transaction request according to the relevant information of each sub-block chain partition;
and the sending unit is used for sending the transaction request to a sub-block chain subarea corresponding to the transfer-out party account.
A storage medium having stored thereon a program which, when executed by a processor, implements a transaction processing method as described above.
An electronic device comprising a memory for storing a program and a processor for executing the program, wherein the program when executed performs a transaction processing method as described above.
A blockchain system, the system comprising a main blockchain partition and at least two sub blockchain partitions, wherein the at least two sub blockchain partitions comprise a first sub blockchain partition and a second main blockchain partition,
the accounting node in the first sub-blockchain partition is used for receiving a transaction request initiated by a client; acquiring an account number of a transfer-in party from the transaction request; acquiring relevant information of each sub-block chain partition from the main block chain partition; determining the sub-block chain partition corresponding to the transfer-in party account according to the relevant information of each sub-block chain partition; judging whether the sub-block chain partition corresponding to the transferring party account is the same as the sub-block chain partition corresponding to the transferring party account; if the sub-block chain partition corresponding to the transferring-in party account number is different from the sub-block chain partition corresponding to the transferring-out party account number, determining a billing node in the sub-block chain partition corresponding to the transferring-in party account number according to the related information of each sub-block chain partition; after the transaction request is processed by the accounting node in the sub-blockchain partition corresponding to the transferring-out party account number, the transaction request is forwarded to the accounting node in the second sub-blockchain partition corresponding to the transferring-in party account number;
and the accounting node in the second sub-blockchain partition is used for receiving the transaction request sent by the accounting node in the first sub-blockchain partition and processing the transaction request.
By means of the technical scheme, the transaction processing method, the transaction processing device and the block chain system, provided by the invention, the accounting node in the sub-block chain partition corresponding to the transfer party account receives the transaction request initiated by the client, and the related information of each sub-block chain partition is obtained from the main block chain partition; determining the sub-block chain partition corresponding to the transferred party account according to the relevant information of each sub-block chain partition; if the sub-block chain partition corresponding to the transferring-in party account number is different from the sub-block chain partition corresponding to the transferring-out party account number, determining a billing node in the sub-block chain partition corresponding to the transferring-in party account number according to the related information of each sub-block chain partition; after the transaction request is processed by the accounting node in the sub-blockchain partition corresponding to the transferring-out party account number, the transaction request is forwarded to the accounting node in the sub-blockchain partition corresponding to the transferring-in party account number, so that the transaction request is processed by the accounting node in the sub-blockchain partition corresponding to the transferring-in party account number. The cross-partition transaction is realized on the basis of the block chain partitions, each sub-block chain partition only needs to process the transaction related to the corresponding account, and the transaction related to a plurality of accounts can be processed in parallel by the plurality of sub-block chain partitions, so that the transaction processing efficiency is improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The transaction processing method provided by the invention is suitable for a blockchain system (as shown in fig. 1) comprising a main blockchain partition and at least two sub-blockchain partitions, wherein the main blockchain partition is used for recording relevant information of all the sub-blockchain partitions, the relevant information includes but is not limited to partition information of each sub-blockchain partition and accounting node information in each sub-blockchain partition, and specifically, the partition information of each sub-blockchain partition can include a corresponding relation between a serial number of each sub-blockchain partition and each account number category; the accounting node information in each sub-blockchain partition may include a correspondence between each sub-blockchain partition number and an accounting person public key in each sub-blockchain partition, and a correspondence between each sub-blockchain partition number and an accounting node address in each sub-blockchain partition. The accounting node in each sub-blockchain partition can obtain the relevant information of all sub-blockchain partitions from the main blockchain partition.
In one embodiment, the at least two sub-blockchain partitions include a first sub-blockchain partition and a second main blockchain partition, and an accounting node in the first sub-blockchain partition is configured to receive a transaction request initiated by a client; acquiring an account number of a transfer party from the transaction request; acquiring relevant information of each sub-block chain partition from the main block chain partition; determining the sub-block chain partition corresponding to the transferring party account according to the relevant information of each sub-block chain partition; judging whether the sub-block chain partition corresponding to the transferring party account is the same as the sub-block chain partition corresponding to the transferring party account; if the sub-block chain partition corresponding to the transferring-in party account number is different from the sub-block chain partition corresponding to the transferring-out party account number, determining a billing node in the sub-block chain partition corresponding to the transferring-in party account number according to the related information of each sub-block chain partition; after the transaction request is processed by the accounting node in the sub-blockchain partition corresponding to the transferring-out party account number, the transaction request is forwarded to the accounting node in the second sub-blockchain partition corresponding to the transferring-in party account number; and the accounting node in the second sub-blockchain partition is used for receiving the transaction request sent by the accounting node in the first sub-blockchain partition and processing the transaction request.
It should be noted that the first and second partition chains are not specifically limited to a certain two partition chains, and may be any two partition chains in at least two partition chains.
Referring to fig. 2, fig. 2 is a schematic flow chart illustrating a transaction processing method according to an embodiment of the present invention, the method is applied to a client, and the method includes:
s100: generating a transaction request;
the transaction request may be generated by the client, and a transaction may include a transferring party and a transferring party, which are used to indicate that the transferring party needs to transfer a certain amount of assets to the transferring party, that is, the transaction request includes an account number of the transferring party and an account number of the transferring party of the transaction, and the amount of the transaction assets.
For example, in this embodiment, the client may be a mobile phone or a computer … … electronic device, and the client may be installed with relevant application software (e.g., a wallet APP) to generate a corresponding transaction request;
s110: acquiring relevant information of each sub-block chain partition from the main block chain partition;
the client needs to obtain the relevant information of each sub-blockchain partition from the main blockchain partition.
S120: determining the sub-blockchain subarea corresponding to the transfer party account number in the transaction request according to the relevant information of each sub-blockchain subarea;
after acquiring the relevant information of each sub-block chain partition, the client determines the sub-block chain partition corresponding to the transfer party account according to the relevant information of each sub-block chain partition; in one embodiment, the client determines the account category to which the transfer-out account belongs, and then determines the sequence number of the sub-blockchain partition corresponding to the account category to which the transfer-out account belongs according to the correspondence between the sequence number of each sub-blockchain partition in the related information of each sub-blockchain partition and each account category, thereby determining the sub-blockchain partition corresponding to the transfer-out account.
S130: and sending the transaction request to the sub-block chain subarea corresponding to the transfer party account number so that the transaction request is processed by an accounting node in the sub-block chain subarea corresponding to the transfer party account number.
After the client determines the sub-blockchain partition corresponding to the transfer-out party account number, the transaction request is sent to the sub-blockchain partition corresponding to the transfer-out party account number, and the transaction request sent by the client is received and processed by the accounting node in the sub-blockchain partition corresponding to the transfer-out party account number.
In this embodiment, the client may obtain the relevant information of each sub-blockchain partition from the main-blockchain partition, obtain the sub-blockchain partition corresponding to the transfer party account in the transaction request according to the relevant information, send the transaction request to the sub-blockchain partition corresponding to the transfer party account, and process the transaction request by using the accounting node in the sub-blockchain partition corresponding to the transfer party account. The specific process of processing the transaction request by the accounting node in the sub-blockchain partition corresponding to the transferee account will be described in detail through the following embodiments.
Referring to fig. 3, fig. 3 is a schematic flow chart of a transaction processing method according to an embodiment of the present invention, where the method is applied to an accounting node in a sub-blockchain partition corresponding to a forwarding account, and the method includes:
s200: receiving a transaction request initiated by a client;
the accounting node in the sub-blockchain partition corresponding to the roll-out account number receives a transaction request initiated by a client, in one embodiment, the accounting node in the sub-blockchain partition corresponding to the roll-out account number can directly receive the transaction request sent by the client, in another embodiment, the transaction request initiated by the client can be sent to other nodes except the accounting node in the sub-blockchain partition corresponding to the roll-out account number, and the accounting node in the sub-blockchain partition corresponding to the roll-out account number receives the transaction request from other nodes.
S210: acquiring an account number of a transfer party from the transaction request;
after receiving a transaction request initiated by a client, an accounting node in a sub-block chain partition corresponding to the transferring-out party account needs to acquire the transferring-in party account from the transaction request.
S220: acquiring relevant information of each sub-block chain partition from the main block chain partition;
after the account keeping node in the sub-blockchain partition corresponding to the transfer-out party account obtains the transfer-in party account, the related information of each sub-blockchain partition can be obtained from the main blockchain partition.
S230: determining the sub-block chain partition corresponding to the transferring party account according to the relevant information of each sub-block chain partition;
after the related information of each sub-block chain partition is acquired, the accounting node in the sub-block chain partition corresponding to the roll-out party account determines the sub-block chain partition corresponding to the roll-in party account according to the related information of each sub-block chain partition.
S240: judging whether the sub-block chain partition corresponding to the transferring party account is the same as the sub-block chain partition corresponding to the transferring party account, if so, executing S250 and S260, and if so, executing S270;
in one embodiment, if the serial number of the sub-block chain partition corresponding to the transferring-in party account is the same as the serial number of the sub-block chain partition corresponding to the transferring-out party account, it is determined that the sub-block chain partition corresponding to the transferring-in party account is the same as the sub-block chain partition corresponding to the transferring-out party account, and if the serial number of the sub-block chain partition corresponding to the transferring-in party account is different from the serial number of the sub-block chain partition corresponding to the transferring-out party account, it is determined that the sub-block chain partition corresponding to the transferring-in party account is different from the sub-block chain partition corresponding to the transferring-out party account.
S250: determining a billing node in the sub-block chain partition corresponding to the transferred party account according to the relevant information of each sub-block chain partition;
in an embodiment, the accounting node in the sub-blockchain partition corresponding to the transfer-in party account may be determined according to a correspondence between the sequence number of each sub-blockchain partition in the related information of each sub-blockchain partition and the accounting node address in each sub-blockchain partition.
S260: and after the transaction request is processed by the accounting node in the sub-blockchain partition corresponding to the transferring-out party account number, the transaction request is forwarded to the accounting node in the sub-blockchain partition corresponding to the transferring-in party account number, and the transaction request is processed by the accounting node in the sub-blockchain partition corresponding to the transferring-in party account number.
S270: and processing the transaction request by an accounting node in a sub-block chain partition corresponding to the transfer party account.
According to the transaction processing method disclosed by the embodiment, cross-partition transaction is realized on the basis of the blockchain partitions, each blockchain partition only needs to process the transaction related to the corresponding account number, and the plurality of blockchain partitions can process the transactions related to the plurality of account numbers in parallel, so that the transaction processing efficiency is improved.
After the transaction is completed, broadcasting transaction information in the partition by the blockchain partition corresponding to the transfer-out party account and the blockchain partition corresponding to the transfer-in party account so as to record the transaction information on the blockchain stored on each node in the partition; moreover, only the transaction information related to each node is stored on the blockchain stored on each node in different partitions, and the transaction information of all the nodes is not stored, so that the size of blockchain data stored by the nodes is reduced.
For example, the processing of the transaction request by the accounting node in the sub-blockchain partition corresponding to the transferee account number may include:
determining the asset amount corresponding to the transaction request;
deducting the amount of the assets from the assets corresponding to the transfer party account;
and after deducting the asset amount from the asset corresponding to the transfer party account, recording the cross-partition synchronization information into a merkle tree in the sub-block chain partition corresponding to the transfer party account.
Then, the forwarding the transaction request to the accounting node in the sub-block chain partition corresponding to the transfer-in party account includes: and forwarding the transaction request and the cross-partition synchronization information to a billing node in a sub-block chain partition corresponding to the transferring-in party account number, and adding the asset amount to the asset corresponding to the transferring-in party account number after confirming that the asset amount is deducted from the asset corresponding to the transferring-out party account number by the billing node in the sub-block chain partition corresponding to the transferring-in party account number according to the cross-partition synchronization information.
After forwarding the transaction request and the cross-partition synchronization information to an accounting node in a sub-partition chain partition corresponding to the transfer-in party account, the method further includes: receiving transaction completion receipt information sent by a billing node in a sub-block chain partition corresponding to the transferring party account; and deleting the cross-partition synchronization information from the merkle tree in the sub-partition chain partition corresponding to the transfer party account.
In the embodiment, the trans-partition synchronization information can verify the transaction processing authenticity of the transfer-in party account number and the transfer-out party account number, and the transaction processing accuracy can be ensured.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a transaction processing device according to an embodiment of the present invention, the transaction processing device is applied to a client, and the transaction processing device includes:
a generating unit 10 for generating a transaction request;
the obtaining unit 11 is further configured to obtain relevant information of each sub-blockchain partition from the main blockchain partition;
a determining unit 12, configured to determine, according to the relevant information of each sub-block chain partition, a sub-block chain partition corresponding to the transfer party account in the transaction request;
and the sending unit 13 is configured to send the transaction request to a sub-block chain partition corresponding to the transfer-out party account.
The transaction processing device comprises a processor and a memory, wherein the generating unit, the acquiring unit, the determining unit, the transmitting unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the transaction processing efficiency is improved by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium having a program stored thereon, which when executed by a processor implements the above-described transaction processing method.
The embodiment of the invention provides a processor, which is used for running a program, wherein the transaction processing method is executed when the program runs.
The embodiment of the invention provides electronic equipment, which comprises a processor, a memory and a program which is stored on the memory and can be operated on the processor, wherein the processor executes the program and realizes the following steps:
generating a transaction request;
acquiring relevant information of each sub-block chain partition from the main block chain partition;
determining the sub-blockchain subarea corresponding to the transfer party account number in the transaction request according to the relevant information of each sub-blockchain subarea;
and sending the transaction request to a sub-block chain subarea corresponding to the transfer-out party account number.
The electronic device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
generating a transaction request;
acquiring relevant information of each sub-block chain partition from the main block chain partition;
determining the sub-blockchain subarea corresponding to the transfer party account number in the transaction request according to the relevant information of each sub-blockchain subarea;
and sending the transaction request to a sub-block chain subarea corresponding to the transfer-out party account number.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a transaction processing apparatus according to an embodiment of the present invention, where the apparatus is applied to a billing node in a sub-blockchain partition corresponding to a forwarding account number, and the apparatus includes:
a receiving unit 20, configured to receive a transaction request initiated by a client;
an obtaining unit 21, configured to obtain a transfer-in party account from the transaction request;
the obtaining unit 21 is further configured to obtain relevant information of each sub-blockchain partition from the main blockchain partition;
a determining unit 22, configured to determine, according to the relevant information of each sub-block chain partition, a sub-block chain partition corresponding to the transferring party account;
a determining unit 23, configured to determine whether the sub-block chain partition corresponding to the transferring-in party account is the same as the sub-block chain partition corresponding to the transferring-out party account;
if the sub-blockchain partition corresponding to the transferring-in party account is different from the sub-blockchain partition corresponding to the transferring-out party account, the determining unit 22 is further configured to determine a billing node in the sub-blockchain partition corresponding to the transferring-in party account according to the related information of each sub-blockchain partition;
and a sending unit 24, configured to, after the processing unit 25 processes the transaction request by using the accounting node in the sub-blockchain partition corresponding to the transferring-out party account, forward the transaction request to the accounting node in the sub-blockchain partition corresponding to the transferring-in party account, and process the transaction request by using the accounting node in the sub-blockchain partition corresponding to the transferring-in party account.
Optionally, the processing unit is specifically configured to:
determining the asset amount corresponding to the transaction request;
deducting the amount of the assets from the assets corresponding to the transfer party account;
and after deducting the asset amount from the asset corresponding to the transfer party account, recording the cross-partition synchronization information into a merkle tree in the sub-block chain partition corresponding to the transfer party account.
Optionally, the sending unit is specifically configured to:
and forwarding the transaction request and the cross-partition synchronization information to a billing node in a sub-block chain partition corresponding to the transferring-in party account number, and adding the asset amount to the asset corresponding to the transferring-in party account number after confirming that the asset amount is deducted from the asset corresponding to the transferring-out party account number by the billing node in the sub-block chain partition corresponding to the transferring-in party account number according to the cross-partition synchronization information.
Optionally, the receiving unit is further configured to receive transaction completion receipt information sent by the accounting node in the sub-blockchain partition corresponding to the transfer-in party account number after forwarding the transaction request and the cross-partition synchronization information to the accounting node in the sub-blockchain partition corresponding to the transfer-in party account number;
the processing unit is further configured to delete the inter-partition synchronization information from a merkletree in a sub-partition chain partition corresponding to the transfer-out party account.
Optionally, the processing unit is further configured to, if the sub-blockchain partition corresponding to the transferring-in party account number is different from the sub-blockchain partition corresponding to the transferring-out party account number, process the transaction request by an accounting node in the sub-blockchain partition corresponding to the transferring-out party account number.
The transaction processing device comprises a processor and a memory, wherein the receiving unit, the acquiring unit, the determining unit, the judging unit, the processing unit, the transmitting unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the transaction processing efficiency is improved by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium having a program stored thereon, which when executed by a processor implements the above-described transaction processing method.
The embodiment of the invention provides a processor, which is used for running a program, wherein the transaction processing method is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
receiving a transaction request initiated by a client;
acquiring an account number of a transfer party from the transaction request;
acquiring relevant information of each sub-block chain partition from the main block chain partition;
determining the sub-block chain partition corresponding to the transferring party account according to the relevant information of each sub-block chain partition;
judging whether the sub-block chain partition corresponding to the transferring party account is the same as the sub-block chain partition corresponding to the transferring party account;
if the sub-block chain partition corresponding to the transferring-in party account number is different from the sub-block chain partition corresponding to the transferring-out party account number, determining a billing node in the sub-block chain partition corresponding to the transferring-in party account number according to the related information of each sub-block chain partition;
and after the transaction request is processed by the accounting node in the sub-blockchain partition corresponding to the transferring-out party account number, the transaction request is forwarded to the accounting node in the sub-blockchain partition corresponding to the transferring-in party account number, and the transaction request is processed by the accounting node in the sub-blockchain partition corresponding to the transferring-in party account number.
Optionally, the processing of the transaction request by the accounting node in the sub-block chain partition corresponding to the transfer-out party account includes:
determining the asset amount corresponding to the transaction request;
deducting the amount of the assets from the assets corresponding to the transfer party account;
and after deducting the asset amount from the asset corresponding to the transfer party account, recording the cross-partition synchronization information into a merkle tree in the sub-block chain partition corresponding to the transfer party account.
Optionally, the forwarding the transaction request to the accounting node in the sub-block chain partition corresponding to the transfer-in party account includes:
and forwarding the transaction request and the cross-partition synchronization information to a billing node in a sub-block chain partition corresponding to the transferring-in party account number, and adding the asset amount to the asset corresponding to the transferring-in party account number after confirming that the asset amount is deducted from the asset corresponding to the transferring-out party account number by the billing node in the sub-block chain partition corresponding to the transferring-in party account number according to the cross-partition synchronization information.
Optionally, after forwarding the transaction request and the cross-partition synchronization information to an accounting node in a sub-partition chain partition corresponding to the transfer-in party account, the method further includes:
receiving transaction completion receipt information sent by a billing node in a sub-block chain partition corresponding to the transferring party account;
and deleting the cross-partition synchronization information from the merkle tree in the sub-partition chain partition corresponding to the transfer party account.
Optionally, the method further includes:
and if the sub-block chain partition corresponding to the transfer-in party account number is different from the sub-block chain partition corresponding to the transfer-out party account number, processing the transaction request by an accounting node in the sub-block chain partition corresponding to the transfer-out party account number.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
receiving a transaction request initiated by a client;
acquiring an account number of a transfer party from the transaction request;
acquiring relevant information of each sub-block chain partition from the main block chain partition;
determining the sub-block chain partition corresponding to the transferring party account according to the relevant information of each sub-block chain partition;
judging whether the sub-block chain partition corresponding to the transferring party account is the same as the sub-block chain partition corresponding to the transferring party account;
if the sub-block chain partition corresponding to the transferring-in party account number is different from the sub-block chain partition corresponding to the transferring-out party account number, determining a billing node in the sub-block chain partition corresponding to the transferring-in party account number according to the related information of each sub-block chain partition;
and after the transaction request is processed by the accounting node in the sub-blockchain partition corresponding to the transferring-out party account number, the transaction request is forwarded to the accounting node in the sub-blockchain partition corresponding to the transferring-in party account number, and the transaction request is processed by the accounting node in the sub-blockchain partition corresponding to the transferring-in party account number.
Optionally, the processing of the transaction request by the accounting node in the sub-block chain partition corresponding to the transfer-out party account includes:
determining the asset amount corresponding to the transaction request;
deducting the amount of the assets from the assets corresponding to the transfer party account;
and after deducting the asset amount from the asset corresponding to the transfer party account, recording the cross-partition synchronization information into a merkle tree in the sub-block chain partition corresponding to the transfer party account.
Optionally, the forwarding the transaction request to the accounting node in the sub-block chain partition corresponding to the transfer-in party account includes:
and forwarding the transaction request and the cross-partition synchronization information to a billing node in a sub-block chain partition corresponding to the transferring-in party account number, and adding the asset amount to the asset corresponding to the transferring-in party account number after confirming that the asset amount is deducted from the asset corresponding to the transferring-out party account number by the billing node in the sub-block chain partition corresponding to the transferring-in party account number according to the cross-partition synchronization information.
Optionally, after forwarding the transaction request and the cross-partition synchronization information to an accounting node in a sub-partition chain partition corresponding to the transfer-in party account, the method further includes:
receiving transaction completion receipt information sent by a billing node in a sub-block chain partition corresponding to the transferring party account;
and deleting the cross-partition synchronization information from the merkle tree in the sub-partition chain partition corresponding to the transfer party account.
Optionally, the method further includes:
and if the sub-block chain partition corresponding to the transfer-in party account number is different from the sub-block chain partition corresponding to the transfer-out party account number, processing the transaction request by an accounting node in the sub-block chain partition corresponding to the transfer-out party account number.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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 present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. 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). The 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 identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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 above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.