CN114663104A - PBFT based on block chain product supply chain tracing - Google Patents

PBFT based on block chain product supply chain tracing Download PDF

Info

Publication number
CN114663104A
CN114663104A CN202011416293.3A CN202011416293A CN114663104A CN 114663104 A CN114663104 A CN 114663104A CN 202011416293 A CN202011416293 A CN 202011416293A CN 114663104 A CN114663104 A CN 114663104A
Authority
CN
China
Prior art keywords
nodes
node
pbft
chain
supply chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011416293.3A
Other languages
Chinese (zh)
Inventor
方维维
童忆
赵宏智
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Fangxinwei Information Technology Co ltd
Original Assignee
Jiangsu Fangxinwei Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Fangxinwei Information Technology Co ltd filed Critical Jiangsu Fangxinwei Information Technology Co ltd
Priority to CN202011416293.3A priority Critical patent/CN114663104A/en
Publication of CN114663104A publication Critical patent/CN114663104A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/018Certifying business or products
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction

Abstract

The invention discloses a PBFT based on block chain product supply chain tracing, which is designed and realized by aiming at the characteristics of numerous product supply chain participants and centralized storage; PBFT is proposed. Deploying an intelligent contract of a selection node in the blockchain network, enabling the node which accords with the intelligent contract reference rule to become a candidate node, ranking all the candidate nodes in a hierarchical manner, and selecting a plurality of nodes according to the ranking to be added into the blockchain network for distributed accounting; based on the idea of the PBFT algorithm, the invention designs and realizes a consensus algorithm for improving the system performance; the communication overhead of the system is reduced, and the consensus efficiency and the throughput of the system are improved.

Description

