Blockchain-based transaction processing method, device, equipment, and medium

By decoupling block nodes and proposed nodes in the blockchain network, block nodes generate blocks, and proposed nodes initiate consensus processing, the communication complexity and resource overhead problems during transaction data processing in the blockchain network are solved, and network performance is improved.

CN119417467BActive Publication Date: 2025-08-26CHINA ACADEMY OF INFORMATION & COMM +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411419633.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2025-08-26
Estimated Expiration
2044-10-11

AI Technical Summary

Technical Problem

When processing transaction data in blockchain networks, communication complexity and resource overhead are high, affecting network performance.

Method used

By decoupling the block-out node and the proposed node from the consensus node, the block-out node is responsible for generating blocks, the proposed node initiates consensus processing, and the transaction information is stored in the transaction pool of the block-out node, and only transaction information is sent to the block-out node, the proposed node executes and writes to the new block, and the consensus node performs consensus processing.

Benefits of technology

It reduces the communication complexity and resource overhead of blockchain networks and improves network performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119417467B_ABST
    Figure CN119417467B_ABST
Patent Text Reader

Abstract

The disclosed embodiments disclose a transaction processing method, apparatus, device, and medium based on blockchain. The method includes: a block-producing node deletes the transaction information corresponding to the previous block in the transaction pool corresponding to the block-producing node based on the block information of the previous block in the block acquisition request, generates a new block based on the transaction information in the transaction pool corresponding to the block-producing node, and sends the new block to a proposing node. The proposing node executes each transaction information in the new block and writes the transaction results of each transaction information into the new block to obtain a block to be chained; the proposing node initiates consensus processing on the block to be chained in the blockchain network; when the block to be chained passes the consensus, the block to be chained is added to the blockchain. As a result, the block-producing node is responsible for generating blocks, so that when nodes in the blockchain network receive transaction information, they only need to send the transaction information to the block-producing node, which greatly reduces the complexity of blockchain network communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of blockchain technology, and in particular to a transaction processing method, apparatus, device, and medium based on blockchain. Background Art

[0002] Blockchain is a new application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain technology is built on a blockchain network, enabling data transmission and processing through each node in the blockchain network.

[0003] In related technologies, when each node in the blockchain network receives transaction data, it needs to process the transaction data and broadcast the transaction data to other nodes in the blockchain network. At the same time, it also needs to update its own transaction pool after the transaction data reaches consensus. This increases the complexity of blockchain network communication and also increases the storage and computing resource overhead of the blockchain network, thereby affecting the overall performance of the blockchain network. Summary of the Invention

[0004] In order to solve the above technical problems, the embodiments of the present disclosure provide a blockchain-based transaction processing method, device, equipment, and medium.

[0005] One aspect of an embodiment of the present disclosure provides a blockchain-based transaction processing method, which is applied to a blockchain network, wherein the blockchain network includes: a block-producing node, a proposing node and multiple consensus nodes, and the method includes: in response to the block-producing node receiving a block acquisition request sent by the proposing node, the block-producing node deletes the transaction information corresponding to the previous block in the transaction pool corresponding to the block-producing node based on the block information of the previous block in the block acquisition request, so as to update the transaction pool corresponding to the block-producing node; the block-producing node generates a new block based on the transaction information in the transaction pool corresponding to the block-producing node, and sends the new block to the proposing node; the proposing node executes each transaction information in the new block, and writes the transaction result of each transaction information into the new block to obtain a block to be chained; the proposing node initiates consensus processing on the block to be chained in the blockchain network; and in response to the block to be chained passing the consensus, adds the block to be chained to the blockchain.

[0006] Another aspect of the embodiments of the present disclosure provides a blockchain-based transaction processing device, which is applied to a blockchain network, wherein the blockchain network includes: a block-producing node, a proposing node, and multiple consensus nodes, the device including: a first transaction pool update module, configured to, in response to the block-producing node receiving a block acquisition request sent by the proposing node, delete the transaction information corresponding to the previous block in the transaction pool corresponding to the block-producing node based on the block information of the previous block in the block acquisition request, so as to update the transaction pool corresponding to the block-producing node; a block generation module, configured to, in the block-producing node, generate a new block based on the transaction information in the transaction pool corresponding to the block-producing node, and send the new block to the proposing node; a transaction execution module, configured to, in the proposing node, execute each transaction information in the new block, and write the transaction result of each transaction information into the new block to obtain a block to be chained; a consensus module, configured to, in the blockchain network, initiate consensus processing of the block to be chained by the proposing node; and an on-chain module, configured to, in response to the block to be chained passing consensus, add the block to be chained to the blockchain.

[0007] Another aspect of the embodiments of the present disclosure provides an electronic device, comprising: a memory for storing a computer program; a processor for executing the computer program stored in the memory, and when the computer program is executed, implementing the above-mentioned blockchain-based transaction processing method.

[0008] In another aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned blockchain-based transaction processing method is implemented.

