Blockchain data transmission method, apparatus, device, storage medium, and program product

CN117097735BActive Publication Date: 2026-09-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210510064.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-11
Publication Date
2026-09-18
Estimated Expiration
2042-05-11

AI Technical Summary

Technical Problem

因此,对于节点而言,接收交易是至关重要的,没有足够的交易,如果节点是主节点,就可能会较难进行打包,如果没有足够的交易则很难保证打包交易的数量,会导致整体性能的降低

Benefits of technology

[0059]In this embodiment, the target participating node acquires transaction data; obtains a first master node, and based on the node selection type and the first master node, determines N associated master nodes from the participating node cluster; the first master node refers to a master node in the block generation state; N is less than the total number of participating nodes included in the participating node cluster; the N associated master nodes include a master node used to package and upload transaction data to the chain; the node selection type is used to indicate the changes in the master node in the block generation state; the transaction data is sent to the N associated master nodes so that the N associated master nodes can process the transaction data for on-chain processing. Through the above process, the transaction data is not broadcast to all nodes, but the broadcasting process of transaction data is optimized to broadcast the transaction data to some nodes, which can reduce the amount of transaction data transmitted, reduce the network space occupied by data transmission, thereby reducing the network communication complexity of the entire blockchain, improving the overall processing performance, and reducing the risk of network storms. Furthermore, the nodes to which transaction data is broadcast are determined based on the first master node in the block generation state. This ensures that the identified N associated master nodes are the nodes that are likely to package the data as soon as possible. In other words, by sending transaction data to nodes that may package transactions, the nodes that need to package transactions can obtain a sufficient amount of transaction data for packaging. This reduces the impact of network storms, ensures the performance of the blockchain in receiving and packaging transaction data, and thus improves the overall performance of the blockchain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117097735B_ABST
    Figure CN117097735B_ABST
Patent Text Reader

Abstract

Embodiments of the application disclose a blockchain data transmission method and device, equipment, a storage medium and a program product. The method comprises: a target participating node acquiring transaction data; acquiring a first master node, determining N associated master nodes from a participating node cluster based on a node selection type and the first master node; the first master node refers to a master node in a block generation state; N is a positive integer; N is less than the total number of nodes of participating nodes included in the participating node cluster; the N associated master nodes include a master node for packaging and chaining the transaction data; and the transaction data is sent to the N associated master nodes, so that the N associated master nodes perform chaining processing on the transaction data. By using the application, network storm can be reduced and blockchain performance can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and in particular to a blockchain data transmission method, apparatus, device, storage medium, and program product. Background Technology

[0002] In blockchain systems, regardless of the consensus algorithm used, the core lies in packaging transactions. Generally, transactions are placed in a transaction pool, and transaction packaging refers to the process of retrieving transactions from the pool and packaging them into a block or proposal. Therefore, receiving transactions is crucial for nodes. Without enough transactions, if a node is a master node, it may be difficult to package transactions, and insufficient transactions will make it difficult to guarantee the number of transactions packaged, leading to a decrease in overall performance. Therefore, to ensure the processing performance of the blockchain, nodes typically broadcast the received transactions to all nodes to ensure that each node can obtain a sufficient number of transactions. This process generates a large amount of data transmission, which may lead to network storms and increase the complexity of network communication. Summary of the Invention

[0003] This application provides a blockchain data transmission method, apparatus, device, storage medium, and program product, which can improve the efficiency of blockchain data transmission and reduce network communication complexity.

[0004] One embodiment of this application provides a blockchain data transmission method, the method comprising:

[0005] The target participating nodes acquire transaction data;

[0006] Obtain the first master node. Based on the node selection type and the first master node, determine N associated master nodes from the participating node cluster. The first master node refers to the master node in the block generation state. N is a positive integer. N is less than the total number of participating nodes included in the participating node cluster. The N associated master nodes include the master node used to package and upload transaction data to the chain. The node selection type is used to indicate the changes in the master nodes in the block generation state.

[0007] The transaction data is sent to N associated master nodes so that the N associated master nodes can process the transaction data on the blockchain.

[0008] One embodiment of this application provides a blockchain data transmission method, the method comprising:

[0009] The data acquisition module is used by the target participating nodes to acquire transaction data;

[0010] The node acquisition module is used to acquire the first master node;

[0011] The node determination module is used to determine N associated master nodes from the participating node cluster based on the node selection type and the first master node; the first master node refers to the master node in the block generation state; N is a positive integer; N is less than the total number of participating nodes included in the participating node cluster; the N associated master nodes include the master node used to package and upload transaction data to the chain; the node selection type is used to indicate the changes in the master node in the block generation state;

[0012] The data sending module is used to send transaction data to N associated master nodes so that the N associated master nodes can process the transaction data on the blockchain.

[0013] The device also includes:

[0014] The first on-chain module is used to generate a first initial block based on transaction data if the target participating node is in the block generation state, send the first initial block to the consensus node, and generate a first block to be on-chain based on the first initial block when the consensus node passes the consensus on the first initial block, and perform on-chain processing on the first block to be on-chain.

[0015] The state determination module is used to execute the process of obtaining the first master node if the target participating node is not in the block generation state.

[0016] The data acquisition module includes:

[0017] The transaction decoding unit is used by the target participating node to receive transaction messages sent by the business client, decode the transaction messages, and obtain the transaction data corresponding to the transaction messages.

[0018] The device also includes:

[0019] The data inspection module is used to inspect transaction data.

[0020] The transaction addition module is used to add the transaction data to the target transaction pool of the target participating node if the transaction data is valid, and then execute the process of obtaining the first master node.

[0021] The data detection module includes:

[0022] The signature detection unit is used to obtain the data signature associated with the transaction data and to detect the data signature; or...

[0023] The identity verification unit is used to obtain the identity information of the business client and verify that identity information; or,

[0024] The object detection unit is used to acquire transaction-related objects included in the transaction data, obtain the object information corresponding to the transaction-related objects in the transaction data, and detect the object information; or,

[0025] The duplicate detection unit is used to perform duplicate detection on transaction data.

[0026] Among them, the node selection types include node rotation type and node determination type;

[0027] This node defines the module, including:

[0028] A fixed node determination unit is used to determine the first master node in the participating node cluster as the associated master node if the node selection type is node determination type.

[0029] The rotating node determination unit is used to obtain the transaction data volume included in the target transaction pool of the target participating node if the node selection type is node rotation type, obtain the block storage space, determine the initial number of blocks based on the transaction data volume and block storage space, and determine N associated master nodes from the participating node cluster based on the first master node as the benchmark and the initial number of blocks.

[0030] The device also includes:

[0031] The adjacency acquisition module is used to acquire, in the participating node cluster, neighboring master nodes that have an adjacency relationship with the N associated master nodes if there is a network abnormal node among the N associated master nodes.

[0032] The node re-determination module is used to identify normal master nodes (excluding network abnormal nodes) and adjacent master nodes from N associated master nodes as candidate master nodes.

[0033] The transaction sending module is used to send transaction data to candidate master nodes so that the candidate master nodes can process the transaction data on the blockchain.

[0034] The data acquisition module includes:

[0035] The data receiving unit is used by the target participating node to receive transaction data sent by other participating nodes;

[0036] The device also includes:

[0037] The transaction processing module is used to perform data inspection on transaction data. If the transaction data is valid, it adds an unpacked state to the transaction data, adds a transaction timer to the transaction data, and adds the transaction data carrying the unpacked state and transaction timer to the target transaction pool of the target participating node.

[0038] The device also includes:

[0039] The second on-chain module is used to obtain the transaction data to be on-chain from the target transaction pool if the target participating node is in the block generation state, generate the second initial block based on the transaction data to be on-chain, send the second initial block to the consensus node, and generate the second block to be on-chain based on the second initial block when the consensus node passes the consensus on the second initial block, and perform on-chain processing on the second block to be on-chain.

[0040] The transaction pool update module is used to stop the timer carried by the transaction data to be uploaded to the blockchain and delete the transaction data to be uploaded to the blockchain from the target transaction pool if the transaction data to be uploaded to the blockchain carries a timer.

[0041] The device also includes:

[0042] The status update module is used to update the data status of the transaction data to be uploaded to the blockchain to the packaged state if consensus on the second initial block fails, and to re-add the transaction data to be uploaded to the target transaction pool.

[0043] The device also includes:

[0044] The status acquisition module is used to acquire the data status of the transaction data if the transaction timer times out.

[0045] The node triggering module is used to execute the process of obtaining the first master node if the data status of the transaction data is unpackaged.

[0046] The timed stop module is used to stop the transaction timer if the transaction data is in the packaged state.

[0047] The device also includes:

[0048] The block voting module is used to vote on the third initial block when the target participating node receives it from the second master node, and then send the voting results for the third initial block to the second master node; the second master node refers to the master node that generated the third initial block.

[0049] The block synchronization module is used to obtain the third block to be added to the chain corresponding to the third initial block if it is determined that the consensus on the third initial block has been passed, and to synchronize the third block to be added to the chain.

[0050] The transaction pool update module is also used to obtain the voted transaction data included in the third block to be added to the chain, and to delete the voted transaction data in the target transaction pool of the target participating node.

[0051] The device also includes:

[0052] The status update module is also used to obtain the voted transaction data included in the third initial block if it is determined that the consensus on the third initial block has failed, and update the data status of the voted transaction data to the packaged status.

[0053] The transaction re-add module is used to re-add voted transaction data to the target transaction pool based on the transaction packaging order of the target transaction pool.

[0054] One embodiment of this application provides a computer device, including a processor, a memory, and an input / output interface;

[0055] The processor is connected to a memory and an input / output interface, respectively. The input / output interface is used to receive and output data, the memory is used to store computer programs, and the processor is used to call the computer programs so that the computer device containing the processor executes the blockchain data transmission method in one aspect of the embodiments of this application.

