Transaction processing method of block chain network and block construction node

By setting up block construction nodes in the blockchain network, receiving and sorting transaction lists, simulated execution and eliminate mismatched transaction lists, the transaction sequence and atomicity problems in the blockchain network are solved, and transaction processing efficiency and data consistency are improved.

CN120034543APending Publication Date: 2025-05-23HANGZHOU HIGH-TECH ZONE (BINJIANG) INSTITUTE OF BLOCKCHAIN & DATA SECURITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411950316.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

Nodes in the blockchain network cannot execute multiple transactions in the specified order, or cannot guarantee the atomicity of multiple transactions on the chain, resulting in reduced transaction processing efficiency.

Method used

Set up a block construction node in the blockchain network, receive transaction lists and transaction failure strategies sent by multiple clients, sort and simulate execution of each transaction list, eliminate mismatched transaction lists, form a new transaction sequence, and send it to the verification node for checksum to produce blocks.

Benefits of technology

Through sorting and simulation execution, the block construction node can ensure the atomicity of multiple transactions on the chain, improve the transaction processing efficiency of the blockchain network, and improve data consistency and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120034543A_ABST
    Figure CN120034543A_ABST
Patent Text Reader

Abstract

The invention relates to a transaction processing method of a block chain network and a block construction node. The method comprises the following steps: executing the following processing through the block construction node: respectively receiving transaction lists sent by a plurality of clients and transaction failure strategies corresponding to the transaction lists; acquiring cost information corresponding to the transaction lists, and sorting the transaction lists according to a sequence of the cost information from high to low to obtain a first transaction sequence; performing simulation execution on the transaction lists in the first transaction sequence in sequence from high to low to obtain simulation execution results corresponding to the transaction lists; removing the transaction list of which the simulation execution result is not matched with the transaction failure strategy from the first transaction sequence to obtain a second transaction sequence; and sending the second transaction sequence to a verification node in the block chain network. Through the method and the device, the transaction lists sent by a plurality of clients can be sorted, the atomicity of a plurality of transaction chains is ensured, and the transaction processing efficiency of a block chain network is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of blockchain technology, and in particular, relates to a transaction processing method and a block construction node of a blockchain network. Background Art

[0002] Blockchain is an encrypted, chained transaction storage structure formed by blocks, which is based on the consensus algorithm between nodes to achieve block generation and linking. Among them, the nodes of the blockchain network sort the transactions in order to generate new blocks and realize the continuous growth of the blockchain.

[0003] However, in some application scenarios, multiple transactions need to be executed in a specified order, or the atomicity of multiple transactions on the chain needs to be guaranteed; and the nodes in the blockchain network cannot meet the above requirements, which will reduce the transaction processing efficiency of the blockchain network. Summary of the invention

[0004] The embodiments of the present application provide a transaction processing method, a block building node, a terminal device and a computer program product of a blockchain network, which can enable the block building node to sort the transaction lists sent by multiple clients, ensure the atomicity of multiple transactions on the chain, and thus improve the transaction processing efficiency of the blockchain network.

[0005] In a first aspect, an embodiment of the present application provides a transaction processing method for a blockchain network, comprising: performing the following processing through a block construction node of the blockchain network: respectively receiving transaction lists sent by multiple clients and a transaction failure strategy corresponding to each of the transaction lists; obtaining fee information corresponding to each of the transaction lists, and sorting each of the transaction lists in order from high to low according to the fee information to obtain a first transaction sequence; simulating and executing the transaction lists in the first transaction sequence in order from high to low to obtain simulation execution results corresponding to each of the transaction lists; removing the transaction lists whose simulation execution results do not match the transaction failure strategy from the first transaction sequence to obtain a second transaction sequence; and sending the second transaction sequence to a verification node in the blockchain network.

[0006] In some embodiments, the transaction list whose simulation execution result does not match the transaction failure policy is removed from the first transaction sequence to obtain the second transaction sequence, including: obtaining the status information of the blockchain network, and simulating the execution of the transaction list in the first transaction sequence based on the status information; if the simulation execution result of the transaction list matches the transaction failure policy, simulating the update of the status information based on the simulation execution result; and simulating the execution of the next transaction list in the first transaction sequence based on the status information after the simulation update; or if the simulation execution result of the transaction list does not match the transaction failure policy, removing the transaction list from the first transaction sequence; and simulating the execution of the next transaction list in the first transaction sequence based on the status information of the blockchain network; after all the transaction lists in the first transaction sequence have completed the simulation execution, the second transaction sequence is obtained.

[0007] In some embodiments, the transaction list includes at least one transaction request, and the transaction failure policy corresponding to the transaction list is used to indicate whether each transaction request in the transaction list allows transaction failure; based on the status information, simulating the execution of the transaction list in the first transaction sequence includes: based on the status information, simulating the execution of each transaction request in the transaction list in sequence according to a preset order, wherein the preset order is specified by the client when sending the transaction list; if the simulated execution results of all the transaction requests in the transaction list match the transaction failure policy, then it is determined that the simulated execution result of the transaction list matches the transaction failure policy; if there is at least one transaction request in the transaction list whose simulated execution result does not match the transaction failure policy, then it is determined that the simulated execution result of the transaction list does not match the transaction failure policy.