PBFT based on block chain product supply chain tracing
Technical Field
The invention belongs to the technical field of product supply chain traceability, and particularly relates to a PBFT based on block chain product supply chain traceability.
Background
With the rapid development of society, the improvement of living standard and the transformation of consumption concept, the step of pursuing health of people is never stopped, and more diversified products (such as food, household goods and the like) have more and more quality safety problems to be paid much attention by consumers. However, the inventor finds that the intercommunication of circulation information between corresponding main bodies of product circulation in the existing mainstream traceability system is difficult, the unified traceability of the circulation information of each life cycle of the product is difficult, and the circulation information provided by each circulation main body record is difficult to be trusted; if the product has quality problems, the problem links and related responsible persons are difficult to locate.
The PBFT algorithm is generally applied to a alliance chain, and the alliance chain is characterized in that most of nodes in a network are credible, so that a consistency protocol of the PBFT algorithm is optimized under the condition that Byzantine nodes do not exist, and communication overhead is reduced.
Disclosure of Invention
The purpose of the invention is as follows: aiming at the defects in the prior art, the invention designs and realizes a consensus algorithm for improving the system performance based on the idea of the PBFT algorithm; the communication overhead of the system is reduced, and the consensus efficiency and the throughput of the system are improved.
The technical scheme is as follows: in order to achieve the purpose of the invention, the technical scheme adopted by the invention is as follows:
a block chain product supply chain traceability based PBFT, the method comprising the steps of:
s1, designing and realizing a PBFT-based multi-module trusted traceability model according to the characteristics of numerous participants of the product supply chain and centralized storage;
s2, forming a alliance chain by connecting four key nodes of production, processing, quality inspection and transportation on the product supply chain;
s3, each node of the product supply chain is independent and equal, so that the formed alliance chain does not need to elect a main node to generate blocks, the accounting right of each node is guaranteed, and the data transmission performance is effectively improved;
s4, designing three modules of a user contract, an event contract and an administrator contract by using an intelligent contract mechanism, and verifying operation requests of a client in a product alliance chain through a tested contract function;
s5, the PBFT is proposed for the product supply chain according to the above step S1.
And S6, according to the client alliance chains formed in the step S2, deploying the program to the blockchain through testing of chain code logic.
S7, establishing independent block information through IPBFT, realizing one-to-one mapping of personal information and operation information by using intelligent contract, and the alliance chain users commonly maintain product supply chain information to ensure the real security of data and the realization of tamper resistance.
The step S5 specifically includes: s51, deploying an intelligent contract of the selected nodes in the blockchain network, enabling the nodes which accord with the intelligent contract reference rule to become candidate nodes, ranking all the candidate nodes in a hierarchical manner, and selecting a plurality of nodes to be added into the blockchain network according to the ranking for distributed accounting;
and step S52, after the nodes become the accounting nodes, blocks are generated among the accounting nodes through PBFT, the accounting nodes become main nodes in a view in turn according to the contribution of the accounting nodes to the network, the main nodes package and package the contents needing to be identified and broadcast in the network, other replica nodes perform identification after receiving the broadcast contents, after the phases of REQUEST, PRE-PREPARE, PREPARE and COMMIT are carried out, the number of the nodes achieving identification in the network is more than 2/3, and new blocks are generated.
And step S53, analyzing the main node and punishing the main node.
Further, in step S51, the node passing rate of the smart contract is set to be greater than 2/3, the smart contract uses a credit integration scheme, the initial integration of all selected nodes is set to 0, when the selected nodes perform the first consensus, the integration that is not a node or a malicious node is reduced, and the integration that is actively involved in the consensus is increased. And presetting a time interval TA, ranking all elected nodes according to the point condition when the TA time is reached, replacing the nodes with lower points by the re-elected nodes, and withdrawing the accounting right of the replaced nodes.
Further, in step S52, the client signs the content that needs to be identified together, and sends the content that needs to be identified together to the blockchain network, and any node in the blockchain network receives the content that needs to be identified together and determines whether the transaction meets the forwarding condition, if yes, the transaction is cached in the consensus queue, before a new round of identification, the blockchain system is initialized, and the transaction with the highest priority is taken out from the consensus queue, thereby implementing dynamic election; numbering the enumerated nodes by numbers, wherein the node set is G {0, 1, 2, 3, 4, … … }, the maximum tolerable malicious node number in G is n, and the set size is larger than 3n +1 according to a PBFT mechanism; let | G | ═ 3n + 1. N is the number of nodes in the set G; after each re-election, the nodes are randomly re-numbered; selecting a bargaining node p before each consensus process, wherein p is (h + v) mod | R |;
wherein h is the height of the block, v is the view number, and the chairman node p is responsible for the whole consensus process.
Further, the initializing blockchain system creates a consensus object that includes the height of the blockchain to be generated, a timestamp, a hash header of the blockchain, and a packed transaction set.
Further, the forwarding condition is to determine whether the signature of the transaction is correct, check whether the node has received the input of the transaction before, and ensure that the initiating client of the transaction has enough balance to pay the fee generated by the transaction.
Has the advantages that: compared with the prior art, the invention has the following advantages: the invention designs and realizes a consensus algorithm for improving the system performance based on the idea of the PBFT algorithm; the communication overhead of the system is reduced, and the consensus efficiency and the throughput of the system are improved.
Drawings
Fig. 1 is a diagram of a product credible traceability model in a block chain-based product supply chain traceability method provided by the present invention;
FIG. 2 is a schematic diagram illustrating the node election process in step S5 according to the present invention;
fig. 3 is a schematic diagram illustrating the master node performing the network-wide broadcasting in step S5 according to the present invention.
Detailed Description
The present invention will be further illustrated with reference to the accompanying drawings and specific examples, which are carried out in the light of the technical solutions of the present invention and are understood to be illustrative only and not limiting to the scope of the present invention.
As shown in fig. 1, the method comprises the following steps based on PBFT of block chain product supply chain tracing:
s1, designing and realizing a PBFT-based multi-module trusted traceability model according to the characteristics of numerous participants of the product supply chain and centralized storage;
s2, connecting four key nodes of production, processing, quality inspection and transportation in a product supply chain to form an alliance chain;
s3, each node of the product supply chain is independent and equal, so that the formed alliance chain does not need to elect a main node to generate blocks, thereby ensuring the accounting right of each node and effectively improving the data transmission performance;
s4, designing three modules of a user contract, an event contract and an administrator contract by using an intelligent contract mechanism, and verifying operation requests of a client in a product alliance chain through a tested contract function;
s5, the PBFT is proposed for the product supply chain according to the above step S1.
And S6, according to the client alliance chains formed in the step S2, deploying the program to the blockchain through testing of chain code logic.
S7, establishing independent block information through IPBFT, realizing one-to-one mapping of personal information and operation information by using intelligent contracts, and ensuring real security and tamper-proof realization of data by jointly maintaining product supply chain information by users of alliance chain.
As shown in fig. 2 and 3, step S5 specifically includes: s51, deploying an intelligent contract of the selected nodes in the blockchain network, enabling the nodes which accord with the intelligent contract reference rule to become candidate nodes, ranking all the candidate nodes in a hierarchical manner, and selecting a plurality of nodes to be added into the blockchain network according to the ranking for distributed accounting;
and step S52, after the nodes become the accounting nodes, blocks are generated among the accounting nodes through PBFT, the nodes become main nodes in view in turn according to the contribution of the accounting nodes to the network, the main nodes package and package the contents needing to be identified and broadcast the contents in the network, other replica nodes carry out identification after receiving the broadcast contents, after the phases of REQUEST, PRE-PREPARE, PREPARE and COMMIT are carried out, the number of the nodes reaching identification in the network is more than 2/3, and new blocks are generated.
And step S53, analyzing the main node and punishing the main node.
In step S51, the node passing rate of the intelligent contract is set to be greater than 2/3, the intelligent contract adopts a credit score system, the initial scores of all the selected nodes are set to be 0, when the selected nodes perform first consensus, the scores that are not nodes or malicious nodes are reduced, and the scores are increased for nodes actively participating in the consensus. And presetting a time interval TA, ranking all elected nodes according to the point condition when the TA time is reached, replacing the nodes with lower points by the re-elected nodes, and withdrawing the accounting right of the replaced nodes.
In step S52, the client signs the content needing consensus and sends the consensus to the blockchain network, any node in the blockchain network receives the content needing consensus and judges whether the transaction meets the forwarding condition, if yes, the transaction is cached in the consensus queue, before a new round of consensus, the blockchain system is initialized, and the transaction with the highest priority is taken out from the consensus queue, thereby implementing dynamic election; numbering the selected nodes by numbers, wherein the node set is G {0, 1, 2, 3, 4, … … }, the maximum tolerable malicious node number in G is n, and the set size is larger than 3n +1 according to a PBFT mechanism; let | G | ═ 3n + 1. N is the number of nodes in the set G; after each re-election, the nodes are randomly re-numbered; selecting a bargaining node p before each consensus process, wherein p is (h + v) mod | R |;
where h is the height of the block, v is the view number, and the chairman node p is responsible for the entire consensus process.
Initializing the blockchain system to create a consensus object that includes the height of the blockchain to be generated, a timestamp, a hash header of the blockchain, and a packed transaction set.
The forwarding condition is to determine whether the signature of the transaction is correct, check whether the node has received the input of the transaction before, and ensure that the initiating client of the transaction has enough balance to pay the fee generated by the transaction.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (5)