[0056] One aspect of this application provides a computer-readable storage medium storing a computer program adapted to be loaded and executed by a processor, so that a computer device having the processor performs the blockchain data transmission method of one aspect of this application.

[0057] One aspect of this application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various optional embodiments of this application.

[0058] Implementing the embodiments of this application will have the following beneficial effects:

[0059] In this embodiment, the target participating node acquires transaction data; obtains a first master node, and based on the node selection type and the first master node, determines N associated master nodes from the participating node cluster; the first master node refers to a master node in the block generation state; N is less than the total number of participating nodes included in the participating node cluster; the N associated master nodes include a master node used to package and upload transaction data to the chain; the node selection type is used to indicate the changes in the master node in the block generation state; the transaction data is sent to the N associated master nodes so that the N associated master nodes can process the transaction data for on-chain processing. Through the above process, the transaction data is not broadcast to all nodes, but the broadcasting process of transaction data is optimized to broadcast the transaction data to some nodes, which can reduce the amount of transaction data transmitted, reduce the network space occupied by data transmission, thereby reducing the network communication complexity of the entire blockchain, improving the overall processing performance, and reducing the risk of network storms. Furthermore, the nodes to which transaction data is broadcast are determined based on the first master node in the block generation state. This ensures that the identified N associated master nodes are the nodes that are likely to package the data as soon as possible. In other words, by sending transaction data to nodes that may package transactions, the nodes that need to package transactions can obtain a sufficient amount of transaction data for packaging. This reduces the impact of network storms, ensures the performance of the blockchain in receiving and packaging transaction data, and thus improves the overall performance of the blockchain. Attached Figure Description

[0060] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0061] Figure 1a This is a network interaction architecture diagram for blockchain data transmission provided in an embodiment of this application;

[0062] Figure 1b This is another network interaction architecture diagram for blockchain data transmission provided in the embodiments of this application;

[0063] Figure 2 This is a schematic diagram of a blockchain data transmission scenario provided in an embodiment of this application;

[0064] Figure 3 This is a flowchart illustrating a blockchain data transmission method provided in an embodiment of this application;

[0065] Figure 4 This is a schematic diagram of a node determination scenario provided in an embodiment of this application;

[0066] Figure 5 This application provides a schematic diagram of a client data processing flow.

[0067] Figure 6 This is a schematic diagram of a node data processing flow provided in an embodiment of this application;

[0068] Figure 7 This is a consensus interaction flowchart provided in an embodiment of this application;

[0069] Figure 8 This is a schematic diagram of a blockchain data transmission device provided in an embodiment of this application;

[0070] Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0071] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0072] First, the blockchain, block, chain, and consensus mechanism mentioned in the embodiments of this application will be introduced.

[0073] 1. Blockchain: In a narrow sense, blockchain is a chain-like data structure with blocks as the basic unit. Blocks use digital digests to verify previous transaction history, making it suitable for the tamper-proof and scalable requirements of distributed ledger scenarios. In a broader sense, blockchain also refers to the distributed ledger technology implemented using the blockchain structure, including distributed consensus, privacy and security protection, peer-to-peer communication technology, network protocols, and smart contracts. The goal of blockchain is to realize a distributed data record ledger that only allows additions, not deletions. The underlying basic structure of the ledger is a linear linked list. The linked list consists of a series of "blocks," with each subsequent block recording the hash value of the previous block. The validity of each block (and the transactions within it) can be quickly verified by calculating the hash value. If a node in the network proposes to add a new block, the block must be confirmed through a consensus mechanism.

[0074] 2. Block: A block records all transactions and state results that occur within a certain period of time, representing a consensus on the current state of the ledger. Specifically, for a blockchain, each time data is written—that is, the transaction process described above—a block is created.

[0075] 3. Chain: A chain is a sequence of blocks linked together in chronological order, serving as a log record of all changes in the ledger's state.

[0076] 4. Consensus Mechanism: Through voting by special nodes, the verification and confirmation of transactions are completed in a very short time, with the goal of ensuring that all honest nodes maintain a consistent blockchain diagram.

[0077] Specifically, a blockchain consists of blocks, each of which comprises two parts: a block header and a block body. The block header includes a timestamp, the current hash value, and the predecessor hash value. The timestamp records when the block was generated; the current hash value is the hash value of the block; the predecessor hash value is the hash value of the block's predecessor; and the block body contains the transaction information stored in the block.

[0078] If this application requires the collection of object data (such as user data), a prompt interface or pop-up window will be displayed before and during the collection process. This prompt interface or pop-up window will inform the user that XXXX data is currently being collected. In other words, the prompt interface or pop-up window may indicate what data is being collected or what purpose the collected data will be used for. The data acquisition process will only begin after the user confirms the prompt interface or pop-up window; otherwise, it will end. Furthermore, the acquired user data will be used in reasonable and legal scenarios or for legitimate purposes, and the use of user data will comply with relevant legal regulations. Optionally, in scenarios where user data needs to be used but user authorization has not been obtained, authorization can be requested from the user, and the user data will only be used after authorization is granted.

[0079] In the embodiments of this application, please refer to Figure 1a , Figure 1a This is a network interaction architecture diagram for blockchain data transmission provided in an embodiment of this application. The network can be considered a blockchain network, which may include a witness network 101 and a consensus network 102, etc. That is, the blockchain network can be considered a multi-layered chain structure, divided into a witness network 101 and a consensus network 102. Optionally, the witness network 101 and the consensus network 102 can interact through a routing proxy layer. The witness network 101 may include at least two first-type nodes. The number of these at least two first-type nodes is determined by the deployment of the witness network 101 and is not limited. For example, the at least two first-type nodes may be as follows: Figure 1aAs shown, nodes of type 10a, 10b, 10c, 10d, 10e, 10f, 10g, and 10h can interact with each other. The consensus network 102 can include at least two second-type nodes. The number of these second-type nodes is determined by the deployment of the consensus network 102 and is not limited. These second-type nodes can be participating nodes; for example, the at least two second-type nodes can be... Figure 1a As shown, participating nodes such as 10i, 10j, 10k, 10m, 10n, 10p, 10q, and 10r can interact with each other. Specifically, the first type of node in witness network 101 can interact with participating nodes in consensus network 102, business nodes in witness network 101 can access consensus network 102 to synchronize data, and participating nodes in consensus network 102 can send data to witness network 101. Optionally, the first type of node in witness network 101 can access consensus network 102 through a routing proxy layer, and participating nodes in consensus network 102 can send messages to witness network 101 through the routing proxy layer.

[0080] In this witness network 101, the first type of node is used for business execution and can obtain block header data and partially authorized visible block data from the consensus network 102 through identity authentication and other methods. Optionally, this first type of node can be a Simplified Payment Verification (SPV) node or other lightweight nodes. Participating nodes in the consensus network 102 can reach consensus on blocks and upload them to the chain, transmit transaction data, or send data to the first type of node in the witness network 101. Optionally, the witness network 101 and the consensus network 102 can be in the same network environment, such as both being in a consortium network; or, the witness network 101 and the consensus network 102 can be in different network environments, such as the witness network 101 being in a public network and the consensus network 102 being in a private network, etc., without any restrictions. Optionally, when consensus network 102 is located in a private network, data interaction is secured by the consensus mechanism within consensus network 102, eliminating the need for additional identity management and network control. However, to enhance data security, further security verification, such as identity management and network control, can be implemented for data interaction within consensus network 102. Optionally, the network environment in which consensus network 102 operates can be disregarded when implementing further security verification, such as identity management and network control, for data interaction within consensus network 102; no restrictions are imposed here. Optionally, participating nodes in consensus network 102 can detect the behavior of first-type nodes and other possible nodes accessing consensus network 102 to improve the security of data access in the blockchain network. Optionally, first-type nodes can receive transaction data sent by business clients, determine N associated master nodes from at least two second-type nodes, and send the transaction data to the N associated master nodes. Optionally, at least two second-type nodes can be considered as a participating node cluster.

[0081] Optional, see below Figure 1b , Figure 1b This is another network interaction architecture diagram for blockchain data transmission provided in this application embodiment. For example... Figure 1b As shown, the blockchain network 103 may include at least two participating nodes, for example... Figure 1bIn this context, participating nodes include 1031, 1032, and 1033. Optionally, any participating node can obtain transaction data, determine N associated master nodes from at least two participating nodes, and broadcast the transaction data to the N associated master nodes, where N is a positive integer. N can be limited to be less than the total number of participating nodes in the participating node cluster. Optionally, N can be further limited to be less than or equal to a node number threshold. This node number threshold can be considered as the maximum number of nodes obtained by expanding the cluster beyond the master nodes that package and upload transaction data, after fault tolerance processing. This allows for a certain degree of fault tolerance while reducing the amount of data that needs to be sent, thereby improving the efficiency of data processing in the blockchain network.

[0082] like Figures 1a to 1b As shown, a blockchain network can be considered to include a cluster of participating nodes, which consists of at least two participating nodes. The target participating node mentioned in this application can be any one of the at least two participating nodes included in the blockchain network. Optionally, among the at least two participating nodes, the participating node currently in the block generation state can be considered the target master node. Here, the target master node can be considered an indicative name used to indicate the participating node (or master node) currently in the block generation state, and does not refer to a specific physical participating node. That is, the participating node indicated by the target master node may change. Optionally, each participating node can include a transaction pool, which is used to store the transaction data received by the corresponding participating node.

[0083] For details, please refer to Figure 2 , Figure 2 This is a schematic diagram of a blockchain data transmission scenario provided in an embodiment of this application. For example... Figure 2As shown, target participating node 201 can obtain transaction data and identify the first master node. This first master node refers to the master node currently in the block generation state; that is, this first master node is the target master node at this time. The block generation state refers to a state where blocks can be generated. Target participating node 201 can determine N associated master nodes from the participating node cluster based on the first master node and the node selection type. N is a positive integer, less than the total number of participating nodes in the participating node cluster. Since these N associated master nodes are determined based on the first master node, which is currently in the block generation state, the selected N associated master nodes are those that will be packaged and uploaded to the chain as quickly as possible. This ensures that nodes requiring transaction packaging can obtain the currently generated transaction data, meaning they can obtain enough transaction data for packaging, guaranteeing the number of transactions packaged, thus ensuring the normal operation of the blockchain and improving its overall performance. Simultaneously, target participating node 201 will select a portion of the participating nodes from the participating node cluster as associated master nodes.