[0008] In some embodiments, fee information corresponding to each of the transaction lists is obtained, and each of the transaction lists is sorted in order from high to low according to the fee information to obtain a first transaction sequence, including: based on the status information of the blockchain network, each of the transaction requests in the transaction list is simulated and executed in sequence according to the preset order; if the simulated execution results of all the transaction requests in the transaction list match the transaction failure strategy, the transaction list is added to a third transaction sequence; if the number of the transaction lists in the third transaction sequence is greater than or equal to a preset threshold, based on the simulated execution results of each of the transaction lists in the third transaction sequence, the fee information corresponding to each of the transaction lists is determined; and each of the transaction lists in the third transaction sequence is sorted in order from high to low according to the fee information to obtain the first transaction sequence.

[0009] In some embodiments, sending the second transaction sequence to the verification node in the blockchain network includes: determining the total value of the second transaction sequence based on the simulated execution results of each of the transaction lists in the second transaction sequence; calculating the hash value of the second transaction sequence, and encrypting the hash value, the total value and the preset handling fee amount and sending them to the verification node; and sending the second transaction sequence to the verification node in response to a receipt notification sent by the verification node.

[0010] In some embodiments, after sending the second transaction sequence to the verification node in response to a receipt notification sent by the verification node, the method further includes: after the verification node completes block generation and chain upload based on the second transaction sequence, receiving a handling fee paid by the verification node based on the handling fee amount.

[0011] In some embodiments, the verification node is connected to multiple block building nodes; the verification node is used to receive the second transaction sequences sent by multiple block building nodes, and send the reception notification to the block building node corresponding to the second transaction sequence with the largest difference between the total value and the handling fee amount in each of the second transaction sequences.

[0012] In the second aspect, an embodiment of the present application provides a block construction node, including: a receiving module, used to respectively receive transaction lists sent by multiple clients, and a transaction failure strategy corresponding to each of the transaction lists; a sorting module, used to obtain the fee information corresponding to each of the transaction lists, and sort each of the transaction lists in order from high to low according to the fee information, to obtain a first transaction sequence; a simulation execution module, used to simulate and execute the transaction lists in the first transaction sequence in order from high to low, to obtain simulation execution results corresponding to each of the transaction lists; a removal module, used to remove the transaction lists whose simulation execution results do not match the transaction failure strategy from the first transaction sequence, to obtain a second transaction sequence; a sending module, used to send the second transaction sequence to the verification node in the blockchain network.

[0013] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the transaction processing method of the blockchain network of any one of the first aspects described above is implemented.

[0014] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is run, the transaction processing method of the blockchain network described in any one of the first aspects above is executed.

[0015] Compared with the related art, the transaction processing method, block construction node, terminal device and computer program product of the blockchain network provided by the embodiment of the present application, by setting a block construction node in the blockchain network, receiving the transaction lists and transaction failure strategies sent by multiple clients, sorting each transaction list, and obtaining a first transaction sequence; and simulating and executing each transaction list in the first transaction sequence, eliminating the transaction list whose simulation execution results do not conform to the transaction failure strategy, and obtaining a second transaction sequence; finally, sending the second transaction sequence to the verification node in the blockchain network, so that the verification node verifies and blocks the second transaction sequence. In this way, the block construction node can sort the transaction lists sent by multiple clients, ensure the atomicity of multiple transactions in the transaction list on the chain, improve the validity of the transactions received by the blockchain network, and thus improve the transaction processing efficiency of the blockchain network.

[0016] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0018] Figure 1 This is a schematic diagram of the application architecture of a blockchain network according to an embodiment of the present application;

[0019] Figure 2 It is a flow chart of a transaction processing method of a blockchain network according to an embodiment of the present application;

[0020] Figure 3 is a flow chart of a transaction processing method of a blockchain network according to another embodiment of the present application;

[0021] Figure 4 is a schematic diagram of the structure of a block construction node according to an embodiment of the present application;

[0022] Figure 5 It is a structural diagram of a terminal device according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0024] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0025] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0026] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0027] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0028] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0029] Blockchain is an encrypted, chained transaction storage structure formed by blocks, which is generated and linked based on the consensus algorithm between nodes. The nodes of the blockchain network sort the transactions in order to generate new blocks and realize the continuous growth of the blockchain. For example, after receiving the transaction submitted by the user, the consensus node in the blockchain network can group a series of transactions into blocks according to the algorithm in the protocol (for example, in descending order of transaction service fee (gasprice) or in order of transaction reception time).

[0030] However, in some application scenarios, multiple transactions need to be executed in a specified order, or the atomicity of multiple transactions on the chain needs to be guaranteed; and the nodes in the blockchain network cannot meet the above requirements, which will reduce the transaction processing efficiency of the blockchain network; or, some blockchain networks (for example, Ethereum) will entrust a third party to act as a validator to produce blocks, but this method completely gives the right to produce blocks to the third party, which is not conducive to the decentralization of the blockchain and will reduce the security of the blockchain network.