[0009] The blockchain-based transaction processing method, apparatus, device, and medium of the disclosed embodiments. When a block-producing node receives a block acquisition request sent by a proposing node, the block-producing node deletes the transaction information corresponding to the previous block in the transaction pool corresponding to the block-producing node based on the block information of the previous block in the block acquisition request, so as to update the transaction pool corresponding to the block-producing node, and then generates a new block based on the transaction information in the transaction pool corresponding to the block-producing node, and sends the new block to the proposing node; the proposing node executes each transaction information in the new block and writes the transaction results of each transaction information into the new block to obtain a block to be chained; the proposing node initiates consensus processing on the block to be chained in the blockchain network; when the block to be chained passes the consensus, the block to be chained is added to the blockchain. In the embodiments of the present disclosure, by decoupling the block-producing nodes and the proposing nodes from the consensus nodes, since the block-producing nodes are responsible for generating blocks, when the nodes in the blockchain network receive transaction information, they only need to send the transaction information to the block-producing nodes, and there is no need to broadcast it to all nodes in the blockchain network. This reduces the complexity of blockchain network communication from O(nlgn) to O(n), where n is the number of consensus nodes, thereby greatly reducing the complexity of blockchain network communication.

[0010] In addition, since transaction information is stored in the transaction pool corresponding to the block-producing node and the consensus on the blocks to be put on the chain is initiated by the proposing node, the transaction pools of the consensus nodes and proposing nodes in the blockchain network no longer need to store and update transaction information, thereby reducing the storage and computing resource overhead of the blockchain network and improving the performance of the blockchain network.

[0011] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0013] The present disclosure can be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:

[0014] Figure 1 It is a flowchart of a blockchain-based transaction processing method provided by an exemplary embodiment of the present disclosure.

[0015] Figure 2 It is a flowchart of a blockchain-based transaction processing method provided by another exemplary embodiment of the present disclosure.

[0016] Figure 3 It is a flowchart of step S200 provided by an exemplary embodiment of the present disclosure.

[0017] Figure 4 It is a flowchart of a blockchain-based transaction processing method provided by another exemplary embodiment of the present disclosure.

[0018] Figure 5 This is a schematic diagram of a blockchain network provided by an application example of the present disclosure.

[0019] Figure 6 This is a schematic diagram of a blockchain-based transaction processing method provided in an application example of the present disclosure.

[0020] Figure 7 It is a structural block diagram of a blockchain-based transaction processing device provided by an exemplary embodiment of the present disclosure.

[0021] Figure 8 The figure is a schematic structural diagram of an application embodiment of the electronic device disclosed herein. DETAILED DESCRIPTION

[0022] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure.

[0023] Those skilled in the art will understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, and do not represent any specific technical meanings, nor do they indicate a necessary logical order between them.

[0024] It should also be understood that in the embodiments of the present disclosure, “a plurality of” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.

[0025] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0026] In addition, the term "and / or" in this disclosure is merely a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this disclosure generally indicates that the related objects are in an "or" relationship.

[0027] It should also be understood that the description of the various embodiments in this disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced with each other. For the sake of brevity, they will not be described one by one.

[0028] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0029] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0030] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0031] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0032] The embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, and servers, and can operate in conjunction with numerous other general-purpose or specialized computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and / or configurations suitable for use with terminal devices, computer systems, servers, and other electronic devices include, but are not limited to, personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, minicomputer systems, mainframe computer systems, and distributed cloud computing technology environments including any of the above systems, among others.

[0033] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system-executable instructions (such as program modules) executed by a computer system. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, where tasks are performed by remote processing devices linked via a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media, including storage devices.

[0034] In the embodiments of the present disclosure:

[0035] A node in a blockchain network usually refers to a computing device in the blockchain network. That is, any computing device connected to the blockchain network (including mobile phones, servers, etc.) is called a node. Nodes can be used to store, run, verify, and perform other processing on data in the blockchain network.

[0036] Figure 1 This is a flowchart of a transaction processing method based on blockchain provided by an exemplary embodiment of the present disclosure. This embodiment can be applied on a blockchain network, such as Figure 1As shown, the blockchain-based transaction processing method may include the following steps:

[0037] In step S100, in response to the block producing node receiving the block acquisition request sent by the proposing node, the block producing node deletes the transaction information corresponding to the previous block in the transaction pool corresponding to the block producing node based on the block information of the previous block in the block acquisition request, so as to update the transaction pool corresponding to the block producing node.

[0038] The blockchain network consists of: block-producing nodes, proposal nodes, and multiple consensus nodes. Block-producing nodes are responsible for generating blocks, proposal nodes are responsible for requesting blocks from block-producing nodes, executing transactions in blocks, initiating consensus on blocks, and reaching consensus on blocks. Consensus nodes are responsible for reaching consensus on blocks.

[0039] The block-producing node communicates with the proposing node and multiple consensus nodes, the proposing node communicates with multiple consensus nodes, and the consensus nodes communicate with each other. The block-producing node includes a transaction pool, which is used to store transaction information. In this embodiment, the transaction pool in the block-producing node can be referred to as the transaction pool corresponding to the block-producing node.

[0040] The previous block is the latest block in the blockchain network, that is, the block before the new block. Transaction information represents transaction-related data. For example, transaction information may include information about each transacting party and transaction data. Particularly, party information may include their account ID and address, while transaction data may include transaction type, gas fee, and transaction time. Examples of transaction types include, but are not limited to, ticketing transactions, car purchases, and parking fee transactions.

[0041] The block acquisition request includes: block information of the previous block, for example, the block information of the previous block may include a hash value of the previous block, etc.

