Enhanced Multiset Consensus Protocol Based on PBFT for Logistics Information Traceability

In the recent years, the global logistics industry has greatly driven the development of the world economy. At the same time, a large amount of data information is generated. Due to the frequent occurrence of logistics information leakage and forgery, it is necessary to fnd solutions that can accurately trace logistics information and ensure the security and authenticity of logistics information. Te birth of blockchain technology has transformed the logistics industry from quantitative change to qualitative change. Te technical characteristics of blockchain technology, such as distributed storage ideas, decentralization, immutability, and complex encryption consensus algorithm, endow it with a wide range of application prospects in the logistics industry. Tis paper proposes an enhanced multiset consensus algorithm based on PBFT (practical Byzantine fault tolerance) for logistics information traceability and storage on the logistics blockchain. Te application of the proposed multi-set consensus algorithm in the topology structure composed of multiple sets can improve the consensus efciency of logistics information in the blockchain. We improve consensus capability and transaction speed, avoid redundant consensus message packets occupying a large bandwidth, and efciently process logistics information generated at any time. We ensure the traceability of logistics information and achieve efcient and accurate traceability, and the efciency and security of the proposed algorithm are analyzed. Tis paper aims to solve the problems of traceability, trustworthiness, and efcient processing of blockchain applications in logistics information to operate the logistics network efciently. Tis paper compares the proposed algorithm with the PBFT-related expansion algorithm regarding bandwidth occupation, delay, and throughput. Te results show that the MPBFT consensus algorithm signifcantly improves the efciency of the logistics blockchain network.


Introduction
With the rapid development of e-commerce, the logistics industry and various Internet technologies have become more in-depth, and the logistics industry has become more intelligent.However, many problems in the logistics industry, such as the authenticity of data information and logistics traceability, still need to be solved urgently.Currently, there is a lot of fake data in the logistics industry; at the same time, with the gradual maturity of big data technology, logistics data information has become increasingly important national confdential information.Due to the characteristics of the logistics industry involving multiple regions, it is very suitable for applying decentralized blockchain technology.Te data in the blockchain are encrypted and stored in a distributed form and cannot be tampered with.Terefore, the logistics industry is exploring how to use blockchain technology better to protect logistics information's privacy, prevent information from being tampered with, and improve traceability.
Tis paper aims to study the application of blockchain technology in logistics information traceability scenarios."Logistics information" refers to the corresponding data generated by each link of logistics circulation.To efciently trace these data, this paper designs a logistics information traceability architecture based on a multiset consensus algorithm, which stores all logistics information indirectly on the blockchain to build a decentralized logistics blockchain.
According to the characteristics of logistics informatization, combined with the research status and application progress of blockchain technology in the logistics industry in domestic and foreign literature, a multiset consensus algorithm is proposed to improve the efciency of logistics blockchain information traceability and information authenticity and introduced the blockchain logistics-related solutions, as shown in Table 1.
How to ensure the security of logistics data is a crucial issue.On the one hand, establishing a traceable system to monitor the information on items is ideal for both managers and buyers.On the other hand, managing and sharing logistics data are a challenging job.Handling large amounts of data efciently and keeping it secure are critical.It is inappropriate and impractical to disclose all information about an item, as doing so may reveal the user's private information.It is also not advisable to rely entirely on information from the online world, as there may be some malicious attackers.Terefore, researchers must fgure out the right way to manage logistics data.Traditional methods, including data sampling [4,5], preprocessing [6], statistical analysis [7], and data mining [8], have insufcient security and low efciency for big data.As mentioned above, as emerging application technology, blockchain is essentially a database with attractive properties such as anticounterfeiting, traceability, and transparency [9].Based on these characteristics, using blockchain as a new foundation for logistics scenarios and its decentralization will beneft the industry's development.However, there are several key issues related to the physical world.One of the problems is that the network nodes on the blockchain are difcult to bind with physical entities, which we call the traceability problem.Generally speaking, only trusted nodes on the blockchain can be protected, and information fraud cannot be controlled at the level of a physical collection of information, so no matter how reliable the blockchain is, it cannot be used and managed.Tis article provides logistics traceability and data security protection at the information fow level.Previous studies combining blockchain and logistics scenarios mainly focused on designing diferent system levels, and a few focused on data reliability before investing in the blockchain.Other work is based on public key infrastructure (PKI) to achieve identity authentication [10].For the supply of goods, the digital identity issued by the certifcate authority (CA) is used to realize the binding of physical goods and network nodes on the blockchain.However, PKI is highly dependent on CAs responsible for the issues and management of private and public key pairs.It is essentially a centralized system and has the disadvantage of being centralized.On the other hand, even with the credentials of the data source and leveraging the blockchain to build the system, it still has problems due to the sheer volume of data.Logistics datasets are usually large scale in practical applications, so an efcient consensus algorithm is required to transmit all information to each node for users to query.Tis places great demands on the efciency of the blockchain network.
Te main content of this paper is to carry out an in-depth research expansion and feasibility study on the article [11] proposed earlier.Section 1 analyzes the problems in the logistics industry and the signifcance of logistics information traceability and expounds on the main research content of this paper.Section 2 introduces the background and related research of logistics information traceability studied in this paper.In addition, related consensus algorithms are also introduced.Section 3 is the logistics traceability system architecture based on a multiset consensus algorithm.Section 4 mainly introduces some improvements to the PBFT algorithm, proposes an efcient consensus algorithm for the logistics industry under MPBFT, avoids redundant consensus message packets, and proposes solutions to describe the basic model algorithm.Te algorithm improves the PBFT consensus efciency, reduces the network bandwidth of the logistics system, and further expounds the algorithm of the overall implementation process.In Section 5, the bandwidth test and performance analysis of the proposed MPBFT algorithm are carried out.Section 6 summarizes the work of this paper, puts forward some shortcomings, and puts forward some suggestions for the research and improvement of this paper.

