CN112967071A - Urban fruit quality tracing method based on block chain - Google Patents

Urban fruit quality tracing method based on block chain Download PDF

Info

Publication number
CN112967071A
CN112967071A CN202110254142.0A CN202110254142A CN112967071A CN 112967071 A CN112967071 A CN 112967071A CN 202110254142 A CN202110254142 A CN 202110254142A CN 112967071 A CN112967071 A CN 112967071A
Authority
CN
China
Prior art keywords
data
node
nodes
message
contract
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
CN202110254142.0A
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.)
Beijing Union University
Original Assignee
Beijing Union University
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 Beijing Union University filed Critical Beijing Union University
Priority to CN202110254142.0A priority Critical patent/CN112967071A/en
Publication of CN112967071A publication Critical patent/CN112967071A/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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • 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/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/405Establishing or using transaction specific rules
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The invention discloses a city fruit quality tracing method based on a block chain, which builds a distributed network architecture by using a hyper-ledger Fabric framework model, is an allowable block chain infrastructure which has the role between nodes in the infrastructure, wherein the execution of an intelligent contract and configurable consensus and membership services enable a tracing network. When participants conduct transactions, the participants are automatically deployed according to a contract system, and each participant is a node in a block chain network and has a data copy of a super ledger. The transaction process generates data change, and the method is mainly used for expanding local data update to the whole network. Wherein the different clients can access data to each other by using gPRC messaging; the Gossip algorithm is used for broadcasting and publishing the message, so that the data can be ensured to spread to all block nodes; the PBFT formula technology is used for processing the problem that the system cannot be synchronized due to message transmission errors during operation, and finally updating of node data is completed.

Description