[0031] In view of this, the embodiment of the present application provides a transaction processing method, block construction node, terminal device and computer program product of a blockchain network, by setting a block construction node in the blockchain network, receiving transaction lists and transaction failure strategies sent by multiple clients, sorting each transaction list, and obtaining a first transaction sequence; and simulating and executing each transaction list in the first transaction sequence, eliminating the transaction list whose simulation execution results do not conform to the transaction failure strategy, and obtaining a second transaction sequence; finally, sending the second transaction sequence to the verification node in the blockchain network, so that the verification node verifies and blocks the second transaction sequence. In this way, the block construction node can sort the transaction lists sent by multiple clients, ensure the atomicity of multiple transactions in the transaction list on the chain, improve the validity of the transactions received by the blockchain network, and thus improve the transaction processing efficiency of the blockchain network.

[0032] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are described. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0033] 1) Transaction, also known as transaction request, is equivalent to the computer term transaction. Transaction includes the operations that need to be submitted to the blockchain network for execution, as well as the corresponding transaction information. It does not refer only to transactions in the business context. Given that the term "transaction" is used conventionally in blockchain technology, the embodiments of this application follow this convention.

[0034] 2) Blockchain is an encrypted, chained transaction storage structure formed by blocks. The header of each block can include the hash value of all transactions in the block, as well as the hash value of all transactions in the previous block, thereby realizing tamper-proof and anti-forgery of transactions in the block based on the hash value; the newly generated transaction is filled into the block and after the consensus of the nodes in the blockchain network, it will be appended to the end of the blockchain to form a chain growth.

[0035] 3) Blockchain Network: A collection of nodes that incorporate new blocks into the blockchain through consensus.

[0036] The following describes an exemplary application architecture of the blockchain network provided by the embodiment of the present application, see Figure 1 , Figure 1It is a schematic diagram of the application architecture of a blockchain network according to an embodiment of the present application, including multiple clients 100 and a blockchain network 110. The blockchain network 110 includes multiple block building nodes 111 and verification nodes 112, each block building node 111 can establish a connection with multiple clients 100 through a wired network or a wireless network, and the verification node 112 can establish a connection with multiple block building nodes 111 through a wired network or a wireless network.

[0037] The types of blockchain network 110 are flexible and diverse, for example, it can be any one of a public chain, a private chain or a consortium chain. Taking the public chain as an example, the client 100 running in the terminal or server of any business entity can access the blockchain network 110 without authorization and become a special type of node, namely a client node.

[0038] The operation of the client node on the blockchain network 110 mainly includes submitting a transaction to the block construction node 111. The client node may send a transaction list and a transaction failure strategy corresponding to the transaction list to the block construction node 111. The transaction list may include at least one transaction request, and the transaction failure strategy corresponding to the transaction list is used to indicate whether each transaction request in the transaction list is allowed to fail.

[0039] As an example, transaction list X may include transaction request A and transaction request B, and the transaction failure policy corresponding to transaction list X is used to indicate whether transaction request A and transaction request B are allowed to fail. For example, the transaction failure policy may be in the form of allowing transaction request A to fail but not allowing transaction request B to fail, or allowing transaction request B to fail but not allowing transaction request A to fail, or allowing at most one of transaction request A and transaction request B to fail, or not allowing either transaction request A or transaction request B to fail.

[0040] In addition, the transaction list may also sort the transaction requests contained therein according to a preset order specified by the client 100. For example, for a transaction list X, the client 100 may specify a preset order that transaction request A is executed before transaction request B, and then the transaction list X may be represented as {A, B}.

[0041] After receiving the transaction list and transaction failure strategy sent by the client 100 , the block construction node 111 may simulate and execute each transaction request in the transaction list in sequence according to a preset order.

[0042] In addition, the block construction node 111 is also used to respectively receive transaction lists sent by multiple clients 100 and transaction failure strategies corresponding to each transaction list; obtain fee information corresponding to each transaction list, and sort each transaction list in order from high to low according to the fee information to obtain a first transaction sequence; simulate and execute the transaction lists in the first transaction sequence in order from high to low to obtain simulation execution results corresponding to each transaction list; remove the transaction lists whose simulation execution results do not match the transaction failure strategy from the first transaction sequence to obtain a second transaction sequence; and send the second transaction sequence to the verification node 112 in the blockchain network 110.

[0043] After verifying the second transaction sequence, the verification node 112 can complete the block generation and chain-linking based on the second transaction sequence, and can also append other transactions processed by the verification node 112 itself to the second transaction sequence to complete the block generation and chain-linking. After completing the block generation and chain-linking, the verification node 112 pays the handling fee to the block construction node 111.

[0044] The client 100 can be installed in the terminal device in the form of a software application. In some embodiments, the terminal device can be a mobile phone, tablet computer, desktop, laptop, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) and virtual reality (VR) devices that can install and use content community applications. This application does not limit the specific implementation of the terminal device. It can interact with the user through one or more methods such as keyboard, touchpad, touch screen, remote control, voice interaction or handwriting device.