Related Work
Tis section mainly studies the application of blockchain technology in logistics information traceability scenarios.Firstly, the background knowledge of logistics information traceability is briefy introduced.Ten, the existing consensus algorithm-related technologies of blockchain are introduced, and the application of blockchain technology in logistics information traceability and the research status at home and abroad are analyzed.

Background.
With the rapid development of the modern logistics industry, the logistics industry generates a large amount of data information, among which problems such as leakage of user cargo information have threatened people's life safety and should not be underestimated [12].In real life, the user's cargo information can generally be divided into two parts, one is the user's private information and the other is the information generated by the logistics in the process of cargo transportation.
At present, the following security threats still exist in the traceability of logistics information: (1) It is not easy to guarantee the confdentiality and authenticity of logistics information.Te logistics industry generally only pays attention to protecting consumers' private information, such as name, phone number, and address, and does not take protective measures for the logistics information generated during the transportation process, which is prone to generate a large amount of false information.(2) User authentication is difcult to achieve.In logistics and distribution, it is often sent to the receiving point.Tere is no shortage of malicious customers 2 Security and Communication Networks Development prototype verifcation traceability Implementing a prototype system using hyperledger Blockchain-Based Supply Chain Traceability: Token Recipes Model Manufacturing Processes [2] Proposing the token to calculate the gas cost A linear relationship between gas cost and the product is proposed to defne the relationship between ingredients and products

Research on Traceability Algorithm of Logistics Service Transaction
Based on Blockchain [3] Traceability algorithm of logistics service transaction Trough the proposed algorithm, the end-to-end traceability service of logistics service is realized Security and Communication Networks who might fake their identities to pick up packages that do not belong to them.
Faced with the above security threats, the research on logistics information traceability is highly signifcant.Solutions are urgently needed to ensure the traceability of logistics information's efciency, authenticity, and security.

Consensus Algorithm.
Reference [13] frst proposed the problem of how nodes participating in transaction maintenance in distributed ledgers reach consensus.Tis problem mainly needs to be verifed from the following three aspects: whether it has termination, whether it is consistent, whether it is valid, and whether it can.Te method to achieve the above three aspects is called the consensus algorithm.Te blockchain logistics traceability system and the consensus algorithm mechanism ensure that the information is decentralized and cannot be easily changed.Consensus refers to making most nodes (at least 51%) in the entire network trust that the data are reliable.At present, the mainstream consensus mechanism includes the proof of work (PoW), proof of interest (PoS), proof of entrusted Interest (DPOS), and Byzantine consensus (PBFT), as shown in Table 2. [14] is the consensus algorithm adopted in the Bitcoin system proposed by Nakamoto and Bitcoin.Te consensus algorithm ensures the consistency of transaction records by introducing the method of computing power competition to make nodes reach a consensus.However, one of the biggest shortcomings of the POW algorithm is the serious waste of computing power.

Proof of Stake.
A node holds many tokens, the node will want the currency to be stable, and the node will strive to maintain the system's normal operation and ensure the currency's stability.Terefore, the algorithm of accounting node selection to reach consensus can be designed by using the information related to the token held by the node, also known as the proof of stake algorithm (POS).Te advantage of the POS consensus algorithm is that it does not need to consume computing resources.Still, the disadvantage is that the nodes holding the largest number of tokens tend to monopolize the nodes, which deviates from the core idea of blockchain.

Delegated Proof of Stake.
Te DPOS algorithm is similar to the board system.To avoid centralizing some nodes with excessive rights, the algorithm uses "witnesses" to supervise the behavior of nodes [15].Tis algorithm is equivalent to partial decentralization, and the core lies in the representative select.Te DPOS algorithm eliminates the time transaction need to wait for verifcation by untrusted nodes, thereby increasing consensus speed.