[0042] In one embodiment, a block producer node may cache the previous block. When a proposing node determines that the previous block has been added to the blockchain, the proposing node sends a block acquisition request to the block producer node. Upon receiving the block acquisition request, the block producer node determines the transaction information corresponding to the previous block in the transaction pool based on the block information of the previous block, and deletes the transaction information corresponding to the previous block to update the transaction pool. The transaction information corresponding to the previous block may be the transaction information included in the previous block.

[0043] In step S110, the block-producing node generates a new block based on the transaction information in the transaction pool corresponding to the block-producing node, and sends the new block to the proposing node.

[0044] Among them, in the transaction pool corresponding to the block-producing node, the remaining transactions after deleting the transaction information corresponding to the previous block are sorted, and a new block is generated based on the sorted remaining transaction information.

[0045] In step S120, the proposing node executes each transaction information in the new block and writes the transaction results of each transaction information into the new block to obtain a block to be chained.

[0046] Among them, the proposing node can execute each transaction information in the new block and update each transaction information according to the transaction results of each transaction information. For example, the balance of the account in each transaction information can be updated, and then the Merkle root is calculated through the updated transaction information, and the Merkle root is written into the new block to write the transaction results of each transaction information into the new block to obtain the block to be chained.

[0047] In step S130, the proposing node initiates a consensus process for the block to be chained in the blockchain network.

[0048] In one embodiment, a proposing node may send a block to be included in the blockchain to multiple consensus nodes and initiate consensus on the block in the blockchain network. The multiple consensus nodes and the proposing node then reach consensus on the block based on a pre-set consensus algorithm. Examples of pre-set consensus algorithms include Practical Byzantine Fault Tolerance (PBFT), Delegated Proof of Stake (DPOS), or HotStuff consensus.

[0049] Step S140: In response to the block to be chained passing the consensus, the block to be chained is added to the blockchain.

[0050] Among them, when the block to be chained passes the consensus, the block to be chained can be added to the blockchain to make the block to be chained.

[0051] In one embodiment, when a block to be chained fails to pass consensus, the block to be chained is not added to the blockchain, that is, the block to be chained fails to be chained.

[0052] In the disclosed embodiment, by decoupling the block-producing nodes and the proposing nodes from the consensus nodes, since the block-producing nodes are responsible for generating blocks, when nodes in the blockchain network receive transaction information, they only need to send the transaction information to the block-producing nodes, without having to send it to all nodes in the blockchain network. This reduces the complexity of blockchain network communication from O(nlgn) to O(n), where n is the number of consensus nodes, thereby greatly reducing the complexity of blockchain network communication. In addition, since transaction information is stored in the transaction pool corresponding to the block-producing nodes, and the consensus on the blocks to be on the chain is initiated by the proposing nodes, the transaction pools of the consensus nodes and the proposing nodes in the blockchain network no longer need to store and update transaction information, thereby reducing the overhead of storage resources and computing resources, thereby improving the performance of the blockchain network.

[0053] In some optional implementations, in the embodiments of the present disclosure, step S130 may include: the proposing node sends the block to be chained to multiple consensus nodes and block-producing nodes, and the multiple consensus nodes, proposing nodes, and block-producing nodes perform consensus processing on the block to be chained.

[0054] In an optional implementation, the block-producing nodes can also be used for block consensus. The proposing node initiates consensus on the block to multiple consensus nodes, proposing nodes, and block-producing nodes. The multiple consensus nodes, proposing nodes, and block-producing nodes reach consensus on the block based on a preset consensus algorithm.

[0055] Accordingly, in this embodiment, step S140 may further include: multiple consensus nodes, proposal nodes, and block-producing nodes adding the to-be-chained blocks to their respective blockchains.

[0056] In some optional implementations, in the embodiments of the present disclosure, the blockchain-based transaction processing method may further include: for each node in the blockchain network, in response to the consensus height of the node being greater than or equal to a preset number of blocks, the node determines a new block-producing node from other nodes in the blockchain network except the block-producing node.

[0057] The node's consensus height is used to indicate the number of consensus blocks for that node. The preset number of blocks can be set based on actual needs.

[0058] In one embodiment, in a blockchain network, when the consensus height of each of the block-producing node, the proposing node, and the multiple consensus nodes is greater than or equal to the preset number of blocks, that is, when the consensus height of each node in the blockchain network is greater than or equal to the preset number of blocks, the block-producing node, the proposing node, and the multiple consensus nodes respectively determine a new block-producing node from other nodes.

[0059] Exemplarily, the block producing node, the proposing node, and the plurality of consensus nodes may each determine a new block producing node from the plurality of consensus nodes. When the proposing node is determined to be the new block producing node, the new block producing node serves as both the block producing node and the proposing node.

[0060] After a new block-producing node is determined, the transaction pool corresponding to the new block-producing node is activated (the transaction pool in the new block-producing node), so that the transaction pool corresponding to the new block-producing node enters a working state to store transaction information, and the new block-producing node is responsible for subsequent block generation. The transaction pool corresponding to the block-producing node is closed, and the transaction pool corresponding to the block-producing node is in a non-working state, that is, no further storage and update of transaction information is performed, and the block-producing node is restored to the node before the block-producing node became a block-producing node. For example, when a consensus node is used as a block-producing node, when a new block-producing node is determined, the block-producing node is restored to a consensus node. When a proposal node is used as a block-producing node, when a new block-producing node is determined, the block-producing node only serves as a proposal node.