Urban fruit quality tracing method based on block chain
Technical Field
The invention relates to the field of reliability systems of block chains, in particular to a block chain-based urban fruit quality tracing method.
Background
Technological advances have made food "visible" throughout the entire process from the place of production to the place of sale. The tracing is a production control system which can trace the product in forward, reverse and non-directional directions and is suitable for any product. From production, processing and sale to consumer terminals, information is shared through dedicated hardware equipment to serve final consumers. Under the coverage of the whole process of the traceability system, once a problem occurs, the traceability system can quickly react to obtain the information of the whole process of production and circulation of the problem product, perform investigation and positioning, determine the root of the problem and then solve the problem in a targeted manner.
The current tracing technology comprises an RFID tracing technology, a two-dimension code tracing technology and a commodity bar code tracing technology, the RFID is in pilot point work in a plurality of industries, but a unified standard does not exist, the cost of a set of complete RFID equipment is higher, different tracing systems are incompatible, and only electronic tags of the system can be identified. Overall, the agricultural product quality tracing system is still in a fragmentization state, the problem that the tracing system is incompatible is very serious, so that the tracing system is not only not beneficial to a consumer to conveniently inquire tracing information, but also low in data security, and is not beneficial to a government department to utilize the tracing system to supervise food safety in real time, and serious waste of resources is caused.
Two-dimensional codes are much cheaper than RFID in terms of cost, and thus are widely used in life. The two-dimensional code has high information density and large information capacity, can be independently applied without depending on a database and a communication network, and can encode digitalized information such as pictures, sounds, signatures, fingerprints and the like to complete the description of articles, thereby providing more comprehensive food traceability information for consumers. However, the two-dimensional code identification technology has the defects of reproducibility, easy pollution and the like, and the data integrity and the safety are lower.
The commodity bar code is the main tracing mode used in the market at present. Because the bar code is unique, the tracing management of each workshop, different production lines and each production process in the whole production flow can be easily realized. Meanwhile, a manager can perform statistics, analysis and feedback on all information, so that traceability management of the whole production process is realized. The bar code mistake proofing system collects original data, the timeliness and the accuracy of production information are guaranteed, the production flow becomes known and controllable, the production technology can be adjusted in a planning mode by mastering all information of the production process, and the information is not worried about losing authenticity. However, in the production and sale process, the phenomenon of obtaining illegal benefits through counterfeiting bar codes still exists, and the data security is low.
These techniques alleviate the hazards of counterfeit products to some extent, but in practice they do not fundamentally solve the problem of counterfeiting by copying and transferring the counterfeit-proof markings and do not avoid centralized manual operations. The recent morning sickness frequently exploded further reduces the official trust of the morning sickness. Compared with the traditional technology, the block chain technology with the characteristics of decentralization, no tampering and the like fundamentally performs anti-counterfeiting traceability on commodities, and effectively enhances the trust of people on the market.
Disclosure of Invention
The invention aims to provide a fruit traceability method based on a block chain, which builds a distributed network architecture by using a hyper-ledger Fabric framework model, is a permitted block chain infrastructure which has a role between nodes in the infrastructure, wherein the execution of an intelligent contract (called 'chain code' in Fabric) and a configurable consensus and membership service enable a traceability network. When participants conduct transactions, the participants are automatically deployed according to a contract system, and each participant is a node in a block chain network and has a data copy of a super ledger. The transaction process generates data change, and the local data update is expanded to the whole network, which is the key point of the research of the method. Wherein the different clients can access data to each other by using gPRC messaging; the Gossip algorithm is used for broadcasting and publishing the message, so that the data can be ensured to spread to all block nodes; the PBFT formula technology is used for processing the problem that the system cannot be synchronized due to message transmission errors during operation, and finally updating of node data is completed.
When the participants in the block chain nodes trade, the data can be changed according to the signed contract, the data of the account book copies of the two parties of the trading block are changed, the data of the nodes of the participants of the whole platform can be updated to confirm the trade, otherwise, the super account book Fabric confirms that the trade is illegal, the data of the trading nodes are invalid, and the trade fails. The super account book transmits update data to different clients in the node block through a gPRC message transmission mechanism, a Gossip inverse entropy transmission algorithm is used for ensuring that the message can be transmitted to each node, a PBFT fault-tolerant algorithm is used for ensuring that the data can be stably updated, and when most of the nodes agree to the data change, the changed message is effective, and the transaction is successfully established.
When a client side makes a source tracing request, an intelligent contract mechanism is called to call a needed contract from a block chain database, and the contract modification record and the display of participants of the contract modification record are displayed to a user. The intelligent contract mechanism of the block chain can convert the text contract into a computer transaction protocol code and endow the computer transaction protocol code with self-execution property, thereby minimizing the requirement of trusted intermediaries of transaction parties and reducing the occurrence of malice and exception. And interest distribution and punishment are carried out on the participating main bodies, and the aims of saving coordination cost and reducing contradiction between unequal interests are achieved.
The end user purchases fruit from the retail platform to create an upper chain of orders to establish a transaction contract, the retail platform is capable of querying the orders in the blockchain network and submitting the orders to a supplier to fulfill the transaction contract, the supplier then submits the goods to a carrier to fulfill the contract, the carrier delivers the fruit to the customer, and the customer confirms the completion of the contract. Participants in the whole process can trace the whole process of fruit transportation according to the account book copies of the accounts.
The invention has the advantages that:
constructing a source tracing method framework according to the intelligent contract and the block chain basic service; then, user information and interactive data are respectively stored by establishing a block chain node and a distributed main account book; distributing sub-nodes to each participant and distributing account book copies updated synchronously with the main account book, wherein the nodes are communicated with each other through gRPC messages, and a plurality of nodes form a gossip network of P2P; and finally, the participants trace the source of the information uplink, and can inquire the quality information of the fruit products according to the account book information. The method uses the super ledger Fabric framework to ensure the consistency of the ledger by using the PBFT consensus algorithm, achieves the state of decentralized and technical level databankization, and ensures that the information of the fruit products can be checked, traced and trusted.
Drawings
FIG. 1 is a flow diagram of a fruit supply chain of the present invention;
FIG. 2 is a schematic view of the fruit tracing structure of the present invention;
fig. 3 is a schematic diagram of the gprs messaging of the present invention;
fig. 4 is a schematic diagram of a Gossip node data transmission method of the present invention;
FIG. 5 is a schematic diagram of Gossip inverse entropy propagation of the present invention;
FIG. 6 is a flow chart of PBFT diffusion of the present invention.
FIG. 7 is a schematic diagram of a transaction flow according to the present invention
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings of the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
Referring to fig. 1, an embodiment of the present invention provides a method for tracing urban fruit quality, including the following steps:
1. end user purchase of fruit production order uplink from retail platform
2. The retail platform submits orders to the raw material factory according to the user information
3. Raw material factory produces products according to order quantity
4. Supplier procurement of fruit products from raw materials plant
5. The supplier will chain up the purchase contract and send the fruit for inspection
6. The detection station stores the inspection completion in storage and links the detection information and the stored information
7. Factory workers deliver the goods package logistics and link the package information
8. Logistics express delivery personnel delivery and cochain delivery information
9. The user can track the logistics information and link up the chain for inquiry and anti-counterfeiting after receiving the product
Fig. 2 is a frame structure diagram of the method, a blockchain manages nodes by establishing a super account book fabric, and stores all data into peer nodes, participants of urban fruit producers, fruit transportation enterprises, distribution enterprises, retail enterprises and the like access a blockchain network through private keys, the super account book establishes an account book copy for each participant, the consistency of account book data is ensured by using a consensus algorithm technology, the participants can automatically establish timestamps and encrypt in the process of message communication, unidirectional interactive data greatly increases the difficulty of changing data, and the justness and credibility of transactions are ensured. The blockchain provides member services, members follow a secret protocol, different authorities can be set according to different identities of participants, and the security of the member private data is ensured by encrypting the member private data.
Fig. 3 is a structure diagram of the node communication mechanism of the method, in which a manufacturer signs a contract with a distribution enterprise to change data, and diffuses the message to other nodes through the gPRC communication mechanism in the block chain. And the producer node sends the transmitted message to the gPRC server, and the server transmits the message to the distribution enterprise node after receiving the message and sends the message to other participant nodes. The RPC (remote procedure call) framework actually provides a set of mechanisms to enable communication between applications, and also conforms to the server/client model. When in use, the client calls the interface provided by the server as calling a local function. The gPC is a high-performance, open-source and universal RPC framework, mobile-oriented and HTTP/2-oriented design. The gRPC is designed based on the HTTP/2 standard, bringing features such as bi-directional flow, flow control, header compression, multiple multiplexed requests over a single TCP connection, etc. These characteristics make it perform better on mobile devices, saving more power and space.
Through the gRPC message communication structure shown in FIG. 3, message interaction between different clients can be realized, but a block chain data book needs to establish a consistent data sample to ensure that data of each node in a block chain is consistent, so a gossip network of P2P is introduced, each node randomly communicates with other nodes in a bounded network, and finally the states of all nodes are consistent through a messy communication. Each node may know all other nodes or only a few neighboring nodes, as long as the nodes can communicate through the network, and eventually their states are consistent. Gossip is a fault-tolerant algorithm with redundancy, and furthermore Gossip is a final consistency algorithm. Although it cannot be guaranteed that all nodes are consistent in state at a certain time, it can be guaranteed that all nodes are consistent in "final", which is a time point that exists in reality but cannot be proved theoretically.
Fig. 4 shows that Gossip single node spreads messages all around and updates the original node state. Because Gossip does not require a node to know all other nodes, the Gossip has the characteristic of decentralization, the nodes are completely equal to each other, and no central node is needed.
Push, the node A initiating the information exchange randomly chooses to contact the node B and sends its own information to it, and the node B updates the data newer than itself after receiving the information. In the graph, the node A pushes data (key, value, version) and a corresponding version number to the node B, and the node B updates the data which is newer than the node A.
Pull: the node A initiating the information exchange randomly selects to contact the node B and obtains the information from the other side. Nodes that do not have new information will generally act as initiating nodes. In the figure, A only pushes data Key and version to B, B pushes data (Key, value and version) which is newer than A locally to A, and A updates locally.
Push/pull: the node A initiating the information exchange sends information to the selected node B, and simultaneously acquires data from the other side for updating own local data. In the figure, A pushes data Key and version to B, B pushes data (Key, value and version) which is newer than that of A to A, A updates the local, A pushes data which is newer than that of B to B, and B updates the local.
If the data synchronization of the two nodes is defined as one period once, in one period, the push needs to communicate for 1 time, the pull needs to communicate for 2 times, and the push/pull needs to communicate for 3 times. Intuitively, it is also felt that the convergence speed of push/pull is the fastest.
Assuming that each node communication cycle can select (infect) a new node, the Gossip algorithm degenerates into a binary search process, each cycle forms a balanced binary tree, the convergence rate is O (n2), and the corresponding time overhead is O (logn). This is also the theoretically optimal convergence rate for Gossip. However, in practical situations, the optimal convergence rate is difficult to achieve, and if the probability that a certain node is infected in the ith period is pi and the probability that a certain node is infected in the (i + 1) th period is pi +1, the pull mode is Pi+1=Pi 2+C
And push is:
Figure BDA0002962638420000051
obviously, the convergence rate of pull is greater than push, and the probability that each node is infected in each period is fixed p (0< p <1), so the Gossip algorithm is based on the square convergence of p, which is also probability convergence.
The operating modes of Gossip nodes are divided into two types: Anti-Entrophy (inverse Entropy): all data is propagated with a fixed probability. Rumor-Mongering (Rumor spreading): only newly arrived data is propagated. The method uses Anti-Encopy. As shown in fig. 5, the 1 node floods the message to the remaining nodes. The node 1 has data change, the change message needs to be synchronized to the whole gossip network, firstly, the update message and the version number are sent to the nearest nodes 2 and 4, the nodes 2 and 4 respectively send the update message and the version number to the nearest nodes 3, 5 and 7, and the node 5 only makes one-time modification judgment after receiving two update data with the same version number; then the 3, 5, 7 nodes send update messages and version numbers to 6, 8, and finally the 6, 8 nodes send update messages and version numbers to the 9 node. The Gossip process is asynchronous, and nodes sending messages do not pay attention to whether the nodes receive the messages or not, namely, the nodes do not wait for response; the other party sends a message to the surrounding nodes every 1 second, regardless of whether it has not received it.
Although the gossip network carries out message diffusion, system problems inevitably occur in system operation engineering, so that messages cannot be synchronized, and therefore, the influence of fault nodes is reduced by adopting a consensus algorithm technology PBFT which prevents system fault introduction by adopting collective decision (comprising correct and fault nodes).
PBFT (practical Byzantine failure Tolerance) is a practical Byzantine Fault-tolerant algorithm. If we issue 3m +1 normal messages through Gossip diffusion, if at most m processors fail, consensus can be reached (agreement is reached on the same state), i.e. the total number of accurately communicated messages should be strictly over two thirds. The message can be accepted.
Setting the diffused duplicate message set as R;
3f +1(f is the number of error-tolerant duplicate messages)
View views are established under the algorithm, one view is a main node in the view, and the other views are backup nodes. The master node is responsible for sending requests from the clients to the sequencing nodes and then sending the requests to the backup nodes in sequence. But the master node may be byzantine: it may order different requests with the same sequence number, or not assign a sequence number, or leave adjacent sequence numbers non-consecutive. The backup node should have the responsibility to actively check the validity of these sequence numbers and be able to detect whether the master node has gone down through the timeout mechanism. When these exceptions occur, these backup nodes will trigger the view change protocol to elect a new master node.
The PBFT algorithm is used for diffusing the communicated messages in a broadcast mode, and the diffusion flow is shown in FIG. 6:
1. and selecting a master node (Leader) from the nodes of the whole network, generating a new block by the master node, and sending a View-new message when the master node is initialized to synchronize data of all the nodes.
2. Each node broadcasts the transaction sent by the client to the whole network, the main node 0 sorts and stores a plurality of transactions collected from the network and needing to be placed in a new block into a list, and the list is broadcasted to the whole network and is diffused to 123. The Client initiates a request to be forwarded to primary, the primary broadcasts the request after verification, initiates a pre-prepare message to all the nodes of the follower, and saves the request by itself.
3. After each node receives the transaction list, the transactions are executed according to the sequencing simulation. And after all transactions are executed, calculating the hash abstract of the new block based on the transaction result, and broadcasting to the whole network, wherein 1- >023, 2- >013 and 3 cannot be broadcasted due to downtime. After all the folders receive the pre-prefix message, the first step is to check, including whether the order of the data is correct, the order of the operations, and whether the transaction is valid, such as a signature. (prevent client counterfeiting or primary node tampering counterfeiting). All nodes count the Prepare message for a certain Request.
4. If the digests received by one node from 2f (f is tolerable number of Byzantine nodes) other nodes are equal to the one node, a commit message is broadcasted to the whole network. When the prefix statistical result exceeds the 2f node, the persistence of most nodes is completed, and the commit stage is entered. And broadcasting the commit message, counting the number of received commit messages, and sending out the commit message when the number exceeds 2 f. The node completes the commit phase and writes the data (this operation has completed 2/3 consensus).
5. If a node receives 2f +1 commit messages, it can submit new blocks and its transactions to the local block chain and state database. When the number of the nodes statistically fed back by the client exceeds f, the fact that the transaction is confirmed by most nodes is shown, and the transaction is successful. If the timeout is not successful, then the request is broadcast to all replicas.
The completion of the message passing realizes one intelligent contract interaction, and a flow diagram of a tracing application program is shown in FIG. 7. Wherein E0, E1 and E2 are endorsement nodes; p3, P4 are commit nodes; o is a sequencing node, and a plurality of sequencing nodes play a sequencing service role; a, B, C, D are intelligent contracts (called chain codes in the super book Fabric); is an account book. The transaction flow process is as follows:
1) application program initiates transaction request
The client program submits a transaction request to smart contract (chain code) a. The intelligent contract is: it must be endorsed by the nodes E0, E1, E2. The endorsement strategy is:
e0, E1, E2 must be signed;
p3, P4 do not require signatures.
2) Endorsement node execution transaction proposal
E0, E1, E2 execute transaction proposals, respectively, which do not update the ledger. Each execution produces a set of data to read and write, called RW sets.
3) Application receives response
RW sets are signed by each endorsement node { E0, E1, E2} and returned to the application.
4) Ordering transactions
The application submits the response data to the sequencing node as a transaction to be sequenced. The ordering is concurrent and submissions of other applications can be processed simultaneously.
5) Distribution transaction
The sort node distributes the transaction to all commit nodes { E0, E1, E2, P3, P4 }. The sorting service collects a set of transactions into a preblock and distributes to commit nodes { E0, E1, E2, P3, P4 }. The nodes use gossip to synchronize each submitting node in the block.
6) Validating transactions
Each commit node { E0, E1, E2, P3, P4} shall verify the endorsement policy, check if the RW sets are still valid for the current state, preventing double-blossoming. The transaction is written to the ledger and status information for valid transactions is updated in the status DB.
7) Notification of transaction results
Submitting nodes { E0, E1, E2, P3, P4} notifying the application of the transaction result. The application may register whether it needs to be notified of the success of the transaction and the tile addition message, and the peer to which the application connects will then notify the other corresponding events.