Practical Byzantine Fault
Tolerance.Te PBFT algorithm [16,17] is divided into fve stages: request, preparation, preparation, submission, and reply.PBFT algorithm has the consistency protocol needed to reach a consensus.It includes the checkpoint protocol used to restrain nodes and the view-switching protocol needed to switch views after discovering faulty nodes.In a consistency protocol, the system broadcasts messages to other secondary nodes through the primary node and reaches a consensus by returning the message consistency.Te checkpoint protocol saves memory by periodically cleaning up contracted transaction data.Te view switchover protocol is used to initiate a view switchover to reselect the primary node when the primary node fails.PBFT algorithm has high consensus efciency and does not require much computing power maintenance.

Research Status of Consensus Algorithm and Application in Blockchain
Traceability.Te development of the logistics express industry should be refected in the huge volume of parcels brought by the current e-commerce industry and should pay attention to the transformation of the logistics industry from quantitative change to qualitative change.Te development of the worldwide logistics industry is increasingly moving towards a high-quality stage [18], in which blockchain technology is expected to endow the logistics industry with more intelligence and innovation by relying on its many unprecedented advantages.Many domestic and foreign researchers are discussing the application of blockchain technology in logistics information traceability scenarios, hoping to promote the logistics industry to another development climax.
Reference [19] uses side chain technology to design a supply chain traceability system.Te blockchain platform used in this system is Ethereum.Te literature focuses on analyzing the design of smart contracts, using smart contracts to manage goods and realizing logistics information's traceability.Reference [20] utilizes the Ethereum blockchain and smart contracts to efciently execute commercial transactions for soybean tracking and traceability throughout the agricultural supply chain.Te scheme utilizes smart contracts to manage and control all participants' interactive supply chain ecosystem transactions.Reference [21] developed a food traceability prototype system using blockchain technology for food safety issues.Tis document proposes a management architecture for on-chain and ofchain data through which traceability systems can alleviate the data explosion problem of IoT blockchains.Reference [22] proposed a blockchain-based drug traceability framework to prevent drug fraud, and logistics traceability was carried out from the start of drug production, including distribution.
Reference [23] applies blockchain to intelligent pallet management in logistics, proposes a Palletaa architecture, and studies the synergy of integrating alliance blockchain and IoT.A corresponding layered architecture is proposed to construct the system deployment in the industry.Te position-inventory-routing problem of the pallet pool is formulated to efciently manage pallet usage in the logistics industry.Reference [24] discusses the situation of BTCS from the perspective of industrial application and market competition.First, it expounds on the potential of BTCS and the gap between the ideal and reality of BCTS.Secondly, it discusses the applicability of BTSC, mainly through the game theory model, to the market.Te situation was discussed.Reference [25] summarizes the application of blockchain in traceability.First, it analyzes the problems that need to be solved in the traceability scenario, then expounds on the related technologies of blockchain, and points out how these technologies can be applied to the traceability scenario.Literature [26][27][28] is based on the current social conditions where smartphones are popularized; the anticounterfeiting system is designed using smartphones as nodes of the blockchain.Users only need to install software on their mobile phones to achieve the purpose of traceability and anticounterfeiting.
Te encrypted logistics information blockchain must be transmitted to the blockchain in the logistics information blockchain.Due to the decentralized nature of the blockchain, all transactions are negotiated by all nodes on the chain."Te consensus algorithm realizes the process."When the transaction information is uploaded to the chain, the nodes complete the consensus of the transaction data.Te data can be added to the blockchain database [29].References [30][31][32][33] all use the consensus algorithm of blockchain technology to realize the traceability query of logistics information.Te following focuses on analyzing the research status of the PBFT consensus algorithm.
Te consensus problem is the core problem of the blockchain network.Te PBFT consensus algorithm can accommodate both faulty nodes and malicious nodes.Te number of all nodes must be at least 3f + 1 (f is the number of malicious/faulty nonresponding nodes), which can ensure security and liveness in an asynchronous system.At the same time, it solves the problem that the original Byzantine fault tolerance (BFT) algorithm is inefcient, but PBFT has high latency in the case of network instability.Reference [34] considers many nodes in the blockchain when for the consensus speed problem, the consensus is carried out in a partially decentralized way.Tat is, a certain number of "central" nodes are selected.For the selection method of such nodes, the literature uses an improved K-medoids clustering algorithm.However, this method is still too expensive in the consensus process.Te literature [35] combines the Gossip protocol to allow half of the nodes in the system to do evil.Te blockchain system proposed in this literature has certain scalability, allowing foreign nodes to join the system anytime.However, this paper's model for node selection is not accurate enough, and the time for the system to enter normal operation still needs to be shortened.Reference [36] considers the issue of client latency and proposes an EZ.But consensus algorithm there is no master node, but instead it enables each replica to order requests received from clients.Reference [37] applies blockchain technology to the logistics service supply chain information platform and uses the blockchain network's DBFT (authorized Byzantine fault tolerance) consensus algorithm.In this consensus algorithm, not all nodes on the chain can reach a consensus.Instead, the nodes eligible for agreement are selected by voting on the nodes.Te higher the stake a node has, the greater the probability of becoming a consensus node.Te literature [38,39] also focuses on the source of the product.In the blockchain traceability system, the NPBFT consensus algorithm is used, and the communication overhead required for consensus is reduced, thereby improving traceability efciency.
It can be seen from the above that blockchain technology can be applied to the traceability requirements of logistics information in various scenarios.Among blockchain-related technologies, the consensus algorithm is an important technology.In the next sections, we will analyze the research status of consensus algorithm technologies in blockchain traceability and focus on exploring the research status of the PBFT consensus algorithm.