[0045] In specific implementation, both the block construction node 111 and the verification node 112 can adopt Figure 5 The composition results shown or include Figure 5 Parts shown. Figure 5 It is a structural diagram of a terminal device according to an embodiment of the present application. When the terminal device 5 has the function of the block building node 111 described in the embodiment of the present application, the terminal device 5 can be the block building node 111 or the chip or system on chip in the block building node 111; when the terminal device 5 has the function of the verification node 112 described in the embodiment of the present application, the terminal device 5 can be the verification node 112 or the chip or system on chip in the verification node 112.

[0046] In some embodiments, the block construction node 111 provided in the embodiments of the present application can be implemented in a software manner. For example, it can be installed on Figure 5 In the memory 51 of the terminal device 5 shown, the block construction node 111 can be software in the form of programs and plug-ins, including: a receiving module 40, a sorting module 41, a simulation execution module 42, a removal module 43 and a sending module 44. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented.

[0047] The functions of each module will be described below.

[0048] The transaction processing method of the blockchain network provided in the embodiment of the present application will be explained in combination with the exemplary application architecture of the blockchain network provided in the embodiment of the present application.

[0049] The following will be combined Figure 2 For an explanation of the transaction processing method of the blockchain network provided by an embodiment of the present application, please refer to Figure 2 , Figure 2 is a flow chart of a transaction processing method of a blockchain network according to an embodiment of the present application, such as Figure 2 As shown, the method performs the following processing by the block construction node 111 of the blockchain network 110:

[0050] Step S201 : receiving transaction lists sent by multiple clients 100 and a transaction failure strategy corresponding to each transaction list.

[0051] In this embodiment, a block construction node 111 can establish connections with multiple clients 100 and receive transactions submitted by multiple clients 100. The transaction list includes at least one transaction request, and the transaction failure policy corresponding to the transaction list is used to indicate whether each transaction request in the transaction list allows transaction failure.

[0052] In a specific implementation, the user can use the client 100 to send the transaction list and the transaction failure strategy to the block construction node 111 through the sendBundle interface.

[0053] Step S202, obtaining the fee information corresponding to each transaction list, and sorting each transaction list in descending order of the fee information to obtain a first transaction sequence.

[0054] In this embodiment, the fee information may refer to the total transaction amount generated when the transaction list is executed, or may refer to the average transaction amount for each transaction request generated when the transaction list is executed. Both forms of fee information may be obtained by simulating the execution of the transaction list.

[0055] Specifically, obtaining the fee information corresponding to each transaction list, and sorting the transaction lists in descending order of the fee information to obtain the first transaction sequence may include the following steps:

[0056] Step 1: Based on the status information of the blockchain network 110, simulate and execute each transaction request in the transaction list in sequence according to a preset order.

[0057] In this embodiment, the preset order can be specified by the client 100 when sending the transaction list. For example, for the transaction list X, the client 100 can specify the preset order that the transaction request A is executed before the transaction request B, then the transaction list X can be expressed as {A, B}; after receiving the transaction list X, the block construction node 111 can simulate the execution of the transaction request A first, and then simulate the execution of the transaction request B, so as to meet the user's requirement to specify the transaction order.

[0058] In addition, in actual application scenarios, there may be such a situation: when all transaction requests in the transaction list are successfully executed, the transaction list can be packaged out of the block; if any transaction request in the transaction list fails to execute, the transaction list will be rejected as a whole. Through the atomicity guarantee mechanism, each transaction request in the transaction list can either succeed or fail.

[0059] Then, the client 100 can determine the transaction failure strategy based on the transaction list submitted by itself. For example, if the transaction list submitted by the client 100 requires atomicity, then the transaction failure strategy can be set to not allow any transaction request in the transaction list to fail to execute; or, if the transaction list submitted by the client 100 does not require atomicity, then the transaction failure strategy can be set to allow a preset number of transaction requests in the transaction list to fail to execute.

[0060] In this way, the atomicity of multiple transactions in the transaction list can be guaranteed, the data consistency and reliability in the blockchain network 110 can be improved, the decentralized transaction security and transparency can be ensured, and the overall transaction processing efficiency of the blockchain network 110 can be improved.

[0061] Step 2: When the simulated execution results of all transaction requests in the transaction list match the transaction failure strategy, the transaction list is added to the third transaction sequence.

[0062] In this embodiment, since the status information of the blockchain network 110 may change at any time, the transaction submitted by the client 100 may not be successfully executed. Therefore, the block construction node 111 needs to combine the transaction failure strategy to determine whether to add the transaction list to the third transaction sequence.

[0063] As an example, for transaction list X, the transaction failure policy may be set to allow at most one of transaction request A and transaction request B to fail. The block construction node 111 may simulate the execution of the transaction list based on a preset order - transaction request A is executed before transaction request B. If the simulated execution result of transaction request A is a successful execution and the simulated execution result of transaction request B is a transaction failure, then the transaction list X may be added to the third transaction sequence; if the simulated execution results of transaction request A and transaction request B are both transaction failures, then the transaction list X needs to be discarded, and a failure message is returned to the client 100 that sent the transaction list X.