[0084] Optionally, the participating node cluster may include at least two participating nodes, such as Figure 2 As shown, participating nodes 20a, 20b, 20c, and 20d, etc., may have transactions that need to be packaged and uploaded to the chain before this transaction data. As the master node in the block generation state changes, the master node that packages and uploads the transaction data may not be the first master node. In other words, the N associated master nodes may or may not include the first master node.

[0085] For example, assuming the first master node is participant node 20b, and the transaction data previously had no transactions that needed to be packaged and uploaded to the chain, or had very few transactions that needed to be packaged and uploaded to the chain (e.g., the number was less than the block storage space, or less than the sum of the block storage space and the fault tolerance range, etc.), then the N associated master nodes are identified, possibly including participant node 20b and participant node 20c, etc. The target participant node 201 can send the transaction data to the N associated master nodes, such as participant node 20b and participant node 20c, etc., that is, taking the first master node as an example among the N associated master nodes. Further optionally, upon receiving the transaction data, participant node 20b can generate an initial block based on the transaction data, and after the initial block consensus is passed, update the initial block to obtain block 202 to be uploaded to the chain, and add block 202 to be uploaded to the chain to the blockchain 203 maintained by participant node 20b. Optionally, if participating node 20b malfunctions, the other related master nodes among the N related master nodes (excluding the first master node, i.e., participating node 20b) can process the transaction data on the blockchain. Alternatively, a master node that is adjacent to the first master node can be selected from the N related master nodes, and this master node that is adjacent to the first master node can process the transaction data on the blockchain.

[0086] In other words, instead of broadcasting transaction data to all participating nodes, it is only broadcast to the selected N associated master nodes. This reduces the number of objects that need to be broadcast to (i.e., the number of associated master nodes), thereby reducing the amount of data transmitted in the blockchain network, reducing network space usage, reducing network bandwidth usage, and thus reducing the risk of network storms and the overall network communication complexity of the blockchain.

[0087] It is understood that the participating node mentioned in the embodiments of this application can be a computer device, including but not limited to terminal devices or servers. In other words, the computer device can be a server or a terminal device, or a system composed of servers and terminal devices. The terminal device mentioned above can be an electronic device, including but not limited to mobile phones, tablets, desktop computers, laptops, PDAs, in-vehicle devices, augmented reality / virtual reality (AR / VR) devices, head-mounted displays, wearable devices, smart speakers, digital cameras, webcams, and other mobile internet devices (MIDs) with network access capabilities. The server mentioned above can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, vehicle-to-everything (V2X) communication, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0088] Optionally, this application may also use cloud storage technology to manage data generated in the blockchain network. Cloud storage is a new concept that is extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology and distributed storage file systems to bring together a large number of storage devices of various types in the network (storage devices are also called storage nodes) to work together through application software or application interfaces to jointly provide data storage and business access functions to the outside world.

[0089] Further, please see Figure 3 , Figure 3 This is a flowchart illustrating a blockchain data transmission method provided in an embodiment of this application. Figure 3 As shown, in Figure 3 In the described method embodiment, the blockchain data transmission process includes the following steps:

[0090] Step S301: The target participating node obtains transaction data.

[0091] In this embodiment, the target participating node can be any node in the blockchain network, and this target participating node can obtain transaction data. Optionally, the target participating node can receive transaction data sent by a business client; or, the target participating node can receive transaction data sent by other participating nodes, etc., without limitation. When the target participating node receives transaction data sent by a business client, it is equivalent to the business client generating transaction data, which can be sent to any node in the blockchain network. The node receiving the transaction data sent by the business client can be called the target participating node. When the target participating node receives transaction data sent by other participating nodes, it can be assumed that when the other participating nodes receive the transaction data, based on the master node in the block generation state, they determine N associated master nodes in the participating node cluster, where N is a positive integer and less than the total number of participating nodes included in the participating node cluster. At this time, the target participating node is included among the N associated master nodes determined by the other participating nodes. The other participating nodes broadcast the transaction data to the N associated master nodes determined by the other participating nodes, and the target participating node can receive the transaction data sent by the other participating nodes.

[0092] Optionally, the target participating node can obtain the transaction message, decode it, and obtain the corresponding transaction data. Specifically, the data type of the transaction message can be considered a type used for transmission in the network. The target participating node can deserialize the transaction message to decode it and obtain the corresponding transaction data. Optionally, the transaction data can be considered a transaction to be added to the blockchain network. The content of the transaction data can be determined by the blockchain network and specific transaction-related data, such as contract methods, contract names, contract parameters, and other related fields; or, assuming the transaction is a two-party transaction, the transaction data can include recipient information, sender information, transaction objects (such as virtual resources or game resources), and transaction conditions, etc., without limitation. Of course, where possible, the target participating node can directly obtain the transaction data.

[0093] Optionally, the target participating node can perform data inspection on the transaction data. If the transaction data is valid, it can be added to the target participating node's target transaction pool, triggering step S302. If the transaction data is invalid, it can be discarded. Optionally, a transaction exception message can also be sent to the device that sent the transaction data (such as a business client or other participating nodes). Optionally, if the target participating node is in the block generation state, it can perform a transaction consensus process. Specifically, it can generate a first initial block based on the transaction data, send the first initial block to the consensus node, and when the consensus node passes consensus on the first initial block, generate a first block to be added to the chain based on the first initial block and perform on-chain processing on the first block to be added to the chain; or, it can send the transaction data to the consensus node, and when the consensus node passes consensus on the transaction data, generate a first block to be added to the chain based on the transaction data and perform on-chain processing on the first block to be added to the chain, etc. In other words, during any transaction consensus process in this application, when consensus is reached on the data to be added to the blockchain, a block can be generated based on the data to be added to the blockchain, and the block generated from the data to be added to the blockchain can be processed for blockchain addition; alternatively, an initial block can be generated based on the data to be added to the blockchain first, and when consensus is reached on the initial block, the initial block can be updated to obtain the block to be added to the blockchain, and the block to be added to the blockchain can be processed for blockchain addition, etc. Further, if the target participating node is not in the block generation state, that is, the target participating node cannot currently package transactions, then step S302 can be triggered. Optionally, the target participating node can add transaction data to the target transaction pool of the target participating node, obtain a target transaction set from the target transaction pool, the target transaction set can include M transactions, where M is a positive integer, the target participating node can conduct a transaction consensus process on the target transaction set, and when consensus is reached on the target transaction set, a block to be added to the blockchain can be generated from the target transaction set, and the block to be added to the blockchain can be processed for blockchain addition, etc. Optionally, before the process of adding transaction data to the target transaction pool of the target participating node or before the transaction consensus process, the transaction data can be checked. If the transaction data is valid, the subsequent process can be executed.

[0094] When performing data detection on transaction data, the target participating node can use d out of h data detection methods to detect the transaction data, where h is a positive integer and d is a positive integer less than or equal to h. That is, d data detection methods are any d out of h data detection methods. If all d data detection methods successfully detect the transaction data, the transaction data is determined to be legal data; if any one of the d data detection methods fails to detect the transaction data, the transaction data is determined to be illegal data. The h data detection methods include, but are not limited to, the following: (1) Obtain the data signature associated with the transaction data and detect the data signature. Specifically, the device public key of the business client that generated the transaction data can be obtained, and the data signature can be verified using the device public key. If the verification fails, it is determined that the data signature detection of the transaction data has failed, and the transaction data can be determined to be illegal data; if the verification is successful, it is determined that the data signature detection of the transaction data has been successful. (2) Obtain the identity information of the business client and detect the identity information. If the identity information is verified, the transaction data detection using the identity information is successful; if the identity information is verified, the transaction data detection using the identity information is unsuccessful, and the transaction data is determined to be illegal. (3) Obtain the transaction-related objects included in the transaction data, obtain the object information corresponding to the transaction-related objects in the transaction data, and detect the object information. The transaction-related object refers to the object involved in the transaction data. For example, if the transaction data is a two-party transaction, the transaction-related object may include the recipient object and the sender object, etc. Further, if the object information is verified, the transaction data detection using the object information is successful; if the object information is verified, the transaction data detection using the object information is unsuccessful, and the transaction data is determined to be illegal. (4) Perform duplicate detection on the transaction data. If duplicate data is detected in the transaction data, the duplicate detection of the transaction data is unsuccessful, and the transaction data is determined to be illegal; if duplicate data is detected, the duplicate detection of the transaction data is successful, etc.

[0095] The above are just a few examples of possible data detection methods for transaction data. They can be updated as needed, such as adding new data detection methods, changing existing data detection methods, or deleting some existing data detection methods. No restrictions are placed on this.

[0096] Step S302: Obtain the first master node. Based on the node selection type and the first master node, determine N associated master nodes from the participating node cluster.

[0097] In this embodiment, the target participating node can obtain a first master node. Based on the node selection type and the first master node, N associated master nodes are determined from the participating node cluster. The first master node refers to the master node in the block generation state, that is, at this time, the first master node is the target master node, and N is less than the total number of participating nodes included in the participating node cluster. Among these N associated master nodes, there are master nodes used for packaging and uploading transaction data to the blockchain. Optionally, these N associated master nodes may also include fault-tolerant master nodes based on the master nodes that package and upload transaction data to the blockchain, so that when a master node malfunctions during the transaction packaging process, the master node that actually packages and uploads the transaction data can still receive the transaction data. The node selection type is used to indicate the change of the master node in the block generation state. Simply put, it is used to indicate whether the node indicated by the target master node will change. Optionally, the associated master node determined by the target participating node can be recorded as the first associated master node, and the associated master node determined by other participating nodes can be recorded as the second associated master node. The node selection type can include node rotation type and node determination type. The node rotation type refers to the type in which the target master node indicated by the consensus algorithm will change. For example, the target master node for generating block height 1 is participating node 1, and the target master node for generating block height 2 can be participating node 2, etc. The node determination type refers to the type in which the target master node indicated by the consensus algorithm will not be rotated. That is, when the participating node corresponding to the target master node becomes abnormal, the next participating node will be selected from the participating node cluster as the target master node. For example, if participating node 1 is the target master node, and participating node 1 does not become abnormal, all blocks generated in the blockchain network can be considered to have been generated by participating node 1.

