Block chain multi-consensus-based termitomyces albuminosus traceability model construction method
By adopting the blockchain multi-consensus mechanism and the improved Merkle tree storage structure in the supply chain of Gallia nigricans, the problems of easy tampering and low efficiency of the traditional traceability system are solved, achieving high security and efficient verification of data, ensuring This ensures the comprehensiveness and credibility of traceability data.
Patent Information
- Application Number
- CN202410712362.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-10-01
AI Technical Summary
The traditional traceability system is highly centralized, and the data is easily tampered with, making it impossible to ensure the authenticity and credibility of the traceability information. Moreover, the supply chain of Gallia nigricans has many links and a large amount of data, resulting in low efficiency of traceability data and difficulty in real-time monitoring of data on the chain, making it impossible to Effectively ensure the comprehensiveness and credibility of traceability data.
Adopting a multi-consensus mechanism based on the blockchain and an improved Merkle tree storage structure, consensus is carried out within and between groups through strategic grouping, ensuring the non-tamperability and efficiency of data, improving the quality of the consensus algorithm and node dynamics, Reduce system consensus latency and improve throughput.
It achieves high-level security and efficiency for the traceability data of Gallia nigricans, ensures the non-tamperability and efficient verification of the data, reduces the consensus delay, and improves the throughput of the system and the credibility of the data.
Smart Images