[0064] It should be noted that the specific forms of the above transaction list and transaction failure strategy can be set by the user of each client 100, and this application does not impose any restrictions on this.

[0065] In this way, the effectiveness of transactions that subsequently enter the transaction stage can be improved, thereby improving the transaction processing efficiency of the blockchain network 110.

[0066] Step 3: when the number of transaction lists in the third transaction sequence is greater than or equal to a preset threshold, determine the fee information corresponding to each transaction list based on the simulation execution results of each transaction list in the third transaction sequence.

[0067] Step 4: sort the transaction lists in the third transaction sequence in descending order of fee information to obtain the first transaction sequence.

[0068] In this embodiment, as different clients 100 submit their own transaction lists and complete the simulated execution, the number of transaction lists in the third transaction sequence will gradually increase. When the number of transaction lists reaches a preset threshold (the preset threshold can be set by yourself, and this application does not impose any restrictions on this), the block construction node 111 can merge the transaction lists in the third transaction sequence to generate a second transaction sequence.

[0069] Specifically, the block construction node 111 may determine the total transaction amount generated when the transaction list in the third transaction sequence is simulated and executed, or determine the average transaction amount for each transaction request generated when the transaction list in the third transaction sequence is simulated and executed based on the simulated execution results of each transaction list in the third transaction sequence. The block construction node 111 may use the total transaction amount or the average transaction amount as the fee information corresponding to the transaction list, and sort the transaction lists in the third transaction sequence according to the fee information to obtain the first transaction sequence.

[0070] As an example, taking the third transaction sequence including transaction list X and transaction list Y (including transaction request C, transaction request D and transaction request E) as an example, when the block construction node 111 simulates the execution of transaction list X, transaction request A is successfully executed, and the transaction amount generated is 50; transaction request B is successfully executed, and the transaction amount generated is 100; when the block construction node 111 simulates the execution of transaction list Y, only transaction request C is successfully executed, and the transaction amount generated is 210, and transaction request D and transaction request E both fail to execute (assuming that the transaction failure policy corresponding to transaction list Y is to allow at most two of transaction request C, transaction request D and transaction request E to fail). Then, when the total transaction amount is used as the fee information, since the total transaction amount of transaction list X, 150, is less than the total transaction amount of transaction list Y, 210, transaction list X can be set after transaction list Y, and the first transaction sequence can be expressed as {Y, X}; when the average transaction amount is used as the fee information, since the average transaction amount of transaction list X, 75, is greater than the average transaction amount of transaction list Y, 70, transaction list X can be set before transaction list Y, and the first transaction sequence can be expressed as {X, Y}.

[0071] Step S203 , simulate and execute the transaction lists in the first transaction sequence in descending order, and obtain simulation execution results corresponding to each transaction list.

[0072] Step S204: remove the transaction list whose simulation execution results do not match the transaction failure strategy from the first transaction sequence to obtain a second transaction sequence.

[0073] In this embodiment, since there is a situation in the blockchain network 110 where one transaction request interferes with another transaction request, for example, the successful execution of transaction request A will cause the failure of transaction request C. The block construction node 111 can simulate and execute the transaction lists in the first transaction sequence in order from high to low, ensuring that the transaction lists with higher fee information are simulated and executed first, preventing the transaction lists with lower fee information (for example, robot transactions, junk transactions) from interfering with the transaction lists with higher fee information, thereby improving the overall transaction processing efficiency of the blockchain network 110.

[0074] Specifically, removing the transaction list whose simulation execution results do not match the transaction failure strategy from the first transaction sequence to obtain the second transaction sequence may include the following steps:

[0075] Step 1: Obtain status information of the blockchain network 110, and based on the status information, simulate the execution of the transaction list in the first transaction sequence.

[0076] In this embodiment, simulating the execution of the transaction list in the first transaction sequence based on the status information may include: based on the status information, simulating the execution of each transaction request in the transaction list in sequence according to a preset order, wherein the preset order is specified when the client 100 sends the transaction list; if the simulated execution results of all transaction requests in the transaction list match the transaction failure policy, then determining that the simulated execution result of the transaction list matches the transaction failure policy; if there is at least one transaction request in the transaction list whose simulated execution result does not match the transaction failure policy, then determining that the simulated execution result of the transaction list does not match the transaction failure policy.

[0077] Step 2: If the simulation execution result of the transaction list matches the transaction failure strategy, the state information is simulated and updated based on the simulation execution result; and based on the state information after the simulation update, the next transaction list in the first transaction sequence is simulated and executed; or if the simulation execution result of the transaction list does not match the transaction failure strategy, the transaction list is removed from the first transaction sequence; and based on the state information of the blockchain network 110, the next transaction list in the first transaction sequence is simulated and executed.

[0078] Step 3: After all transaction lists in the first transaction sequence have completed simulation execution, a second transaction sequence is obtained.