[0098] For details, please refer to Figure 4 , Figure 4 This is a schematic diagram of a node determination scenario provided in an embodiment of this application. For example... Figure 4 As shown, the target participating node 401 can determine N associated master nodes from the participating node cluster 402, which may include the target participating node 401. Specifically, based on the node selection type and the first master node 403, N associated master nodes are determined from the participating node cluster 402.

[0099] Optionally, in one scenario ①, if the node selection type is a node-determined type, then the first master node 403 in the participating node cluster 402 is determined as the associated master node. In this case, the number of associated master nodes is less than the total number of participating nodes included in the participating node cluster. Optionally, if the node selection type is a node-determined type, then the supporting master node selected by the target participating node 401 can be determined from the participating node cluster 402. The first master node and supporting master node in the participating node cluster 402 are determined as associated master nodes. In this case, the number of the first master node and supporting master nodes is N, where N is less than the total number of participating nodes included in the participating node cluster. The supporting master node refers to the next master node that the target participating node 401 might select for transaction packaging if the first master node 403 malfunctions. In this case, the N associated master nodes include the first master node.

[0100] Optionally, if the first master node 403 experiences a network anomaly, i.e., cannot interact with the other participating nodes in the participating node cluster 402, a new master node in the block generation state can be elected, which is the newly elected target master node, and the new master node is determined as the associated master node.

[0101] In scenario ②, if the node selection type is node rotation, the transaction data volume included in the target transaction pool of the target participating node 401 is obtained, and the block storage space is acquired. Based on the transaction data volume and the block storage space, the initial number of blocks is determined. Taking the first master node 403 as a benchmark, N associated master nodes 404 are determined from the participating node cluster 402 based on the initial number of blocks. N is less than the total number of participating nodes included in the participating node cluster. Optionally, the target participating node 401 can obtain the stored transaction data volume. Specifically, each participating node in the blockchain network can maintain a transaction storage variable. For each transaction received in the blockchain network, the value of the transaction storage variable is incremented by one to obtain a first changed value, and the first changed value of the transaction storage variable is synchronized to each participating node. For each block added to the blockchain network, the value of the transaction storage variable is subtracted from the number of transactions included in the added block to obtain a second changed value, and the second changed value of the transaction storage variable is synchronized to each participating node. The target participating node 401 can obtain the current value of the transaction storage variable as the transaction data volume. Specifically, the target participating node 401 can obtain the node rotation order corresponding to the consensus algorithm. Based on the first master node 403, and the initial number of blocks and the node rotation order, it determines N associated master nodes 404 from the participating node cluster 402. Here, the block storage space refers to the number of transactions that can be accommodated in a block, and the node rotation order refers to the transformation order of blocks in the block generation state under this consensus algorithm, such as a continuous rotation order or an interval rotation order, etc., which is not limited here. The number of intervals in the interval rotation order can be determined according to the consensus algorithm. Specifically, the target participating node 401 can obtain the node identifier of the first master node 403, and determine an initial identifier range based on the node identifier of the first master node 403 and the initial number of blocks. Based on the initial identifier range, N associated master nodes 404 are determined from the participating node cluster 402. Optionally, a fault tolerance range can be added to the initial identifier range to obtain a target identifier range. The participating nodes in the participating node cluster 402 corresponding to the target identifier range are then determined as N associated master nodes 404.

[0102] Optionally, N can be less than or equal to the node number threshold. For example, the node number threshold can be determined based on the fault tolerance range, such as doubling the fault tolerance range, or expanding the number based on the fault tolerance range to obtain the node number threshold. That is, based on the theoretically used master node for packaging and uploading transaction data to the chain, fault tolerance processing is performed before and after to obtain N associated master nodes. Through this process, when a master node malfunctions during the transaction packaging process in the blockchain network, the master node that actually packages and uploads the transaction data can still receive the transaction data, thereby ensuring the normal operation of transaction packaging in the blockchain network and improving the performance of the blockchain network. For example, assuming that theoretically participating node 3 should package and upload the transaction data to the blockchain, and based on participating node 3, perform fault tolerance processing before and after, assuming that N related master nodes are obtained, including participating node 1, participating node 2, participating node 3, participating node 4, and participating node 5, where participating node 2 experiences an anomaly while packaging the transaction, causing the transaction that should theoretically be packaged and uploaded to the blockchain by participating node 2 to be postponed to participating node 3, and the transaction (including transaction data) that should theoretically be packaged and uploaded to the blockchain by participating node 3 to be postponed to participating node 4. Through the aforementioned fault tolerance processing for participating node 3, participating node 4 can also receive the transaction data and can directly package and upload the transaction data to the blockchain, ensuring the normal operation of transaction packaging.

[0103] For example, assuming the node rotation order is consecutive, the next master node after the first master node refers to the participating node in participating node cluster 402 that is immediately following the first master node. For instance, assuming the first master node is L1, the next master node could be L2, etc. Assuming the block storage space is c, the transaction data volume is k, where c is a positive integer and k is a natural number, and the first master node 403 is L... i The target participating node 401 can obtain the node identifier (i.e., L) of the first master node 403. i Based on the node identifier of the first master node 403 and the initial block count, the initial identifier range is determined. The initial block count can be expressed as (k / c), meaning the ratio of transaction data volume to block storage space can be used to determine the initial block count. This initial block count represents the minimum number of blocks required to package all transactions included in the target transaction pool. Optionally, the target identifier range can be expressed as L. xThe threshold for the number of nodes is {i+(k / c)-b}≤x≤{i+(k / c)+b}, i.e., x=[i+(k / c)-b,i+(k / c)+b]. Optionally, this threshold can be 2b or (2b+1), etc. The transactions in this target transaction pool require at least the initial number of blocks (i.e., k / c). In other words, if transaction data needs to be packaged, normally, the primary node (403) is used as the base, and the primary nodes following the node corresponding to the initial number of blocks are rotated to package the transactions. Theoretically, this transaction data is packaged by the node identified as L. {i+(k / c)} The primary nodes are packaged and uploaded to the blockchain, where b refers to the fault tolerance range, which is a positive integer. Optionally, the target participating node 401 can add a fault tolerance range to the initial identifier range to obtain the target identifier range. This expands the range of primary nodes that need to send transactions to a certain extent while reducing the number of primary nodes that need to send transactions. This ensures that even if consensus cannot be reached in a certain round, or if an anomaly occurs in the block being packaged during a certain round of consensus, there are still a certain number of nodes storing transactions that need to be packaged, thereby improving the fault tolerance of the blockchain network and improving the overall performance of the blockchain network. Further, the participating nodes corresponding to the target identifier range in the participating node cluster 402 are determined as N associated primary nodes 404. Optionally, if transaction packaging starts from the first primary node, the ratio of transaction data volume to block storage space can be rounded down to obtain the initial number of blocks; if transaction packaging starts from the next primary node after the first primary node, the ratio of transaction data volume to block storage space can be rounded up to obtain the initial number of blocks. Transaction packaging refers to packaging transactions and uploading them to the blockchain. Optionally, all participating master nodes can be considered to be cyclical. For example, assuming there are d participating nodes, where d is a positive integer, if the maximum boundary of the target identifier range exceeds the total number of nodes, the node rotation can be restarted. Based on the node rotation, N associated master nodes corresponding to the target identifier range are determined from the participating node cluster. Optionally, the probability of abnormal nodes in the blockchain network and the total number of participating nodes can be obtained. The fault tolerance range can be determined based on the probability of abnormal nodes and the total number of nodes; or, the fault tolerance range submitted by business objects (i.e., business personnel, etc.) can be directly obtained, without restriction.

[0104] Optionally, if there is a network-abnormal node among the N associated master nodes, then in the participating node cluster, neighboring master nodes that are adjacent to the N associated master nodes are obtained based on the network-abnormal node. Specifically, the node relationships between the participating nodes in the participating node cluster can be determined based on the consensus algorithm. Based on the node relationships and the network-abnormal node, neighboring master nodes that are adjacent to the N associated master nodes are obtained. That is, the adjacency relationship refers to the node relationship of adjacent order in packaging transactions. For example, if participating node 1 generates a block with a block height of 1 and participating node 2 generates a block with a block height of 2, then participating node 1 and participating node 2 can be considered to have an adjacency relationship. That is, this neighboring master node can be considered as the master node that packages transactions after the N associated master nodes. The normal master nodes and neighboring master nodes among the N associated master nodes, excluding the network-abnormal node, are determined as candidate master nodes. Transaction data is sent to the candidate master nodes so that the candidate master nodes can process the transaction data on the chain.

[0105] Optionally, it can also be considered that if there is a network abnormal node among the N associated master nodes, then in the participating node cluster, the adjacent master nodes that have an adjacency relationship with the N associated master nodes are obtained based on the network abnormal node; the normal master nodes and adjacent master nodes other than the network abnormal node among the N associated master nodes are re-determined as the N associated master nodes, and step S303 is executed.

[0106] Step S303: Send the transaction data to N associated master nodes so that the N associated master nodes can process the transaction data on the blockchain.