1. PBFT based on block chain product supply chain tracing is characterized in that: the method comprises the following steps:
s1, designing and realizing a PBFT-based multi-module trusted traceability model according to the characteristics of numerous participants of the product supply chain and centralized storage;
s2, forming a alliance chain by connecting four key nodes of production, processing, quality inspection and transportation on the product supply chain;
s3, each node of the product supply chain is independent and equal, so that the formed alliance chain does not need to elect a main node to generate blocks, thereby ensuring the accounting right of each node and effectively improving the data transmission performance;
s4, designing three modules of a user contract, an event contract and an administrator contract by using an intelligent contract mechanism, and verifying operation requests of a client in a product alliance chain through a tested contract function;
s5, propose PBFT for the product supply chain according to the above step S1.
And S6, according to the client alliance chains formed in the step S2, deploying the program to the blockchain through testing of chain code logic.
S7, establishing independent block information through IPBFT, realizing one-to-one mapping of personal information and operation information by using intelligent contracts, and ensuring real security and tamper-proof realization of data by jointly maintaining product supply chain information by users of alliance chain.
The step S5 specifically includes: step S51, deploying intelligent contracts of the selected nodes in the block chain network, enabling the nodes meeting the intelligent contract selection rules to become candidate nodes, ranking all the candidate nodes in a grading system mode, selecting a plurality of nodes according to the ranking, adding the nodes into the block chain network, and performing distributed bookkeeping;
and step S52, after the nodes become the accounting nodes, blocks are generated among the accounting nodes through PBFT, the accounting nodes become main nodes in a view in turn according to the contribution of the accounting nodes to the network, the main nodes package and package the contents needing to be identified and broadcast in the network, other replica nodes perform identification after receiving the broadcast contents, after the phases of REQUEST, PRE-PREPARE, PREPARE and COMMIT are carried out, the number of the nodes achieving identification in the network is more than 2/3, and new blocks are generated.
And step S53, analyzing the main node and punishing the main node.
2. The block chain product-supply chain traceability-based PBFT according to claim 1, wherein: in step S51, the node passing rate of the intelligent contract is set to be greater than 2/3, the intelligent contract uses a credit integration system, the initial integration of all selected nodes is set to 0, when the selected nodes perform first consensus, the integration that is not a node or a malicious node is reduced, and the integration is increased for nodes actively participating in the consensus. And presetting a time interval TA, ranking all elected nodes according to the point condition when the TA time is reached, replacing the nodes with lower points by the re-elected nodes, and withdrawing the accounting right of the replaced nodes.
3. The block chain product-supply chain traceability-based PBFT according to claim 1, wherein: in step S52, the client signs the content that needs to be identified, and sends the identified content to the blockchain network, and any node in the blockchain network receives the content that needs to be identified, and determines whether the transaction meets the forwarding condition, if yes, the transaction is cached in the identified queue, before a new round of identification, the blockchain system is initialized, and the transaction with the highest priority is taken out from the identified queue, thereby implementing dynamic election; numbering the enumerated nodes by numbers, wherein the node set is G {0, 1, 2, 3, 4, … … }, the maximum tolerable malicious node number in G is n, and the set size is larger than 3n +1 according to a PBFT mechanism; let | G | ═ 3n + 1. N is the number of nodes in the set G; after each re-election, the nodes are randomly re-numbered; selecting a bargaining node p before each consensus process, wherein p is (h + v) mod | R |;
wherein h is the height of the block, v is the view number, and the chairman node p is responsible for the whole consensus process.
4. The block chain product-supply chain traceability-based PBFT according to claim 1, wherein: the initializing blockchain system creates a consensus object that includes the height of the blockchain to be generated, a timestamp, a hash header of the blockchain, and a packed transaction set.
5. The block chain product-supply chain traceability-based PBFT according to claim 1, wherein: the forwarding condition is to judge whether the signature of the transaction is correct or not, check whether the node has received the input of the transaction before, and ensure that the initiating client of the transaction has enough balance to pay the cost generated by the transaction.
CN202011416293.3A 2020-12-05 2020-12-05 PBFT based on block chain product supply chain tracing Pending CN114663104A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011416293.3A CN114663104A (en) 2020-12-05 2020-12-05 PBFT based on block chain product supply chain tracing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011416293.3A CN114663104A (en) 2020-12-05 2020-12-05 PBFT based on block chain product supply chain tracing