Figure CN118740359A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of food safety of Alpinia cerana var. capitis with blockchain technology, and in particular to a method for constructing a traceability model of Alpinia cerana var. capitis based on blockchain multi-consensus. Background Art
[0002] With the rapid development of the industry with the growing demand for black-skinned Alpinia pilosa, the overall production of black-skinned Alpinia pilosa has shown a continuous upward trend in recent years, and the main body of the black-skinned Alpinia pilosa industry has shifted towards large-scale industrial production. As an effective means of supervising and controlling the quality of black-skinned Alpinia pilosa products, the traceability system has become an important tool to ensure the quality and safety of its products.
[0003] However, the traditional traceability system is usually managed by a single organization, and its database independently manages the data of the entire supply chain, resulting in a highly centralized system. The traceability data is easily tampered with, making it impossible to ensure the authenticity of the traceability information. In the traceability scenario of the black-skinned Alpinia fasciata supply chain, the application of blockchain technology can effectively improve the credibility of the traceability data of the black-skinned Alpinia fasciata.
[0004] However, due to the many links, long range and large amount of data in the supply chain of Alpinia fasciata, the traceability system has high fault tolerance and efficiency requirements. In addition, the supply chain of Alpinia fasciata has many problems such as long chain, multiple entities, low efficiency of traceability data, and difficulty in real-time supervision of on-chain data, which cannot effectively guarantee the comprehensiveness and credibility of traceability data. Summary of the invention
[0005] In order to solve the above technical problems, this application proposes the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a method for constructing a black-skinned Alpinia thunbergii traceability model based on blockchain multi-consensus, including: using a hyperledger to construct a blockchain network for a black-skinned Alpinia thunbergii supply chain information traceability system;
[0007] Improving the Merkel tree storage structure for each block of the blockchain network;
[0008] The nodes in the blockchain network use a multi-consensus mechanism and reach consensus within and between groups through strategic grouping.
[0009] In a possible implementation, the Merkel tree storage structure is improved for each block of the blockchain, including:
[0010] Acquire transaction information and store it in a data node; perform hash calculation on the transaction information stored in the data node, and store the calculated hash value in a first node, wherein the first node includes a plurality of nodes;
[0011] Hash values of three adjacent layers in the first node are hashed, and the calculated hash values are stored in a second node, where the second node includes a plurality of nodes;
[0012] Hash calculation is performed on the hash values of three adjacent layers in the second node to achieve progression between the layers and eventually form a Merkel root.
[0013] In a possible implementation, the nodes in the blockchain network use a multi-consensus mechanism to reach consensus within and between groups by means of strategy grouping, including: a probability grouping stage, a strategy grouping stage, and a multi-consensus stage, wherein the strategy grouping stage includes:
[0014] Randomly select x nodes to form the initial management node set. The selection criteria are the response speed between other nodes and the management node, forming X consensus sets.
[0015] Each management node has a list of group members X i Check to see if the number of test nodes exceeds N max ;
[0016] If the number of nodes exceeds N max , then new nodes are no longer allowed to join the group;
[0017] Alternatively, if the number of nodes does not reach the upper limit, broadcast and start receiving member messages <GROUP,t1,X i >σ i , where N max is the maximum number of nodes that can be tolerated within the group, t1 is the timer, X i is the list of nodes contained in the current group, σ i Signature for the management node;
[0018] After the grouping is completed, the management nodes each have their own group list X i Broadcast and verify, and send the information to each member in the group to complete the group confirmation.
[0019] In a possible implementation, if the number of nodes does not reach the upper limit, the node broadcasts and starts to receive member messages, including: when node a receives the broadcast message from the management node, it verifies the correctness of the message signature. If the verification is correct, node a submits a membership application to the management node.<GROUP-REOUEST,a,t2> σ a ;
[0020] After receiving the application for joining the group and verifying that it is correct, the management node agrees to allow node a to join the group member list X i , and reverse message confirmation <GROUP-COMMIT,t3,Xi >σ i .
[0021] In a possible implementation, the use of a multi-consensus mechanism to reach a consensus within the group includes: an intra-group pre-qualification phase and an intra-group qualification phase, wherein the intra-group pre-qualification phase includes:
[0022] The master node within the group first receives and signs the transaction data of the client;
[0023] Each node generates a unique data-ID for each transaction data and combines the relevant information into<pre-commit,data-ID,data-sk,data-hash> Then send it to the first replica node;
[0024] After receiving the message, the first replica node decrypts and verifies the message using the public key of the master node.
[0025] In a possible implementation, the intra-group qualification phase includes: when the master node receives more than 2f+1 qualification messages from the secondary nodes, the master node generates a combined signature data-sk-list and then sends<commit,data-ID,data-sk,data-hsh,tata-sk-list> Message to the second replica node;
[0026] The second replica node receives<commit,data-ID,data-sk,data-hash,data-sk-list> After receiving the message, verify whether the data-ID exists in the previous pre-commit message and verify the signature of the master node;
[0027] If the verification is successful, confirm again whether the nodes in the data-sk-list signature set exceed 2f+1;
[0028] After confirmation, the second replica node replies<commit-ack,data-ID,data-sk,data-hash,node-ID> Message to the master node.
[0029] In a possible implementation, verifying the message by using the public key of the master node includes:
[0030] Use the verification strategy to test whether the transaction data has data-ID;
[0031] If the verification result is true, the message application is rejected;
[0032] Alternatively, if the verification result is false, continue to verify whether the value of the message is consistent with the hash value;
[0033] If the value is consistent with the hash value, the first replica node confirms it with the private key signature and replies<pre-commit-ack,data-ID,data-sk,data-hash,node-ID> information.
[0034] In a possible implementation, the use of a multi-consensus mechanism to reach consensus among groups includes: a pre-prepare stage, a prepare stage, and a commit stage. The pre-prepare stage includes:
[0035] After successfully verifying the request message containing multiple transactions sent from the client node, the master node sends a pre-prepare message to all slave nodes; once the slave node receives the pre-prepare message, it begins to verify the legitimacy of the message and initiates the network-wide broadcast of the corresponding prepare message.
[0036] In a possible implementation, the prepare phase includes: the node starts to collect the received prepare messages; when a node receives 2f+1 consistent prepare messages, the node has entered the block submission state; and the broadcast of the commit message is started.
[0037] In a possible implementation, the commit phase includes: all nodes begin to collect received commit messages; when a node receives 2f+1 consistent commit messages, the node directly submits the block data cached in itself to the database.
[0038] Compared with the prior art, the present invention has the following beneficial effects:
[0039] (1) The blockchain-based traceability model of this application uses a distributed ledger, where data is stored on multiple nodes and linked to the previous block through cryptographic hashing, ensuring that the data cannot be tampered with. Therefore, the application of blockchain technology provides a higher level of data security for the shiitake mushroom traceability model.
[0040] (2) This application improves the Merkle tree storage structure. The Merkle tree file memory is small and is suitable for scenarios where a small amount of data is stored. Therefore, based on the analysis of the traceability data of each link, the Merkle tree storage structure is improved according to the data storage requirements to achieve efficient verification and storage of data.
[0041] (3) This application proposes a multi-consensus mechanism that introduces a strategy grouping approach to perform consensus within and between groups, thereby improving the quality of the consensus algorithm and the dynamics of the nodes, thereby reducing the system consensus delay and improving throughput. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic diagram of a black-skinned Alpinia fasciata traceability model based on blockchain multi-consensus provided in an embodiment of the present application;
[0043] Figure 2 A schematic diagram of a method for constructing a traceability model of Alpinia fasciata based on blockchain multi-consensus provided in an embodiment of the present application;
[0044] Figure 3 A flow chart for the supply chain of black-skinned Alpinia fasciata provided in the embodiment of the present application;
[0045] Figure 4 An improved Merkle tree storage structure diagram provided in an embodiment of the present application;
[0046] Figure 5 A multi-consensus mechanism flow chart provided for an embodiment of the present application;
[0047] Figure 6 This is a Chain-raft process optimization diagram provided for an embodiment of the present application. DETAILED DESCRIPTION
[0048] The present solution is described below in conjunction with the accompanying drawings and specific implementation methods.
[0049] Figure 1 A schematic diagram of the traceability model of Alpinia fasciata based on blockchain multi-consensus provided in the embodiment of the present application, Figure 2 A schematic diagram of a method for constructing a black-skinned Alpinia fasciata traceability model based on blockchain multi-consensus provided in an embodiment of the present application, see Figure 2 In this embodiment, a method for constructing a traceability model of Alpinia solani based on blockchain multi-consensus includes:
[0050] S101, a blockchain network built using Hyperledger for the supply chain information traceability system of Alpinia solani.
[0051] See also Figure 3 , the information flow characteristics of black-skinned Alpinia solani products are analyzed in the supply chain of black-skinned Alpinia solani. Each link may contain multiple small links, and each small link also contains multiple specific steps. The information of each link is automatically collected through IoT devices such as surveillance cameras, temperature and humidity sensors, RFID radio frequency identification devices, and label scanning devices, which can effectively improve the accuracy and timeliness of the data.
[0052] S102, improving the Merkel tree storage structure for each block of the blockchain network.
[0053] In order to meet the efficient verification of the traceability data transaction of black-skinned Alpinia fasciata, the Merkle tree storage structure is improved for each block of the blockchain network in this embodiment. Among them, in the improved Merkle tree storage structure, after the transaction information is embedded in the data node, it is stored in the leaf node of the tree structure, and the new higher-level hash value is generated by hashing the three hash values of the lower layer. Through periodic hash operations, it progresses between the levels and finally forms a Merkle root.
[0054] See also Figure 4 In the embodiment of the present application, the improved Merkle tree storage structure generates a root hash value, and the concept of non-structural nodes is introduced. Non-structural nodes are used between two hash values generated at the bottom layer to optimize the structure of the tree. Figure 3 In the figure, node b is a non-structural node, and nodes e and h are structural nodes. Data1-7 in the figure are data nodes that store transaction information. The transaction information stored in the data nodes is hashed, and the hash values obtained are stored in nodes b, d, e, f, g, h, and i. Then the system performs hash operations on the hash values stored in nodes d, e, f and g, h, and i, respectively, and the obtained hash values are stored in nodes a and c, respectively. The system continues to perform hash operations on the hash values in nodes a, b, and c, and the resulting root hash value is stored in the Merkle root.
[0055] When constructing the improved Merkle tree storage structure in this embodiment, if the amount of transaction information is not enough to form a complete Merkle tree, empty positions will be left at the bottom layer. This means that in the process of constructing the Merkle tree, there will be some unfilled data nodes. These empty positions will be used as non-structural nodes, and their hash values will be obtained by hashing their parent nodes.
[0056] In the traditional Merkle tree storage structure, light nodes must start from the bottom layer and perform hash operations layer by layer to complete verification. However, this embodiment transforms the storage structure of the Merkle tree and defines that the hash value is generated by the hash values of three adjacent layers. When both have the same node transaction data, the generated Merkle tree will have fewer layers. When the newly inserted non-structural node contains data transaction information, the number of hash values generated by full node operations in the tree structure is relatively small, which will reduce the transmission load. Therefore, the improved Merkle tree storage structure has significant advantages in improving verification efficiency.
[0057] In addition, when verifying transactions in the improved Merkle tree storage structure, the transaction information is distributed in different node locations, which will also cause differences in the data transmission time of the full node, the number of hash operations performed, and the time required to complete verification. When transaction information is stored in a structure close to the root of the Merkle tree, the amount of data transmitted by the node will be reduced. This is because storing key transaction information with a high verification frequency in the upper data nodes of the Merkle tree can achieve an efficient verification process.
[0058] S103, using a multi-consensus mechanism to group the nodes in the blockchain network by strategies to reach consensus within and between groups.
[0059] In order to meet the requirements of low consensus delay and high throughput in the supply chain of Alpinia fasciata, it is necessary to improve the consensus efficiency of the traceability system. In this embodiment, a multi-consensus mechanism is proposed, which introduces a strategy grouping method to conduct consensus within and between groups, improve the quality of the consensus algorithm and the dynamics of the nodes, thereby reducing the system consensus delay and improving the throughput.
[0060] See also Figure 5 , the multi-consensus mechanism flow chart provided in the embodiment of the present application includes three stages, specifically, the probability grouping stage, the strategy grouping stage and the multi-consensus stage. Among them, in the multi-consensus mechanism probability grouping stage, all nodes in the black-skinned Alpinia fasciata supply chain need to be registered in the system and assigned a unique identifier, as well as a security certificate or key pair associated with it. In the PBFT consensus algorithm, when the number of nodes is 3f+1, a maximum of f Byzantine nodes are tolerated, resulting in a consensus failure rate of nearly 1 / 3, thereby frequently triggering viewchange to switch the master node, significantly reducing system performance. The method based on probability grouping helps to reduce the failure rate of consensus, thereby improving system performance.
[0061] In the strategy grouping stage, as the number of nodes increases, the PBFT consensus algorithm faces the problem of rapidly increasing complexity of communication between nodes, which leads to a gradual increase in the communication burden of the master node. By introducing a grouping mechanism, consensus is first performed within the group, and then between groups, which can effectively reduce the complexity of communication and slow down its growth rate. This grouping strategy successfully reduces the communication pressure of a single master node by setting up master nodes both within and between groups. According to the strategy grouping, a large number of nodes are divided into multiple groups to reduce the scale of consensus nodes and simplify the complexity of consensus.
[0062] In this embodiment, the specific steps of the grouping strategy include:
[0063] (1) Nodes need to verify their identities when joining the alliance chain. First, x nodes are randomly selected to form the initial management node set. The selection criteria are the response speed between other nodes and the management node, forming a consensus set of X.
[0064] (2) Each management node lists X of its group members i Check to see if the number of test nodes exceeds N max , if the number of nodes exceeds N max , no new nodes are allowed to join the group. If the upper limit of the number of nodes is not reached, the group will be broadcast and start receiving member messages. <GROUP,t1,X i >σ i , where N max is the maximum number of nodes that can be tolerated within the group, t1 is the timer, X i is the list of nodes contained in the current group, σ i Signature of the management node.
[0065] (3) When node a receives the broadcast message from the management node, it verifies the correctness of the message signature. If the verification is correct, node a submits a group application to the management node.<GROUP-REOUEST,a,t2> σ a .
[0066] (4) After the management node receives the application for joining the group and verifies that it is correct, it agrees to allow node a to join the group member list X i , and reverse message confirmation <GROUP-COMMIT,t3,X i >σ i .
[0067] (5) After the grouping is completed, the management nodes each have their own group list X i Broadcast, verify, and send this information to each member of the group to complete the group confirmation.
[0068] The multi-consensus mechanism in this embodiment is a multi-consensus mechanism based on PBFT. By using the identity authentication mechanism for nodes to join the alliance chain, better grouping can be performed. The reason for node grouping is that although an additional grouping process is introduced, re-grouping will only be performed when consensus fails. According to the probabilistic grouping algorithm proposed in this article, the consensus failure rate of the system is reduced, and the communication pressure between consensus nodes is reduced. At the same time, through this grouping process, the activity of the system is guaranteed. After grouping, each group is equipped with a master node. This design helps to reduce the communication pressure of the master node in the consensus node. Strategy grouping can reduce the scale of consensus nodes and simplify the complexity of consensus.
[0069] In the multi-consensus stage, the supply chain groups reach consensus based on the PBFT consensus, and the PBFT consensus is also applied within each group. The communication complexity will be O(n 2) growth. To this end, we conduct Chain-raft consensus within each group. The parallel consensus mechanism between groups can be carried out through component aggregation signature confirmation messages, making the consensus communication complexity within the group reach O(n), reducing the communication complexity of consensus between systems. PBFT consensus is used between groups to ensure Byzantine fault tolerance between groups.
[0070] In this embodiment, the intra-group consensus applies the Byzantine fault-tolerant Chain-raft algorithm, which is divided into two key stages, namely the intra-group pre-qualification stage and the intra-group qualification stage. The specific steps of the intra-group pre-qualification stage include: the master node within the group first receives and signs the transaction data of the client. In order to improve the security and integrity of the transaction data, the data hash value (data-hash) is generated by the private key. Each node generates a unique data-ID corresponding to each transaction data, and combines the relevant information into<pre-commit,data-ID,data-sk,data-hash> After receiving the message, the replica node decrypts the message with the public key of the master node and performs a series of verification steps. First, the verification strategy is used to test whether the transaction data has data-ID. If the verification result is true, the message application is rejected. If the verification result is false, the value is verified to be consistent with the hash value. If they are consistent, the replica node confirms and replies with the private key signature.<pre-commit-ack,data-ID,data-sk,data-hash,node-ID> information.
[0071] The specific steps of the qualification phase within the group include: When the master node receives more than 2f+1 qualification messages from the secondary nodes, the master node generates a combined signature data-sk-list and then sends<commit,data-ID,data-sk,data-hash,data-sk-list> The replica node receives the message.<commit,data-ID,data-sk,data-hash,data-sk-list> After the message, verify whether the data-ID exists in the previous pre-commit message, and then verify the signature of the master node. If the verification is successful, confirm again whether the nodes in the data-sk-list signature set exceed 2f+1. After the verification is successful, the replica node replies<commit-ack,data-ID,data-sk,data-hash,node-ID> Message to the master node.
[0072] See also Figure 6 The process of the Chain-raft consensus algorithm is that a transaction first goes through the pre-commit stage, the master node collects the signature set data-sk-list, and then enters the commit stage, and the master node collects the signature set data-sk-list again. In order to optimize the consensus process, when the master node is in the commit stage of the first transaction, it can send the pre-commit message of the second transaction at the same time. In this way, the master node can receive the commit-ack reply of the first transaction and the pre-commit-ack reply of the second transaction at the same time, which effectively improves the efficiency of the consensus process.
[0073] In this embodiment, the inter-group consensus phase includes three stages of PBFT consensus, namely, the pre-prepare phase, the prepare phase, and the commit phase, in which the inter-group nodes use the consensus algorithm to complete the collaborative recognition and consistency guarantee of data.
[0074] (1) Pre-prepare stage: After successfully verifying the request message containing multiple transactions sent from the client node, the master node sends a pre-prepare message to all slave nodes. The request message carries information about multiple transactions. Once the slave node receives the pre-prepare message, it begins to verify the legitimacy of the message and initiates the network-wide broadcast of the corresponding prepare message.
[0075] (2) Prepare phase: Nodes start to collect the received prepare messages. When a node receives 2f+1 consistent prepare messages, it has entered the block submission state and starts broadcasting the commit message.
[0076] (3) Commit phase: All nodes begin to collect the received commit messages. When a node receives 2f+1 consistent commit messages, the node directly submits the block data cached in itself to the database.
[0077] This consensus process ensures that in a Byzantine fault-tolerant environment, each node can effectively collaborate, verify the legitimacy of the message and reach a consistent threshold, and finally complete the confirmation and submission of the transaction. This phased process ensures the reliability and security of the consensus.
[0078] In the embodiments of the present application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B can mean that A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0079] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0080] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for constructing a traceability model of Alpinia solani based on blockchain multi-consensus, characterized in that: include: Use Hyperledger to build a blockchain network for the supply chain information traceability system of Alpinia fasciata; Improving the Merkel tree storage structure for each block of the blockchain network; The nodes in the blockchain network use a multi-consensus mechanism and reach consensus within and between groups through strategic grouping.
2. The method for constructing a black-skinned Alpinia solani traceability model based on blockchain multi-consensus according to claim 1, characterized in that: The Merkel tree storage structure is improved for each block of the blockchain, including: Obtain transaction information and store it in the data node; By performing hash calculation on the transaction information stored in the data node, the calculated hash value is stored in a first node, and the first node includes a plurality of nodes; Hash values of three adjacent layers in the first node are hashed, and the calculated hash values are stored in a second node, where the second node includes a plurality of nodes; Hash calculation is performed on the hash values of three adjacent layers in the second node to achieve progression between the layers and eventually form a Merkel root.
3. The method for constructing a black-skinned Alpinia solani traceability model based on blockchain multi-consensus according to claim 1, characterized in that, The nodes in the blockchain network use a multi-consensus mechanism to reach consensus within and between groups through strategic grouping, including: a probability grouping stage, a strategic grouping stage, and a multi-consensus stage. The strategic grouping stage includes: Randomly select x nodes to form the initial management node set. The selection criteria are the response speed between other nodes and the management node, forming X consensus sets. Each management node has a list of group members X i Check to see if the number of test nodes exceeds N max ; If the number of nodes exceeds N max , then new nodes are no longer allowed to join the group; Alternatively, if the number of nodes does not reach the upper limit, broadcast and start receiving member messages <GROUP,t1,X i >σ i , where N max is the maximum number of nodes that can be tolerated within the group, t1 is the timer, X i is the list of nodes contained in the current group, σ i Signature for the management node; After the grouping is completed, the management nodes each have their own group list X i Broadcast and verify, and send the information to each member in the group to complete the group confirmation.
4. The method for constructing a black-skinned Alpinia solani traceability model based on blockchain multi-consensus according to claim 3, characterized in that, If the number of nodes does not reach the upper limit, broadcast and start receiving member messages, including: When node a receives the broadcast message from the management node, it verifies the correctness of the message signature. If the verification is correct, node a submits a group application to the management node.<GROUP-REOUEST,a,t2> σ a ; After the management node receives the application for joining the group and verifies that it is correct, it agrees to allow node a to join the group member list X i , and reverse message confirmation <GROUP-COMMIT,t3,X i >σ i .
5. The method for constructing a black-skinned Alpinia solani traceability model based on blockchain multi-consensus according to claim 3, characterized in that, The use of the multi-consensus mechanism to reach consensus within the group includes: a pre-qualification stage within the group and a qualification stage within the group. The pre-qualification stage within the group includes: The master node within the group first receives and signs the transaction data of the client; Each node generates a unique data-ID for each transaction and combines the relevant information into<pre-commit,data-ID,data-sk,data-hash> Then send it to the first replica node; After receiving the message, the first replica node decrypts and verifies the message using the public key of the master node.
6. The method for constructing a black-skinned Alpinia fasciata traceability model based on blockchain multi-consensus according to claim 5, characterized in that: The in-group qualification stage includes: When the master node receives more than 2f+1 qualification messages from the slave nodes, the master node generates a combined signature data-sk-list and then sends<commit,data-ID,data-sk,data-hash,data-sk-list> Message to the second replica node; The second replica node receives<commit,data-ID,data-sk,data-hash,data-sk-list> After receiving the message, verify whether the data-ID exists in the previous pre-commit message and verify the signature of the master node; If the verification is successful, confirm again whether the nodes in the data-sk-list signature set exceed 2f+1; After confirmation, the second replica node replies<commit-ack,data-ID,data-sk,data-hash,node-ID> Message to the master node.
7. The method for constructing a black-skinned Alpinia fasciata traceability model based on blockchain multi-consensus according to claim 5, characterized in that: Verifying the message by the public key of the master node includes: Use the verification strategy to test whether the transaction data has data-ID; If the verification result is true, the message application is rejected; Alternatively, if the verification result is false, continue to verify whether the value of the message is consistent with the hash value; If the value is consistent with the hash value, the first replica node confirms it with the private key signature and replies<pre-commit-ack,data-ID,data-sk,data-hash,node-ID> information.
8. The method for constructing a black-skinned Alpinia solani traceability model based on blockchain multi-consensus according to claim 1, characterized in that: The use of a multi-consensus mechanism to reach consensus among groups includes: a pre-prepare stage, a prepare stage, and a commit stage. The pre-prepare stage includes: After successfully verifying the request message containing multiple transactions sent from the client node, the master node sends a pre-prepare message to all slave nodes; once the slave node receives the pre-prepare message, it begins to verify the legitimacy of the message and initiates the network-wide broadcast of the corresponding prepare message.
9. The method for constructing a black-skinned Alpinia fasciata traceability model based on blockchain multi-consensus according to claim 8, characterized in that: The prepare phase includes: The node starts to collect the received prepare messages; When a node receives 2f+1 consistent prepare messages, the node has entered the block submission state; Start broadcasting the commit message.
10. The method for constructing a traceability model of Alpinia solani based on blockchain multi-consensus according to claim 9, characterized in that: The commit phase includes: All nodes start collecting received commit messages; When a node receives 2f+1 consistent commit messages, the node directly submits the block data cached in itself to the database.