[0061] In the disclosed embodiments, when the block height of each node in the blockchain network is greater than or equal to a predetermined number of blocks, each node in the blockchain network independently determines a new block-producing node to be responsible for subsequent block generation, thereby enhancing fairness and data security in the blockchain network. Furthermore, the new block-producing node is selected from the nodes in the blockchain network, eliminating the need to add additional nodes to the blockchain network as block-producing nodes.

[0062] In some optional implementations, in the embodiments of the present disclosure, the node may determine the new block-producing node in the following manner: the node determines the new block-producing node from other nodes based on a preset block-producing node ranking.

[0063] The preset block-producing node ranking may include the order in which nodes in the blockchain network are determined to be block-producing nodes. In one embodiment, each of the block-producing nodes, the proposing node, and the plurality of consensus nodes may determine a new block-producing node from among the other nodes based on the preset block-producing node ranking.

[0064] In the embodiment of the present disclosure, selecting a new block-producing node according to a preset block-producing node ranking can effectively ensure the consistency of the new block-producing node selected by each node in the blockchain network.

[0065] Figure 2 This is a flowchart of a blockchain-based transaction processing method provided by another exemplary embodiment of the present disclosure. In some optional implementations, in the embodiment of the present disclosure, the node can also determine the new block-producing node in the following manner:

[0066] Step S200: The node obtains target random information.

[0067] The block-producing node, the proposing node, and each of the multiple consensus nodes obtains the target random information. For example, when the consensus height of each node in the blockchain network is greater than or equal to a preset number of blocks, a random number generator can be used to generate a random number and send the random number to the block-producing node, the proposing node, and the multiple consensus nodes. The block-producing node, the proposing node, and each of the multiple consensus nodes can use the hash value of the random number as the target random information.

[0068] In step S210, the node determines a new block generating node based on the distance between the target random information and the node information of other nodes.

[0069] The node information may include, for example, the address information and / or identification of the node.

[0070] In one embodiment, each of the block-producing node, the proposing node, and the consensus nodes may determine the distance between the target random information and the hash value of the node information of each of the other nodes, and determine the other node with the smallest distance as the new block-producing node. The distance between the target random information and the hash value of the node information of each of the other nodes may be, for example, the Hamming distance or the Levenshtein distance.

[0071] Figure 3 2 is a flow chart of step S200 provided by an exemplary embodiment of the present disclosure. In some optional implementations, in the embodiment of the present disclosure, step S200 may include the following steps:

[0072] In step S201, the node obtains the target historical block from the blockchain based on a preset block selection rule.

[0073] The preset block selection rule may include, for example, taking the latest block on the blockchain as the target historical block.

[0074] In one embodiment, the block producing node, the proposing node, and each of the plurality of consensus nodes respectively obtain the latest block on the blockchain (target historical block).

[0075] In step S202, the node determines target random information based on the target historical block.

[0076] Among them, the hash value of the target historical block can be used as the target random information.

[0077] Exemplarily, the block-producing node, the proposing node, and each of the multiple consensus nodes obtains the target historical block as a seed, and determines the distance between the hash value of the seed (target random information) and the hash value of the address information (node ​​information) of each node in the multiple consensus nodes, and determines the consensus node with the smallest distance as the new block-producing node.

[0078] In the embodiment of the present disclosure, the target historical block is determined based on a preset block selection rule, and the target random information is determined by the target historical block, thereby ensuring the consistency of the target random information obtained by each node in the blockchain network, and further ensuring the consistency of the new block-producing node selected by each node in the blockchain network.

[0079] Figure 4 This is a flowchart of a transaction processing method based on blockchain provided by another exemplary embodiment of the present disclosure. In some optional implementations, such as Figure 4 As shown, in the embodiment of the present disclosure, the following steps may be further included before step S100:

[0080] Step S300: In response to the proposing node and / or any consensus node among the plurality of consensus nodes receiving the transaction information, the proposing node and / or any consensus node sends the transaction information to the block producing node.

[0081] Among them, when the proposing node receives the transaction information sent by the user, the proposing node sends the transaction information to the block-producing node; when any consensus node receives the transaction information sent by the user, the consensus node sends the transaction information to the block-producing node; when the block-producing node receives the transaction information sent by the user, it directly stores the transaction information in the transaction pool corresponding to the block-producing node.

[0082] In step S310, the block-producing node updates the transaction information to the transaction pool corresponding to the block-producing node.

[0083] In one embodiment, the block producing node receives the transaction information sent by the proposing node and / or any consensus node, and stores the transaction information in the transaction pool corresponding to the block producing node, so as to update the transaction information to the transaction pool corresponding to the block producing node.

[0084] In the disclosed embodiment, when the proposal node and the consensus node receive transaction information, they directly send the transaction information to the block-producing node, and the transaction pool corresponding to the block-producing node stores the transaction information, thereby reducing storage overhead and improving the performance of the blockchain network.

[0085] In some optional embodiments, in the embodiments of the present disclosure, the blockchain-based transaction processing method may further include: in response to the proposing node not receiving a new block within a first preset time period, for each node in the blockchain network, the node determines a new block-producing node from other nodes in the blockchain network except the block-producing node; or, in response to multiple consensus nodes not receiving a block to be chained within a second preset time period, for each node in the blockchain network, the node determines a new block-producing node from other nodes in the blockchain network except the block-producing node.