Publications (1)

Publication Number Publication Date
CN114663104A true CN114663104A (en) 2022-06-24

Family

ID=82025392

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011416293.3A Pending CN114663104A (en) 2020-12-05 2020-12-05 PBFT based on block chain product supply chain tracing

Country Status (1)

Country Link
CN (1) CN114663104A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114915428A (en) * 2022-07-18 2022-08-16 江苏数一科技服务有限公司 Alliance chain suitable for circulation steel is traceed to source
CN115514638A (en) * 2022-11-23 2022-12-23 湖南天河国云科技有限公司 Trust value updating method and device for supply chain consensus node
CN117194359A (en) * 2023-11-07 2023-12-08 国网信息通信产业集团有限公司 Data sharing method, device, equipment and medium supporting privacy protection

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114915428A (en) * 2022-07-18 2022-08-16 江苏数一科技服务有限公司 Alliance chain suitable for circulation steel is traceed to source
CN114915428B (en) * 2022-07-18 2022-11-18 江苏数一科技服务有限公司 Alliance chain suitable for circulation steel is traced to source
CN115514638A (en) * 2022-11-23 2022-12-23 湖南天河国云科技有限公司 Trust value updating method and device for supply chain consensus node
CN117194359A (en) * 2023-11-07 2023-12-08 国网信息通信产业集团有限公司 Data sharing method, device, equipment and medium supporting privacy protection

Similar Documents

Publication Publication Date Title
CN110113388B (en) Improved clustering algorithm-based block chain system consensus method and device
CN114663104A (en) PBFT based on block chain product supply chain tracing
CN110784346B (en) Reputation value-based PBFT consensus system and method
CN107231299A (en) A kind of chain route and realized the system that block chain communicates across chain
CN111625593B (en) Block chain-based data processing method and device and computer equipment
CN110928951B (en) Data sharing and arbitration method based on block chain
CN110611701B (en) Parameter configuration and transaction processing method based on block chain
CN107733855A (en) A kind of block catenary system and application process that can support publicly-owned chain, alliance's chain and privately owned chain simultaneously
CN108614748A (en) A kind of method of Byzantine failure tolerance and its economic governing system of logical card
CN112887380B (en) Cross-chain intercommunication method and system
CN113407640A (en) Multi-chain NFT (network File transfer) based chain crossing method and system
CN111478795B (en) Alliance block chain network consensus method based on mixed Byzantine fault tolerance
CN111047316A (en) Tamper-resistant intelligent block chain system and implementation method
CN111782723A (en) Double-layer product information tracing system architecture based on permission chain
Liu et al. Ltsm: Lightweight and trusted sharing mechanism of iot data in smart city
CN110620820A (en) Ubiquitous power Internet of things intelligent management system
US20230259938A1 (en) Blockchain-based data processing method and apparatus, device, readable storage medium and computer program product
CN115796261A (en) Block chain-based lightweight group consensus federated learning method
CN115499129A (en) Multimode trust cross-chain consensus method, system, medium, equipment and terminal
CN113448694B (en) Block chain consensus method for improving transaction processing capability
CN112801791B (en) Block chain consensus method and system based on authorization
CN106357604A (en) Cumulative, cooperative assembly method for consistent data
CN111695701B (en) System for realizing data set construction processing based on federal learning and construction generation method thereof
CN109391643A (en) Block chain light-weight technologg method, block chain node and storage medium
Gao et al. Improved byzantine fault-tolerant algorithm based on alliance chain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination