Joint block output method and system of alliance chain system
By introducing a joint block generation method between consensus nodes and master nodes in the consortium chain system, consensus nodes participate in the collection and packaging of transactions, solving the problem that block generation efficiency is limited by master node performance, improving system performance and ensuring blocks Chain security and data consistency.
Patent Information
- Application Number
- CN202411074510.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-11-12
AI Technical Summary
The block production efficiency of the blockchain system is completely limited by the performance of the main node, resulting in a decrease in the block production efficiency and affecting the performance of the entire blockchain system.
In the alliance chain system, a joint block output method is introduced, and the consensus node and the master node participate in the collection, legality verification and packaging of transactions. The intermediate transaction package is generated through the consensus node and forwarded to the master node. The master node receives and packages to generate candidate areas. Block, consensus nodes participate in consensus to improve block production efficiency.
It improves the block production efficiency of the master node, improves the system performance, solves the problem of low block production efficiency in traditional alliance chains, and ensures the security and data consistency of the blockchain.
Smart Images

Figure CN118939732A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a joint block generation method and system for an alliance chain system. Background Art
[0002] TPS is an important performance indicator for measuring blockchain systems. It refers to the number of transactions that the system can process per second. A transaction needs to go through several main stages: node collection, legitimacy verification, packaging, consensus, smart contract verification, and submission to the chain.
[0003] Blockchain refers to a series of data blocks generated using cryptographic methods. Each block contains the hash value of the previous block, and is connected to the current block from the genesis block to form a block chain. In essence, blockchain is a decentralized database. At the same time, as the underlying technology of Bitcoin, it is a series of data blocks generated using cryptographic methods. Each data block contains a batch of Bitcoin network transaction information, which is used to verify the validity of its information and generate the next block. In terms of characteristics, blockchain technology has the characteristics of decentralization, openness, transparency, and immutability. From a technical point of view, blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. Among them, the consensus mechanism is the core technology of blockchain. Summary of the invention
[0004] The embodiments of the present application provide a joint block generation method and system for a consortium chain system, which is used to solve the problem that the block generation efficiency is completely limited by the performance of the master node, and the reduction of the block generation efficiency will directly affect the subsequent consensus, and then affect the performance of the entire blockchain system.
[0005] In a first aspect, an embodiment of the present application provides a joint block generation method for a consortium chain system, which is applied to consensus nodes in the consortium chain system. The consensus nodes are connected to each other in communication, and the consensus nodes are connected to the client and the master node in communication. The method includes:
[0006] receiving a plurality of first transactions sent by a client, verifying the plurality of first transactions, and determining each first transaction that passes the verification as a second transaction;
[0007] Packing multiple second transactions into a first transaction package and sending it to the master node, wherein the first transaction package includes: chain ID, sequence number, consensus node ID, transaction ID set, signature, and second transaction quantity;
[0008] Obtaining the candidate block sent by the master node, and reaching consensus on the candidate block to generate a first simulation execution result, wherein the candidate block is generated by the master node according to a plurality of first transaction packages, and the simulation execution result is used to indicate the transaction execution status in the candidate block;
[0009] Submit the candidate block to the chain and update the world state based on the results of the first simulation execution.
[0010] In a possible design, multiple first transactions are verified, including:
[0011] Verify the size, format, chain, transaction signature, and creator authority of each first transaction to verify the legitimacy of each corresponding first transaction;
[0012] After verifying the multiple first transactions and determining each first transaction that passes the verification as a second transaction, the method further includes:
[0013] Each second transaction is placed into the transaction pool of the corresponding chain, wherein each corresponding chain is a data channel, and multiple consensus nodes are deployed on each data channel.
[0014] In a possible design, each second transaction is placed into the transaction pool of the corresponding chain, including:
[0015] Temporarily save each second transaction in the transaction pool of the corresponding chain, wherein each consensus node is provided with a transaction pool on each corresponding chain;
[0016] After each second transaction is placed into the transaction pool of the corresponding chain, the method further includes:
[0017] Read the second transaction in each transaction pool, and pack multiple second transactions into at least one first transaction package according to the number of second transactions, the size of the first transaction package, and the time interval for generating the first transaction package;
[0018] Clean up the second transaction in each transaction pool and send each first transaction package to the master node.
[0019] In a possible design, consensus is reached on the candidate blocks to generate a first simulation execution result, including:
[0020] Receiving a candidate block, verifying the candidate block, and generating a second message, wherein the second message is used to indicate that the candidate block has passed verification and is agreed to be submitted;
[0021] After receiving at least a first number of second messages, each second transaction in the candidate block is executed, and each second transaction is confirmed to have been successfully executed, wherein the first number is preset according to different consensus algorithms.
[0022] In one possible design, each consensus node keeps a ledger for each data channel to which it belongs, and the ledger is used to store the transaction records of the corresponding candidate blocks.
[0023] In a second aspect, an embodiment of the present application provides a joint block generation method for a consortium chain system, the method being applied to a master node in the consortium chain system, the method comprising:
[0024] Receive multiple first transaction packages sent by the consensus node, verify the multiple first transaction packages, determine each first transaction package that passes the verification as a second transaction package, and put the second transaction package into the transaction package pool;
[0025] Packing multiple second transaction packages to generate candidate blocks, reaching consensus on the candidate blocks, and generating second simulation execution results, wherein the candidate blocks include: chain ID, block number, timestamp, parent block hash, second transaction package hash, second transaction ID set, repeated transaction ID set, and multiple second transaction packages, and the simulation execution results are used to indicate the transaction execution status in the candidate blocks;
[0026] Submit the candidate block to the chain and update the world state based on the results of the second simulation execution.
[0027] In a possible design, receiving and verifying a plurality of first transaction packets includes:
[0028] The size, chain and signature of each first transaction package are verified to exclude the first transaction packages sent by abnormal consensus nodes.
[0029] In a possible design, multiple second transaction packages are packaged to generate candidate blocks, consensus is reached on the candidate blocks, and a second simulation execution result is generated, including:
[0030] Read the transaction package pool, and pack multiple second transaction packages into candidate blocks according to the number of second transaction packages, the size of the candidate blocks, and the candidate block generation time interval;
[0031] A consensus protocol is initiated to reach consensus on the candidate block, and a first message is generated and broadcast to each consensus node, wherein the first message is used to indicate a transaction request in the candidate block.
[0032] In a possible design, before verifying the plurality of first transaction packages, the method further includes:
[0033] Based on the view number and the number of each consensus node, the master node is determined from multiple consensus nodes in the alliance chain system; the calculation formula for the master node number is:
[0034] Primary=(View+1)mod N
[0035] Among them, View is the view number, N is the total number of consensus nodes in the system, and Primary is the number of the selected primary node.
[0036] In a third aspect, an embodiment of the present application provides a consortium chain joint block generation system, the method comprising: a plurality of consensus nodes and a master node;
[0037] Each consensus node is used to implement the joint block production method of the alliance chain system of the first aspect of the invention, and the master node is used to implement the joint block production method of the alliance chain system of the second aspect of the invention.
[0038] In a fourth aspect, an embodiment of the present application provides a consensus node in a consortium chain system, the consensus node comprising:
[0039] A verification module, configured to receive a plurality of first transactions sent by a client, verify the plurality of first transactions, and determine each first transaction that passes the verification as a second transaction;
[0040] A packaging module is used to package multiple second transactions to generate a first transaction package, and send it to the master node, wherein the first transaction package includes: a chain ID, a sequence number, a consensus node ID, a transaction ID set, a signature, and a second transaction quantity;
[0041] A consensus module is used to obtain a candidate block sent by the master node, and to reach a consensus on the candidate block to generate a first simulation execution result, wherein the candidate block is generated by the master node according to a plurality of first transaction packages, and the simulation execution result is used to indicate the transaction execution status in the candidate block;
[0042] The submission module is used to submit the candidate block to the chain and update the world state according to the first simulation execution result.
[0043] In a fifth aspect, the embodiment of the present application provides a master node in a consortium chain system.
[0044] The master node includes:
[0045] A verification module, used to receive multiple first transaction packages sent by the consensus node, verify the multiple first transaction packages, determine each first transaction package that passes the verification as a second transaction package, and put the second transaction package into the transaction package pool;
[0046] A consensus module, used to package multiple second transaction packages to generate a candidate block, reach a consensus on the candidate block, and generate a second simulation execution result, wherein the candidate block includes: a chain ID, a block number, a timestamp, a parent block hash, a second transaction package hash, a second transaction ID set, a repeated transaction ID set, and multiple second transaction packages, and the simulation execution result is used to indicate the transaction execution status in the candidate block;
[0047] The submission module is used to submit the candidate block to the chain and update the world state according to the second simulation execution result.
[0048] In a sixth aspect, an embodiment of the present application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0049] Memory stores computer-executable instructions;
[0050] When the processor executes the computer execution instructions stored in the memory, it is used to implement a joint block production method of a consortium chain system of the first aspect or the second aspect.
[0051] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer execution instructions. When the computer execution instructions are executed by a processor, they are used to implement a joint block production method of a consortium chain system of the first aspect and the second aspect.
[0052] In an eighth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, is used to implement a joint block production method of a consortium chain system of the first aspect and the second aspect.
[0053] The embodiment of the present application provides a joint block generation method and system for a consortium chain system, which receives multiple first transactions sent by a client, verifies the multiple first transactions, and determines each first transaction that passes the verification as a second transaction, packages the multiple second transactions to generate a first transaction package, and sends it to the master node, wherein the first transaction package includes: a chain ID, a sequence number, a consensus node ID, a transaction ID set, a signature, and a second transaction quantity, obtains a candidate block sent by the master node, and reaches a consensus on the candidate block to generate a first simulation execution result, wherein the candidate block is generated by the master node based on the multiple first transaction packages, and the simulation execution result is used to indicate the transaction execution status in the candidate block, submits the candidate block to the chain, and updates the world state based on the first simulation execution result. The following technical effects are achieved: a transaction package construction method is proposed, an intermediate data transaction package is generated during the consensus node participation process, and the transaction package is forwarded to the master node, which solves the problem of how the consensus node sends the collected transactions to the master node; the master node receives the transaction package and packages it to generate a block, which solves the problem of data non-uniqueness caused by excessive decentralization of the blockchain; all consensus nodes participate in determining the transactions within the block and jointly generate blocks to solve the problem of low block efficiency caused by the master node completing all the tasks in the traditional alliance chain. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0055] Figure 1 A schematic diagram of a scenario of a joint block generation method of a consortium chain system provided in an embodiment of the present application;
[0056] Figure 2 A schematic diagram of a transaction package provided in an embodiment of the present application;
[0057] Figure 3 A schematic diagram of a candidate block provided in an embodiment of the present application;
[0058] Figure 4 A schematic diagram of a joint block generation method of a consortium chain system provided in an embodiment of the present application Figure 1 ;
[0059] Figure 5 A schematic diagram of a joint block generation method of a consortium chain system provided in an embodiment of the present application Figure 2 ;
[0060] Figure 6 A schematic diagram of a joint block generation method of a consortium chain system provided in an embodiment of the present application Figure 3 ;
[0061] Figure 7 A schematic diagram of a joint block generation method of a consortium chain system provided in an embodiment of the present application Figure 4 ;
[0062] Figure 8 A schematic diagram of a joint block generation method of a consortium chain system provided in an embodiment of the present application Figure 5 . DETAILED DESCRIPTION
[0063] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0064] In the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference. It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or design. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way. In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more.
[0065] It should be noted that the "at..." in the embodiment of the present application can be the instant when a certain situation occurs, or it can be a period of time after a certain situation occurs, and the embodiment of the present application does not specifically limit this. In addition, the edge computing data transmission method provided in the embodiment of the present application is only used as an example, and the edge computing data transmission method can also include more or less content.
[0066] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0067] Transactions Per Second (TPS): The number of transactions that a system can process per second is a key indicator for measuring the performance of a blockchain system and an important parameter for whether blockchain technology can cope with large-scale application needs.
[0068] Transaction: It is the operation of value transfer or data exchange in the blockchain network.
[0069] Smart Contract: A program running on the blockchain that can automatically execute contract terms when preset conditions are met.
[0070] Consensus mechanism: The process of reaching a consensus among all consensus nodes.
[0071] World State: It is the collection of all accounts and smart contract states in the blockchain network.
[0072] On-chain: The act of recording data, transactions or other information on the blockchain.
[0073] The consensus mechanism refers to an algorithm that reaches a consensus on the order of things within a period of time. On the blockchain, everyone has a ledger that records all transactions on the chain. When a new transaction is generated on the chain, everyone receives this information at different times, and people with different ideas will deliberately publish some wrong information. At this time, one person is needed to verify the information received by everyone and finally publish the most correct information to maintain the security of the entire blockchain network.
[0074] In the prior art, in order to ensure the uniqueness of the block, the secondary nodes in the consensus cluster do not participate in the generation process of the candidate block. Instead, the main node determines the transactions in the block and the execution order of each transaction, that is, the main node completes the collection, legality verification and packaging of transactions alone. After the main node packages the transaction to generate the candidate block, the secondary node will complete the consensus on the candidate block together with the main node through the consensus algorithm, and verify the validity of the transaction through the smart contract. The candidate block that passes the consensus will be submitted to the chain, and only then will the valid transactions in the candidate block be recognized by the entire network.
[0075] However, this approach makes the block generation efficiency completely limited by the performance of the master node. If the performance of the master node is insufficient, the block generation speed will be slow, or the number of transactions in the generated candidate blocks will be reduced, that is, the block generation efficiency of the master node will be reduced. The reduction in block generation efficiency will directly affect the subsequent consensus, and then greatly affect the performance of the entire blockchain system.
[0076] In order to solve the problem that the block production efficiency is completely limited by the performance of the master node, the embodiment of the present application designs a joint block production method for the alliance chain system. In addition to the master node, all slave nodes will also participate in the collection, legitimacy verification and packaging of transactions. The joint block production of the master node and the slave node can improve the block production efficiency of the master node and enhance the system performance.
[0077] Based on this, the embodiments of the present application provide a joint block production method and system for a consortium chain system, which can be used in the field of blockchain technology, and aims to solve the problem that the block production efficiency is completely limited by the performance of the master node, and the reduction of the block production efficiency will directly affect the subsequent consensus, and then affect the performance of the entire blockchain system.
[0078] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0079] Figure 1 A schematic diagram of a scenario of a joint block generation method of a consortium chain system provided in an embodiment of the present application. It should be noted that: Figure 1 What is shown are merely examples of scenarios to which the embodiments of the present application can be applied, to help those skilled in the art understand the technical content of the present application, but it does not mean that the embodiments of the present application cannot be used in other devices, systems, environments or scenarios.
[0080] like Figure 1 As shown, a topological structure of a joint block generation method of a consortium chain system is shown, including: a master node and a consensus node.
[0081] In this scenario, the master node and each consensus node are connected through a consensus network and communicate through a specific communication protocol to ensure that consensus nodes can exchange information efficiently and securely. The master node and consensus node have multiple modules for implementing different functions. Optionally, in the consensus node, the transaction verification module is used to verify the legitimacy of the transaction; the transaction package verification module is used to verify the validity of the transaction package; the transaction pool module is used to temporarily store transactions; the consensus module is used to reach a consensus on candidate blocks; the transaction package generation module is used to package transactions according to generation rules to generate transaction packages; the smart contract module is used to execute transaction content; in the master node, the candidate block module is used to package transaction packages to generate candidate blocks; the transaction package pool module is used to temporarily store transaction packages sent by other consensus nodes.
[0082] Figure 2 The schematic diagram of the transaction package provided in the embodiment of the present application. Figure 2 As shown, a structure of a transaction package is shown. The transaction package is a data structure containing multiple fields, which are used to describe and transmit specific information. The transaction package is encapsulated with a header, and the header contains a chain ID, a transaction package sequence number, a consensus node ID, a transaction ID set and a transaction package signature, wherein the chain ID is used to identify and distinguish different blockchain networks, and each chain represents a data channel; the transaction package sequence number is used to identify the order of the transaction package transmission process; the consensus node ID is used to distinguish different nodes participating in the consensus process; the transaction ID is used to identify each transaction in the network; the transaction package signature is used to verify the integrity and source of the transaction package; the transaction package is generated by the consensus node, and the source of the transaction package is determined to be legal based on the nature of the consensus node. If the consensus node is an abnormal node, the source of the transaction package generated by the consensus node is determined to be illegal, and the legitimacy of the transaction package is verified as not passed; multiple transactions are stored in the transaction package, which are stored according to pre-set storage rules.
[0083] Figure 3 The schematic diagram of the candidate blocks provided in the embodiment of the present application. Figure 3As shown, a structure of a candidate block is shown. The candidate block is a block constructed by the master node that has not been confirmed by the consensus network. The candidate block contains multiple transaction packages and block headers. The block header includes chain ID, block number, timestamp, parent block hash value, transaction package hash, transaction ID set, repeated transaction ID set and several transaction packages. Chain ID is used to identify and distinguish different blockchain networks, and each chain represents a data channel; block number is used to indicate the position or height of the candidate block in the blockchain; timestamp is used to record time information in the block, indicating the time when the candidate block was created or added to the blockchain; parent block hash value is used to determine the continuity and integrity of the blockchain, so that each candidate block is closely connected with the previous block, thus forming an unalterable chain; transaction package hash is used to ensure the integrity and unalterability of transaction data in the block; candidate blocks are generated by the master node by packaging transaction packages according to the preset candidate block generation rules.
[0084] Figure 4 A schematic diagram of a joint block generation method of a consortium chain system provided in an embodiment of the present application Figure 1 .like Figure 4 As shown, the method is applied to the consensus node in the alliance chain system, and the method includes:
[0085] S401, receiving multiple first transactions sent by a client, verifying the multiple first transactions, and determining each first transaction that passes the verification as a second transaction;
[0086] Specifically, the client creates a transaction request. Optionally, the transaction request is for fund transfer, smart contract call or other on-chain operation. The client can be an individual user, enterprise service or other application service. The client uses a private key to sign the transaction to ensure the security of the transaction and the verification of the initiator's identity. The signed transaction is sent to one or more consensus nodes in the alliance chain. The transaction received by the consensus node is the first transaction, and the legitimacy of the first transaction is verified. The legitimacy verification content includes but is not limited to whether the size of the first transaction meets the system requirements, whether the format of the first transaction is correct, whether the chain to which the first transaction belongs exists, whether the signature of the first transaction is valid, whether the creator of the first transaction has the request authority, whether the first transaction is repeated (whether it is repeated with the on-chain transaction, whether it is repeated with the transaction in the transaction pool, whether it is repeated with the transaction in the transaction package pool), etc. First transactions that pass the legitimacy verification are all determined as second transactions.
[0087] S402, packaging multiple second transactions to generate a first transaction package, and sending it to the master node;
[0088] Specifically, the second transaction that has passed the legality verification is packaged into a transaction list. According to a specific sorting algorithm, the consensus node sorts the transactions, assigns numbers, packages them, and then attaches timestamps and signature information to the transaction package. The sorting may be based on transaction fees, transaction arrival time, or other preset criteria.
[0089] The consensus node has preset transaction package generation rules, which determine when and how to package transactions based on the number of second transactions, the size of the transaction package, and the time interval;
[0090] The packaged transaction package is an intermediate data package. The transaction package cannot be uploaded to the blockchain system to execute the smart contract. The transaction package needs to be sent to the master node for further processing.
[0091] S403, obtaining the candidate blocks sent by the master node, and reaching consensus on the candidate blocks to generate a first simulation execution result;
[0092] Specifically, the consensus node receives candidate blocks from the master node. The candidate blocks contain a series of transactions to be confirmed, and verifies the validity of the received candidate blocks, including the structure of the candidate blocks, transaction validity, and signature verification.
[0093] The consensus node starts the consensus process according to the preset consensus algorithm to ensure that other nodes in the network reach a consensus on the candidate block. Optionally, in this embodiment, the consensus node uses a practical Byzantine fault-tolerant algorithm to reach a consensus on the candidate block. After receiving the pre-prepare message, the consensus node judges based on the validity verification result of the candidate block. If the candidate block is considered valid, it signs a prepare message and broadcasts it to all consensus nodes including the master node;
[0094] When a consensus node receives 2f+1 prepare messages with the same sequence number, where f is the maximum number of Byzantine nodes in the consortium chain system, it enters the commit phase. The consensus node signs a commit message and broadcasts it to other consensus nodes, including the master node, indicating that the node agrees to add the candidate block to the blockchain.
[0095] The consensus node simulates the execution of transactions in the candidate block, predicts the execution results of the smart contract and the state changes of the candidate block after execution. If the transactions in the candidate block are fully executed, the return result is successful. If the execution fails, the return result is empty.
[0096] S404: Submit the candidate block to the chain, and update the world state according to the first simulation execution result;
[0097] Specifically, consensus is reached on the candidate block, the candidate block is officially added to the end of the blockchain, becomes the latest block, the smart contract is executed, the transaction records of the intermediate consensus nodes in the transaction execution process are aggregated into a complete record, and the final balance of the account is updated.
[0098] The embodiment of the present application provides a joint block method for a consortium chain system, which receives multiple first transactions sent by a client, verifies the multiple first transactions, and determines each first transaction that passes the verification as a second transaction; packages multiple second transactions to generate a first transaction package, and sends it to the master node; wherein the first transaction package includes: chain ID, sequence number, consensus node ID, transaction ID set, transaction signature, and second transaction quantity; obtains the candidate block sent by the master node, and reaches a consensus on the candidate block to generate a first simulation execution result, wherein the candidate block is generated by the master node based on multiple first transaction packages, and the simulation execution result is used to indicate the transaction execution status in the candidate block; submits the candidate block to the chain, and updates the world state according to the first simulation execution result. The following technical effects are achieved: the consensus node participates in the collection, verification and packaging of transactions to improve transaction efficiency and solve the problem of being limited by the performance of the master node; the consensus node verifies the transaction, detects the legitimacy of the transaction to ensure the security of the consortium chain, generates an intermediate transaction package to facilitate packaging and transmission, and solves the problem of inconsistent block data caused by excessive decentralization.
[0099] Figure 5 A schematic diagram of a joint block generation method of a consortium chain system provided in an embodiment of the present application Figure 2 The method is applied to the consensus node in the alliance chain system, and the method includes:
[0100] S501, verifying the size, format, chain, transaction signature, and creator authority of each first transaction;
[0101] Specifically, the consensus node verifies the legitimacy of each first transaction received. The legitimacy verification of the transaction includes whether the size of the transaction meets the system requirements, whether the format of the transaction is correct, whether the chain to which the transaction belongs exists, whether the signature of the transaction is valid, and whether the creator of the transaction has the proposal authority;
[0102] Whether the transaction is repeated, whether it is repeated with the on-chain transaction, whether it is repeated with the transaction in the transaction pool, and whether it is repeated with the transaction in the transaction package pool, the legitimacy of the received transaction is verified, and the one that passes the verification is determined as the second transaction.
[0103] S502, placing each second transaction into the transaction pool of the corresponding chain;
[0104] Specifically, each corresponding chain is a data channel, and multiple consensus nodes are deployed on each data channel;
[0105] The transaction pool is used as a buffer to temporarily store transactions received by the consensus node. Each consensus node passes through multiple chains, and each corresponding chain is set up with a transaction pool to package the received transactions.
[0106] S503, packaging multiple second transactions to generate a first transaction package, and sending it to the master node;
[0107] S504, obtaining the candidate blocks sent by the master node, and reaching consensus on the candidate blocks to generate a first simulation execution result;
[0108] S505: Submit the candidate block to the chain, and update the world state according to the first simulation execution result.
[0109] S503, S504 and S505 are similar to S402, S403 and S404, and are not described in detail in this embodiment.
[0110] The embodiment of the present application provides a joint block generation method for a consortium chain system, in which the consensus nodes verify the legitimacy of the received transactions to ensure the security of the system. Transactions that do not meet the system requirements are eliminated through legitimacy verification, thus solving the problem of failing to ensure system data security while improving block generation efficiency.
[0111] Figure 6 A schematic diagram of a joint block generation method of a consortium chain system provided in an embodiment of the present application Figure 3 The method is applied to the consensus node in the alliance chain system, and the method includes:
[0112] S601, verifying the size, format, chain, transaction signature, and creator authority of each first transaction;
[0113] S601 is similar to S501 and will not be described in detail in this embodiment.
[0114] S602, temporarily saving each second transaction in the transaction pool of the corresponding chain;
[0115] Specifically, each consensus node has a transaction pool on each corresponding chain, which is a container for temporarily storing data.
[0116] S603, reading the second transactions in each transaction pool, and packaging multiple second transactions to generate at least one first transaction package according to the number of second transactions, the size of the first transaction package, and the first transaction package generation time interval;
[0117] Specifically, the consensus node puts the received transaction into the transaction pool. The transaction in the transaction pool is the second transaction that has been previously verified for legitimacy. The transaction pool is then read and a transaction package is generated according to the transaction package generation rules.
[0118] The transaction package generation rules include the number of transactions, the size of the transaction package, and the transaction package generation time interval configured by the system. The consensus node will pre-define a transaction capacity size and package the transactions into a transaction package based on the transaction capacity and quantity.
[0119] S604, clearing the second transaction in each transaction pool, and sending each first transaction package to the master node;
[0120] Specifically, the transaction pool can only be used to temporarily store transaction data. Generally, the capacity of the transaction pool is not very large. After the transactions in the transaction pool are packaged to generate transaction packages, the consensus node will delete the original data of the packaged transactions from the transaction pool and clear the space in the transaction pool to store subsequent received transactions.
[0121] As an intermediate data packet, the transaction package cannot be executed in the alliance chain system. Each consensus node only generates a transaction package and then forwards it to the master node through the data channel.
[0122] S605, receiving a candidate block, verifying the candidate block, and generating a second message;
[0123] Specifically, the second message is used to indicate that the candidate block has been verified and agreed to be submitted;
[0124] The consensus node receives the candidate blocks sent by the master node. The candidate blocks are unverified blocks. The consensus node needs to verify the validity of the candidate blocks to exclude the error blocks generated by the master node abnormality. It is necessary to exclude the error transaction packages generated by individual consensus nodes, which cause the master node to pack the error transaction packages into the candidate blocks.
[0125] After the candidate block passes the validity verification of the consensus node, a second message will be sent to the alliance chain. The second message is different from the preparation message of the master node, which is used to indicate that the candidate block has passed the verification and agreed to be submitted by this consensus node, and is ready to be put on the chain to execute transactions.
[0126] S606. After receiving at least the first number of second messages, execute each second transaction in the candidate block, and confirm that each second transaction has been successfully executed;
[0127] Specifically, wherein the first number is preset according to different algorithms;
[0128] After the candidate block passes the validity verification of the consensus node, it will send a second message to the alliance chain. After each consensus node receives 2f+1 preparation messages, the alliance chain system is considered normal, where f is the number of abnormal nodes;
[0129] Each transaction package in the block is sorted, and the transactions in the transaction package also have corresponding serial numbers. The transactions in the transaction package are executed step by step according to the increasing serial numbers, and the execution results are saved.
[0130] In one possible design, each consensus node will keep a ledger for each data channel it belongs to, and the ledger is used to save the transaction records of the corresponding candidate blocks;
[0131] Specifically, the ledger consists of a blockchain, with one ledger in each data channel to record transaction details. Optionally, if a transaction passes through multiple consensus nodes for multiple operations, multiple records will be saved, and each record will be connected to form a final transaction record.
[0132] The embodiment of the present application provides a joint block generation method for a consortium chain system, in which all consensus nodes reach consensus on the candidate blocks generated by the master node, thereby ensuring the consistency of blocks in the system and solving the problem of transaction execution differences caused by inconsistent system data due to decentralization.
[0133] Figure 7 A schematic diagram of a joint block generation method of a consortium chain system provided in an embodiment of the present application Figure 4 .like Figure 7 As shown, the method is applied to the master node in the alliance chain system, and the method includes:
[0134] S701, receiving multiple first transaction packages sent by the consensus node, verifying the multiple first transaction packages, and determining each first transaction package that passes the verification as a second transaction package, and putting the second transaction package into a transaction package pool;
[0135] Specifically, the transaction package received by the master node is the first transaction package, and the first transaction package is verified for repeatability. In practice, the consensus node may pack duplicate transactions into the transaction package, resulting in low utilization of the transaction package. When the master node receives the transaction package sent by other consensus nodes, it will check whether the transaction ID of the transaction package is repeated. If there are duplicate transactions, the duplicate transactions will be removed.
[0136] S702, packaging multiple second transaction packages to generate candidate blocks, reaching consensus on the candidate blocks, and generating a second simulation execution result;
[0137] Specifically, the master node starts the consensus process according to the preset consensus algorithm to ensure that other nodes in the network reach a consensus on the candidate blocks. Optionally, in this embodiment, the consensus nodes use the practical Byzantine fault-tolerant algorithm to reach a consensus on the candidate blocks. The master node sends a pre-prepared message to the alliance chain system to wait for other consensus nodes to verify;
[0138] When the master node receives 2f+1 prepare messages with the same sequence number, where f is the maximum number of Byzantine nodes in the consortium chain system, it enters the commit phase and adds the candidate block to the blockchain.
[0139] The master node simulates the execution of transactions in the candidate block, predicts the execution results of the smart contract and the state changes of the candidate block after execution. If the transactions in the candidate block are fully executed, the return result is a successful execution, and if the execution fails, the return result is empty.
[0140] S703, submit the candidate block to the chain, and update the world state according to the second simulation execution result;
[0141] Specifically, consensus is reached on the candidate block, the candidate block is officially added to the end of the blockchain, becomes the latest block, the smart contract is executed, the transaction records of the intermediate consensus nodes in the transaction execution process are aggregated into a complete record, and the final balance of the account is updated.
[0142] The embodiment of the present application provides a joint block method for a consortium chain system, which receives multiple first transaction packages sent by consensus nodes, verifies multiple first transaction packages, and determines each first transaction package that passes the verification as a second transaction package; packages multiple second transaction packages to generate candidate blocks, reaches consensus on the candidate blocks, and generates a second simulation execution result, wherein the candidate blocks include: chain ID, block number, timestamp, parent block hash, second transaction package hash, second transaction ID set, repeated transaction ID set and multiple second transaction packages, and the simulation execution result is used to indicate the transaction execution status in the candidate blocks; submits the candidate blocks to the chain, and updates the world state according to the second simulation execution result. The following technical effects are achieved: the master node verifies the transaction packages sent by the received consensus nodes to ensure that all transaction packages are valid and exclude the transaction packages sent by abnormal nodes; all consensus nodes send the transaction packages to the master node, and the master node packages the transaction packages to generate candidate blocks, solving the problem of inconsistent data in the system, and the master node participates in the consensus and chain operation of the candidate blocks to solve the problem of incomplete execution of block transactions.
[0143] Figure 8 A schematic diagram of a joint block generation method of a consortium chain system provided in an embodiment of the present application Figure 5 .like Figure 8 As shown, the method is applied to the master node in the alliance chain system, and the method includes:
[0144] S801. Verify the size, chain and signature of each first transaction package, and exclude first transaction packages sent by abnormal consensus nodes.
[0145] Specifically, the master node receives the first transaction packet sent by the consensus node. In practice, there may be abnormal nodes in the alliance chain system. In this embodiment, the abnormal nodes are generally Byzantine nodes, which can deliberately transmit wrong information to interfere with the consensus of the entire network.
[0146] There is a problem with the first transaction package sent. The first transaction package needs to be verified to ensure the security of the system. It is verified whether the size of the transaction package meets the system requirements, whether the chain to which the transaction package belongs exists, and whether the signature of the transaction package is valid. The first transaction package verified by the master node is determined as the second transaction package.
[0147] S802, reading the transaction package pool, and packaging multiple second transaction packages to generate candidate blocks according to the number of second transaction packages, the size of the candidate blocks, and the candidate block generation time interval;
[0148] Specifically, the master node is also equipped with a transaction pool, which is used to temporarily store transaction packages sent by other consensus nodes. The master node reads the transaction package pool and packages the transaction packages according to the candidate block generation rules;
[0149] The generation rules of candidate blocks include the number of second transaction packages, the size of candidate blocks and the candidate block generation time interval configured by the system. In addition to acting as a consensus node to package transactions and generate transaction packages, the master node presets candidate blocks. Among them, candidate blocks are the basic units of data transmission in the alliance chain system and are blocks that have not yet been agreed upon by other consensus nodes in the system. The master node will package the second transaction packages in the transaction package pool to generate candidate blocks.
[0150] S803, starting the consensus protocol to reach a consensus on the candidate block, generating a first message and broadcasting it to each consensus node, wherein the first message is used to indicate a transaction request in the candidate block;
[0151] Specifically, the master node starts the consensus mechanism after packaging and generating the candidate block, and sends a pre-prepare message to the alliance chain system to tell each consensus node that it will send the candidate block. Each consensus node is required to reach a consensus on the candidate block and send the prepare message to the system to ensure that each consensus node receives 2f+1 prepare messages, indicating that the system agrees on the transactions in the candidate block.
[0152] S804. Determine a master node from multiple consensus nodes in the alliance chain system based on the view number and the number of each consensus node;
[0153] Specifically, the master node can be any consensus node in the system. Different from the full openness of the public chain, each consensus node in the consortium chain system needs to be audited and verified to have the authority to receive and execute transactions before entering the consortium chain system. Each consensus node in the system has a number. The master node is determined based on the view number and the node number. The master node calculation formula is:
[0154] Primary=(View+1)mod N
[0155] Among them, View is the view number, N is the total number of consensus nodes in the system, Primary is the number of the selected primary node, and the first primary node in the system can be randomly elected. When an abnormality occurs in the existing primary node of the system, the system view number will be incremented according to the current system data to determine the next primary node. After the above collection, verification, packaging and consensus are all passed, the primary node is considered normal. However, when the primary node is abnormal, the view number is converted to re-elect the primary node.
[0156] An embodiment of the present application provides a joint block generation method for a consortium chain system, in which the master node participates in the consensus and broadcasts a pre-prepared message to the system to initiate a consensus, thereby solving the problem of incomplete execution due to decentralization, and electing the master node based on the view number and the consensus node number to prevent the system from being unable to execute transactions due to master node anomalies.
[0157] The present application embodiment provides a consortium chain joint block generation system, the system comprising:
[0158] A master node in the system, which is connected to each consensus node through a consensus network and transmits data through a specific communication protocol. The master node is used to implement a joint block generation method of a consortium chain system in the above embodiment;
[0159] There is only one master node in a consortium chain system, and the other nodes serve as consensus nodes. Each consensus node communicates through a formula network to transmit preparation messages and participates in the collection, verification, packaging, consensus and execution of transactions. The consensus node is used to implement a joint block production method of a consortium chain system in the above-mentioned embodiment.
[0160] An alliance chain joint block production system provided in an embodiment of the present application is an alliance joint block production method applied to consensus nodes and master nodes. Its implementation principle and technical effects are similar, and this embodiment will not be repeated here.
[0161] The embodiment of the present application provides a consensus node in a consortium chain system, the consensus node including:
[0162] A verification module, configured to receive a plurality of first transactions sent by a client, verify the plurality of first transactions, and determine each first transaction that passes the verification as a second transaction;
[0163] A packaging module is used to package multiple second transactions to generate a first transaction package, and send it to the master node; wherein the first transaction package includes: a chain ID, a sequence number, a consensus node ID, a transaction ID set, a signature, and a second transaction quantity;
[0164] A consensus module is used to obtain a candidate block sent by the master node, and to reach a consensus on the candidate block to generate a first simulation execution result, wherein the candidate block is generated by the master node according to a plurality of first transaction packages, and the simulation execution result is used to indicate the transaction execution status in the candidate block;
[0165] The submission module is used to submit the candidate block to the chain and update the world state according to the first simulation execution result.
[0166] In a possible design, the verification module includes:
[0167] The first verification module is used to verify the size, format, chain, transaction signature and creator authority of each first transaction, and to verify the legitimacy of each corresponding first transaction.
[0168] In a possible design, after verifying the plurality of first transactions and determining each first transaction that passes the verification as a second transaction, the method further includes:
[0169] The transaction pool module is used to put each second transaction into the transaction pool of the corresponding chain.
[0170] Among them, each corresponding chain is a data channel, and multiple consensus nodes are deployed on each data channel.
[0171] In a possible design, the transaction pool module includes:
[0172] The saving module is used to temporarily save each second transaction in the transaction pool of the corresponding chain, wherein each consensus node is provided with a transaction pool on each corresponding chain.
[0173] In a possible design, after placing the second transaction into the transaction pool of the corresponding chain, the method further includes:
[0174] a reading module, configured to read the second transactions in each transaction pool, and to package a plurality of second transactions to generate at least one first transaction package according to the number of second transactions, the size of the first transaction package, and the time interval for generating the first transaction package;
[0175] The cleaning module is used to clean up the second transaction in each transaction pool and send each first transaction package to the master node.
[0176] In one possible design, the consensus module includes:
[0177] A second verification module is used to receive a candidate block, verify the candidate block, and generate a second message, wherein the second message is used to indicate that the candidate block has passed the verification and is agreed to be submitted;
[0178] An execution module is used to execute each second transaction in the candidate block after receiving at least a first number of second messages, and confirm that each second transaction has been successfully executed, wherein the first number is preset according to different algorithms.
[0179] In one possible design, each consensus node keeps a ledger for each data channel to which it belongs, and the ledger is used to store the transaction records of the corresponding candidate blocks.
[0180] The embodiment of the present application provides a consensus node located in an alliance chain system, and an alliance joint block generation method applied to the consensus node. The implementation principle and technical effects are similar, and this embodiment will not be repeated here.
[0181] The embodiment of the present application provides a master node in a consortium chain system, the master node comprising:
[0182] A verification module, used to receive multiple first transaction packages sent by the consensus node, verify the multiple first transaction packages, and determine each first transaction package that passes the verification as a second transaction package;
[0183] The consensus module packages multiple second transaction packages to generate a candidate block, reaches a consensus on the candidate block, and generates a second simulation execution result, wherein the candidate block includes: a chain ID, a block number, a timestamp, a parent block hash, a second transaction package hash, a second transaction ID set, a repeated transaction ID set, and multiple second transaction packages, and the simulation execution result is used to indicate the transaction execution status in the candidate block;
[0184] The submission module is used to submit the candidate block to the chain and update the world state according to the second simulation execution result.
[0185] In a possible design, the verification module includes:
[0186] The third verification module is used to verify the size, chain and transaction package signature of each first transaction package, and exclude the first transaction packages sent by abnormal consensus nodes.
[0187] In one possible design, the consensus module includes:
[0188] A reading module, used for reading the transaction package pool, and packaging multiple second transaction packages to generate candidate blocks according to the number of second transaction packages, the size of the candidate blocks and the candidate block generation time interval;
[0189] The startup module is used to start the consensus protocol to reach a consensus on the candidate block, generate a first message and broadcast it to each consensus node, wherein the first message is used to indicate the transaction request in the candidate block.
[0190] In a possible design, before verifying the plurality of first transaction packages, the method further includes:
[0191] Based on the view number and the number of each consensus node, the master node is determined from multiple consensus nodes in the alliance chain system; the calculation formula for the master node number is:
[0192] Primary=(View+1)mod N
[0193] Among them, View is the view number, N is the total number of consensus nodes in the system, and Primary is the number of the selected primary node.
[0194] The embodiment of the present application provides a master node located in an alliance chain system, which is applied to an alliance joint block production method of a master node. The implementation principle and technical effects are similar, and this embodiment will not be repeated here.
[0195] The embodiment of the present application also provides an electronic device, which includes: at least one processor and a memory. The electronic device also includes a communication component. The processor, the memory, and the communication component are connected via a bus.
[0196] The specific implementation process can be found in the above method embodiment, the implementation principle and technical effect are similar, and will not be repeated in this embodiment.
[0197] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the invention may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0198] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk storage.
[0199] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0200] The above-mentioned functions implemented by the electronic device and the main control device introduce the scheme provided by the embodiment of the present invention. It can be understood that in order to implement the above-mentioned functions, the electronic device or the main control device includes a hardware structure and / or software module corresponding to the execution of each function. In combination with the units and algorithm steps of each example described in the embodiment disclosed in the embodiment of the present invention, the embodiment of the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware 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 implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present invention.
[0201] An embodiment of the present application also provides a computer-readable storage medium, in which computer-readable storage medium is stored computer execution instructions. When the computer execution instructions are executed by a processor, they are used to implement a joint block production method of a consortium chain system in the above embodiment.
[0202] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0203] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in an electronic device or a main control device.
[0204] An embodiment of the present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, it is used to implement a joint block generation method of a consortium chain system of the above embodiment.
[0205] The computer program is stored in a readable storage medium. At least one processor can read the computer program from the readable storage medium. At least one processor executes the computer program to execute the solution provided in any of the above embodiments.
[0206] Those skilled in the art can understand that all or part of the steps of the above method embodiments can be completed by hardware related to program instructions. The above program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above method embodiments are executed; and the above storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0207] So far, the technical solution of the present application has been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments, and the above embodiments are only used to illustrate the technical solution of the present application rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A joint block generation method for a consortium chain system, characterized in that: The method is applied to consensus nodes in a consortium chain system, the consensus nodes are connected to each other in communication, and the consensus nodes are connected to the client and the master node in communication, and the method includes: receiving a plurality of first transactions sent by the client, verifying the plurality of first transactions, and determining each first transaction that passes the verification as a second transaction; Packing multiple second transactions into a first transaction package, and sending the package to the master node, wherein the first transaction package includes: a chain ID, a sequence number, a consensus node ID, a transaction ID set, a signature, and a second transaction quantity; Obtaining the candidate block sent by the master node, and reaching consensus on the candidate block to generate a first simulation execution result, wherein the candidate block is generated by the master node according to a plurality of the first transaction packages, and the simulation execution result is used to indicate the transaction execution status in the candidate block; Submit the candidate block to the chain, and update the world state according to the first simulation execution result.
2. The method according to claim 1, characterized in that Verifying the plurality of first transactions includes: Verifying the size, format, chain, transaction signature, and creator authority of each of the first transactions to verify the legitimacy of each of the first transactions; After verifying the plurality of first transactions and determining each first transaction that passes the verification as a second transaction, the method further includes: Each of the second transactions is placed into the transaction pool of the corresponding chain, wherein each of the corresponding chains is a data channel, and multiple consensus nodes are deployed on each of the data channels.
3. The method according to claim 2, characterized in that The step of placing each of the second transactions into a transaction pool of a corresponding chain includes: Temporarily saving each of the second transactions in a transaction pool of a corresponding chain, wherein each of the consensus nodes is provided with a transaction pool on each corresponding chain; After each of the second transactions is placed into the transaction pool of the corresponding chain, the method further includes: Reading the second transaction in each of the transaction pools, and packaging a plurality of the second transactions to generate at least one first transaction package according to the number of the second transactions, the size of the first transaction package, and the first transaction package generation time interval; Clean up each second transaction in the transaction pool, and send each first transaction package to the master node.
4. The method according to claim 1, characterized in that: The step of reaching consensus on the candidate blocks and generating a first simulation execution result includes: receiving the candidate block, verifying the candidate block, and generating a second message, wherein the second message is used to indicate that the candidate block has passed the verification and is agreed to be submitted; After receiving at least a first number of second messages, executing each of the second transactions in the candidate block, and confirming that each second transaction has been successfully executed, wherein the first number is preset according to different consensus algorithms.
5. The method according to any one of claims 2 to 4, characterized in that: Each consensus node will save a ledger for each of the data channels to which it belongs, and the ledger is used to save the transaction records of the corresponding candidate blocks.
6. A joint block generation method for a consortium chain system, characterized in that: The method is applied to a master node in a consortium chain system, and the method includes: Receive multiple first transaction packages sent by the consensus node, verify the multiple first transaction packages, determine each first transaction package that passes the verification as a second transaction package, and put the second transaction package into a transaction package pool; Packing multiple second transaction packages to generate a candidate block, reaching consensus on the candidate block, and generating a second simulation execution result, wherein the candidate block includes: a chain ID, a block number, a timestamp, a parent block hash, a second transaction package hash, a second transaction ID set, a repeated transaction ID set, and multiple second transaction packages, and the simulation execution result is used to indicate the transaction execution status in the candidate block; Submit the candidate block to the chain, and update the world state according to the second simulation execution result.
7. The method according to claim 6, characterized in that Verifying the plurality of first transaction packages includes: The size, chain and transaction package signature of each of the first transaction packages are verified to exclude first transaction packages sent by abnormal consensus nodes.
8. The method according to claim 7, characterized in that The step of packaging the plurality of the second transaction packages to generate a candidate block, reaching a consensus on the candidate block, and generating a second simulation execution result includes: Reading the transaction package pool, and packaging a plurality of the second transaction packages to generate the candidate block according to the number of the second transaction packages, the size of the candidate block, and the candidate block generation time interval; A consensus protocol is initiated to reach a consensus on the candidate block, and a first message is generated and broadcast to each consensus node, wherein the first message is used to indicate a transaction request in the candidate block.
9. The method according to claim 6, characterized in that Before verifying the plurality of first transaction packages, the method further includes: Based on the view number and the number of each consensus node, the master node is determined from the multiple consensus nodes of the alliance chain system; the calculation formula of the master node number is: Primary=(View+1)mod N Wherein, View is the view number, N is the total number of consensus nodes in the system, and Primary is the number of the selected primary node.
10. A consortium chain joint block system, characterized in that: The system includes: multiple consensus nodes and a master node; Each of the consensus nodes is used to implement a joint block production method for a consortium chain system as described in any one of claims 1 to 6, and the master node is used to implement a joint block production method for a consortium chain system as described in any one of claims 7 to 9.