[0086] Among them, the first preset time length and the second preset time length can be set according to the actual needs of the blockchain network. For example, the first preset time length and the second preset time length can be 1s, etc.

[0087] In one embodiment, when a proposing node fails to receive a new block within a first preset time period after the last consensus processing of a block, or when multiple consensus nodes fail to receive a block to be chained within a second preset time period after the last consensus processing of a block, the block-producing node may malfunction, crash, or act maliciously. Each node in the blockchain network generates a message that a new block has not been received, and signs the message that a new block has not been received. At the same time, the signed message that a new block has not been received is broadcast to nodes other than the node in the blockchain network. When the node receives the signed message that a new block has not been received sent by 2 / 3 of the nodes in the blockchain network, the node determines a new block-producing node from the other nodes. For example, the new block-producing node can be determined from multiple consensus nodes.

[0088] The method for determining a new block-producing node when a proposing node and multiple consensus nodes in a blockchain network do not receive a new block within a preset time period can be referenced to the method for determining a new block-producing node when the consensus height is greater than or equal to a preset number of blocks, and will not be repeated here. In the disclosed embodiments, when a block-producing node cannot normally produce a block (generate a new block), the nodes in the blockchain network promptly determine a new block-producing node from other nodes, thereby ensuring the normal operation of the blockchain network.

[0089] In some optional implementations, in the embodiments of the present disclosure, after determining the new block-producing node, the process may further include: the new block-producing node obtains transaction information that is not stored in the blockchain from the block-producing node, and stores the information in the transaction pool corresponding to the new block-producing node.

[0090] Among them, the transaction information that is not stored in the blockchain may be transaction information that has not formed a block, that is, transaction information that has not been put on the chain.

[0091] In one embodiment, the new block-producing node may request the block-producing node for transaction information that is not stored in the blockchain. The block-producing node then sends the transaction information in its corresponding transaction pool that is not stored in the blockchain to the new block-producing node. The block-producing node may delete all transaction information in its corresponding transaction pool, and the new fast node will store the transaction information that is not stored in the blockchain into the transaction pool corresponding to the new block-producing node.

[0092] In the disclosed embodiment, the new block-producing node obtains transaction information that is not stored in the blockchain from the block-producing node and stores it in the transaction pool corresponding to the new block-producing node, thereby avoiding omission of transaction information and ensuring that each transaction information can be stored in the blockchain.

[0093] In some optional embodiments, in the disclosed embodiments, the blockchain network further includes: at least one candidate node, each of which is communicatively connected to the proposing node, the plurality of consensus nodes, and the block producing node. This candidate node can be used as a rotating block producing node. Exemplarily, the blockchain network may include multiple candidate nodes.

[0094] Accordingly, step S130 in this embodiment may further include: the proposing node sends the block to be chained to multiple consensus nodes, and the multiple consensus nodes and the proposing node perform consensus processing on the block to be chained.

[0095] Among them, the proposing node can initiate consensus on the block to be on the chain to multiple consensus nodes, and multiple consensus nodes and proposing nodes perform consensus processing on the block to be on the chain based on the preset consensus algorithm.

[0096] In one embodiment, the block-producing nodes are only used to generate blocks and do not participate in consensus or store the blockchain. Accordingly, step S140 may include: multiple consensus nodes and proposal nodes adding the blocks to be added to their respective blockchains.

[0097] In some optional embodiments, in the embodiments of the present disclosure, the blockchain-based transaction processing method in the embodiments of the present application also includes: in response to the consensus height of multiple consensus nodes and proposal nodes being greater than or equal to a preset number of blocks, the multiple consensus nodes and proposal nodes respectively determine a new block-producing node from at least one candidate node.

[0098] Among them, the method of determining a new block-producing node from candidate nodes can refer to the method of determining a new block-producing node from other nodes, which will not be repeated here.

[0099] In some optional embodiments, in the embodiments of the present disclosure, the blockchain-based transaction processing method in the embodiments of the present application also includes: in response to the proposing node not receiving a new block within a first preset time period, for each node in the blockchain network, the node determines a new block-producing node from at least one candidate node; or, in response to multiple consensus nodes not receiving a block to be chained within a second preset time period, for each node in the blockchain network, the node determines a new block-producing node from at least one candidate node.

[0100] Among them, the method of determining a new block-producing node from candidate nodes can refer to the method of determining a new block-producing node from other nodes, which will not be repeated here.

[0101] Figure 5 This is a schematic diagram of a blockchain network provided by an application example of the present disclosure. Figure 6 This is a schematic diagram of a blockchain-based transaction processing method provided in an application example of the present disclosure.

[0102] like Figure 5 As shown, in a blockchain network, the blockchain network includes: block-producing nodes, proposal nodes, and multiple consensus nodes. Each of the block-producing nodes, proposal nodes, and multiple consensus nodes includes a transaction pool. The block-producing nodes, proposal nodes, and multiple consensus nodes can communicate with the user's client via a wired network or a wireless network. Among them, the transaction pool in the block-producing node (the transaction pool corresponding to the block-producing node) is in a working state, and the transaction pools in the proposal node and multiple consensus nodes are in a non-working state. The block-producing node is respectively connected to the proposal node and multiple consensus nodes via a wireless network or a wired network, the proposal node is connected to the multiple consensus nodes via a wireless network or a wired network, and the multiple consensus nodes are connected to each other via a wireless network or a wired network.