[0107] In this embodiment, the target participating node can broadcast transaction data to N associated master nodes, enabling the N associated master nodes to process the transaction data on the blockchain. Optionally, since there may be transactions that need to be packaged and uploaded to the blockchain before the transaction data is sent, the transaction data may not be uploaded to the blockchain in real time. For example, assuming the block storage space is 2, that is, a block can include 2 transactions, and there are historical transaction data 1, historical transaction data 2 and historical transaction data 3 before the transaction data (that is, the transaction data volume is 3), where the first master node is participating node 2, the target identifier range can be obtained as [2+(3 / 2)-b, 2+(3 / 2)+b]=[3-b, 3+b]. Assuming b is 2, the target identifier range is [1, 5]. At this time, the N associated master nodes include participating node 1 to participating node 5. Specifically, participating node 2 can package and upload historical transaction data 1 and historical transaction data 2 to the blockchain, and participating node 3 can package and upload historical transaction data 3 and transaction data to the blockchain. In other words, among the N associated master nodes, there is a master node (referring to participating node 3) used for packaging and uploading transaction data to the blockchain. Optionally, if participating node 3 malfunctions during the process of packaging and uploading historical transaction data 3 and transaction data to the blockchain—in other words, if the master node theoretically used for packaging and uploading transaction data to the blockchain among the N associated master nodes malfunctions—then the master node adjacent to the master node theoretically used for packaging and uploading transaction data to the blockchain will process the transaction data for uploading to the blockchain. That is, participating node 4 will package and upload historical transaction data 3 and transaction data to the blockchain.

[0108] In this embodiment, the target participating node acquires transaction data; obtains a first master node, and based on the node selection type and the first master node, determines N associated master nodes from the participating node cluster; the first master node refers to a master node in the block generation state; the N associated master nodes include a master node used to package and upload transaction data to the chain; the node selection type is used to indicate the changes in the master node in the block generation state; and the transaction data is sent to the N associated master nodes so that the N associated master nodes can process the transaction data for on-chain processing. Through the above process, the transaction data is not broadcast to all nodes, but the broadcasting process is optimized to broadcast the transaction data to some nodes, which can reduce the amount of transaction data transmitted, reduce the network space occupied by data transmission, thereby reducing the network communication complexity of the entire blockchain, improving the overall processing performance, and reducing the risk of network storms. Furthermore, the nodes to which transaction data is broadcast are determined based on the first master node in the block generation state. This ensures that the identified N associated master nodes are the nodes that are likely to package the data as soon as possible. In other words, by sending transaction data to nodes that may package transactions, the nodes that need to package transactions can obtain a sufficient amount of transaction data for packaging. This reduces the impact of network storms, ensures the performance of the blockchain in receiving and packaging transaction data, and thus improves the overall performance of the blockchain.

[0109] Further, please see Figure 5 , Figure 5 This is a schematic diagram of a client data processing flow provided in an embodiment of this application. Specifically, taking the example of a target participating node obtaining transaction data from a business client, the process may include the following steps:

[0110] Step S501: Obtain transaction data.

[0111] In this embodiment, the target participating node can receive transaction data sent by the business client. Alternatively, the target participating node can receive a transaction message sent by the business client, decode the transaction message, and obtain the transaction data corresponding to the transaction message. See details below. Figure 3 The specific description shown in step S301 is as follows.

[0112] Step S502: Verify the legality of the transaction data.

[0113] In this embodiment, the target participating node can perform data inspection on the transaction data. If the transaction data is valid, step S503 is executed; if the transaction data is invalid, step S506 is executed. Specifically, this data inspection process can be found in [link to relevant documentation]. Figure 3 The relevant descriptions in step S301 will not be repeated here.

[0114] Step S503: Place the transaction into the target transaction pool of the target participating node.

[0115] In this embodiment, the target participating node can add the transaction data to its target transaction pool. Further, step S504 is executed to obtain a first master node, and based on the first master node and the node selection type, N associated master nodes are determined. Optionally, if the target participating node is in a block generation state, a target transaction set is obtained from the target transaction pool. When consensus on the target transaction set is passed, a block to be added to the blockchain is generated from the target transaction set and processed for blockchain addition. If the target participating node is not in a block generation state, step S504 is executed.

[0116] Step S504: Determine N associated master nodes.

[0117] In this embodiment, the target participating node can obtain a first master node, and based on the first master node and the node selection type, determine N associated master nodes from the participating node cluster. See details below. Figure 3 The specific description of step S302 will not be repeated here.

[0118] Step S505: Broadcast the transaction data to N associated master nodes.

[0119] In this embodiment of the application, the target participating node can broadcast the transaction data to N associated master nodes.

[0120] Optionally, if there are network-abnormal nodes among the N associated master nodes (i.e., nodes that cannot connect or whose network communication has failed), then in the participating node cluster, neighboring master nodes that are adjacent to the N associated master nodes can be obtained based on the network-abnormal nodes. The normal master nodes (excluding the network-abnormal nodes) and their neighboring master nodes are then re-determined as the N associated master nodes, and the transaction data is broadcast to these N associated master nodes. These neighboring master nodes are essentially nodes that are sequentially sent to the initially obtained N associated master nodes.

[0121] Step S506: Discard transaction data.

[0122] In this embodiment of the application, the target participating node may discard the transaction data, and optionally, may also send a transaction exception message to the business client.

[0123] Further optional, please see Figure 6 , Figure 6 This is a schematic diagram of a node data processing flow provided in an embodiment of this application. Specifically, taking the example of a target participating node obtaining transaction data from other participating nodes, the process may include the following steps:

[0124] Step S601: Obtain transaction data.

[0125] In this embodiment, the target participating node can receive transaction data sent by other participating nodes. Alternatively, the target participating node can receive transaction messages sent by other participating nodes, decode the transaction messages, and obtain the transaction data corresponding to the transaction messages. See details in [link to relevant documentation]. Figure 3 The specific description shown in step S301 is as follows.

[0126] Step S602: Verify the legality of the transaction data.

[0127] In this embodiment, the target participating node can perform data inspection on the transaction data. If the transaction data is valid, step S603 is executed; if the transaction data is invalid, step S606 is executed. Specifically, this data inspection process can be found in [reference needed]. Figure 3 The relevant descriptions in step S301 will not be repeated here.

[0128] Step S603: Add an unpacked status to the transaction data.

[0129] In this embodiment, the target participating node can add an unpackaged state to the transaction data. The data state of the transaction data indicates whether it has been broadcast or reached consensus, which is equivalent to indicating whether the transaction data has undergone on-chain processing.

[0130] Step S604: Add a transaction timer to the transaction data.

[0131] In this embodiment, the target participating node can add a transaction timer to the transaction data. Optionally, a timer can be added to each transaction generated or acquired in the blockchain network. Each transaction indicates a transaction data, and the timer is used to indicate that the corresponding transaction needs to be packaged and uploaded to the chain within the time range corresponding to the timer. If the timer expires, the next master node can be triggered to package and upload the transaction to the chain based on the consensus algorithm. For example, assuming the master node order in the blockchain network is "participating node 1 -> participating node 2 -> ... -> participating node d", the master node currently in the block generation state is participating node 2. Assuming participating node 2 needs to package and upload transaction data 1 and transaction data 2, and the timer for transaction data 1 is 1 minute, and more than 1 minute has passed since transaction data 1 was added to the transaction pool and the timer was added, then participating node 3 can package and upload transaction data 1 and transaction data 2 to the chain.

[0132] In other words, when the target participating node adds a transaction timer for transaction data, it can execute step S605. Optionally, after the transaction timer is added, it can be considered to be always working. If the transaction timer triggers a timeout, step S607 is executed. Through the transaction timer, the transaction data can be packaged and uploaded to the chain as soon as possible within the specified time. Once the transaction timer triggers a timeout, it indicates that some nodes may be abnormal. The abnormal nodes will trigger the maximum rotation threshold during the rotation, resulting in time consumption. Moreover, the abnormal nodes may not be able to package the transaction normally, which will theoretically cause the master node that packages and uploads the transaction data to the chain to be postponed. That is, a new master node needs to package and upload the transaction data to the chain. The master node in the block generation state (i.e., performing transaction packaging) is rotated based on the node rotation order. Alternatively, if the node selection type is a node-determined type, when the master node in the block generation state is abnormal, a new master node in the block generation state can be selected. Therefore, step S607 can be triggered. If step S608 is triggered based on step S607, the master node currently in the block generation state (referred to here as the first master node) can be re-acquired. Based on this first master node, N associated master nodes are determined. At this time, these N associated master nodes include the new master node that packages and uploads the transaction data to the blockchain. This ensures that the transaction packaging process of the blockchain network continues to run, allowing transaction data to be sent to the master node that can package and upload the transaction data to the blockchain in a timely manner, thus improving the data security of the blockchain network. It can be assumed that the node rotation order is determined based on the consensus algorithm. Generally, based on the node rotation order, each master node in the rotation can package transactions sequentially, so that the transaction data can be packaged and uploaded to the chain by the master node used to package the transaction data within the time range indicated by the transaction timer. If the transaction timer triggers a timeout, it means that some nodes may be abnormal during the rotation of each master node, causing some transactions that are before the transaction data and the transaction data itself to be unable to be packaged and uploaded to the chain by the theoretical master node. Therefore, N associated master nodes can be re-determined, see step S608 for details.

[0133] Step S605: Place the transaction into the target transaction pool of the target participating node.

[0134] In this embodiment of the application, the target participating node can add the transaction data carrying the unpacked state and transaction timer to the target participating node's target transaction pool.

[0135] The execution order of steps S603 to S605 is not limited to the above order and can be changed. For example, transaction data can be added to the target transaction pool of the target participating node, an unpacked state can be added to the transaction data, a transaction timer can be added to the transaction data, etc. There are no restrictions here.