[0079] As an example, taking the first transaction sequence represented as {X, Y, Z} as an example, the block construction node 111 simulates and executes the transaction list X first in descending order based on the state information of the blockchain (also referred to as the first state information). When the block construction node 111 simulates and executes the transaction list X, it simulates and executes the transaction request A first, and then simulates and executes the transaction request B in accordance with the preset order - transaction request A is executed before transaction request B. Assuming that the simulation execution results of transaction request A and transaction request B are both successful, the block construction node 111 can simulate and update the first state information based on the simulation execution result.

[0080] Subsequently, the block construction node 111 can simulate the execution of the next transaction list in the first transaction sequence {X, Y, Z}, that is, the transaction list Y, based on the simulated updated state information (also called the second state information). Similarly, the block construction node 111 simulates the execution of the transaction list Y in a preset order. Assuming that in the blockchain network 110, the successful execution of transaction request A will cause the failure of the execution of transaction request C, then the simulated execution result of transaction list Y may be that transaction request C, transaction request D and transaction request E all fail, which does not match the transaction failure policy of transaction list Y (allowing at most two of transaction request C, transaction request D and transaction request E to fail). Therefore, transaction list Y needs to be removed from the first transaction sequence.

[0081] Finally, the block construction node 111 can simulate the execution of the next transaction list - transaction list Z based on the second state information (because transaction list Y is removed from the first transaction sequence, it will not affect the simulated execution of transaction list Z in theory). Assuming that the simulated execution result of transaction list Z matches its transaction failure strategy, then since all transaction lists in the first transaction sequence have completed the simulated execution, the second transaction sequence {X, Z} can be obtained.

[0082] In this way, it can be ensured that the transaction lists at the front in the first transaction sequence are given priority in simulation execution, preventing the transaction lists at the back in the first transaction sequence (for example, robot transactions, junk transactions, or transactions with a lower total transaction amount or an average transaction amount) from interfering with the transaction lists with a higher total transaction amount or an average transaction amount. This helps to improve the throughput of the blockchain network 110, enhance the validity of the transactions received by the blockchain network 110, and thus improve the overall transaction processing efficiency of the blockchain network 110.

[0083] Step S205, sending the second transaction sequence to the verification node 112 in the blockchain network 110.

[0084] In this embodiment, the verification node 112 can be connected to multiple block construction nodes 111; the verification node 112 is used to receive the second transaction sequences sent by the multiple block construction nodes 111, and send a reception notification to the block construction node 111 corresponding to the second transaction sequence with the largest difference between the total value and the handling fee amount in each second transaction sequence.

[0085] The following will be combined Figure 3 The information interaction between the block construction node 111 and the verification node 112 provided in the embodiment of the present application is described, see Figure 3 , Figure 3 is a flow chart of a transaction processing method of the blockchain network 110 according to another embodiment of the present application. Figure 3 As shown: After step S204, the method further includes:

[0086] Step S301, based on the simulation execution results of each transaction list in the second transaction sequence, determine the total value of the second transaction sequence; calculate the hash value of the second transaction sequence, and encrypt the hash value, the total value and the preset handling fee amount and send them to the verification node 112.

[0087] In this embodiment, the block construction node 111 can determine the total transaction amount generated when each transaction list is simulated and executed based on the simulation execution results of each transaction list in the second transaction sequence, and add up the total transaction amounts corresponding to each transaction list, and take the sum of the total transaction amounts corresponding to each transaction list as the total value of the second transaction sequence.

[0088] Subsequently, the block construction node 111 may calculate the hash value of the second transaction sequence, and encrypt the hash value, the total value, and the preset handling fee amount and send them to the verification node 112 .

[0089] Step S302 , in response to the receipt notification sent by the verification node 112 , the second transaction sequence is sent to the verification node 112 .

[0090] In this embodiment, since the verification node 112 can establish connections with multiple block construction nodes 111, the verification node 112 can select the block construction node 111 corresponding to the second transaction sequence with the largest difference between the total value and the handling fee amount to send a receipt notification based on the perspective of maximizing its own interests.

[0091] After the block construction node 111 sends the second transaction sequence to the verification node 112 in response to the reception notification sent by the verification node 112, it can receive the handling fee paid by the verification node 112 based on the handling fee amount after the verification node 112 completes the block generation and chaining based on the second transaction sequence.

[0092] It should be noted that the above-mentioned handling fee amount can be set by yourself, and this application does not impose any restrictions on this.

[0093] Through the above steps S201 to S205 and S301 to S302, by setting the block construction node 111 in the blockchain network 110, receiving the transaction lists and transaction failure strategies sent by multiple clients 100, sorting each transaction list, and obtaining a first transaction sequence; and performing simulation execution on each transaction list in the first transaction sequence, eliminating the transaction list whose simulation execution results do not conform to the transaction failure strategy, and obtaining a second transaction sequence; finally, sending the second transaction sequence to the verification node 112 in the blockchain network 110, so that the verification node 112 verifies and blocks the second transaction sequence. In this way, the block construction node 111 can sort the transaction lists sent by multiple clients 100, ensure the atomicity of multiple transactions in the transaction list, improve the validity of the transactions received by the blockchain network 110, and thus improve the transaction processing efficiency of the blockchain network 110.