Claims (8)

1. A city fruit quality tracing method based on a block chain is characterized in that: building a distributed network architecture using a hyper book Fabric framework model, which is a permissive blockchain infrastructure having a role between nodes in the infrastructure, wherein execution of intelligent contracts and configurable consensus and membership services enable a traceable network; when participants conduct transactions, the participants are automatically deployed according to a contract system, each participant is a node in a block chain network and has a data copy of a super account book; data change can be generated in the transaction process, and local data updating is expanded to the whole network; the fact that different clients can access data to each other is achieved through the use of gPRC message communication; broadcasting and publishing the message by using a Gossip algorithm to ensure that the data can spread to all block nodes; and (3) processing the problem of incapability of synchronization caused by message transmission errors possibly occurring during system operation by using the PBFT formula technology, and finally finishing the updating of the node data.
2. The urban fruit quality tracing method based on the blockchain according to claim 1, wherein the method comprises the following steps: when a participant in a block chain node transacts with a participant, the participant can confirm according to a signed contract, at the moment, data change is carried out, the data of the account book copies of both sides of the transaction block are changed, the node data of the participants of the whole platform are required to be updated to confirm that the transaction is established, otherwise, the super account book Fabric can determine that the transaction is illegal, the transaction node data is invalid, and the transaction fails; the super account book transmits update data to different clients in the node block through a gPRC message transmission mechanism, a Gossip inverse entropy transmission algorithm is used for ensuring that the message can be transmitted to each node, a PBFT fault-tolerant algorithm is used for ensuring that the data can be stably updated, and when most of the nodes agree to the data change, the changed message is effective, and the transaction is successfully established.
3. The urban fruit quality tracing method based on the blockchain according to claim 1, wherein the method comprises the following steps: when a client side puts forward a source tracing request, calling an intelligent contract mechanism to call a needed contract from a block chain database, and showing a contract modification record and the contract modification record displayed by participants to a user; the intelligent contract mechanism of the blockchain can convert the text contract into a computer transaction agreement code and endow the computer transaction agreement code with self-execution properties, thereby minimizing the requirement of credible intermediaries of two transaction parties.
4. The urban fruit quality tracing method based on the blockchain according to claim 1, wherein the method comprises the following steps: the terminal user purchases fruits from a retail platform to generate an order uplink chain to establish a transaction contract, the retail platform can inquire orders in a blockchain network and submit the orders to a supplier to fulfill the transaction contract, then the supplier delivers the commodities to a transport company to fulfill the contract, the transport company delivers the fruits to a client, and the client confirms the completion contract; participants in the whole process can trace the whole process of fruit transportation according to the account book copies of the accounts.
5. The urban fruit quality tracing method based on the blockchain according to claim 1, wherein the method comprises the following steps: the method comprises the following steps:
s1 the end user purchasing a chain of fruit production orders from the retail platform;
s2, the retail platform submits orders to the raw material factory according to the user information;
s3, the raw material factory produces products according to the order quantity;
s4 the supplier purchases fruit products from the raw materials plant;
s5 the supplier links the purchase contract and sends the fruit for inspection;
s6, the detection station stores the information into a warehouse after finishing the inspection and links the detection information and the stored information;
s7, the factory worker ships the goods package logistics and links the package information;
s8 logistics express delivery personnel distribute and link distribution information;
s9 user can trace logistics information and receive product and chain up inquiry anti-fake.
6. The urban fruit quality tracing method based on the blockchain according to claim 5, wherein the method comprises the following steps: the block chain manages nodes by establishing a super account book fabric, all data are stored in peer nodes, urban fruit producers, fruit transportation enterprises, distribution enterprises and retail enterprise participants access a block chain network through private keys, the super account book establishes an account book copy for each participant, the consistency of the account book data is ensured by using a consensus algorithm technology, the participants can automatically establish timestamps and encrypt in the process of message communication, and unidirectional interactive data ensure the justness and credibility of transactions; the blockchain provides member services, members follow a secret protocol, different authorities can be set according to different identities of participants, and the security of the member private data is ensured by encrypting the member private data.
7. The urban fruit quality tracing method based on the blockchain according to claim 5, wherein the method comprises the following steps: in the node communication mechanism structure, a manufacturer signs a contract with a distribution enterprise to change data, and the message is diffused to other nodes through a gPRC communication mechanism in a block chain; the producer node sends the transmitted message to the gPRC server, and the server transmits the message to the distribution enterprise node after receiving the message and sends the message to other participant nodes; the RPC framework provides a set of mechanism to make the application programs communicate with each other and conform to the server/client model; when the system is used, the client calls an interface provided by the server just like calling a local function; the gPC is a high-performance, open-source and universal RPC framework, and is designed for mobile and HTTP/2; the gRPC is designed based on the HTTP/2 standard, bringing multiple multiplexed requests over a single TCP connection such as bi-directional streaming, flow control, header compression.
8. The urban fruit quality tracing method based on the blockchain according to claim 1, wherein the method comprises the following steps: the message interaction among different clients can be realized through a gPRC message communication structure, but a block chain data book needs to establish a consistent data sample to ensure that the data of each node in a block chain are consistent, so a gossip network of P2P is introduced, each node randomly communicates with other nodes in a bounded network, and finally the states of all the nodes can be consistent; each node may know all other nodes or only a few neighboring nodes, as long as the nodes are connected through the network, and eventually their states are consistent.
CN202110254142.0A 2021-03-04 2021-03-04 Urban fruit quality tracing method based on block chain Pending CN112967071A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110254142.0A CN112967071A (en) 2021-03-04 2021-03-04 Urban fruit quality tracing method based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110254142.0A CN112967071A (en) 2021-03-04 2021-03-04 Urban fruit quality tracing method based on block chain