Design of Logistics Information Traceability System Based on Multiset Consensus Algorithm
Aiming at the proposed logistics information traceability problem, this section designs a logistics information traceability system based on a multiset consensus algorithm in combination with blockchain-related technologies.We carry out the overall design of the system.After analyzing the system's requirements, the overall architecture of the system is created, and the system's network is deployed.

Overall System Design.
Te design goal of the system in this paper is to solve the problem that the information in each link of the goods circulation is not updated in time, and the transportation process is difcult to trace.Due to the huge amount of logistics information data and real-time changes, an efcient consensus algorithm is needed to ensure that the data can be uploaded to the chain quickly and without errors.Tis system plans to use an improved PBFT Security and Communication Networks consensus algorithm (MPBFT), which can reduce the time it takes for transactions to reach consensus, thereby improving consensus efciency.Tis paper uses the supply chain solution provided by IBM [40] to build a blockchain traceability system suitable for logistics.Te supply chain solution provides basic logistics equipment management, storage and query and provides cloud services required for gateway service integration, which greatly improves the scalability of required functions.According to the IBM product business model [41], the proposed system is layered, and the logistics traceability system is jointly constructed using IBM-related services and the proposed MPBFT consensus algorithm.Te overall architecture of this system is based on the fve-layer architecture of the blockchain, adding a storage layer, adding a data analysis platform to the contract layer, and merging the network layer and the consensus layer.Te system's overall architecture is shown in Figure 1, divided into the application, contract, storage, network, consensus, and data layer from top to bottom.
(1) Application layer: the application layer is the entrance to the realization of system functions and is mainly responsible for the interaction of system users, including the registration, login, and query operations of administrators and ordinary users.According to the overall system architecture of Figure 1, the network structure of this system mainly includes cloud, blockchain network, and application.Te system network deployment is shown in Figure 2. Te raw data of logistics information is stored in a distributed database in the cloud.Diferent roles access through the MSP access control system of Hyperledger Fabric and access the application data in the blockchain network after CA authentication.Each user terminal can quickly and efciently query the required information, and the Blockchain ensures the authenticity and validity of the data.

Multiset PBFT (MPBFT)
Tis paper uses a consensus algorithm of PBFT type in the logistics information traceability system based on blockchain.Since multiple nodes are involved in the logistics and transportation process, a large amount of logistics information will be generated, which requires the blockchain to have high performance and bandwidth requirements.Terefore, because of the low efciency of blockchain logistics traceability and the pain point of the redundant large amount of data, this paper designs a multiset PBFT algorithm, which improves the consensus efciency of the logistics system, improves the consensus efciency of transaction information on the chain, and reduces the communication overhead of the system.

Basic Model of Algorithm.
As shown in Figure 3, this paper defnes each computer as a separate node.In the MPBFT algorithm, the nodes are divided into diferent node sets according to the architectural requirements (region, environment, communication), the node sets are connected, and the nodes in each node set adopt the PBFT algorithm consensus.Te set of nodes relates to the consensus recorder.In this paper, it is assumed that each node set has four nodes.First, the consensus information is broadcast to the consensus recorder through the master node, and the consensus recorder will send a new consensus message to the nodes in each set.After all, nodes complete the consensus; each node will write the consensus data.After the data have passed the node consensus, the master node will verify and respond to the client, which proves that the transaction consensus is completed.
Tis paper applies the above consensus model to the blockchain logistics industry, and nodes are divided into diferent sets according to diferent geographical locations.Nodes with the same geographical location are divided into the same node set, and nodes in any node set can be used as master nodes to broadcast consensus.To reduce the number of communications, we avoid redundant consensus message packets.Te MPBFT algorithm is used to verify the consensus message package between nodes, and there is no need to repeatedly forward the consensus message package across regions.Assume that M set networks are set up according to diferent cities in the logistics blockchain network N: (1) Set the number of a set in the blockchain node network to M and denote the set as S i , So Si ∈ S, S 2 , . . ., S M     (2) Set the malicious nodes among the N nodes of the cluster as f, so the cluster N must satisfy the following: As the number of nodes increases, the bandwidth and consensus delay will greatly increase.In the event of a faulty node, the communication connection will be lost, and there will also be malicious nodes.In this paper, the forwarding and packet structure optimization of the PBFT algorithm is carried out to improve consensus efciency and avoid redundant consensus message packets occupying a large  Security and Communication Networks amount of bandwidth.First, the master node obtains a copy of the node set the record in the network through the consensus recorder.Te copy in the consensus recorder needs to be registered with the global node during network construction, and each node will synchronize the copy of the consensus recorder.Te MSP management mechanism of the alliance chain is introduced here.Jointly manage the number of nodes and state information in the consensus recorder.Te master node sends the transaction packet that needs to be broadcast to the consensus recorder, the consensus recorder sends a new consensus notifcation to each node, and each node executes the consensus process of PBFT.As shown in Figure 4, consensus blocks in this paper mainly include the following: (1) Te feld Set_Number in the consensus recorder contains all the sets M in the network, the node names in each set, and the consensus state of the nodes.(2) Te Node_Set_Name feld represents the node name in the set and records the order between adjacent nodes.(3) Te consensus state feld indicates the consensus state of each node, including the verifcation data (v, n, d, i, m) of each node in the consensus stage, and the consensus recorder compares and confrms the response message packets of each node to determine whether the consensus is successful.(4) Te forward nodes feld is used for ofine consensus forwarding by the adjacent nodes of the faulty node when a communication failure occurs on the faulty node (introduced below).( 5) We set the timing of each node to synchronize the copy with the consensus recorder, and each node will save the copy to confrm whether the consensus data of the consensus stage is consistent with the consensus data of other nodes and meet the consensus condition of 2f + 1.
Te introduction of the consensus recorder in this paper greatly reduces the communication frequency between nodes and the communication bandwidth; each node only needs to obtain the consensus state of each node through the consensus recorder.We have modifed the PBFT algorithm process to reduce the number of communications and ofine forwarding when a faulty node occurs.Security and Communication Networks (iii) Replica node is responsible for block consensus, there are multiple replica nodes in each round of the consensus process, and the processing process of each replica node is similar Among them, both primary and replica nodes belong to consensus nodes.

Algorithm Flow.
As shown in Figure 5, the basic process of the PBFT algorithm mainly includes the following four steps: (i) Te client sends a request to the master node (ii) Te master node broadcasts the request to other nodes, and the nodes execute the three-phase consensus process of the PBFT algorithm (iii) After the node processes the three-stage process, it returns a message to the client (iv) After the client receives the same message from f + 1 nodes, the consensus has been completed correctly Te three core stages of the algorithm are the preprepare stage, the prepare stage, and the commit stage.C in the fgure represents the client, 0, 1, 2, and 3 represent the number of the nodes, of which 0 is the primary node, and the three marked with an X represents a possible fault node or a malicious node.Te behavior shown here is for other nodes.Te whole process is rough as follows.
First, the client initiates a request to the master node 0 ≪ REQUEST, o, t, c ≫ where t is the timestamp, o represents the operation, c is the client, the master node receives the client request, and the master node sends the consensus recorder.When the request packet is sent, the consensus recorder will send a preprepare message to other nodes.Other nodes will receive the preprepare message and start the core three-phase consensus process.
(1) Preprepare Stage.After the replica node receives the preprepare message, there are two choices, one is to accept and the other is not to accept.A typical case of not accepting is if a replica node receives a preprepare message ≪ PRE PREPARE, v, n, d > , m > , where v represents the view number, v represents the sequence number (the primary node receives the client each request on the side is marked with a number), d represents the message digest, and m represents the raw message data.Te v and n in the message have appeared in the message received before, but they d, and m are inconsistent with the previous message, and the request will be rejected now.Te rejection logic is that the master will not send two messages with the same v and n but diferent d and m.
Te replica node receives the preprepare message and performs the following message verifcation: (i) Te signature of the message m is valid, and the message digest d matches the message m: d � hash(m) (ii) Te node is currently in view v (iii) Te node currently has no other preprepare messages on the same (view , sequence n).Tat is, there is no other m ′ and corresponding d ′ , d ′ � hash(m ′ ).
(2) Prepare Phase.After the current node agrees to the request, it will send a prepare message 〈PREPARE, v, n, d, i〉 to the consensus state of the consensus recorder and record the message in the log, where i is used to represent the identity of the current node.At the same time, not only one node is going through this process.Tere may be n nodes that are also going through this process.Terefore, the consensus recorder will record the prepare messages sent by diferent nodes.Te current node synchronizes the copy of the consensus recorder.Te current node i verifes whether the data v, n, and d of these prepared messages and the prepared messages sent by itself are consistent.After the verifcation is passed, the current node i sets prepared (m, v, n) to true and sent to the consensus recorder.Prepared (m, v, n) represents the consensus node believing that the message m in (v, n) whether the prepare phase has been completed.Te preparation phase has been completed if the consensus recorder replica receives prepare messages from more than 2f other nodes within a certain time frame.Finally, the consensus node i sends the commit message and enters the commit stage.
(3) Commit Stage.Te current node i receives 2f commit messages 〈COMMIT, v, n, d, i〉 from the copy of the consensus recorder and inserts the messages into the log (2f + 1 including its own), verifying after these commit messages are consistent with the three data of v, n, and d in the commit message sent by themselves, the consensus node sets committed-local (m, v, n) to true, committed-local(m, v, n).
On behalf of the consensus node, it is determined that the message least 2f + 1 nodes have agreed with the message m in the entire system, and this ensures that at least f + 1 nonfaulty nodes have reached a consensus on the message m.Ten, the node will execute the request and write the data.After processing, the node will return the message ≪ REPLY, v, t, c, i, r ≫ to the client.When the client collects f + 1 messages, the consensus is completed, which is the whole process of the PBFT algorithm.

Communication Disconnection.
Suppose there is a communication failure between the node and the consensus recorder to ensure that all nodes are fully connected.In that case, messages need to be forwarded to the faulty node.Tis process occurs between nodes in the node set.Te normal nodes adjacent to the faulty node forward the copy of the consensus recorder.
As shown in Figure 6, the consensus process of adjacent nodes is as follows: (i) Te consensus recorder sends a PBFT message to {node 0, node 1, node 2, node 3} and fnds that {node 1, node 3} is not in the connection list (faulty node), then sets the forward nodes feld of the PBFT message msg to {node 1, node 3}, and forwards it to Security and Communication Networks node 0 and node 2; according to the principle of the proximity of nodes, this paper uses four nodes in the node set as an example.(ii) If node 2 determines that the forward nodes feld is not empty after receiving the PBFT message from the consensus recorder, it traverses the neighbor node list {node 1, node 3} and removes the neighbor nodes from forward nodes.(iii) Node 2 forwards the updated PBFT message msg to node1 and node 3. (iv) After node1 and node3 receive the msg, they judge that the forward nodes feld is empty, we consider that the message has reached all nodes and do not continue to forward the PBFT message.
As shown in Figure 7, the improved PBFT message forwarding strategy adds the forward nodes feld to the PBFT message packet in the copy of the consensus recorder to record the disconnected node information.After receiving the PBFT message packet, other nodes forward the message to the reachable nodes (adjacent nodes) recorded by forward nodes, ensuring that PBFT message packets can reach all nodes as much as possible, reducing redundant PBFT messages in the network and improving network efciency.Since the message packet of the faulty node is forwarded and received by the adjacent node, the authenticity of the forwarding process of the adjacent node is recorded by the consensus recorder.If the node state of the consensus recorder is ≪ PRE PREPARE, v, n, d >, m >, the values of v, n, d, and m are verifed, and if they are not the same, it is judged as a malicious node.

Analysis of Communication Times
. Tis section will compare the number of communications between the MDPBFT algorithm and the classic PBFT algorithm, the COMBFT algorithm [42], and the SPBFT algorithm [43] in the consensus process to verify that the MBFT algorithm has a relatively small number of communications.
Assuming that the number of nodes in the network is N, in the frst stage of communication in the basic PBFT algorithm, the client frst sends a request to the master node, and then the master node broadcasts the request to the rest of the nodes.Te number of communications in the frst stage is (N − 1) times.In the second stage, the remaining nodes need to respond to the pre-preparation message sent by the master node, broadcast consensus to each other, and  10 Security and Communication Networks the number of communications is (N − 1) 2 .All nodes in the third-stage system perform consensus feedback on the second-stage messages.Send an acknowledgment message to the master node, and the number of communications at this stage is N(N − 1).Based on the above analysis, it can be concluded that the communication times T 1 for the classical PBFT consensus algorithm to complete a consensus is as follows: Unlike PBFT, in the COMBFT consensus algorithm, the client sends the message to all nodes when sending a request message.Tis is the frst stage, and the number of communications is N. Tis mechanism divides the consensus protocol into normal and abnormal cases (with or without malicious nodes).In the normal case, the consensus process is designed into three stages.the second stage, the master node sends messages to the slave nodes, and the number of communications is N − 1.In the third stages, all nodes send reply messages to the client, and the number of transmissions is N, and then the number of contacts in the normal case is as follows: Te confict-ordering mechanism (COM) needs to be implemented in abnormal cases.Te SUSPECT phase is added to the consistency protocol.Each slave node sends SUSPECT messages to others except in this phase, and the master node sends messages to the client.Te number of communications is N * (N − 1) + 1, and the number of contacts in the abnormal case is as follows: In the SPBFT consensus algorithm, although three stages of consensus are still required, it uses data encoding to assign diferent data requests to diferent nodes, so there is no need to broadcast messages to all other nodes in the preparation and confrmation stages.In the algorithm, the requested data is divided into multiple subdata, assuming that the number is also K.In the preliminary stage, the number of communications is still (N − 1).In the preparation phase, each node, except the master node only broadcasts the message to the other two nodes related to the news, and the number of communications in this phase is 2(N − 1) times.In the confrmation phase, each node broadcasts the message to at least the other two nodes, and the number of communications in this phase is at least 2N times.Terefore, the number of contacts of the SNCPBFT algorithm is as follows: In the MPBFT algorithm, during a round of the consensus process, the node mainly communicates with the consensus recorder.In the frst stage, the master node sends a message to the consensus recorder.Te number of communications is 1.In the second stage, the consensus recorder sends (N − 1) messages.Nodes broadcast consensus messages and carry consensus copies.Te third-stage node submits the consensus record to the consensus recorder and verifes whether the consensus of the remaining nodes satisfes the condition greater than (2f − 1), where the number of communications (N − 1).If the condition is met, each node submits the consensus confrmation result and returns the consensus recorder result (N − 1).Te consensus recorder returns the result to the master node with a communication count of 1.To sum up,

