Data transmission method and apparatus, network node, and blockchain system
By introducing forwarding nodes into the blockchain system and adopting pre-configured forwarding and block grouping strategies, the problem of excessive workload on confirmation nodes is solved, transaction verification efficiency and overall performance are improved, and network bandwidth consumption is reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-30
- Publication Date
- 2026-03-24
AI Technical Summary
In blockchain systems, the excessive workload of confirmation nodes leads to low transaction verification efficiency, as well as issues such as duplicate block forwarding and incomplete propagation coverage, affecting overall performance.
A forwarding node is introduced to receive blocks sent by the sorting node and send them to the confirmation node for transaction verification according to the pre-configured forwarding strategy, thereby reducing the workload of the confirmation node. The block is also sent to different confirmation nodes for verification through a block grouping strategy.
It improves transaction verification efficiency, reduces the problems of duplicate block forwarding and incomplete propagation in the network, reduces network bandwidth consumption, and improves the overall processing performance of the blockchain.
Smart Images

Figure CN115733640B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a data transmission method, apparatus, network node, and blockchain system. Background Technology
[0002] Currently, in blockchain systems, a complete blockchain transaction requires three stages: simulation (endorsing nodes), sorting (sorting nodes), and verification (confirmation nodes) before it can be permanently stored on the chain. Since not every confirmation node is connected to a sorting node, the sorting node sends the sorted blocks to its connected confirmation nodes, which then propagate the block information to other confirmation nodes. Furthermore, to improve the efficiency of sorting nodes, the blockchain system also supports electing a leader peer from among the confirmation nodes. This leader peer pulls blocks from the sorting nodes and then distributes them to other confirmation nodes. This approach increases the workload of the confirmation nodes, affecting their transaction verification efficiency and consequently impacting the overall processing performance of the blockchain. Moreover, the method of sorting nodes sending sorted blocks to connected confirmation nodes, which then propagate the block information to other confirmation nodes, can lead to a large number of blocks being repeatedly forwarded, consuming network bandwidth and potentially resulting in long propagation times and incomplete coverage. Summary of the Invention
[0003] The purpose of this invention is to provide a data transmission method, apparatus, network node, and blockchain system to solve the problems of low transaction verification efficiency, duplicate data forwarding, or incomplete data forwarding coverage in current blockchain systems, which affect blockchain performance.
[0004] To achieve the above objectives, embodiments of the present invention provide a data transmission method, comprising:
[0005] Receive blocks sent by sorting nodes in the blockchain system; wherein, the blocks are obtained by the sorting nodes after sorting the transactions according to the endorsement results sent by the client and then packaging them.
[0006] According to a pre-configured forwarding strategy, the block is sent to the first confirmation node in the blockchain system so that the first confirmation node can verify the transaction of the block; wherein, the first confirmation node is at least one confirmation node in the blockchain system.
[0007] Optionally, sending the block to the first confirmation node in the blockchain system according to a pre-configured forwarding strategy includes:
[0008] According to the forwarding strategy, the block is sent to each confirmation node in the blockchain system.
[0009] Optionally, sending the block to the first confirmation node in the blockchain system according to a pre-configured forwarding strategy includes:
[0010] According to the block grouping strategy in the forwarding strategy, the blocks are grouped to obtain at least two block groups;
[0011] According to the forwarding strategy, different block groups are sent to different first confirmation nodes.
[0012] Optionally, the block grouping strategy is determined by at least one of transaction type, smart contract, user type, and business type.
[0013] Optionally, after sending different block groups to different first confirmation nodes, the method further includes:
[0014] Receive transaction verification results sent by the target confirmation node; wherein, the transaction verification results are fed back by the target confirmation node after verifying the transactions of the blocks in the received block group, and the target confirmation node is any one of the first confirmation nodes;
[0015] The transaction verification result is sent to the second confirmation node; wherein the second confirmation node is a confirmation node in the blockchain system other than the target confirmation node.
[0016] Optionally, the forwarding strategy includes at least one of the following: block forwarding range, block forwarding method, and block forwarding response mechanism.
[0017] To achieve the above objectives, embodiments of the present invention provide a data transmission apparatus, comprising:
[0018] The first receiving module is used to receive blocks sent by sorting nodes in the blockchain system; wherein, the blocks are obtained by the sorting nodes after sorting the transactions according to the endorsement results sent by the client and then packaging them.
[0019] The first forwarding module is used to send the block to the first confirmation node in the blockchain system according to a pre-configured forwarding strategy, so that the first confirmation node can verify the transaction of the block; wherein, the first confirmation node is at least one confirmation in the blockchain system.
[0020] To achieve the above objectives, embodiments of the present invention provide a network node, comprising: a transceiver, a processor, a memory, and a program or instructions stored in the memory and executable on the processor; characterized in that, when the processor executes the program or instructions, it implements the steps of the data transmission method as described in any one of claims 1 to 6.
[0021] To achieve the above objectives, embodiments of the present invention provide a readable storage medium having a program or instructions stored thereon, which, when executed by a processor, implement the steps in the data transmission method described above.
[0022] To achieve the above objectives, embodiments of the present invention provide a blockchain system, including: endorsement nodes, sorting nodes, forwarding nodes, and confirmation nodes; wherein,
[0023] The endorsement node is used to: receive an endorsement request sent by the client, and after endorsing the request, send an endorsement response back to the client.
[0024] The sorting node is used to: receive the endorsement result sent by the client based on the endorsement response, sort the transactions based on the endorsement result, package them into blocks, and send the blocks to the forwarding node;
[0025] The forwarding node is used to: receive blocks sent by the sorting node, and send the blocks to the confirmation node according to a pre-configured forwarding strategy;
[0026] The confirmation node is used to: receive the block sent by the forwarding node, and to verify the transactions in the block.
[0027] Optionally, the forwarding node is specifically used to: send the block to each confirmation node in the blockchain system according to the forwarding strategy;
[0028] The confirmation node is specifically used for: verifying transactions in the block to obtain transaction verification results, and feeding back the transaction verification results to the client and saving them on the blockchain.
[0029] Optionally, the forwarding node is specifically used to: group the blocks into at least two block groups according to the block grouping strategy in the forwarding strategy, and send the different block groups to different first confirmation nodes according to the forwarding strategy; wherein, the first confirmation node is at least one confirmation node in the blockchain system;
[0030] The first confirmation node is specifically used to: verify the transactions of the blocks in the block group to obtain the transaction verification results, and then feed back the transaction verification results to the forwarding node.
[0031] Optionally, the forwarding node is specifically used to: send the transaction verification result sent by the target confirmation node to the second confirmation node; wherein, the target confirmation node is any one of the first confirmation nodes, and the second confirmation node is a confirmation node in the blockchain system other than the target confirmation node;
[0032] The second confirmation node is specifically used to: send the transaction verification result to the client and save it on the blockchain.
[0033] Optionally, the forwarding nodes are deployed in a cluster.
[0034] The beneficial effects of the above technical solution of the present invention are as follows: In the embodiments of the present invention, by receiving blocks sent by sorting nodes in the blockchain system and, according to a pre-configured forwarding strategy, sending the blocks to the first confirmation node in the blockchain system, the first confirmation node verifies the transactions in the blocks. That is, the confirmation nodes in the blockchain system no longer forward blocks, thereby reducing the workload of the confirmation nodes and improving the efficiency of transaction validity confirmation, thus enhancing the overall processing performance of the blockchain. Furthermore, sending blocks to the confirmation node for transaction verification based on the pre-configured forwarding strategy can also avoid the problems of duplicate block forwarding or incomplete forwarding coverage in the network, thereby reducing network bandwidth consumption and improving data transmission efficiency. Attached Figure Description
[0035] Figure 1 This is a flowchart of a data transmission method according to an embodiment of the present invention;
[0036] Figure 2 This is a block diagram of a data transmission device according to an embodiment of the present invention;
[0037] Figure 3 A block diagram of a network node according to an embodiment of the present invention;
[0038] Figure 4 This is a block diagram of a blockchain system according to an embodiment of the present invention;
[0039] Figure 5 This is one of the interactive diagrams of the nodes in the blockchain system according to an embodiment of the present invention;
[0040] Figure 6 This is the second schematic diagram of the interaction between nodes in the blockchain system according to an embodiment of the present invention. Detailed Implementation
[0041] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0042] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.
[0043] In various embodiments of the present invention, it should be understood that the sequence number of each process described below does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0044] In addition, the terms "system" and "network" are often used interchangeably in this article.
[0045] In the embodiments provided in this application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.
[0046] like Figure 1 As shown, an embodiment of the present invention provides a data transmission method comprising:
[0047] Step 11: Receive blocks sent by the sorting nodes in the blockchain system.
[0048] The block is obtained by the sorting node after sorting the transactions according to the endorsement results sent by the client and then packaging them.
[0049] Step 12: According to the pre-configured forwarding strategy, the block is sent to the first confirmation node in the blockchain system so that the first confirmation node can verify the transaction of the block.
[0050] The first confirmation node is at least one confirmation node in the blockchain system.
[0051] Optionally, this data transmission method can be applied to a blockchain system, which may include endorsement nodes, sorting nodes, and confirmation nodes.
[0052] Specifically, when a user uses a blockchain service, they first generate an endorsement request using the application client's Software Development Kit (SDK) and send it to the endorsing node to request endorsement. Upon receiving and verifying the endorsement request, the endorsing node generates a corresponding read-write set and endorsement response, and returns these to the client. The client verifies and packages all endorsement responses and read-write sets (i.e., the endorsement results), and sends them as transaction requests to the sorting node to request transaction sorting. The sorting node sorts the transactions according to the client's transaction requests and then packages them into blocks of a certain size. The sorting node can broadcast these blocks.
[0053] Optionally, the data transmission method can be executed by a network node (or forwarding node) in the blockchain system. This forwarding node has functions for receiving blocks, sending blocks, and configuring and storing forwarding strategies. For example, the forwarding node receives a block sent by the sorting node and, according to a pre-configured forwarding strategy, sends it to a first confirmation node. The first confirmation node can verify the transactions in the block and can either feed back the transaction verification result to the forwarding node, send the transaction verification result to a client, or save the transaction verification result on the blockchain.
[0054] Optionally, the communication mechanism between the forwarding node, the sorting node, and the confirmation node can be directly based on the gossip protocol in the blockchain platform (fabric), or it can be extended to support other protocols, etc., and the embodiments of the present invention are not limited thereto.
[0055] In the above scheme, by receiving blocks sent by the sorting nodes in the blockchain system and forwarding them to the first confirmation node in the blockchain system according to a pre-configured forwarding strategy, the first confirmation node verifies the transactions in the blocks. This means the confirmation nodes in the blockchain system no longer forward blocks, thus reducing their workload and improving the efficiency of transaction validity confirmation, thereby enhancing the overall processing performance of the blockchain. Furthermore, sending blocks to the confirmation node for transaction verification based on the pre-configured forwarding strategy avoids the problems of duplicate block forwarding or incomplete forwarding coverage in the network, thereby reducing network bandwidth consumption and improving data transmission efficiency.
[0056] Optionally, sending the block to the first confirmation node in the blockchain system according to a pre-configured forwarding strategy includes:
[0057] According to the forwarding strategy, the block is sent to each confirmation node in the blockchain system.
[0058] Specifically, according to the forwarding strategy, the forwarding node sends all the blocks received from the sorting node to each confirmation node in the blockchain system. Each confirmation node verifies the validity of all transactions, meaning that the first confirmation node is one of all confirmation nodes in the blockchain system.
[0059] Optionally, the forwarding strategy includes at least one of the following: block forwarding scope, block forwarding method, and block forwarding response mechanism. The forwarding node can also support the administrator to set the block forwarding scope, forwarding method, forwarding response mechanism, etc. For example, the forwarding strategy can be set according to various methods such as transaction type, smart contract, user type, and business type. Of course, the embodiments of the present invention are not limited thereto.
[0060] In this embodiment, after the sorting node in the blockchain system completes the transaction sorting and packages it into blocks, it no longer sends the blocks to its connected confirmation nodes or leader peers. Instead, it sends them directly to the forwarding nodes in the blockchain system. The forwarding nodes are responsible for forwarding the sorted blocks, that is, they are responsible for forwarding all the blocks they receive to each confirmation node. After receiving the blocks from the forwarding nodes, each confirmation node in the blockchain system needs to verify the transactions. For example, the confirmation node may split the block and verify the validity of the transactions involved and the on-chain transaction verification. It does not need to undertake the block forwarding work again, thereby reducing the workload of the confirmation nodes and improving the efficiency of transaction validity verification, which in turn improves the overall processing performance of the blockchain.
[0061] Optionally, sending the block to the first confirmation node in the blockchain system according to a pre-configured forwarding strategy includes:
[0062] According to the block grouping strategy in the forwarding strategy, the blocks are grouped to obtain at least two block groups;
[0063] According to the forwarding strategy, different block groups are sent to different first confirmation nodes.
[0064] Specifically, the forwarding node groups all the blocks received from the sorting node according to the block grouping strategy, resulting in at least two block groups. For example, a block group may include at least one block. Then, the forwarding node sends the different block groups to different confirmation nodes for confirmation. Only the confirmation node that receives the block group performs transaction validity verification. That is, the first confirmation node can be some of the confirmation nodes in the blockchain system or all of the confirmation nodes. However, a confirmation node does not need to perform transaction validity verification for all blocks, thereby reducing the workload of transaction verification for the confirmation nodes, improving verification efficiency, and thus improving the overall performance of the blockchain.
[0065] Optionally, the block grouping strategy is determined by at least one of transaction type, smart contract, user type, and business type.
[0066] For example, the forwarding strategy includes at least one of the following: block forwarding scope, block forwarding method, and block forwarding response mechanism. The forwarding strategy and block grouping strategy can be preset by the administrator. In particular, different forwarding grouping strategies can be set according to various methods such as transaction type, smart contract, user type, and business type. Of course, the embodiments of the present invention are not limited thereto.
[0067] Optionally, after sending different block groups to different first confirmation nodes, the method further includes:
[0068] Receive transaction verification results sent by the target confirmation node; wherein, the transaction verification results are fed back by the target confirmation node after verifying the transactions of the blocks in the received block group, and the target confirmation node is any one of the first confirmation nodes;
[0069] The transaction verification result is sent to the second confirmation node; wherein the second confirmation node is a confirmation node in the blockchain system other than the target confirmation node.
[0070] In this embodiment, by setting a forwarding strategy, the forwarding node no longer sends all blocks to the confirmation node for transaction verification. Instead, according to the block grouping strategy in the forwarding strategy, it groups the received blocks and then sends different block groups to different confirmation nodes for transaction verification. After the confirmation node completes the transaction verification, it returns the transaction verification result to the forwarding node. After collecting and summarizing the transaction verification results from different confirmation nodes, the forwarding node forwards the transaction verification results to other nodes that did not participate in the group verification (i.e., the second confirmation node), thereby reducing the workload of the confirmation nodes in transaction verification, improving verification efficiency, and thus improving the overall performance of the blockchain.
[0071] The data transmission method of the present invention has been described above, and the corresponding data transmission device will be described below with reference to the accompanying drawings.
[0072] like Figure 2 As shown, an embodiment of the present invention provides a data transmission device 200, comprising:
[0073] The first receiving module 210 is used to receive blocks sent by sorting nodes in the blockchain system; wherein, the blocks are obtained by the sorting nodes after sorting the transactions according to the endorsement results sent by the client and then packaging them.
[0074] The first forwarding module 220 is used to send the block to the first confirmation node in the blockchain system according to a pre-configured forwarding strategy, so that the first confirmation node can verify the transaction of the block; wherein, the first confirmation node is at least one confirmation in the blockchain system.
[0075] Optionally, the first forwarding module 220 includes:
[0076] The first forwarding unit is used to send the block to each confirmation node in the blockchain system according to the forwarding strategy.
[0077] Optionally, the first forwarding module 220 includes:
[0078] A grouping unit is used to group the blocks according to the block grouping strategy in the forwarding strategy to obtain at least two block groups;
[0079] The second forwarding unit is used to send different block groups to different first confirmation nodes according to the forwarding strategy.
[0080] Optionally, the block grouping strategy is determined by at least one of transaction type, smart contract, user type, and business type.
[0081] Optionally, the data transmission device 200 further includes:
[0082] The second receiving module is used to receive the transaction verification result sent by the target confirmation node after sending different block groups to different first confirmation nodes; wherein, the transaction verification result is fed back by the target confirmation node after verifying the transactions of the blocks in the received block group, and the target confirmation node is any one of the first confirmation nodes.
[0083] The second forwarding module is used to send the transaction verification result to the second confirmation node; wherein the second confirmation node is a confirmation node in the blockchain system other than the target confirmation node.
[0084] Optionally, the forwarding strategy includes at least one of the following: block forwarding range, block forwarding method, and block forwarding response mechanism.
[0085] The data transmission device of this invention can implement each process of the above data transmission method and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0086] Embodiments of the present invention provide a network node, which may also be referred to as a forwarding node in the blockchain system, such as... Figure 3 As shown, the network node includes a transceiver 310, a processor 300, a memory 320, and a program or instructions stored in the memory 320 and executable on the processor 300; when the processor 300 executes the program or instructions, it implements the steps in the above-described data transmission method.
[0087] The transceiver 310 is used to receive and send data under the control of the processor 300.
[0088] Among them, Figure 3 In this context, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits together, represented by one or more processors (processor 300) and memory (memory 320). The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 310 may be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. The processor 300 is responsible for managing the bus architecture and general processing, and the memory 320 may store data used by the processor 300 during operation.
[0089] An embodiment of the present invention provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the steps in the data transmission method described above and achieve the same technical effect. To avoid repetition, further details are omitted here.
[0090] The processor mentioned above is the processor in the network node described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0091] like Figure 4As shown, this embodiment of the invention provides a blockchain system 400, including: an endorsement node 410, a sorting node 420, a forwarding node 430, and a confirmation node 440.
[0092] The endorsing node 410 is configured to: receive endorsement requests sent by clients, endorse the requests, and then send an endorsement response back to the clients. For example, when a user uses a blockchain service, they first generate an endorsement request using the application client's Software Development Kit (SDK) and send it to the endorsing node for endorsement. After receiving and verifying the endorsement request, the endorsing node generates a read / write set and an endorsement response corresponding to the request, and returns these to the client.
[0093] The sorting node 420 is used to: receive the endorsement result sent by the client based on the endorsement response, sort the transactions according to the endorsement result, package them into blocks, and send the blocks to the forwarding node. For example, the client verifies and packages all endorsement responses and read / write sets (i.e., endorsement results), and sends them to the sorting node in the form of a transaction request, requesting that the transactions be sorted. After the sorting node completes the transaction sorting according to the transaction request sent by the client, it packages the transactions into blocks of a certain size. The sorting node can broadcast the blocks to the forwarding node.
[0094] The forwarding node 430 is used to: receive blocks sent by the sorting node, and send the blocks to the confirmation node according to a pre-configured forwarding strategy.
[0095] The confirmation node 440 is used to: receive the block sent by the forwarding node, and verify the transactions of the block. For example, the forwarding node receives the block sent by the sorting node and sends it to the first confirmation node according to the pre-configured forwarding strategy. The first confirmation node can verify the transactions of the block and can feed back the transaction verification result to the forwarding node, or send the transaction verification result to the client, and save the transaction verification result on the blockchain.
[0096] Optionally, the communication mechanism between the forwarding node, the sorting node, and the confirmation node can be directly based on the gossip protocol in the blockchain platform, or it can be extended to support other protocols, etc., and the embodiments of the present invention are not limited thereto.
[0097] The blockchain system described above receives blocks sent by sorting nodes through forwarding nodes and, according to a pre-configured forwarding strategy, sends the blocks to the confirmation nodes. The confirmation nodes then verify the transactions within these blocks, eliminating the need for block forwarding and thus reducing their workload. This improves the efficiency of transaction validity confirmation and enhances the overall processing performance of the blockchain. Furthermore, sending blocks to confirmation nodes for transaction verification based on the pre-configured forwarding strategy avoids issues such as duplicate block forwarding or incomplete forwarding coverage, thereby reducing network bandwidth consumption and improving data transmission efficiency.
[0098] Optionally, the forwarding node is specifically used to: send the block to each confirmation node in the blockchain system according to the forwarding strategy;
[0099] The confirmation node is specifically used for: verifying transactions in the block to obtain transaction verification results, and feeding back the transaction verification results to the client and saving them on the blockchain.
[0100] Specifically, such as Figure 5 As shown, when a user uses a blockchain service, they first generate an endorsement request (such as a proposal request message) using the application client's Software Development Kit (SDK) and send it to an endorsing node to request endorsement. The endorsing node receives the proposal request message, verifies its validity, completes the endorsement, and returns a proposal request response message to the client. The client verifies the proposal request response message, packages all endorsement responses and read / write sets (i.e., endorsement results), and sends it as a transaction request to a sorting node to request transaction sorting. The sorting node verifies the signature based on the transaction request sent by the client, sorts the transactions, packages them into blocks of a certain size, and sends the packaged blocks to forwarding nodes. The sorting node can broadcast these blocks to the forwarding nodes.
[0101] Specifically, after receiving a block from the sorting node, the forwarding node can query the forwarding policy and forward the block sent by the sorting node to the confirmation node (e.g., ...) according to the corresponding forwarding policy. Figure 5In the blockchain system, there are two confirmation nodes (Confirmation Node 1 and Confirmation Node 2). It's important to note that the forwarding nodes forward all blocks received from the sorting nodes to all confirmation nodes. Confirmation Node 1 and Confirmation Node 2 are merely illustrative and do not imply that there are only two confirmation nodes in the system. Each confirmation node verifies the validity of all transactions. Specifically, after receiving a block from the forwarding nodes, the confirmation nodes directly split the block and verify the validity of the transactions involved. The confirmation nodes no longer need to forward blocks; they only need to focus their resources on verifying and uploading transactions to the blockchain. After completing transaction verification and uploading to the blockchain, the confirmation nodes notify the client of the transaction verification results.
[0102] Optionally, from a functional perspective, the forwarding node needs a block receiving module to receive blocks, a block sending module to forward blocks, and a forwarding strategy configuration and storage module to configure and store forwarding strategies. The forwarding strategy of the forwarding node can support setting the forwarding range, forwarding method, and forwarding response mechanism for blocks. The communication mechanism between the forwarding node, the sorting node, and the confirmation node can be directly based on the gossip protocol, or it can be extended to support other protocols, etc., and this embodiment of the invention is not limited thereto.
[0103] Optionally, the forwarding node is specifically used to: group the blocks into at least two block groups according to the block grouping strategy in the forwarding strategy, and send the different block groups to different first confirmation nodes according to the forwarding strategy; wherein, the first confirmation node is at least one confirmation node in the blockchain system;
[0104] The first confirmation node is specifically used to: verify the transactions of the blocks in the block group to obtain the transaction verification results, and then feed back the transaction verification results to the forwarding node.
[0105] Furthermore, the forwarding node is specifically used to: send the transaction verification result sent by the target confirmation node to the second confirmation node; wherein, the target confirmation node is any one of the first confirmation nodes, and the second confirmation node is a confirmation node in the blockchain system other than the target confirmation node;
[0106] The second confirmation node is specifically used to: send the transaction verification result to the client and save it on the blockchain.
[0107] Specifically, such as Figure 6As shown, when a user uses a blockchain service, they first generate an endorsement request (such as a proposal request message) using the application client's Software Development Kit (SDK) and send it to an endorsing node to request endorsement. The endorsing node receives the proposal request message, verifies its validity, completes the endorsement, and returns a proposal request response message to the client. The client verifies the proposal request response message, packages all endorsement responses and read / write sets (i.e., endorsement results), and sends it as a transaction request to a sorting node to request transaction sorting. The sorting node verifies the signature based on the transaction request sent by the client, sorts the transactions, packages them into blocks of a certain size, and sends the packaged blocks to forwarding nodes. The sorting node can broadcast these blocks to the forwarding nodes.
[0108] Specifically, after receiving a block from the sorting node, the forwarding node can query the forwarding policy and group all received blocks according to the block grouping strategy within the corresponding forwarding policy, obtaining at least two block groups. Then, it sends each of these different block groups to different acknowledgment nodes for confirmation (e.g., ...). Figure 6 The process involves sending block group 1 to confirmation node 1 and block group 2 to confirmation node 2. Confirmation nodes 1 and 2 are merely illustrative and do not imply that the blockchain system has only two confirmation nodes, nor that all received blocks are simply divided into two groups. The specific number of block groups can be determined based on a pre-configured block grouping strategy. Specifically, after receiving the block group from the forwarding node, the confirmation node splits all blocks within that group and verifies the validity of the transactions involved. After completing transaction verification, the confirmation node feeds back the verification results for the corresponding block group to the forwarding node. This way, the confirmation node only needs to verify the blocks within a specific block group, rather than verifying all blocks, improving processing efficiency.
[0109] Furthermore, after collecting and summarizing the transaction verification results from different confirmation nodes, the forwarding nodes forward the transaction verification results to other nodes that did not participate in the group verification (such as sending the transaction verification results fed back by confirmation node 1 to confirmation node 2, and sending the transaction verification results fed back by confirmation node 2 to confirmation node 1). Then, the confirmation nodes save the transaction verification results on the blockchain based on the transaction verification results after the transaction verification and the received transaction verification results, and notify the client of the transaction verification results, thereby reducing the workload of the confirmation nodes in transaction verification, improving verification efficiency, and thus improving the overall performance of the blockchain.
[0110] Optionally, the forwarding nodes in the blockchain system are deployed in a cluster to achieve load balancing.
[0111] Optionally, from a functional perspective, the forwarding node needs a block receiving module to receive blocks, a block sending module to forward blocks, and a forwarding strategy configuration and storage module to configure and store forwarding strategies. The forwarding strategy of the forwarding node can support setting the forwarding range, forwarding method, and forwarding response mechanism for blocks. The communication mechanism between the forwarding node, the sorting node, and the confirmation node can be directly based on the gossip protocol, or it can be extended to support other protocols, etc., and this embodiment of the invention is not limited thereto.
[0112] The above-described solution of this invention introduces forwarding nodes into the blockchain system, so that the confirmation nodes no longer undertake the function of block forwarding, but only the function of block confirmation. This reduces the workload of transaction verification for the confirmation nodes, improves verification efficiency, reduces communication pressure, and thus improves the overall performance of the blockchain. The forwarding nodes have functions for receiving blocks, forwarding blocks, and setting block forwarding strategies, and support administrators to flexibly configure forwarding strategies, which helps to further expand support for more flexible management of blocks and transactions. Furthermore, the forwarding nodes support clustered deployment to achieve load balancing, thereby reducing the possibility of the forwarding nodes becoming transaction bottlenecks.
[0113] In this embodiment of the invention, the module can be implemented in software so that it can be executed by various types of processors. For example, an identified executable code module may include one or more physical or logical blocks of computer instructions, which may be constructed as objects, procedures, or functions. Nevertheless, the executable code of the identified module does not need to be physically located together, but may include different instructions stored in different bits, which, when logically combined, constitute the module and achieve the module's intended purpose.
[0114] In practice, an executable code module can be a single instruction or many instructions, and can even be distributed across multiple different code segments, different programs, and across multiple memory devices. Similarly, operational data can be identified within the module and can be implemented in any suitable form and organized within any suitable type of data structure. This operational data can be collected as a single dataset or distributed across different locations (including different storage devices), and can exist, at least in part, solely as electronic signals within the system or network.
[0115] When a module can be implemented using software, considering the current level of hardware technology, modules that can be implemented in software can be implemented using hardware circuits by those skilled in the art to achieve the corresponding functions, without considering cost. These hardware circuits include conventional very-large-scale integrated circuits (VLSI) or gate arrays, as well as existing semiconductors such as logic chips and transistors, or other discrete components. Modules can also be implemented using programmable hardware devices, such as field-programmable gate arrays, programmable array logic, and programmable logic devices.
[0116] The exemplary embodiments described above are with reference to the accompanying drawings. Many different forms and embodiments are feasible without departing from the spirit and teachings of the invention. Therefore, the invention should not be construed as limiting the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided to make the invention complete and convey the scope of the invention to those skilled in the art. In these drawings, component dimensions and relative dimensions may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. As used herein, unless clearly indicated otherwise, the singular forms “a,” “an,” and “the” are intended to include all such forms. It will be further understood that the terms “comprising” and / or “including”, when used in this specification, indicate the presence of the stated features, integers, steps, operations, components, and / or elements, but do not exclude the presence or addition of one or more other features, integers, steps, operations, components, and / or groups thereof. Unless otherwise indicated, when stated, a range of values includes the upper and lower limits of the range and any subranges in between.
[0117] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A data transmission method, characterized in that, include: Receive blocks sent by sorting nodes in the blockchain system; wherein, the blocks are obtained by the sorting nodes after sorting the transactions according to the endorsement results sent by the client and then packaging them. According to a pre-configured forwarding strategy, the block is sent to the first confirmation node in the blockchain system so that the first confirmation node can verify the transaction of the block; wherein, the first confirmation node is at least one confirmation node in the blockchain system; The step of sending the block to the first confirmation node in the blockchain system according to the pre-configured forwarding strategy includes: According to the forwarding strategy, the blocks are sent to each confirmation node in the blockchain system; each confirmation node verifies the validity of all transactions; or, The step of sending the block to the first confirmation node in the blockchain system according to the pre-configured forwarding strategy includes: According to the block grouping strategy in the forwarding strategy, the blocks are grouped to obtain at least two block groups; According to the forwarding strategy, different block groups are sent to different first confirmation nodes; wherein, the first confirmation node is at least one confirmation node in the blockchain system; the confirmation node that receives the block group verifies the transaction of the block group.
2. The data transmission method according to claim 1, characterized in that, After sending different block groups to different first confirmation nodes, the process further includes: Receive transaction verification results sent by the target confirmation node; wherein, the transaction verification results are fed back by the target confirmation node after verifying the transactions of the blocks in the received block group, and the target confirmation node is any one of the first confirmation nodes; The transaction verification result is sent to the second confirmation node; wherein the second confirmation node is a confirmation node in the blockchain system other than the target confirmation node.
3. The data transmission method according to claim 1, characterized in that, The block grouping strategy is determined by at least one of the following: transaction type, smart contract, user type, and business type.
4. The data transmission method according to claim 1, characterized in that, The forwarding strategy includes at least one of the following: block forwarding scope, block forwarding method, and block forwarding response mechanism.
5. A data transmission device, characterized in that, include: The first receiving module is used to receive blocks sent by sorting nodes in the blockchain system; wherein, the blocks are obtained by the sorting nodes after sorting the transactions according to the endorsement results sent by the client and then packaging them. The first forwarding module is used to send the block to the first confirmation node in the blockchain system according to a pre-configured forwarding strategy, so that the first confirmation node can verify the transaction of the block; wherein, the first confirmation node is at least one confirmation in the blockchain system. The first forwarding module includes: The first forwarding unit is configured to send the block to each confirmation node in the blockchain system according to the forwarding strategy; each confirmation node verifies the validity of all transactions; or, The first forwarding module includes: A grouping unit is used to group the blocks according to the block grouping strategy in the forwarding strategy to obtain at least two block groups; The second forwarding unit is used to send different block groups to different first confirmation nodes according to the forwarding strategy; wherein the first confirmation node is at least one confirmation node in the blockchain system; the confirmation node that receives the block group performs transaction verification on the block group.
6. A network node, characterized in that, include: A transceiver, a processor, a memory, and a program or instructions stored in the memory and executable on the processor; characterized in that, when the processor executes the program or instructions, it implements the steps of the data transmission method as described in any one of claims 1 to 4.
7. A readable storage medium having a program or instructions stored thereon, characterized in that, When the program or instructions are executed by the processor, they implement the steps in the data transmission method as described in any one of claims 1 to 4.
8. A blockchain system, characterized in that, include: Endorsement nodes, sorting nodes, forwarding nodes, and confirmation nodes; among them, The endorsement node is used to: receive an endorsement request sent by the client, and after endorsing the request, send an endorsement response back to the client. The sorting node is used to: receive the endorsement result sent by the client based on the endorsement response, sort the transactions based on the endorsement result, package them into blocks, and send the blocks to the forwarding node; The forwarding node is used to: receive blocks sent by the sorting node, and send the blocks to the confirmation node according to a pre-configured forwarding strategy; The confirmation node is used to: receive the block sent by the forwarding node, and to verify the transactions in the block; The forwarding node is specifically used to: send the block to each confirmation node in the blockchain system according to the forwarding strategy; each confirmation node verifies the validity of all transactions; or, The forwarding node is specifically used for: grouping the blocks into at least two block groups according to the block grouping strategy in the forwarding strategy; and sending different block groups to different first confirmation nodes according to the forwarding strategy; wherein the first confirmation node is at least one confirmation node in the blockchain system; and the confirmation node that receives the block group performs transaction verification on the block group.
9. The blockchain system according to claim 8, characterized in that, The confirmation node is specifically used for: verifying transactions in the block to obtain transaction verification results, and feeding back the transaction verification results to the client and saving them on the blockchain.
10. The blockchain system according to claim 8, characterized in that, The first confirmation node is specifically used to: verify the transactions of the blocks in the block group to obtain the transaction verification results, and then feed back the transaction verification results to the forwarding node.
11. The blockchain system according to claim 10, characterized in that, The forwarding node is specifically used to: send the transaction verification result sent by the target confirmation node to the second confirmation node; wherein, the target confirmation node is any one of the first confirmation nodes, and the second confirmation node is a confirmation node in the blockchain system other than the target confirmation node; The second confirmation node is specifically used to: send the transaction verification result to the client and save it on the blockchain.
12. The blockchain system according to claim 8, characterized in that, The forwarding nodes are deployed in a cluster.
Citation Information
Patent Citations
Community income and expenditure data storage method based on block chain network and terminal equipment
CN112967135A