Publications (1)

Publication Number Publication Date
CN112967071A true CN112967071A (en) 2021-06-15

Family

ID=76277394

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110254142.0A Pending CN112967071A (en) 2021-03-04 2021-03-04 Urban fruit quality tracing method based on block chain

Country Status (1)

Country Link
CN (1) CN112967071A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114047899A (en) * 2022-01-12 2022-02-15 南京金宁汇科技有限公司 View synchronization method and system of block chain
CN115242805A (en) * 2022-06-11 2022-10-25 北京网聚云联科技有限公司 Gossip-based distributed MQTT message transmission method, transmission system and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
蔡元纪 等: "基于区块链的绿色证书交易平台:概念与实践", 《电力系统自动化》 *
许继平 等: "基于区块链的粮油食品全供应链信息安全管理原型系统", 《农业机械学报》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114047899A (en) * 2022-01-12 2022-02-15 南京金宁汇科技有限公司 View synchronization method and system of block chain
CN114047899B (en) * 2022-01-12 2022-03-18 南京金宁汇科技有限公司 View synchronization method and system of block chain
CN115242805A (en) * 2022-06-11 2022-10-25 北京网聚云联科技有限公司 Gossip-based distributed MQTT message transmission method, transmission system and storage medium

Similar Documents

Publication Publication Date Title
CN109151013B (en) Logistics industry information platform based on alliance block chain
CN111416808B (en) Cross-block-chain data mutual storage method, device, equipment and storage medium
CN107846278B (en) Intelligent contract processing method and device
CN111314067A (en) Block storage method and device, computer equipment and storage medium
CN108615195B (en) Resource transfer information transmission method and device, storage medium and electronic device
CN111325581B (en) Data processing method and device, electronic equipment and computer readable storage medium
CN102609834A (en) Countersigning method and system
CN112967071A (en) Urban fruit quality tracing method based on block chain
CN110728494A (en) Real estate service handling method, real estate property information system and real estate property information device
CN106063186B (en) The distribution of the fair marketing data for having screened credit
CN112001663B (en) Material donation data processing method based on block chain and related equipment
CN111383020B (en) Block chain-based article anti-counterfeiting management method, device, equipment and storage medium
CN109377220B (en) Block chain-based media data transaction method and system and computer storage medium
CN114971625A (en) Microgrid green electricity transaction system based on block chain technology and data storage and settlement method
CN112053271B (en) Public service platform data evidence management method and system based on block chain
CN111385751B (en) Information sending method, device, terminal and readable storage medium
CN115115451A (en) Block chain service management system for bulk commodity transaction supervision
CN112508587A (en) Tracing code generation method and device based on block chain
CN113706313A (en) Financing method, system and computer readable storage medium based on block chain
CN116151828A (en) Block chain-based carbon footprint tracking method, system, equipment and medium
Li et al. The design of power grid data management system based on blockchain technology and construction of system security evaluation model
CN114169685A (en) Block chain-based full life cycle evaluation data system and control method thereof
CN116633943A (en) De-centralized block chain-based Internet of things data sharing interaction model, construction method and data sharing interaction method
Behl et al. Trusted data notifications from private blockchains
CN114741734A (en) Drug anti-counterfeiting traceability cloud chain data multi-party safe computing method

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20210615

WD01 Invention patent application deemed withdrawn after publication