Security and Communication Networks
We compare T with the above four communication times because when N ≥ 12 and the node scale is large, there are T 5 < T 1 , T 5 < T 2 , T 5 < T 3 , and T 5 < T 4 .So overall, the communication times of this scheme are less.Proof.In the PBFT algorithm, the PRE-PREPARE stage is the stage of requesting sequence number assignment, which is used to ensure that the request has assigned sequence numbers in the current view.When multiple clients send request information to the nodes in the set, the nodes in the set will assign serial numbers and execute requests in sequence according to the preassigned serial numbers.Due to various attacks, this paper designs the nodes under the multiarea logistics information for identity verifcation and guarantees the nodes through a third-party identity verifcation agency.Tat is, each node that joins the network must be authenticated by a third-party agency.Nodes can be uniquely defned through hash value, key, and DNS name computer mechanism to prevent attacks such as Sybil attack.Tis method relies on verifcation by other institutions and will lose some of the node's anonymity.In the preparation stage, the request with the previous serial number will be executed frst, and the node initiating the request will broadcasts the preparation message 〈PREPARE, m, v, n, t, i〉 through the consensus recorder.Tis stage is a preliminary consensus; in the confrmation stage, each node gives feedback on the messages broadcast by the consensus recorder.Tat is, each node sends a confrmation message 〈PREPARE, m, v, n, t, i〉 to the sending node through the consensus recorder.During this process, the consensus recorder will record and compare the return information of each node.If there is a malicious node, a node log will be recorded.Trough the above process, the consensus validity of the multiset architecture can be guaranteed.

Te Security and Data Validity of the Consensus Recorder
Proof.Te consensus recorder is in the network and is not controlled by any node.Te independence of the consensus recorder is guaranteed by updating the public smart contract.Te execution of events (requests, confrmations, verifcations) is automatically triggered by smart contracts (when set conditions are met).When a node sends a request, the smart contract of the consensus recorder generates a new consensus log, and the feedback of each node in the confrmation stage is recorded in the log.Te smart contract of the consensus recorder automatically verifes the validity of the consensus of the node.It is enough to ensure that the feedback confrmation message satisfes 2f + 1 benign nodes.

Te Messages Responded to by the Node Set in Tis Paper Are Unique
Proof.Tere is no direct communication between node sets, and messages need to be transmitted through the consensus recorder.When a node in a set broadcasts a message, the consensus recorder records and relays the broadcast message, waiting for other nodes to feedback confrmation messages; feedback messages between sets are Recorded and verifed in the consensus recorder, blocking data forgery communication between collection nodes.When the verifcation of nodes in a certain set is inconsistent, the malicious node is quickly located and recorded in the consensus recorder.When the verifcation of all nodes in a certain set is inconsistent with that of other set nodes, 2f + 1 benign sets are also applicable.

Performance Analysis
Tis section compares the MPBFT algorithm proposed in this paper with the PBFT algorithm, SPBFT algorithm, and COMPBFT algorithm [42] regarding network bandwidth consumption and network delay.Te experimental results illustrate the communication of the algorithm in this paperless overhead.Te experiment's confguration in this paper is a Windows 10 system with an i7-4558U processor and 8 G.B. memory.Te experimental simulation is carried out through MATLAB R2017a, and the number of nodes is 50, 100, 150, and 200.Te size of the transmitted data is the same.

Network Bandwidth.
Since the block size is constant, the required network bandwidth increases with the number of nodes.Diferent algorithms occupy diferent bandwidths.Algorithms with less communication time can occupy less bandwidth and thus consume less energy.Te changes in network bandwidth and the number of nodes for the four algorithms are shown in the following fgure.PBFT and SPBFT algorithms have three-stage message broadcasts, COMBFT has four groups of broadcasts, and MPBFT reduces the number of broadcasts and geographic distance through consensus repeaters.Terefore, the bandwidth occupied by the network is smaller than the other three algorithms.

Network Delay.
Network latency is an important indicator refecting the running speed of the blockchain system.Te lower the network latency, the higher the system efciency, the faster the consensus, and the higher the transaction efciency.Te relationship between the network delay and the number of nodes of the four algorithms is shown in Figure 8.It can be seen from the fgure that with the increase in the number of nodes, the network delay is prolonged to a certain extent, and the network delay of the PBFT algorithm increases the most, which also explains the reason for improving the PBFT algorithm.As can be seen from the fgure in this paper, the proposed MPBFT algorithm has a low delay and is relatively stable, which also 12 Security and Communication Networks shows that the scheme in this paper is more suitable for systems with a large number of nodes.