[0136] Optionally, if the target participating node is in the block generation state, the target participating node obtains the transaction data to be added to the chain from the target transaction pool, generates a second initial block based on the transaction data to be added to the chain, and sends the second initial block to the consensus node. The transaction data to be added to the chain can be obtained from the target transaction pool based on the transaction packaging order. The number of such transaction data to be added to the chain is at least one, meaning that the transaction data to be added to the chain can be considered to correspond to at least one transaction. The transaction packaging order can include a normal packaging order and an abnormal packaging order. The normal packaging order indicates the packaging order of transactions that have been added once in the transaction pool (here, the target transaction pool); the abnormal packaging order indicates the packaging order of transactions that have experienced anomalies (such as consensus failure) in the transaction pool (here, the target transaction pool). Simply put, the transaction packaging order can also be considered as the packaging priority of transactions in the transaction pool; transactions with higher packaging priority are packaged earlier. For example, assuming the standard packaging order is sequential (first-in, first-out), the transaction data at the beginning of the pool can be retrieved sequentially from the target transaction pool as the data to be uploaded to the blockchain. The beginning of the pool refers to the transaction with the shortest entry time; that is, the shorter the entry time, the higher the packaging priority and the earlier the packaging. The participating node cluster can include consensus nodes, which can be considered as participating nodes other than the block-producing nodes. For example, here, a consensus node can refer to any participating node in the cluster other than the target participating node. When the consensus node passes consensus on the second initial block, a second block to be uploaded to the blockchain is generated based on the second initial block, and the second block to be uploaded to the blockchain is processed. If the transaction data to be uploaded to the blockchain carries a timer, the timer is stopped, and the transaction data to be uploaded to the blockchain is deleted from the target transaction pool. At this time, since the timer carried by the transaction data to be uploaded to the blockchain has stopped, no timeout will be triggered. Furthermore, if consensus on the second initial block fails, the data status of the transaction data to be uploaded to the blockchain is updated to the packaged state, and the transaction data to be uploaded to the blockchain is re-added to the target transaction pool. Specifically, the re-addition of the transaction data to be uploaded to the target transaction pool can be based on an abnormal packaging order. For example, the abnormal packaging order can include, but is not limited to, the first insertion order (equivalent to directly adding the transaction data to be uploaded to the first position in the pool, so that the transaction data to be uploaded to the blockchain can be directly repackaged and uploaded to the blockchain in the next instance), random insertion order, and late insertion order (equivalent to adding the transaction data to be uploaded to the target transaction pool with new transaction data and re-queuing for uploading to the blockchain).

[0137] Step S606: Discard transaction data.

[0138] In this embodiment of the application, the target participating node may discard the transaction data, and optionally, may also send a transaction anomaly message to other participating nodes or business clients.

[0139] Step S607: Check the data status of the transaction data.

[0140] In this embodiment of the application, the target participating node can obtain the data status of the transaction data. If the data status of the transaction data is unpackaged, then step S608 is executed; if the data status of the transaction data is packaged, then step S610 is executed.

[0141] Step S608: Determine N associated master nodes.

[0142] In this embodiment, the target participating node can obtain a first master node, and based on the first master node and the node selection type, determine N associated master nodes from the participating node cluster. See details below. Figure 3 The specific description of step S302 will not be repeated here.

[0143] Step S609: Broadcast the transaction data to N associated master nodes.

[0144] In this embodiment of the application, the target participating node can broadcast the transaction data to N associated master nodes.

[0145] Optionally, if there are network-abnormal nodes among the N associated master nodes (i.e., nodes that cannot connect or whose network communication has failed), then in the participating node cluster, neighboring master nodes that are adjacent to the N associated master nodes can be obtained based on the network-abnormal nodes. The normal master nodes (excluding the network-abnormal nodes) and their neighboring master nodes are then re-determined as the N associated master nodes, and the transaction data is broadcast to these N associated master nodes. These neighboring master nodes are essentially nodes that are sequentially sent to the initially obtained N associated master nodes.

[0146] Step S610: Stop the transaction timer.

[0147] In this embodiment of the application, it can be assumed that the transaction data has been rebroadcast, or that the data status of the transaction data is a packaged state, that is, the transaction data has undergone on-chain processing, etc., so it can be assumed that the target participating node does not need to broadcast the transaction data again, and the transaction timer can be stopped so that the transaction timer of the transaction data cannot trigger a timeout.

[0148] Optionally, when the target participating node receives the third initial block sent by the second master node, it votes on the third initial block and sends the voting result to the second master node; the second master node refers to the master node that generated the third initial block. If the consensus on the third initial block is determined to be successful, the third block to be added to the chain corresponding to the third initial block is obtained, and the third block to be added to the chain is synchronized; the voted transaction data included in the third block to be added to the chain is obtained, and the voted transaction data in the target transaction pool of the target participating node is deleted. Optionally, if the voted transaction data carries a timer, the timer of the voted transaction data can be stopped, and the voted transaction data in the target transaction pool of the target participating node can be deleted. If the consensus on the third initial block is determined to be unsuccessful, the voted transaction data included in the third initial block is obtained, and the data status of the voted transaction data is updated to the packaged state; based on the transaction packaging order of the target transaction pool, the voted transaction data is re-added to the target transaction pool. Optionally, the number of consensus failures of the voted transaction data can be obtained; if the number of consensus failures is greater than the transaction anomaly threshold, the voted transaction data can be deleted. Since each participating node in the participating node cluster can participate in the consensus process for the voted transaction data, each participating node can also obtain the number of consensus failures for the voted transaction data, and can delete the voted transaction data based on the number of consensus failures.

[0149] Further options can be found in Figure 7 , Figure 7 This is a consensus interaction flowchart provided in an embodiment of this application. For example... Figure 7 As shown, it can be assumed that the target master node will package the transactions, generate the initial block, and send the initial block to the consensus node for consensus. For details, please refer to the following steps:

[0150] Step S71a: Package the transactions and generate the initial block.

[0151] In this embodiment of the application, the target master node can obtain a transaction set from the transaction pool of the target master node, package the transaction set, and generate an initial block.

[0152] Step S72a: Broadcast and wait for consensus results.

[0153] In this embodiment of the application, the target master node can broadcast the initial block to the consensus node so that the consensus node can vote for the target master node.

[0154] Step S71b: Receive the initial block and begin consensus processing on the initial block.

[0155] In this embodiment of the application, the consensus node receives the initial block sent by the target master node and begins to reach a consensus on the initial block.

[0156] Furthermore, the target master node and consensus nodes reach a consensus on this initial block, that is... Figure 7 The consensus process in [the context of the event]. Furthermore, it includes the following steps:

[0157] Step S73a: Obtain the consensus result.

[0158] In this embodiment of the application, the target master node can obtain the consensus result for the initial block, which includes the voting results of the consensus nodes for the initial block, etc.

[0159] Step S74a: Detect the consensus result.

[0160] In this embodiment of the application, the target master node can detect the consensus result. If the consensus result for the initial block is a consensus success result, then step S75a is executed; if the consensus result for the initial block is a consensus failure result, then step S77a is executed.

[0161] Step S75a: Delete the transaction set corresponding to the initial block from the transaction pool.

[0162] In this embodiment, the target master node can generate a block to be added to the blockchain based on the initial block and consensus results, and then perform blockchain-uploading processing on this block. Further, the transaction set corresponding to the initial block can be deleted from the transaction pool. Optionally, if the transaction set carries a timer, the timer can be stopped, and the transaction set can be deleted. Optionally, if the data state of the transaction set is unpackaged, the data state of the transaction set can be updated to packaged, and the transaction set can be deleted. Of course, the transaction set can be directly deleted, and the corresponding data state of the transaction set can be considered non-existent.

[0163] Step S76a: Initiate the processing flow for the new block height.

[0164] In this embodiment of the application, a new block height processing flow can be initiated. Specifically, based on the node rotation order, the next master node in the block generation state can be determined as the target master node, and the target master node can perform the next block height processing flow.

[0165] Step S77a: Update the data state of the transaction set corresponding to the initial block and add the transaction set to the transaction pool.

[0166] In this embodiment, the target master node can update the data status of the transaction set corresponding to the initial block. Specifically, it updates the data status of the transaction set corresponding to the initial block to a packaged state and re-adds the transaction set to the target master node's transaction pool. When the data status of the transaction set is packaged, the target master node does not need to broadcast the transaction set.

[0167] Step S78a: Initiate a new round of processing for the target block height.

[0168] In this embodiment of the application, a new block height processing flow can be initiated.

[0169] Step S72b: Obtain the consensus result.

[0170] In this embodiment of the application, the consensus node can obtain the consensus result for the initial block.

[0171] Step S73b: Detect the consensus result.

[0172] In this embodiment of the application, the target master node can detect the consensus result. If the consensus result for the initial block is a consensus success result, then step S74b is executed; if the consensus result for the initial block is a consensus failure result, then step S76b is executed.

[0173] Step S74b: Delete the transaction set corresponding to the initial block from the transaction pool.

[0174] In this embodiment, the consensus node can obtain the block to be added to the chain corresponding to the initial block and synchronize the block to be added to the chain. Further, the transaction set corresponding to the initial block can be deleted from the consensus node's transaction pool. Optionally, if the transaction set carries a timer, the consensus node can stop the timer of the transaction set and delete the transaction set from the consensus node's transaction pool.

[0175] Step S75b: Initiate the processing flow for the new block height.

[0176] In this embodiment of the application, the consensus node can initiate the processing flow for a new block height.

[0177] Step S76b: Update the data state of the transaction set corresponding to the initial block and add the transaction set to the transaction pool.

[0178] In this embodiment of the application, the consensus node can update the data status of the transaction set corresponding to the initial block. Specifically, the data status of the transaction set corresponding to the initial block is updated to the packaged state, and the transaction set is re-added to the transaction pool of the consensus node.

[0179] Step S77b initiates a new round of processing for the target block height.

[0180] Specifically, when the target participating node is the target master node, i.e., when the target participating node is in the block generation state, steps S71a to S78a above can be executed, that is, the process corresponding to the target master node can be executed. When the target participating node is a consensus node, i.e., when the target participating node is not in the block generation state, steps S71b to S77b above can be executed, that is, the process corresponding to the consensus node can be executed.

[0181] Further, please see Figure 8 , Figure 8 This is a schematic diagram of a blockchain data transmission device provided in an embodiment of this application. The blockchain data transmission device can be a computer program (including program code, etc.) running on a computer device; for example, the blockchain data transmission device can be application software. This device can be used to execute the corresponding steps in the method provided in the embodiments of this application. Figure 8 As shown, the blockchain data transmission device 800 can be used for Figure 3 Specifically, the computer device in the corresponding embodiment may include: a data acquisition module 11, a node acquisition module 12, a node determination module 13, and a data transmission module 14.

[0182] Data acquisition module 11 is used by the target participating nodes to acquire transaction data;

[0183] Node acquisition module 12 is used to acquire the first master node;

[0184] The node determination module 13 is used to determine N associated master nodes from the participating node cluster based on the node selection type and the first master node; the first master node refers to the master node in the block generation state; N is a positive integer; N is less than the total number of participating nodes included in the participating node cluster; the N associated master nodes include the master node used to package and upload transaction data to the chain; the node selection type is used to indicate the changes in the master node in the block generation state;

[0185] The data sending module 14 is used to send transaction data to N associated master nodes so that the N associated master nodes can process the transaction data on the blockchain.

[0186] The device 800 also includes:

[0187] The first on-chain module 15 is used to generate a first initial block based on transaction data if the target participating node is in the block generation state, send the first initial block to the consensus node, generate a first block to be on-chain based on the first initial block when the consensus node passes the consensus on the first initial block, and perform on-chain processing on the first block to be on-chain.

[0188] The state determination module 16 is used to execute the process of obtaining the first master node if the target participating node is not in the block generation state.

[0189] The data acquisition module 11 includes:

[0190] The transaction decoding unit 111 is used to receive transaction messages sent by the business client from the target participating node, decode the transaction messages, and obtain the transaction data corresponding to the transaction messages.

[0191] The device 800 also includes:

[0192] Data detection module 17 is used to perform data detection on transaction data;

[0193] The transaction addition module 18 is used to add the transaction data to the target transaction pool of the target participating node if the transaction data is valid, and to execute the process of obtaining the first master node.

[0194] The data detection module 17 includes:

[0195] The signature detection unit 171 is used to obtain the data signature associated with the transaction data and to detect the data signature; or,

[0196] Identity detection unit 172 is used to obtain the identity information of the business client and detect the identity information; or,

[0197] The object detection unit 173 is used to acquire transaction-related objects included in the transaction data, acquire object information corresponding to the transaction-related objects in the transaction data, and detect the object information; or,

[0198] The duplicate detection unit 174 is used to perform duplicate detection on transaction data.

[0199] Among them, the node selection types include node rotation type and node determination type;

[0200] This node identifies module 13, which includes:

[0201] The fixed node determination unit 131 is used to determine the first master node in the participating node cluster as the associated master node if the node selection type is node determination type.

[0202] The rotating node determination unit 132 is used to obtain the transaction data volume included in the target transaction pool of the target participating node if the node selection type is the node rotation type, obtain the block storage space, determine the initial number of blocks based on the transaction data volume and the block storage space, and determine N associated master nodes from the participating node cluster based on the first master node as the benchmark and the initial number of blocks.

[0203] The device 800 also includes:

[0204] The adjacency acquisition module 19 is used to acquire, in the participating node cluster, the neighboring master nodes that have an adjacency relationship with the N associated master nodes if there is a network abnormal node among the N associated master nodes.

[0205] The node re-determination module 20 is used to determine the normal master nodes (excluding network abnormal nodes) and adjacent master nodes among N associated master nodes as candidate master nodes.

[0206] The transaction sending module 21 is used to send transaction data to the candidate master node so that the candidate master node can process the transaction data on the chain.

[0207] The data acquisition module 11 includes:

[0208] The data receiving unit 112 is used for the target participating node to receive transaction data sent by other participating nodes;

[0209] The device 800 also includes:

[0210] The transaction processing module 22 is used to perform data inspection on the transaction data. If the transaction data is valid, it adds an unpacked state to the transaction data, adds a transaction timer to the transaction data, and adds the transaction data carrying the unpacked state and the transaction timer to the target transaction pool of the target participating node.

[0211] The device 800 also includes:

[0212] The second on-chain module 23 is used to obtain the transaction data to be on-chain from the target transaction pool if the target participating node is in the block generation state, generate the second initial block according to the transaction data to be on-chain, send the second initial block to the consensus node, and generate the second block to be on-chain based on the second initial block when the consensus node passes the consensus on the second initial block, and perform on-chain processing on the second block to be on-chain.

[0213] The transaction pool update module 24 is used to stop the timer carried by the transaction data to be uploaded to the blockchain and delete the transaction data to be uploaded to the blockchain from the target transaction pool if the transaction data to be uploaded to the blockchain carries a timer.

[0214] The device 800 also includes:

[0215] The state update module 25 is used to update the data status of the transaction data to be uploaded to the blockchain to the packaged state if consensus on the second initial block fails, and to re-add the transaction data to be uploaded to the target transaction pool.

[0216] The device 800 also includes:

[0217] The status acquisition module 26 is used to acquire the data status of the transaction data if the transaction timer times out.

[0218] The node triggering module 27 is used to execute the process of obtaining the first master node if the data status of the transaction data is unpacked.

[0219] The timed stop module 28 is used to stop the transaction timer if the data status of the transaction data is "packaged".

[0220] The device 800 also includes:

[0221] The block voting module 29 is used to vote on the third initial block when the target participating node receives the third initial block sent by the second master node, and to send the voting result for the third initial block to the second master node; the second master node refers to the master node that generates the third initial block;

[0222] The block synchronization module 30 is used to obtain the third block to be uploaded to the chain corresponding to the third initial block if it is determined that the consensus on the third initial block has been passed, and to synchronize the third block to be uploaded to the chain.

[0223] The transaction pool update module 24 is also used to obtain the voted transaction data included in the third block to be added to the chain and delete the voted transaction data in the target transaction pool of the target participating node.

[0224] The device 800 also includes:

[0225] The state update module 25 is also used to obtain the voted transaction data included in the third initial block if it is determined that the consensus on the third initial block has failed, and update the data status of the voted transaction data to the packaged status.

[0226] The transaction re-add module 31 is used to re-add the voted transaction data to the target transaction pool based on the transaction packaging order of the target transaction pool.

[0227] This application provides a blockchain data transmission device that can operate within a target participating node to acquire transaction data; acquire a first master node; and, based on the node selection type and the first master node, determine N associated master nodes from the participating node cluster. The first master node refers to a master node in the block generation state. The N associated master nodes include a master node used for packaging and uploading transaction data to the blockchain. The node selection type indicates the changes in the master nodes in the block generation state. The transaction data is sent to the N associated master nodes so that they can process the transaction data for on-chain processing. Through this process, transaction data is not broadcast to all nodes, but rather the broadcasting process is optimized, broadcasting transaction data to only some nodes. This reduces the amount of transaction data transmitted, reduces the network space occupied by data transmission, thereby reducing the overall network communication complexity of the blockchain, improving overall processing performance, and reducing the risk of network storms. Furthermore, the nodes to which transaction data is broadcast are determined based on the first master node in the block generation state. This ensures that the identified N associated master nodes are the nodes that are likely to package the data as soon as possible. In other words, by sending transaction data to nodes that may package transactions, the nodes that need to package transactions can obtain a sufficient amount of transaction data for packaging. This reduces the impact of network storms, ensures the performance of the blockchain in receiving and packaging transaction data, and thus improves the overall performance of the blockchain.

[0228] See Figure 9 , Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 9 As shown, the computer device in this embodiment may include one or more processors 901, a memory 902, and an input / output interface 903. The processor 901, memory 902, and input / output interface 903 are connected via a bus 904. The memory 902 stores a computer program, which includes program instructions. The input / output interface 903 receives and outputs data, such as for data interaction between participating nodes or for data interaction between participating nodes and a business client. The processor 901 executes the program instructions stored in the memory 902.

[0229] The processor 901 can perform the following operations:

[0230] The target participating nodes acquire transaction data;

[0231] Obtain the first master node. Based on the node selection type and the first master node, determine N associated master nodes from the participating node cluster. The first master node refers to the master node in the block generation state. N is a positive integer. N is less than the total number of participating nodes included in the participating node cluster. The N associated master nodes include the master node used to package and upload transaction data to the chain. The node selection type is used to indicate the changes in the master nodes in the block generation state.

[0232] The transaction data is sent to N associated master nodes so that the N associated master nodes can process the transaction data on the blockchain.

[0233] In some feasible implementations, the processor 901 may be a central processing unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0234] The memory 902 may include read-only memory and random access memory, and provides instructions and data to the processor 901 and the input / output interface 903. A portion of the memory 902 may also include non-volatile random access memory. For example, the memory 902 may also store device type information.

[0235] In practice, the computer device can perform actions such as these through its built-in functional modules. Figure 3 For details on the implementation methods provided for each step, please refer to [the relevant documentation / document / etc.]. Figure 3 The implementation methods provided for each step are not elaborated here.

[0236] This application provides a computer device including a processor, an input / output interface, and a memory. The processor retrieves a computer program from the memory and executes it. Figure 3Each step of the method shown performs blockchain data transmission operations. This embodiment of the application implements the following: acquiring transaction data; acquiring a first master node; determining N associated master nodes from the participating node cluster based on the node selection type and the first master node; the first master node refers to a master node in the block generation state; the N associated master nodes include a master node used to package and upload transaction data to the chain; the node selection type indicates the changes in the master nodes in the block generation state; and sending the transaction data to the N associated master nodes so that the N associated master nodes can process the transaction data for on-chain processing. Through the above process, the transaction data is not broadcast to all nodes, but the broadcasting process is optimized by broadcasting the transaction data to only some nodes. This reduces the amount of transaction data transmitted, reduces the network space occupied by data transmission, thereby reducing the overall network communication complexity of the blockchain, improving overall processing performance, and reducing the risk of network storms. Furthermore, the nodes to which transaction data is broadcast are determined based on the first master node in the block generation state. This ensures that the identified N associated master nodes are the nodes that are likely to package the data as soon as possible. In other words, by sending transaction data to nodes that may package transactions, the nodes that need to package transactions can obtain a sufficient amount of transaction data for packaging. This reduces the impact of network storms, ensures the performance of the blockchain in receiving and packaging transaction data, and thus improves the overall performance of the blockchain.