[0103] like Figure 6 As shown, in this application example, the transaction processing method based on blockchain may include:

[0104] The user can send transaction information to the proposing node or any consensus node through his client. When the proposing node or any consensus node receives the transaction information sent by the client, the proposing node or any consensus node sends the transaction information to the block-producing node. The block-producing node receives the transaction information and stores the transaction information in the transaction pool corresponding to the block-producing node.

[0105] When a block-producing node receives a block acquisition request sent by a proposing node, the block-producing node deletes the transaction information corresponding to the previous block in the transaction pool corresponding to the block-producing node based on the block information of the previous block in the block acquisition request, so as to update the transaction pool corresponding to the block-producing node. The block-producing node generates a new block based on the transaction information in the transaction pool corresponding to the block-producing node, and sends the new block to the proposing node. The proposing node executes each transaction information in the new block and writes the transaction result of each transaction information into the new block to obtain the block to be chained. The proposing node sends the block to be chained to multiple consensus nodes and block-producing nodes. Multiple consensus nodes, proposing nodes and block-producing nodes perform consensus processing on the block to be chained. When the block to be chained passes the consensus, it is added to the blockchain.

[0106] When the proposing node does not receive a new block within a first preset time period, for each node in the blockchain network, the node determines a new block-producing node from other nodes in the blockchain network except the block-producing node; or, when multiple consensus nodes do not receive a block to be chained within a second preset time period, for each node in the blockchain network, the node determines a new block-producing node from other nodes in the blockchain network except the block-producing node.

[0107] Figure 7 This is a block diagram of a transaction processing device based on blockchain provided by an exemplary embodiment of the present disclosure. This embodiment can be applied on a blockchain network, which includes: a block node, a proposal node, and multiple consensus nodes, such as Figure 7 As shown, the blockchain-based transaction processing device includes:

[0108] A first transaction pool updating module 400 is configured to, in response to the block producing node receiving the block acquisition request sent by the proposing node, delete the transaction information corresponding to the previous block in the transaction pool corresponding to the block producing node based on the block information of the previous block in the block acquisition request, so as to update the transaction pool corresponding to the block producing node;

[0109] The block generation module 410 is configured for the block-producing node to generate a new block based on the transaction information in the transaction pool corresponding to the block-producing node, and to send the new block to the proposing node;

[0110] The transaction execution module 420 is used for the proposing node to execute each transaction information in the new block and write the transaction results of each transaction information into the new block to obtain a block to be on-chain;

[0111] Consensus module 430, configured for the proposing node to initiate consensus processing on the block to be put on the blockchain in the blockchain network;

[0112] The on-chain module 440 is configured to add the block to the blockchain in response to the block to be on-chain passing the consensus.

[0113] In one embodiment of the present disclosure, the consensus module 430 in the embodiment of the present disclosure is specifically configured for the proposing node to send the block to be chained to the multiple consensus nodes and the block-producing node, and for the multiple consensus nodes, the proposing node and the block-producing node to perform consensus processing on the block to be chained.

[0114] In one embodiment of the present disclosure, the blockchain-based transaction processing device in the embodiment of the present disclosure further includes:

[0115] The first node replacement module is used for each node in the blockchain network, in response to the consensus height of the node being greater than or equal to a preset number of blocks, to determine a new block-producing node from other nodes in the blockchain network except the block-producing node.

[0116] In one embodiment of the present disclosure, the node in the embodiment of the present disclosure determines a new block-producing node from other nodes in the blockchain network except the block-producing node, and is further used to:

[0117] The node determines the new block-producing node from among the other nodes based on a preset block-producing node sorting.

[0118] In one embodiment of the present disclosure, the node in the embodiment of the present disclosure determines a new block-producing node from other nodes in the blockchain network except the block-producing node, and is further used to:

[0119] The node obtains target random information;

[0120] The node determines the new block generating node based on the distance between the target random information and the node information of other nodes.

[0121] In one embodiment of the present disclosure, the node in the embodiment of the present disclosure obtains target random information, and is further used to:

[0122] The node obtains a target historical block from the blockchain based on a preset block selection rule;

[0123] The node determines the target random information based on the target historical block.

[0124] In one embodiment of the present disclosure, the blockchain-based transaction processing device in the embodiment of the present disclosure further includes:

[0125] a transaction information sending module, configured to, in response to the proposing node and / or any consensus node among the plurality of consensus nodes receiving the transaction information, cause the proposing node and / or any consensus node to send the transaction information to the block producing node;

[0126] The second transaction pool update module is used for the block-producing node to update the transaction information into the transaction pool.

[0127] In one embodiment of the present disclosure, the blockchain-based transaction processing device in the embodiment of the present disclosure further includes:

[0128] The second node replacement module is used to, in response to the proposing node not receiving the new block within the first preset time period, for each node in the blockchain network, determine a new block-producing node from other nodes in the blockchain network except the block-producing node; or, in response to the multiple consensus nodes not receiving the block to be chained within the second preset time period, for each node in the blockchain network, determine a new block-producing node from other nodes in the blockchain network except the block-producing node.

[0129] In one embodiment of the present disclosure, the blockchain-based transaction processing device in the embodiment of the present disclosure further includes:

[0130] A transaction information acquisition module is used for the new block-producing node to obtain transaction information that is not stored in the blockchain from the block-producing node and store it in the transaction pool corresponding to the new block-producing node.

[0131] In one embodiment of the present disclosure, the blockchain network in the embodiment of the present disclosure further includes: at least one candidate node; the consensus module 430 in the embodiment of the present disclosure is also used for the proposing node to send the block to be chained to the multiple consensus nodes, and the multiple consensus nodes and the proposing node perform consensus processing on the block to be chained.

[0132] In one embodiment of the present disclosure, the blockchain-based transaction processing device in the embodiment of the present disclosure further includes:

[0133] The third node replacement module is used to, in response to the consensus height of the multiple consensus nodes and the proposing node being greater than or equal to a preset number of blocks, cause the multiple consensus nodes and the proposing node to respectively determine a new block-producing node from the at least one candidate node.

[0134] In one embodiment of the present disclosure, the blockchain-based transaction processing device in the embodiment of the present disclosure further includes:

[0135] The fourth node replacement module is used to, in response to the proposing node not receiving the new block within the first preset time length, determine, for each node in the blockchain network, a new block-producing node from the at least one candidate node; or, in response to the multiple consensus nodes not receiving the block to be chained within the second preset time length, determine, for each node in the blockchain network, a new block-producing node from the at least one candidate node.

[0136] The blockchain-based transaction processing device of the embodiment of the present disclosure corresponds to the embodiment of the blockchain-based transaction processing method of the present disclosure, and the relevant contents can be referenced to each other and will not be repeated here.

[0137] The beneficial technical effects corresponding to the exemplary embodiment of the blockchain-based transaction processing device of the embodiment of the present disclosure can be found in the corresponding beneficial technical effects of the above-mentioned corresponding exemplary method part, which will not be repeated here.

[0138] In addition, an embodiment of the present disclosure further provides an electronic device, including:

[0139] Memory for storing computer programs;

[0140] The processor is configured to execute the computer program stored in the memory, and when the computer program is executed, implements the blockchain-based transaction processing method described in any of the above embodiments of the present disclosure.

[0141] Figure 8 This is a schematic diagram of the structure of an application embodiment of the electronic device disclosed in the present invention. Figure 8 The electronic device according to the embodiment of the present disclosure is described. The electronic device may be either or both of the first device and the second device, or a standalone device independent of them, and the standalone device may communicate with the first device and the second device to receive collected input signals from them.

[0142] like Figure 8 As shown, the electronic device includes one or more processors and memory.

[0143] The processor may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.

[0144] The memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), a hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may execute the program instructions to implement the blockchain-based transaction processing method of the various embodiments of the present disclosure described above and / or other desired functions.

[0145] In one example, the electronic device may further include an input device and an output device, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0146] In addition, the input device may also include, for example, a keyboard, a mouse, and the like.

[0147] The output device can output various information to the outside, including determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

[0148] Of course, to simplify, Figure 8 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, the electronic device may further include any other appropriate components according to specific application scenarios.

[0149] In addition to the above-mentioned methods and devices, embodiments of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, cause the processor to perform the steps of the blockchain-based transaction processing method according to various embodiments of the present disclosure described in the above part of this specification.

[0150] The computer program product may be written in any combination of one or more programming languages ​​to implement the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, and conventional procedural programming languages ​​such as C or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0151] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, causes the processor to execute the steps of the blockchain-based transaction processing method according to various embodiments of the present disclosure described in the above part of this specification.

[0152] The computer-readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can, for example, include but is not limited to a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0153] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk, etc. Various media that can store program codes.

[0154] The basic principles of the present disclosure have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, and effects mentioned in this disclosure are merely illustrative and not restrictive, and should not be construed as necessarily possessed by each embodiment of the present disclosure. Furthermore, the specific details disclosed above are provided for illustrative purposes and to facilitate understanding, rather than as limitations. These details do not limit the present disclosure to necessarily being implemented using these specific details.

[0155] Each embodiment in this specification is described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. References to the same or similar parts between the various embodiments are sufficient. For system embodiments, since they largely correspond to method embodiments, their description is relatively simple. For relevant parts, references to the description of the method embodiments are sufficient.

[0156] The block diagrams of the devices, devices, equipment, and systems involved in this disclosure are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, devices, equipment, and systems can be connected, arranged, or configured in any manner. Words such as "include," "comprise," "have," and the like are open-ended words, meaning "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or" and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.

[0157] The methods and apparatus of the present disclosure may be implemented in many ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless otherwise specified. In addition, in some embodiments, the present disclosure may also be implemented as programs recorded in a recording medium, which include machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers recording media that store programs for executing the methods according to the present disclosure.

[0158] It should also be noted that in the apparatus, device, and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.

[0159] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0160] The above description has been provided for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.

Claims

1. A transaction processing method based on blockchain, characterized in that: Applied to a blockchain network, the blockchain network includes: a block-producing node, a proposal node, and multiple consensus nodes. The block-producing node is used to generate blocks, the proposal node is used to request blocks from the block-producing node, execute transaction information in the block, initiate consensus on the block, and reach consensus on the block. Each consensus node is used to reach consensus on the block. The transaction pool corresponding to the block-producing node is in a working state, and the transaction pools of the proposal node and the multiple consensus nodes are all in a non-working state. The method includes: In response to the proposing node and / or any one of the plurality of consensus nodes receiving the transaction information, the proposing node and / or any one of the consensus nodes sends the transaction information to the block producing node; The block producing node updates the transaction information to the transaction pool; In response to the block producing node receiving the block acquisition request sent by the proposing node, the block producing node deletes the transaction information corresponding to the previous block in the transaction pool corresponding to the block producing node based on the block information of the previous block in the block acquisition request, so as to update the transaction pool corresponding to the block producing node; The block producing node generates a new block based on the transaction information in the transaction pool corresponding to the block producing node, and sends the new block to the proposing node; The proposing node executes each transaction information in the new block and writes the transaction results of each transaction information into the new block to obtain a block to be on-chain; The proposing node initiates a consensus process on the block to be chained in the blockchain network; In response to the block to be chained passing the consensus, the block to be chained is added to the blockchain.

2. The method according to claim 1, characterized in that The proposing node initiates a consensus process on the block to be put on the chain in the blockchain network, including: The proposing node sends the block to be chained to the multiple consensus nodes and the block-producing node, and the multiple consensus nodes, the proposing node and the block-producing node perform consensus processing on the block to be chained.

3. The method according to claim 1, characterized in that Also includes: For each node in the blockchain network, in response to the consensus height of the node being greater than or equal to a preset number of blocks, the node determines a new block-producing node from other nodes in the blockchain network except the block-producing node.

4. The method according to claim 3, characterized in that The node determines a new block-producing node from other nodes in the blockchain network except the block-producing node, including: The node determines the new block-producing node from among the other nodes based on a preset block-producing node sorting.

5. The method according to claim 3, characterized in that The node determines a new block-producing node from other nodes in the blockchain network except the block-producing node, including: The node obtains target random information; The node determines the new block generating node based on the distance between the target random information and the node information of other nodes.

6. The method according to claim 5, characterized in that The node obtains target random information, including: The node obtains a target historical block from the blockchain based on a preset block selection rule; The node determines the target random information based on the target historical block.

7. The method according to claim 1, characterized in that Also includes: In response to the proposing node not receiving the new block within a first preset time period, for each node in the blockchain network, the node determines a new block-producing node from other nodes in the blockchain network except the block-producing node; or, In response to the multiple consensus nodes not receiving the block to be chained within a second preset time period, for each node in the blockchain network, the node determines a new block-producing node from other nodes in the blockchain network except the block-producing node.

8. The method according to claim 3, characterized in that Also includes: The new block-producing node obtains transaction information that is not stored in the blockchain from the block-producing node, and stores the information in the transaction pool corresponding to the new block-producing node.

9. The method according to claim 1, characterized in that The blockchain network further includes: at least one candidate node; The proposing node initiates a consensus process on the block to be put on the chain in the blockchain network, including: The proposing node sends the block to be put on the chain to the multiple consensus nodes, and the multiple consensus nodes and the proposing node perform consensus processing on the block to be put on the chain.

10. The method according to claim 9, characterized in that The method further comprises: In response to the consensus height of the multiple consensus nodes and the proposing node being greater than or equal to a preset number of blocks, the multiple consensus nodes and the proposing node respectively determine a new block-producing node from the at least one candidate node.

11. The method according to claim 10, characterized in that The method further comprises: In response to the proposing node not receiving the new block within a first preset time period, for each node in the blockchain network, the node determines a new block-producing node from the at least one candidate node; or In response to the multiple consensus nodes not receiving the block to be chained within a second preset time period, for each node in the blockchain network, the node determines a new block-producing node from the at least one candidate node.

12. A transaction processing device based on blockchain, characterized in that: Applied to a blockchain network, the blockchain network includes: a block-producing node, a proposal node, and multiple consensus nodes. The block-producing node is used to generate blocks, the proposal node is used to request blocks from the block-producing node, execute transaction information in the block, initiate consensus on the block, and reach consensus on the block. Each consensus node is used to reach consensus on the block. The transaction pool corresponding to the block-producing node is in a working state, and the transaction pools of the proposal node and the multiple consensus nodes are all in a non-working state. The device includes: a transaction information sending module, configured to, in response to the proposing node and / or any consensus node among the plurality of consensus nodes receiving the transaction information, cause the proposing node and / or any consensus node to send the transaction information to the block producing node; The second transaction pool update module is configured to cause the block-producing node to update the transaction information into the transaction pool. The first transaction pool update module is configured to, in response to the block-producing node receiving the block acquisition request sent by the proposing node, delete the transaction information corresponding to the previous block in the transaction pool corresponding to the block-producing node based on the block information of the previous block in the block acquisition request, thereby updating the transaction pool corresponding to the block-producing node. A block generation module, configured for the block-producing node to generate a new block based on transaction information in the transaction pool corresponding to the block-producing node, and to send the new block to the proposing node; A transaction execution module, configured for the proposing node to execute each transaction information in the new block and write the transaction results of each transaction information into the new block to obtain a block to be on-chain; A consensus module, configured for the proposing node to initiate a consensus process on the block to be put on the chain in the blockchain network; The on-chain module is used to add the block to the blockchain in response to the block to be on-chain passing the consensus.

13. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute a computer program stored in the memory, and when the computer program is executed, implements the blockchain-based transaction processing method described in any one of claims 1 to 11.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the blockchain-based transaction processing method described in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Block-link data shrinking method and device and storage medium

    CN109324757A