Troughput.
Troughput is an important indicator refecting the transaction rate of the blockchain system.Te higher the throughput, the more the transactions per unit of time and the higher the consensus efciency.Te relationship between the throughput ratio of the four algorithms and the nodes is shown in Figure 9.It can be seen from the fgure that as the number of nodes increases, the network throughput of the global environment will gradually decrease.When there are 200 nodes, throughput of MPBFT is high.On the other three nodes, the MPBFT decline rate refects that the multiset architecture can effectively improve the throughput of the multinode case.Tis also shows that the MPBFT consensus algorithm is relatively stable.Security and Communication Networks

Conclusion
Tis paper frst introduces the theory and technology involved in the blockchain logistics information traceability system.According to the characteristics of the logistics industry, a more efcient multiset consensus algorithm MDBFT is proposed, and the basic model and the entire implementation process of the algorithm are described.Te feasibility of the algorithm is demonstrated by analyzing the communication times of the MDBFT algorithm.Trough the comparative experiment and simulation of network bandwidth and network delay, it is verifed that the algorithm can improve the consensus efciency of logistics information, thereby ensuring the information's authenticity and traceability efciency.Tis paper proposes a logistics information traceability system based on blockchain.By improving consensus efciency, an efcient traceability process is completed.With the development of blockchain technology, the system still needs to be perfected in practical application.Tis paper only improves the efciency of logistics information traceability from consensus efciency.However, there are still many factors that afect the efciency of traceability, and further research is needed.Tis paper only considers the geographic information generated by the general logistics and circulation links and studies the traceability of general transportation route information to ensure the authenticity of the information traceability.In the future, the model can be further optimized.For complex logistics links, such as cold chain transportation, cross-border transportation, and other complex scenarios, various information such as temperature, humidity, and weather can be added.

( 2 )
Contract layer: execute-related smart contracts in the application layer, such as sign-of and delivery reminders (3) Storage layer: the layer is divided into of-chain and on-chain databases.Te of-chain database is a traditional distributed database, mainly deployed in the cloud, and stores the hash data corresponding to the original data of logistics information.Te on-chain database is mainly used to serve data information generated by nodes in the blockchain.(4) Network and consensus layer: the logistics information data fles are transmitted through the transmission network formed by 5G, NBIoT, and intelligent gateway, and the block data is sent to the P2P point-to-point network.(5) Data layer: the data layer is divided into logistics information and block data.Te logistics information data is actual transportation route data.Address information and form chain structure blocks through technologies such as digital signatures and Merkle trees.

) 6
Security and Communication Networks 4.2.MPBFT Algorithm Design.Te basic PBFT consensus algorithm requires high-frequency communication to ensure that the consensus message packet can reach all nodes.

Figure 1 :
Figure 1: Overall architecture diagram of logistics information traceability system.

Figure 3 :Figure 4 :
Figure 3: Group division diagram for logistics information traceability.

Figure 6 :Figure 5 :
Figure 6: Communication forwarding model of disconnected neighbor nodes in the network.

Figure 7 :
Figure 7: Te communication forwarding process of the network disconnecting adjacent nodes.

Figure 9 :Figure 10 :Figure 8 :
Figure 9: Troughput comparison of four algorithms with different numbers of nodes.

Table 3 :
Te proposed algorithm is compared with the traditional algorithm.

Table 1 :
Comparison of logistics traceability solutions.

Table 2 :
Comparison of four consensus algorithms.
Figure 2: Network deployment diagram of logistics information traceability system.
Comparison.It can be seen from Figures 8-10 that PBFT, SPBFT, COMBFT, and MPBFT have low latency, high bandwidth, and high throughput in the 200-node MPBFT network.As shown in Table3, the performance of the MPBFT consensus process is better than traditional algorithms (PBFT, SPBFT, and COMBFT) is more prominent.MPBFT consists of 3-stage communication and consensus recorder, which can reduce the consensus delay to a greater extent.Te channel capacity is determined by the internal structure of the block.Only the block serial number needs to be agreed upon between the node sets.After the consensus is completed, the data in the block serial number is synchronized.Terefore, more block serial number data can be carried out during the consensus process.Scalability of consensus algorithms in the process of adding nodes, PBFT, SPBFT, and COMBFT all directly add nodes globally, while MPBFT adds nodes to the set, and when the consensus set reaches its peak, it expands the new set.When many nodes are added, the MPBFT global consensus performance is less afected.In terms of applicability, PBFT, SPBFT, and COMBFT are not suitable for long-distance geographic location consensus, and the global consensus network delay is greatly afected by communication.MPBFT adopts a multiset architecture and deploys consensus sets based on geographic locations, which greatly reduces communication delays.