[0094] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0095] Corresponding to the transaction processing method of the blockchain network 110 described in the above embodiment, Figure 4 A schematic diagram of the structure of a block construction node according to an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0096] See also Figure 4 The block construction node 4 includes: a receiving module 40, which is used to respectively receive transaction lists sent by multiple clients and transaction failure strategies corresponding to each transaction list; a sorting module 41, which is used to obtain the fee information corresponding to each transaction list, and sort each transaction list in order from high to low according to the fee information to obtain a first transaction sequence; a simulation execution module 42, which is used to simulate and execute the transaction lists in the first transaction sequence in order from high to low, and obtain the simulation execution results corresponding to each transaction list; a removal module 43, which is used to remove the transaction list whose simulation execution results do not match the transaction failure strategy from the first transaction sequence to obtain a second transaction sequence; a sending module 44, which is used to send the second transaction sequence to the verification node in the blockchain network.

[0097] In one embodiment, the elimination module 43 is also used to obtain the status information of the blockchain network, and based on the status information, simulate the execution of the transaction list in the first transaction sequence; if the simulated execution result of the transaction list matches the transaction failure strategy, then simulate the update of the status information based on the simulated execution result; and based on the simulated updated status information, simulate the execution of the next transaction list in the first transaction sequence; or if the simulated execution result of the transaction list does not match the transaction failure strategy, then eliminate the transaction list from the first transaction sequence; and based on the status information of the blockchain network, simulate the execution of the next transaction list in the first transaction sequence; after all transaction lists in the first transaction sequence have completed the simulated execution, a second transaction sequence is obtained.

[0098] In one embodiment, the transaction list includes at least one transaction request, and the transaction failure policy corresponding to the transaction list is used to indicate whether each transaction request in the transaction list allows transaction failure; the elimination module 43 is also used to simulate the execution of each transaction request in the transaction list in sequence according to the preset order based on the status information, wherein the preset order is specified when the client sends the transaction list; if the simulated execution results of all transaction requests in the transaction list match the transaction failure policy, it is determined that the simulated execution result of the transaction list matches the transaction failure policy; if there is at least one transaction request in the transaction list whose simulated execution result does not match the transaction failure policy, it is determined that the simulated execution result of the transaction list does not match the transaction failure policy.

[0099] In one embodiment, the sorting module 41 is also used to simulate the execution of each transaction request in the transaction list in sequence according to a preset order based on the status information of the blockchain network; when the simulated execution results of all transaction requests in the transaction list match the transaction failure strategy, the transaction list is added to the third transaction sequence; when the number of transaction lists in the third transaction sequence is greater than or equal to a preset threshold, based on the simulated execution results of each transaction list in the third transaction sequence, the fee information corresponding to each transaction list is determined; and each transaction list in the third transaction sequence is sorted in order of the fee information from high to low to obtain a first transaction sequence.

[0100] In one embodiment, the sending module 44 is also used to determine the total value of the second transaction sequence based on the simulated execution results of each transaction list in the second transaction sequence; calculate the hash value of the second transaction sequence, and encrypt the hash value, total value and preset handling fee amount and send them to the verification node; in response to the receipt notification sent by the verification node, send the second transaction sequence to the verification node.

[0101] In one embodiment, the receiving module 40 is further used to receive a handling fee paid by the verification node based on the handling fee amount after the verification node completes the block generation and chaining based on the second transaction sequence.

[0102] In one embodiment, the verification node is connected to multiple block building nodes; the verification node is used to receive second transaction sequences sent by multiple block building nodes, and send a reception notification to the block building node corresponding to the second transaction sequence with the largest difference between the total value and the handling fee amount in each second transaction sequence.

[0103] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0104] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0105] Figure 5 is a schematic diagram of the structure of a terminal device according to an embodiment of the present application. Figure 5 As shown, the terminal device 5 includes: at least one processor 50 ( Figure 5 Only one is shown in the figure) a processor, a memory 51, and a computer program 52 stored in the memory 51 and executable on at least one processor 50. When the processor 50 executes the computer program 52, the steps in the transaction processing method embodiments of any of the above-mentioned blockchain networks are implemented.

[0106] The terminal device 5 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device 5 may include but is not limited to a processor 50 and a memory 51. It is understood by those skilled in the art that Figure 5 It is only an example of the terminal device 5 and does not constitute a limitation on the terminal device 5. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0107] The processor 50 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0108] In some embodiments, the memory 51 may be an internal storage unit of the terminal device 5, such as a hard disk or memory of the terminal device 5. In other embodiments, the memory 51 may also be an external storage device of the terminal device 5, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 5. In other embodiments, the memory 51 may also include both an internal storage unit and an external storage device of the terminal device 5. The memory 51 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of a computer program 52. The memory 51 may also be used to temporarily store data that has been output or is to be output.

[0109] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it can implement the steps in the transaction processing method embodiments of each of the above-mentioned blockchain networks.

[0110] An embodiment of the present application provides a computer program product. When the computer program product is run on a mobile terminal, the mobile terminal implements the steps in the transaction processing method embodiments of the above-mentioned various blockchain networks when executing the computer program product.