[0237] This application also provides a computer-readable storage medium storing a computer program adapted to be loaded and executed by a processor. Figure 3 For details on the blockchain data transmission methods provided in each step, please refer to [the relevant documentation / document / etc.]. Figure 3 The implementation methods provided for each step are not repeated here. Furthermore, the beneficial effects of using the same method are also not repeated. For technical details not disclosed in the computer-readable storage medium embodiments involved in this application, please refer to the description of the method embodiments of this application. As an example, a computer program may be deployed to execute on a single computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed across multiple locations and interconnected via a communication network.

[0238] The computer-readable storage medium can be the blockchain data transmission device provided in any of the foregoing embodiments or the internal storage unit of the computer device, such as the hard drive or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device. Furthermore, the computer-readable storage medium can include both internal storage units and external storage devices of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0239] This application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform... Figure 3 The method provided among the various optional approaches optimizes the transaction data broadcasting process. Instead of broadcasting transaction data to all nodes, it broadcasts it to a select group of nodes, reducing the amount of transaction data transmitted and the network space occupied by data transmission. This lowers the overall network communication complexity of the blockchain, improves overall processing performance, and reduces the risk of network storms. Furthermore, the nodes to which transaction data is broadcast are determined based on the first master node in the block generation state. This ensures that the identified N associated master nodes are likely to be packaged as soon as possible. In other words, sending transaction data to nodes that may perform transaction packaging ensures that these nodes receive a sufficient amount of transaction data for packaging. This reduces the risk of network storms, ensures the blockchain's performance in receiving and packaging transaction data, and ultimately improves the overall performance of the blockchain.

[0240] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.

[0241] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of functionality. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0242] The methods and related apparatus provided in this application are described with reference to the method flowcharts and / or structural diagrams provided in this application. Specifically, each block of the method flowcharts and / or structural diagrams, as well as combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable blockchain data transmission device to create a machine, such that the instructions, which execute via the processor of the computer or other programmable blockchain data transmission device, create means for implementing the functions specified in one or more blocks of the flowcharts and / or one or more blocks of the structural diagrams. These computer program instructions can also be stored in a computer-readable storage medium capable of directing a computer or other programmable blockchain data transmission device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium create an article of manufacture including instruction means that implement the functions specified in one or more blocks of the flowcharts and / or one or more blocks of the structural diagrams. These computer program instructions may also be loaded onto a computer or other programmable blockchain data transmission device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable device, provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more blocks in the structural diagram.

[0243] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A blockchain data transmission method, characterized in that, The method includes: The target participating nodes acquire transaction data; Obtain the first master node. Based on the node selection type and the first master node, determine N associated master nodes from the participating node cluster. The first master node refers to the master node in the block generation state. N is a positive integer. N is less than the total number of participating nodes included in the participating node cluster. The N associated master nodes include the master node used to package and upload the transaction data to the chain. The node selection type is used to indicate the change status of the master node in the block generation state. The node selection type includes node rotation type and node determination type. The node rotation type refers to the type in which the target master node indicated by the consensus algorithm will change. The node determination type refers to the type in which the target master node indicated by the consensus algorithm will not be rotated. The transaction data is sent to the N associated master nodes so that the N associated master nodes can process the transaction data on the blockchain. The step of determining N associated master nodes from the participating node cluster based on the node selection type and the first master node includes: If the node selection type is the node determined type, then the first master node in the participating node cluster is determined as the associated master node; If the node selection type is the node rotation type, then obtain the transaction data volume included in the target transaction pool of the target participating node, obtain the block storage space, determine the initial number of blocks based on the transaction data volume and the block storage space, and determine N associated master nodes from the participating node cluster based on the first master node as the benchmark and the initial number of blocks.

2. The method as described in claim 1, characterized in that, The method further includes: If the target participating node is in the block generation state, the target participating node generates a first initial block based on the transaction data, sends the first initial block to the consensus node, and when the consensus node reaches a consensus on the first initial block, it generates a first block to be added to the chain based on the first initial block and performs on-chain processing on the first block to be added to the chain. If the target participating node is not in the block generation state, then the process of obtaining the first master node is executed.

3. The method as described in claim 1, characterized in that, The target participating node acquires transaction data, including: The target participating node receives the transaction message sent by the business client, decodes the transaction message, and obtains the transaction data corresponding to the transaction message; The method further includes: The transaction data is inspected. If the transaction data is valid, it is added to the target transaction pool of the target participating node, and the process of obtaining the first master node is executed.

4. The method as described in claim 3, characterized in that, The data detection of the transaction data includes: Obtain the data signature associated with the transaction data and perform detection on the data signature; or... Obtain the identity information of the business client and perform detection on the identity information; or, Obtain the transaction-related objects included in the transaction data, obtain the object information corresponding to the transaction-related objects in the transaction data, and detect the object information; or, The transaction data is subjected to duplicate detection.

5. The method as described in claim 1, characterized in that, The method further includes: If there is a network anomaly among the N associated master nodes, then in the participating node cluster, based on the network anomaly node, obtain the neighboring master nodes that have an adjacency relationship with the N associated master nodes; the adjacency relationship refers to the node relationship that is adjacent in the order of packaged transactions; The normal master nodes (excluding the network abnormal nodes) among the N associated master nodes and the adjacent master nodes are identified as candidate master nodes. The transaction data is sent to the candidate master node so that the candidate master node can process the transaction data on the blockchain.

6. The method as described in claim 1, characterized in that, The target participating node acquires transaction data, including: The target participating node receives transaction data sent by other participating nodes; The method further includes: The transaction data is inspected. If the transaction data is valid, an unpacked state is added to the transaction data, a transaction timer is added to the transaction data, and the transaction data carrying the unpacked state and the transaction timer is added to the target transaction pool of the target participating node.

7. The method as described in claim 6, characterized in that, The method further includes: If the target participating node is in the block generation state, the target participating node obtains the transaction data to be uploaded to the chain from the target transaction pool, generates a second initial block based on the transaction data to be uploaded to the chain, sends the second initial block to the consensus node, and when the consensus node passes the consensus on the second initial block, generates a second block to be uploaded to the chain based on the second initial block, and performs on-chain processing on the second block to be uploaded to the chain. If the transaction data to be uploaded to the blockchain carries a timer, then stop the timer carried by the transaction data to be uploaded to the blockchain and delete the transaction data to be uploaded to the blockchain from the target transaction pool.

8. The method as described in claim 7, characterized in that, The method further includes: If consensus on the second initial block fails, the data status of the transaction data to be uploaded to the blockchain will be updated to the packaged status, and the transaction data to be uploaded to the blockchain will be re-added to the target transaction pool.

9. The method as described in claim 6, characterized in that, The method further includes: If the transaction timer times out, the data status of the transaction data is obtained; If the data status of the transaction data is the unpacked state, then the process of obtaining the first master node is executed; If the transaction data is in a packaged state, then the transaction timer is stopped.

10. The method as described in claim 1, characterized in that, The method further includes: When the target participating node receives the third initial block sent by the second master node, it votes on the third initial block and sends the voting result for the third initial block to the second master node; the second master node refers to the master node that generated the third initial block; If it is determined that the consensus on the third initial block has been passed, then the third block to be added to the chain corresponding to the third initial block is obtained, and the third block to be added to the chain is synchronized. Obtain the voted transaction data included in the third block to be added to the chain, and delete the voted transaction data from the target transaction pool of the target participating node.

11. The method as described in claim 10, characterized in that, The method further includes: If it is determined that consensus on the third initial block has failed, the voted transaction data included in the third initial block is obtained, and the data status of the voted transaction data is updated to the packaged status. Based on the transaction packaging order of the target transaction pool, the voted transaction data is re-added to the target transaction pool.

12. A blockchain data transmission device, characterized in that, The device includes: The data acquisition module is used by the target participating nodes to acquire transaction data; The node acquisition module is used to acquire the first master node; The node determination module is used to determine N associated master nodes from the participating node cluster based on the node selection type and the first master node; the first master node refers to the master node in the block generation state; N is a positive integer; N is less than the total number of participating nodes included in the participating node cluster; the N associated master nodes include the master node used to package and upload the transaction data to the chain; the node selection type is used to indicate the change of the master node in the block generation state, and the node selection type includes node rotation type and node determination type; the node rotation type refers to the type in which the target master node indicated by the consensus algorithm will change, and the node determination type refers to the type in which the target master node indicated by the consensus algorithm will not be rotated; The data sending module is used to send the transaction data to the N associated master nodes so that the N associated master nodes can perform on-chain processing of the transaction data; The node determination module is used for: If the node selection type is the node determined type, then the first master node in the participating node cluster is determined as the associated master node; If the node selection type is the node rotation type, then obtain the transaction data volume included in the target transaction pool of the target participating node, obtain the block storage space, determine the initial number of blocks based on the transaction data volume and the block storage space, and determine N associated master nodes from the participating node cluster based on the first master node as the benchmark and the initial number of blocks.

13. A computer device, characterized in that, Includes processor, memory, and input / output interfaces; The processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used to receive data and output data, the memory is used to store computer programs, and the processor is used to call the computer programs so that the computer device executes the method according to any one of claims 1-11.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1-11.

15. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method described in any one of claims 1-11.

Citation Information

Patent Citations

  • Transaction broadcasting method, computer equipment and storage medium

    CN113507524A