[0111] The present application implements all or part of the processes in the above-mentioned embodiment method, and can instruct the relevant hardware to complete through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk.

[0112] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0113] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0114] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0115] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0116] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A transaction processing method for a blockchain network, characterized in that: include: The following processing is performed by the block building nodes of the blockchain network: Receiving transaction lists sent by multiple clients and a transaction failure strategy corresponding to each of the transaction lists respectively; Acquire the fee information corresponding to each of the transaction lists, and sort the transaction lists in descending order of the fee information to obtain a first transaction sequence; Simulating and executing the transaction lists in the first transaction sequence in descending order to obtain simulation execution results corresponding to the transaction lists; Eliminate the transaction list whose simulation execution results do not match the transaction failure strategy from the first transaction sequence to obtain a second transaction sequence; Send the second transaction sequence to a verification node in the blockchain network.

2. The method according to claim 1, characterized in that The transaction list whose simulation execution results do not match the transaction failure strategy is removed from the first transaction sequence to obtain a second transaction sequence comprising: Acquire status information of the blockchain network, and simulate execution of the transaction list in the first transaction sequence based on the status information; If the simulated execution result of the transaction list matches the transaction failure strategy, then simulate updating the state information based on the simulated execution result; and simulate executing the next transaction list in the first transaction sequence based on the simulated updated state information; or If the simulated execution result of the transaction list does not match the transaction failure strategy, the transaction list is removed from the first transaction sequence; and based on the state information of the blockchain network, the next transaction list in the first transaction sequence is simulated and executed; After all the transaction lists in the first transaction sequence have completed simulation execution, the second transaction sequence is obtained.

3. The method according to claim 2, characterized in that The transaction list includes at least one transaction request, and the transaction failure policy corresponding to the transaction list is used to indicate whether each transaction request in the transaction list allows transaction failure; Based on the state information, simulating execution of the transaction list in the first transaction sequence includes: Based on the state information, simulate and execute each of the transaction requests in the transaction list in sequence according to a preset order, wherein the preset order is specified by the client when sending the transaction list; If the simulated execution results of all the transaction requests in the transaction list match the transaction failure strategy, determining that the simulated execution results of the transaction list match the transaction failure strategy; If there is at least one transaction request in the transaction list whose simulated execution result does not match the transaction failure policy, it is determined that the simulated execution result of the transaction list does not match the transaction failure policy.

4. The method according to claim 3, characterized in that Acquiring the fee information corresponding to each of the transaction lists, and sorting the transaction lists in descending order of the fee information, to obtain a first transaction sequence including: Based on the state information of the blockchain network, simulate and execute each of the transaction requests in the transaction list in sequence according to the preset order; When the simulated execution results of all the transaction requests in the transaction list match the transaction failure strategy, adding the transaction list to a third transaction sequence; When the number of the transaction lists in the third transaction sequence is greater than or equal to a preset threshold, determining fee information corresponding to each of the transaction lists based on the simulation execution results of each of the transaction lists in the third transaction sequence; The transaction lists in the third transaction sequence are sorted in descending order of the fee information to obtain the first transaction sequence.

5. The method according to any one of claims 1 to 4, characterized in that Sending the second transaction sequence to a verification node in the blockchain network includes: determining a total value of the second transaction sequence based on the simulated execution results of each of the transaction lists in the second transaction sequence; Calculate the hash value of the second transaction sequence, and encrypt the hash value, the total value, and the preset handling fee amount and send them to the verification node; In response to the receipt notification sent by the verification node, the second transaction sequence is sent to the verification node.

6. The method according to claim 5, characterized in that After sending the second transaction sequence to the verification node in response to the receipt notification sent by the verification node, the method further includes: After the verification node completes block generation and chaining based on the second transaction sequence, a handling fee paid by the verification node based on the handling fee amount is received.

7. The method according to claim 5, characterized in that The verification node is connected to multiple block construction nodes; the verification node is used to receive the second transaction sequences sent by multiple block construction nodes, and send the reception notification to the block construction node corresponding to the second transaction sequence with the largest difference between the total value and the handling fee amount in each of the second transaction sequences.

8. A block construction node, characterized in that: include: A receiving module, used to respectively receive transaction lists sent by multiple clients and a transaction failure strategy corresponding to each of the transaction lists; A sorting module, used for obtaining the fee information corresponding to each of the transaction lists, and sorting the transaction lists in descending order of the fee information to obtain a first transaction sequence; a simulation execution module, configured to simulate and execute the transaction lists in the first transaction sequence in descending order, and obtain simulation execution results corresponding to the transaction lists; A removal module, configured to remove the transaction list whose simulation execution results do not match the transaction failure strategy from the first transaction sequence to obtain a second transaction sequence; A sending module is used to send the second transaction sequence to a verification node in the blockchain network.

9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the transaction processing method of the blockchain network as described in any one of claims 1 to 7 is implemented.

10. A computer program product, characterized in that It comprises a computer program, which, when executed, enables the transaction processing method of the blockchain network as described in any one of claims 1 to 7 to be executed.