CN114819891A - Rice full supply chain information supervision method based on parallel block chain and intelligent contract - Google Patents

Rice full supply chain information supervision method based on parallel block chain and intelligent contract Download PDF

Info

Publication number
CN114819891A
CN114819891A CN202210406686.9A CN202210406686A CN114819891A CN 114819891 A CN114819891 A CN 114819891A CN 202210406686 A CN202210406686 A CN 202210406686A CN 114819891 A CN114819891 A CN 114819891A
Authority
CN
China
Prior art keywords
chain
data
parallel
node
supervision
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
CN202210406686.9A
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 Technology and Business University
Original Assignee
Beijing Technology and Business 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 Technology and Business University filed Critical Beijing Technology and Business University
Priority to CN202210406686.9A priority Critical patent/CN114819891A/en
Publication of CN114819891A publication Critical patent/CN114819891A/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
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • 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
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/02Agriculture; Fishing; Forestry; Mining

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • General Physics & Mathematics (AREA)
  • Marketing (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Economics (AREA)
  • Tourism & Hospitality (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Probability & Statistics with Applications (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Agronomy & Crop Science (AREA)
  • Animal Husbandry (AREA)
  • Marine Sciences & Fisheries (AREA)
  • Mining & Mineral Resources (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Primary Health Care (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a rice full-supply chain information supervision method based on a parallel block chain and an intelligent contract, and relates to the field of rice quality safety. The rice supply chain information monitoring model architecture is divided into three block chains of a main chain, a parallel chain and a relay chain, and different types of data are stored in different parallel chains; a rice supply chain supervision cross-chain mode is constructed by providing a collection cross-chain mechanism and a supervision cross-chain mechanism based on Hash locking, an intelligent contract and a relay chain, and by using a concurrency mechanism based on a K-means algorithm and a bloom filter and an SPBFT consensus mechanism applicable to multi-chain consensus. The invention increases the coupling of different types of data among various links of the rice supply chain, improves the convenience and safety of data interaction among various links of the rice supply chain, reduces the storage cost of the data of the supply chain and the high delay of the interaction, realizes the fine management of the data and personnel of the rice supply chain, and ensures the food quality safety of rice.

Description

Rice full-supply chain information supervision method based on parallel block chain and intelligent contract
Technical Field
The invention relates to the fields of new-generation information technologies such as block chains, privacy encryption and the like, grain safety management and the like, in particular to a rice full-supply chain information supervision method based on parallel block chains and intelligent contracts.
Background
Agricultural scientific and technological innovation is an effective means for strengthening rice supply chain supervision, and a new technology is used for improving the rice supply chain supervision level, promoting the rice digital transformation and playing an important role in promoting the rice quality safety. The parallel block chain is an organic combination of a parallel intelligent theoretical method and a block chain technology, aims to increase the functions of calculation experiment and parallel decision for the current block chain technology through the parallel interaction and the collaborative evolution of an actual block chain system and an artificial block chain system, and realizes the block chain system management and decision combining description, prediction and guidance. The rice supply chain data are complex and frequent in interaction, the parallel block chains are quoted to contribute to sharing of the storage pressure of the block chains, the transaction amount of a block chain system is increased, the storage cost of the rice supply chain data is reduced, and the rice supply chain can be assisted in efficient management of the complex information of the whole life cycle of the rice supply chain. The intelligent contracts on the block chain can be regarded as computer programs which run on a distributed account book, preset rules, have state and condition responses, can encapsulate, verify and execute complex behaviors of distributed nodes, and complete information exchange, value transfer and asset management.
In recent years, researchers have explored the combination of blockchain technology and artificial intelligence, big data, 5G, industrial internet, etc. to enhance the supervision capability, which is mainly reflected in the following aspects. Firstly, Artificial Intelligence (AI) and an intelligent contract are combined, the problem of redundancy of block chain information is solved, and the supervision efficiency is improved. And secondly, combining a block chain technology with a big data technology to unify different data sources and realize the unified supervision of data. Thirdly, the blockchain technology is combined with the 5G technology to solve the problem of slow real-time data transmission. And fourthly, combining the block chain with the industrial internet, and realizing accurate source tracing and positioning of the supervision information by technologies such as identification analysis and the like. Compared with the traditional rice supply chain supervision mode, the 'block chain +' mode can ensure the safety and credibility of data on the rice supply chain, and realize credible traceability and accurate responsibility determination of the rice data, so that the supervision efficiency and the authenticity of the rice supply chain are improved.
The rice supply chain has the characteristics of complex links, various data types, long life cycle and the like, the application of the block chain and the intelligent contract promotes the digitization and the intellectualization of the rice supply chain, and the supervision level of a supervision department on the rice supply chain is improved to a certain extent. However, as the amount of data increases, the following disadvantages exist in the block chain and the application of intelligent convergence in rice supply chain regulation.
(1) At present, the research of a block chain at the stage is mostly single-link block chains such as a production chain, a processing chain and a storage chain in the rice supply chain, and the research of the block chain is mostly a mode of the block chain plus a local database or the block chain plus a cloud database in the rice supply chain. Data are difficult to be timely and effectively interconnected and intercommunicated among links of a rice supply chain, and potential safety hazards exist in data interaction between a block chain and a local database.
(2) Because the rice supply chain has a plurality of links, the participators are complex, the rice circulation is huge, and the data volume generated by the rice supply chain is huge. The block chain has limited storage space, and the single-chain mode cannot bear huge data volume of the rice supply chain, and has the problems of high delay, high storage cost and the like.
(3) The rice supply chain data storage is dispersive, the relevance of basic information, harmful information, personnel identity information and the like in each link is weak, the rice supply chain data management is rough, a supervision mechanism can only supervise the rice data, and the related fraud behaviors of enterprises are difficult to effectively supervise.
Disclosure of Invention
Aiming at the defects of the block chain in the rice supply chain supervision application, the invention provides a rice full supply chain information supervision method based on a parallel block chain and an intelligent contract, parallel chain division is carried out on supply chain data based on a main link of the rice full supply chain, and a rice supply chain supervision cross-chain mode is designed.
The invention provides a rice supply chain information supervision method based on a parallel block chain and an intelligent contract, which comprises the following specific steps:
the rice supply chain information monitoring model architecture is divided into three different types of block chains of a main chain, a parallel chain and a relay chain, wherein the main chain nodes are all monitoring departments, upper chain enterprises and consumers, the parallel chain is a data storage chain, and the relay chain is a data cross-chain transfer chain.
The data is divided into 9 parallel chains for storage according to the rice full supply chain links and the involved data owners. The 9 parallel chains respectively correspond to harmful substance information, enterprise information, consumer information, supervision agency information, transaction records, cost information, data interaction records, health records and other information and are respectively numbered as 1-9.
And (II) dividing the privacy and the authority of the supply chain data. The data is divided according to three categories of data owners, namely enterprises, regulatory agencies and consumers, and specifically comprises the following steps: for an enterprise, the data owned by the enterprise is stored in 6 blockchains of parallel chains 1,2,5,6,8,9 and the like, wherein the data contained in 4 blockchains of parallel chains 2,5,8,9 and the like are shared data, and the data such as related harmful information, cost information and the like in the parallel chains 1,6 are unpublished data. For the supervising authority, the owned data is stored in two block chains of parallel chains 4 and 7, wherein the data contained in the parallel chain 4 is shared data, and the data contained in the parallel chain 7 is unpublished data. For the consumer, the owned data is parallel chain 3, and the block chain data is shared data. In terms of access rights, the enterprise and the consumer can access all shared data after verifying the identity. And when the supervision mechanism carries out supervision action, the corresponding data is accessed according to the owned authority.
And (III) carrying out real-time data acquisition chain by using an acquisition cross-chain mechanism by participating enterprises, supervision departments and consumers involved in each batch of the rice supply chain. The collection cross-chain mechanism totally involves two intelligent contracts, namely a collection cross-chain contract A (CCSC-A) and a collection cross-chain contract B (CCSC-B).
The method comprises the steps that data are collected by nodes on a main chain through data collection equipment, the identity of a request initiator is verified through collection of a cross-link contract A, the data are encrypted and then stored in a relay chain in a split mode through Hash locking and asymmetric encryption, data integrity rights are distributed to the nodes of the relay chain through games, the data are pre-stored according to data digests through collection of a cross-link contract B, corresponding storage addresses are obtained and encrypted through the same Hash lock, mutual decryption of encrypted data is achieved through mutual calling between the collection of the cross-link contract A and the collection of the cross-link contract B, and finally, safe storage of the data is achieved within a set time.
And fourthly, when the main chain supervision mechanism needs to call and supervise the data, adopting a supervision chain-crossing mechanism to call the data in a chain-crossing manner. The supervision cross-chain mechanism totally involves two intelligent contracts, namely supervision cross-chain contract A (SCSC-A) and supervision cross-chain contract B (SCSC-B).
A monitoring node of the main chain initiates a data calling and viewing request, a monitoring cross-link contract A verifies the identity of a request initiator, the request data is preprocessed and then sent to a parallel link, and the parallel link transmits the data to the monitoring cross-link contract A through consensus; the supervision cross-link contract A carries out Hash locking and asymmetric encryption on data, and then the data are fragmented and transmitted into a relay link; after the game winning nodes on the relay chain integrate the data, the data are sent to a supervision cross-chain contract B; the supervision cross-link contract B encrypts the identity document of the supervision department by using the same Hash lock, and then calls the supervision cross-link contract A mutually to decrypt data; and finally, the supervision cross-link contract B sends the data to the supervision department, and the supervision cross-link contract A stores the calling information of the supervision department on the parallel chain.
(V) adopting a concurrency mechanism to preprocess the supervision cross-chain request by the supervision cross-chain contract A; the concurrency mechanism is a data processing method based on K-means quadratic clustering and a bloom filter.
In the method, the communication among the main chain, the parallel chain and the relay chain is based on the SPBFT consensus mechanism. For the parallel chain and the relay chain, each node realizes information state migration from the parallel chain to the main chain through an SPBFT consensus mechanism, and realizes consistency of the states of each node of the parallel chain and each node of the main chain; compared with the PBFT consensus mechanism, the SPBFT consensus mechanism adds a Competition step for relay chain consensus.
The SPBFT consensus mechanism comprises the steps of: (I) request, (II) Pre-prepare, (III) Pepart, (IV) Commit, (V) Competition, (VI) Reply.
The process of consensus was:
a client initiates a request message on a main chain, and the main chain broadcasts the message to each node of a parallel chain; each node of the parallel chain independently completes the I-IV step of the SPBFT consensus mechanism; after the reply message is constructed in the VI step, the reply message is bridged to each node of the main chain, the reply message is used as a request to carry out second round of consensus on the main chain, and each node of the main chain directly returns to the client after reaching the reply-1 message;
the consensus of the relay chain is: the client initiates a request message on a main chain, and the main chain broadcasts the message to each node of the relay chain; each node of the relay chain independently completes the I-V step, and after a reply message is constructed in the VI step, the relay chain is bridged to each node of the main chain; the reply message is used as a request to perform the second round of consensus on the main chain, and each node of the main chain directly returns to the client after reaching the reply-2 message.
Compared with the prior art, the invention has the advantages that:
(1) the method combines the parallel block chain, the intelligent contract technology and the rice supply chain, strengthens the information exchange among different links of rice in the aspect of the rice full supply chain industry, and realizes the point-to-point real-time data intercommunication among different types of enterprises in the rice supply chain.
(2) Compared with the prior art, the method improves the adhesiveness of the supervising personnel to the rice full supply chain data, strengthens the coupling of the rice supply chain data, the basic information, the harmful substance information and the like and the personnel identity information, and realizes the fine management of the rice full supply chain data and the personnel in the aspect of the credible supervision of the rice supply chain.
(3) Compared with the prior art, the method improves the convenience and the safety of data cross-chain interaction among all links of the rice supply chain in the aspect of the rice full supply chain mode technology, reduces the storage cost of the supply chain data and the high delay of the interaction, realizes the credible supervision of the rice data by a better distributed account book technology, and ensures the food quality safety of the rice.
(4) The method has strong applicability, can realize information supervision of a full supply chain aiming at different types of grain and oil food, and has universal applicability.
Drawings
FIG. 1 is a classification diagram of rice supply chain links;
FIG. 2 is a diagram of a rice supply chain information monitoring framework according to the present invention;
FIG. 3 is a flow chart of rice supply chain information policing based on parallel blockchains and intelligent contracts in accordance with the present invention;
FIG. 4 is a schematic diagram of the acquisition cross-chain mechanism of the present invention;
FIG. 5 is a schematic diagram of the policing cross-chaining mechanism of the present invention;
FIG. 6 is a schematic diagram of the concurrency mechanism of the present invention;
FIG. 7 is a schematic diagram of the SPBFT consensus mechanism of the present invention;
FIG. 8 is a timing diagram of the SPBFT consensus of the present invention;
fig. 9 is a diagram of a simulation result of a concurrency mechanism in an experiment according to an embodiment of the present invention.
Detailed Description
The present invention will be further described in detail and with reference to examples, which are included to enable those of ordinary skill in the art to understand and practice the invention.
The invention relates to a rice full-supply chain information supervision method based on a parallel block chain and an intelligent contract. Secondly, designing a rice supply chain supervision cross-chain mode based on rice supply chain data analysis, wherein the rice supply chain supervision cross-chain mode comprises a rice supply chain supervision cross-chain framework, an acquisition cross-chain mechanism and a supervision cross-chain mechanism based on Hash locking, an intelligent contract and a relay chain, a concurrency mechanism based on a K-means algorithm and a bloom filter, and an SPBFT consensus mechanism applicable to multi-chain consensus.
First, the main links of the rice supply chain are sorted out, as shown in fig. 1: the whole rice supply chain is divided into six basic links of planting, collecting and storing, processing, storing, transporting and selling; the collecting and storing links comprise 4 small links of purchasing, drying, removing impurities and warehousing; the processing links comprise 5 small links of ridge valley, rice milling, color selection, polishing and packaging.
Secondly, a rice supply chain information supervision model is established, as shown in fig. 2: the rice supply chain information supervision model serves three types of people, namely supervision departments, enterprises and consumers. And the adopted cross-link mechanism is hash latch, cross-link contract and organic combination of relay links. The cross-link contract comprises an acquisition cross-link contract A, an acquisition cross-link contract B, a supervision cross-link contract A and a supervision cross-link contract B. And thirdly, simultaneously adopting a K-means algorithm and a bloom filter to serve data transmission between the main chain and the parallel chain, and designing an SBFT (Byzantine Fault tolerant Algorithm) consensus mechanism for achieving consensus between the main chain and the parallel chain. And fourthly, the lowest part of the frame is a parallel chain group, and the data branch chain storage is mainly realized. And classifying data between the whole frames into 4 types according to types, namely collecting cross-chain data, supervising cross-chain data, consensus data and cross-chain processing data. Sixthly, in order to achieve the consensus between the nodes between the main chain and the parallel chain, an SPBFT (supervisory reactive Byzantine Fault probability) consensus mechanism is designed to achieve the consensus between the nodes between the main chain and the parallel chain.
The rice supply chain supervision cross-chain mode based on the block chain and the intelligent contract fundamentally solves the serious problem of supply chain centralization and realizes the complete decentralization of data. The rice supply chain cross-chain mode comprises data acquisition cross-chain and supervision data cross-chain, and the data acquisition cross-chain mode corresponds to credible cross-chain storage and credible cross-chain supervision of data respectively. For data collection cross-link, main chain participating enterprise nodes collect data by using data collection equipment, verification of the identity of a request initiator is achieved by collecting cross-link intelligent contracts A, the data are encrypted and then are stored in a relay link in a fragmentation mode in a Hash locking and asymmetric encryption mode, distribution of an integrity right is achieved by each node of the relay link through a game method, data are pre-stored according to data digests through collecting cross-link contracts B, corresponding storage addresses are obtained, the addresses are encrypted through the same Hash lock, mutual decryption of the encrypted data is achieved through mutual calling between the collecting cross-link contracts A and the collecting cross-link contracts B, and finally, safe storage of the data is achieved within a specified time. For supervision data cross-linking, a main chain supervision node initiates a data calling and viewing request, a supervision cross-linking intelligent contract A verifies the identity of the supervision cross-linking intelligent contract A, then the request data is preprocessed and sent to a parallel chain, the parallel chain transmits the data to the supervision cross-linking intelligent contract A through consensus, the supervision cross-linking contract A conducts Hash locking and asymmetric encryption on the data and then transmits the data to a relay chain in a fragmentation mode, a relay chain game winning node integrates the data and then sends the data to a supervision cross-linking contract B, and the supervision cross-linking contract B encrypts an identity document of a supervision department by using the same Hash lock and then realizes decryption of the data through mutual calling with the supervision cross-linking contract A. And finally, the supervision cross-link contract B sends the data to the supervision department, and the supervision cross-link contract A stores the calling information of the supervision department on a parallel chain to realize the cochain storage of the data interaction records.
As shown in FIG. 3, the rice supply chain information supervision method based on parallel block chains and intelligent contracts of the present invention comprises the following steps one to eight.
The rice supply chain information supervision model architecture is divided into three different types of block chains including a main chain, a parallel chain and a relay chain, wherein the main chain nodes are all supervision departments, upper chain enterprises and consumers, the parallel chain is a data storage chain, and the relay chain is a data cross-chain transfer chain.
The nodes on the main chain store summary information of data, including data types, node identities and the like.
The nodes on the relay chain only transfer data.
Step two, dividing the whole rice supply chain into six basic links of planting, storing, processing, warehousing, transporting and selling;
the collecting and storing links comprise 4 small links of purchasing, drying, impurity removing and warehousing, and the processing links comprise 5 small links of ridge valley, rice milling, color sorting, polishing and packaging.
And thirdly, dividing the data of each link into 9 parallel chains for storage, wherein the 9 parallel chains correspond to harmful substance information, enterprise information, consumer information, supervision agency information, transaction records, cost information, data interaction records, health records and other information. Data information not belonging to other classes is recorded in the other information. For convenience of explanation, the serial numbers of the 9 parallel chains are 1-9.
And step four, dividing the privacy and the authority of the data.
The data owners are classified into three categories, namely enterprises, regulatory agencies and consumers. For an enterprise, the data owned by the enterprise is stored in 6 blockchains of parallel chains 1,2,5,6,8,9 and the like, wherein the data contained in 4 blockchains of parallel chains 2,5,8,9 and the like are shared data, and the data such as related harmful information, cost information and the like in the parallel chains 1,6 are unpublished data. For the supervising authority, the owned data is stored in two block chains of parallel chains 4 and 7, wherein the data contained in the parallel chain 4 is shared data, and the data contained in the parallel chain 7 is unpublished data. For the consumer, the owned data is parallel chain 3, and the block chain data is shared data.
In terms of access rights, the enterprise and the consumer can access all shared data after verifying the identity. And when the supervision mechanism carries out supervision action, the corresponding data is accessed according to the owned authority. Wherein the national food bureau can visit all parallel chain data, and the finance department can visit 2 nd, 3 rd, 4 th, 5,6,7,8,9 parallel chain data, and the health ministry can visit 1 st, 2 nd, 3 th, 4 th, 5 th, 8,9 parallel chain, and the national industry and commerce bureau can visit 2 nd, 3 th, 4 th, 5 th, 8,9 parallel chain data, and the national quality control bureau can visit 1 st, 2 th, 3 th, 4 th, 5 th, 7 th, 8,9 parallel chain data. The department of agriculture has access to the 2 nd, 3 rd, 4 th, 5 th, 7 th, 8 th and 9 th parallel chain data.
And step five, carrying out real-time data acquisition and chain linking on participating enterprises, supervision departments and consumers related to each batch of the rice supply chain by using an acquisition chain-crossing mechanism. The collection cross-chain mechanism totally involves two intelligent contracts, namely a collection cross-chain contract A (CCSC-A) and a collection cross-chain contract B (CCSC-B). The acquisition cross-link contract A and the acquisition cross-link contract B mainly realize the automatic defense of data acquisition, encryption, fragmentation, game, storage and attack.
As shown in fig. 4, the specific uplink acquisition process includes:
first, various enterprises, regulatory agencies, and consumers need to obtain certification on the supply chain. When data needs to be stored on the chain, the user sends a request to CCSC-A. After the CCSC-A is authenticated, the storage authority is opened to the user. Data that collection equipment gathered first carries out standardized processing, after forming all data D and data summary Ds, CCSC-A carries out the hash lock encryption to D, forms ciphertext Dn, and specific hash lock encryption mode is: a random number N is randomly generated and then a unique hash value h (N) of N is generated, where N is the decryption key for D and h (N) is the encryption lock for D. CCSC-A obtains the user's public key pkp, and encrypts Dn, Ds and H (N) with pkp to form a DATA packet DATA. The CCSC-a transmits the DATA slice to the relay chain, i.e. each node on the relay chain possesses only a part of the DATA. Then, designing a time lock T, wherein within the range of T, each node of the relay chain achieves consensus, and randomly selecting one node through a game to perform DATA restoration. During the restore process, each node of the relay chain endorses the DATA slice. When time T is over, each node of the relay chain will automatically encrypt the DATA slice and return the encryption result to CCSC-a for verification. When CCSC-a receives results returned by more than 51% of the nodes in the relay chain, it can be determined that the DATA slice in the relay chain has been processed. After endorsement of each node of the relay chain is finished, the CCSC-B obtains a private key skp of the user for decryption, and obtains Ds, Dn and H (N). CCSC-B calls a concurrency mechanism to process Ds, and then prestores the Ds and returns an address AD. Thereafter, CCSC-B encrypts AD using H (N). CCSC-A calls CCSC-B, contracts input N, decrypts to obtain AD, and stores it on the backbone. And after the CCSC-B obtains N, decrypting Dn to obtain D, obtaining the data summary by the same operation, matching the data summary with Ds, and verifying whether D is tampered. Finally, the data is stored on the chain according to the AD. The data interaction needs to be carried out within the time T and only carried out once, otherwise, CCSC-A terminates the data uplink.
The contract specific flow is shown as algorithm 1, 2:
algorithm 1: collection cross-chain intelligent contract A (CCSC-A)
Input:H(user);D;Dn;DATA;Ds;T;AD;CCSC-B;pkp;Y;F;
Step 1: function verification (H) (user)/(D)// data acquisition module
Figure RE-GDA0003685582550000071
And 2, step: func Hash lock (D)// data encryption module
Figure RE-GDA0003685582550000072
Step 3, func Slice (DATA)// DATA slicing module
Figure RE-GDA0003685582550000073
Figure RE-GDA0003685582550000081
Step 4, func Game (Relay chain) (node) ) // game module
Figure RE-GDA0003685582550000082
And 5: func Get (AD)// storage module
Figure RE-GDA0003685582550000083
And 2, algorithm: collection cross-chain intelligent contract B (CCSC-B)
Input:DATA;CCSC-A;N;skp
Step 1, func Get-Crack (DATA, skp)// Get DATA, Get Ds, etc. using user skp to decrypt.
Figure RE-GDA0003685582550000091
Step 2: func Pre-stored (Ds)// Pre-storage by data summarization
Figure RE-GDA0003685582550000092
Step 3 func Get (N)// obtaining N
Figure RE-GDA0003685582550000093
And 4, step 4: func Storage (D)// store by pre-stored address
Figure RE-GDA0003685582550000094
Figure RE-GDA0003685582550000101
Wherein H (user) is a user unique hash; y is storage success proof; f is a storage failure notification.
And step six, when the main chain supervision mechanism needs to call and supervise the data, adopting a supervision chain-crossing mechanism to call the data in a chain-crossing manner. The supervision cross-chain mechanism totally involves two intelligent contracts, namely supervision cross-chain contract A (SCSC-A) and supervision cross-chain contract B (SCSC-B). The supervision cross-link contract A and the supervision cross-link contract B mainly achieve authority verification of personnel and automatic defense of data encryption, fragmentation, game, storage and attack.
As shown in fig. 5, the specific cross-chain supervision process is as follows:
first, the supervisor node on the main chain sends a supervision request to SCSC-a and submits the required supervision cross-chain data request to SCSC-a. SCSC-a verifies its unique hash value and if the rights match, the request passes. First, SCSC-a standardizes the administration of cross-chain data requests. The required data may exist in multiple parallel chains, so SCSC-a employs a concurrency mechanism to pre-process the data for review by the regulatory body. SCSC-A explicitly supervises the location of cross-chain data stored in parallel chains and places the request into the cross-chain wait queue of each parallel chain. Each parallel chain sends Data to SCSC-A, and contracts integrate the Data to form supervision cross-chain Data. SCSC-a forms a random number M and generates a unique hash value h (M). H (M) encrypts Data to form a ciphertext Dn. At the same time, time lock T is set by SCSC-A. SCSC-A calls pkp of the backbone regulatory authority to encrypt Dn and H (M) to form a DATA packet DATA. And then storing the data packet fragments into the relay chain. Each node of the relay chain carries out endorsement on the sliced DATA, randomly selects sequencing nodes through an SPBFT consensus mechanism, restores DATA and transmits the DATA to SCSC-B. When the time interval T comes, each node of the relay chain randomly encrypts and locks the data in the chain, and returns the encrypted hash value to the SCSC-A. When the SCSC-a receives more than 51% of the node feedback in the relay chain, it may be determined that the cross-chain data in the relay chain has been completely destroyed. SCSC-B obtains skp and authority authentication certificate S from the supervision department, and decrypts DATA with skp to obtain Dn. SCSC-B uses the same H (M) to encrypt S, SCSC-A calls SCSC-B, uses M to decrypt S, and uploads S to the parallel chain to record the data interaction. And finally, the SCSC-B simultaneously acquires the random number M, decrypts Dn to obtain Data, and transmits the Data to a supervision department. Meanwhile, the data slices in the relay chain are automatically destroyed. And after the SCSC-B decrypts, a decryption success message is sent to the SCSC-A, and the data is completed in a chain crossing manner. If the SCSC-A does not receive the message within the time range T, the chain crossing fails, the SCSC-A starts emergency measures, and all related chain crossing data are encrypted and blocked.
The contract is specifically designed as shown in algorithms 3 and 4:
algorithm 3: supervisory cross-chain intelligent contract A (SCSC-A)
Input H(S);Ds;S;SCSC-B;V;IR;DATA
Step 1: function verification (H (S))// identity verification;
Figure RE-GDA0003685582550000102
Figure RE-GDA0003685582550000111
step 2: func Pretreamtent (D)// Cross-chain request handling
Figure RE-GDA0003685582550000112
And step 3: func Integration (Data)// establish Data
Figure RE-GDA0003685582550000113
And 4, step 4: func Slice (DATA)// DATA fragmentation into relay chains
Figure RE-GDA0003685582550000114
Figure RE-GDA0003685582550000121
And 5: func Storage (IR)
Figure RE-GDA0003685582550000122
Step 6: func Destroy (S)// Call SCSC-B, decrypt, and get S
Figure RE-GDA0003685582550000123
And 7: func delete (V)// Hash Lock
Figure RE-GDA0003685582550000124
And algorithm 4: supervisory cross-chain intelligent contract B (SCSC-B)
Input Data;M;SCSC-A;skp;T;DATA
1: func Decrypt (DATA)// Decrypt DATA using skp
Figure RE-GDA0003685582550000125
Figure RE-GDA0003685582550000131
2: func Get (M)// Get M, exchange S
Figure RE-GDA0003685582550000132
3: func Get (Data)// decrypt Get Data
Figure RE-GDA0003685582550000133
4:func Transport(Data)
Figure RE-GDA0003685582550000134
5: func Self-defense (T, SCSC-A)// attack defense
Figure RE-GDA0003685582550000135
Figure RE-GDA0003685582550000141
H (S) is a supervision department hash value, V is a decryption success notice, and IR is a data interaction record.
Step seven, the concurrency mechanism mentioned in the SCSC-a cross-link request processing is shown in fig. 6, and the specific process is as follows:
firstly, defining Data packet Data required to be subjected to cross-linking, wherein each Data packet Data comprises a plurality of pieces of cross-linking Data, and the formula (1) is shown. Each piece of data in the formula is associated with the hash of the applicant, the data is in a three-dimensional expression form, wherein i is a rice batch, j is a link where the rice data is located, and m is a specific line number in a table where the data type is located, namely the mth parameter of the key data in the table 1. The three variables are respectively specified, wherein j corresponds to 13 links of the rice supply chain, and m corresponds to the specific position of the required cross-chain data in 9 parallel chains.
Figure RE-GDA0003685582550000142
The principle of the K-means algorithm is an unsupervised learning algorithm for automatically clustering sample data according to the measure standard of the correlation among the data samples, and the objective function of the unsupervised learning algorithm is shown as a formula (2). In the formula, k is the number of clusters; n is i Counting the number of sample points in the cluster i; p is a radical of t Is the t-th data sample; u. of i Is the centroid of cluster i. The quantity of the invention is to cluster the sample data according to the Euclidean distance d (t, i) between the sample data and the centroid, and the formula is shown as (3).
Figure RE-GDA0003685582550000143
Figure RE-GDA0003685582550000144
The invention designs a secondary clustering method for concurrent preprocessing of cross-chain data, and the design of a K-means algorithm is as follows:
and (5) initial clustering. Firstly, initializing a k value according to a preset Data storage range of 9 parallel chains, wherein the k value is the number of Data crossing the parallel chains in the Data packet Data. An initial centroid is determined for each cluster from the m values, as shown in equation (4). The centroid c value is the mean of all m values in the cluster. In the initial clustering, the m values of all Data strips in the Data of the Data packet are evenly divided into k parts after being sorted from small to large, and then the average value of m of each part is calculated to be used as an initial centroid. The initial clustering is to perform m-valued clustering on the cross-link data in order to prepare for the second clustering.
Figure RE-GDA0003685582550000145
In the formula (4), n represents the number of data strips in a certain span chain, and m n The m-th parameter of the n-th piece of data is shown.
And (5) secondary clustering. And according to the similarity of the i and j values, clustering for 2 times on the basis of the first clustering. By adopting the secondary clustering method, the Data in the Data packet Data can form the same or similar batches after clustering, and the storage positions of the links are similar, thereby reducing the calculation amount of searching.
A bloom filter is a binary data structure used to determine whether an element is in a set. When the Data packet Data is clustered by the K-means algorithm, K Data blocks are formed. At this time, the names of the parallel chains of all the elements in each data block can be judged only by verifying a random data in each data block. Specifically, a bloom filter is designed for each parallel chain, and the hash h (x) of data included in each parallel chain is mapped onto the bloom filter in advance. When verification is needed, the data to be determined is judged only by the bloom filters of 9 parallel chains, and specific classification can be carried out. When a large amount of data needs to be subjected to chain crossing, a time level T is designed to control the data of each chain crossing. And the parallel chain where the data in each data packet is located is rapidly determined for the data packets in the T time through the organic combination of a K-means algorithm and a bloom filter, so that the efficiency of data chain crossing is improved, and the problem of high concurrence of chain crossing data is solved.
Step eight, the communication of the mechanism depends on the SPBFT consensus mechanism, as shown in fig. 7:
the consensus mode of 'Chain link Chain' is adopted, and the consensus among the main Chain, the parallel Chain and the relay Chain is achieved. For the main chain, all the supervision nodes, the enterprise nodes and the consumer nodes process the message through the node state (consistency) of each stage, so that the message is completely processed, and the consensus is realized. For the parallel Chain and the relay Chain, each Node realizes information state migration from the parallel Chain to the main Chain through an SPBFT consensus algorithm, realizes the consistency of the states of each Node of the parallel Chain and each Node of the main Chain, and realizes the consensus process of 'Chain link Chain' - > 'Node link Node'.
The specific communication process is shown in fig. 8:
the SPBFT has 6 steps, compared with the PBFT consensus mechanism, the competition step is added to adapt to the multi-chain consensus, and the specific description is as follows:
I. request: the client C sends a request to the main chain node.
II. Pre-prepare: the master node allocates a unique number n to the request, the request and the request form a pre-prepare message together, and the pre-prepare message is transmitted to all member nodes after being signed. The unique number n consists of three parts, namely a type, a parallel chain number and a request number, wherein the parallel chain number is assigned only when the parallel chains are identified together, and the rest conditions are preset to be 0, so that the problem of multi-chain identification concurrence is solved. A member node refers to a node on a parallel chain or a node on a relay chain.
III, Prepare: and after receiving the pre-prefix message, the member node judges the correctness of the message by depending on the signature and judges whether the message is received or not. And after the verification is correct, the signature and n form a prefix message together, and the message is broadcast to all other member nodes.
IV, Commit: after all nodes receive the prefix message, the correctness is verified through the signature. If the number of the prefix messages received by each node exceeds two thirds of the number of all the nodes, a commit message is broadcast to all the nodes, and the main chain node can carry out the request service.
V, Competition: the Competition phase is special for relay chain consensus, and all nodes of the relay chain are initially defined as trusted nodes. After all nodes of the relay chain receive the commit message, every two nodes conduct free game, all the nodes form game information with game turns and signatures and broadcast the game information to other nodes, and the signatures are signature authentications conducted by failed game nodes. And after receiving the message, the other nodes determine the winning node by verifying the signature and the number of the signatures. And the winning node performs a second round of game, and sends game information until the only winning node is selected after K rounds. And the winning node forms a game message competition by the game information and the signatures of other nodes and sends the game message competition to all nodes of the relay chain. K is a positive integer.
VI, Reply: and if the number of the commit messages exceeds one third of the number of all the nodes, the service of the request is completed, and a reply message is constructed and replied to the client. The client judges whether the system completes the request according to whether the correct reply of more than one third of the nodes is received or not. And for the relay chain consensus, all the nodes receive the competition message, verify the correctness of the message, complete the service of the request by the winning node, construct a reply message and directly reply to the client. The client judges whether the system completes the request according to whether the correct reply of more than one third of the nodes is received.
The specific consensus process is as follows: the client initiates a request message on the main chain, and the main chain broadcasts the message to each node of the parallel chain. And independently finishing the I-IV steps by each node of the parallel chain, constructing a reply message in the VI step, then crossing the chain to each node of the main chain, using the reply message as a request to perform second round consensus on the main chain, and directly replying to the client after each node of the main chain achieves the reply-1 message.
For relay chain consensus, the consensus is achieved by the relay chain nodes and the main chain nodes. The method comprises the following specific steps: the client initiates a request message on the main chain, and the main chain broadcasts the message to each node of the relay chain. And independently finishing the I-V step by each node of the relay chain, constructing a reply message in the VI step, then spanning the link to each node of the main chain, using the reply message as a request to perform second round consensus on the main chain, and directly replying to the client after each node of the main chain achieves the reply-2 message.
Example (b):
the method arranges more than 200 types of key data according to different types of data stored in each parallel chain, relevant national/local/industrial standards, data actually generated in each link of a rice supply chain and the like. The data covers the whole flow of rice from planting to eating circulation. And stipulate 9 parallel chains to correspond to harmful substance information, enterprise information, consumer information, regulatory agency information, transaction record, cost information, data interaction record, health record and other information separately, the key data classification produced by each batch is shown in table 1:
TABLE 1 parallel chain data partitioning
Figure RE-GDA0003685582550000161
Figure RE-GDA0003685582550000171
The authorities of the relevant supervision departments are classified, and the data supervision authorities are shown in table 2. According to the different properties of each supervision department, the parallel chain which each department has the right to supervise and access is regulated, and the privacy and the safety of data are ensured on the application level.
TABLE 2 supervision authority table
Figure RE-GDA0003685582550000172
Figure RE-GDA0003685582550000181
And then constructing a rice supply chain information supervision model. The rice supply chain cross-chain mode comprises data acquisition cross-chain and supervision data cross-chain, and the data acquisition cross-chain mode corresponds to credible cross-chain storage and credible cross-chain supervision of data respectively.
And (I) acquiring data across chains.
The main chain participating enterprise node utilizes data acquisition equipment to collect data, the identity of a request initiator is verified by acquiring a cross-chain intelligent contract A, the data is encrypted and then is stored in a relay chain in a fragmentation mode in a Hash locking and asymmetric encryption mode, each node of the relay chain realizes the distribution of an integrity right through a game method, the data is pre-stored according to a data abstract by acquiring a cross-chain contract B, a corresponding storage address is obtained, the address is encrypted through the same Hash lock, the mutual decryption of the encrypted data is realized through the mutual calling between the acquisition of the cross-chain contract A and the acquisition of the cross-chain contract B, and finally the safe storage of the data is realized in a specified time.
And (II) monitoring data cross-linking.
The main chain supervision node initiates a data calling and checking request, the supervision cross-chain intelligent contract A verifies the identity of the supervision cross-chain intelligent contract A, then the request data is preprocessed and sent to a parallel chain, the parallel chain transmits the data to the supervision cross-chain intelligent contract A through consensus, the supervision cross-chain contract A conducts Hash locking and asymmetric encryption on the data and then transmits the data into a relay chain in a fragmentation mode, a relay chain game winning node rectifies the data and then sends the data to a supervision cross-chain contract B, and the supervision cross-chain contract B encrypts an identity document of a supervision department by using the same Hash lock and then realizes decryption of the data through mutual calling with the supervision cross-chain contract A. And finally, the supervision cross-link contract B sends the data to the supervision department, and the supervision cross-link contract A stores the calling information of the supervision department on a parallel chain to realize the cochain storage of the data interaction records.
The specific embodiment is as follows:
the designed rice supply chain multi-chain supervision mode is subjected to experimental simulation, 1 cloud server is adopted, and the server is configured to be a 4-core CPU, an 8G memory and a 50G high-performance cloud hard disk. The cloud server is provided with 32 nodes, wherein 8 nodes are used as main chain nodes and respectively correspond to representative enterprises and 2 regulatory departments in 6 main links of the rice supply chain. 6 are arranged as relay chain nodes, and the relay chain game adopts CFR (virtual regret minimization algorithm). And 3 parallel chains are built by the rest 18 nodes, and each parallel chain is provided with 6 nodes which respectively correspond to the stored enterprise information, the supervisor information and the cost information. The correctness of cross-chain transmission in the rice supply chain multi-chain supervision mode is tested by respectively setting different malicious nodes and wrong nodes. The test sets are divided into 3 groups, the number of error nodes in each group is 0, 1 and 3 respectively, and each group of test sets respectively acquires data cross-linking and supervises data cross-linking for 500 times. Because the parallel chain and the relay chain link points are credible, the fault node is deployed to the main chain node for testing, the SPBFT consensus mechanism can effectively tolerate the fault node below 30% (only the main chain node), the chain crossing success rate reaches 100%, and the safety of data chain crossing transmission can be fully ensured.
The method is used for testing and analyzing the performance of a rice supply chain multi-chain framework, and mainly aims at testing the cross-chain concurrency problem. For the concurrency problem, the invention adopts quadratic clustering and a bloom filter arranged on each parallel chain to solve the problem of concurrency across the chains.
The concurrent processing capacity of the rice supply chain is tested by performing cross-chain transmission of 50000 groups of data at the same time through experimental simulation. Firstly, the concurrency mechanism designed by the invention firstly carries out the first clustering, the clustering condition is shown as fig. 9(a), after the clustering is successful, each cluster randomly selects a piece of data to be screened with the bloom filter on each parallel chain, so as to determine the parallel chain represented by each cluster. The total time of the first clustering is 0.60823 seconds, the iteration is carried out for 6 times, and the result shows that the data can be matched with the corresponding parallel chain position after one-time Hash conversion. The second time the present invention performs secondary clustering on 12695 groups of data in the first chain to facilitate data search, and the clustering situation is shown in fig. 9 (b). The second clustering took 1.32542 seconds total and was iterated 22 times, and the results showed that the test dataset was stored in the first chain dataset in around batch 63 and batch 101.
In addition to the technical features described in the specification, the technology is known to those skilled in the art. Descriptions of well-known components and techniques are omitted so as to not unnecessarily obscure the present invention. The embodiments described in the above embodiments do not represent all embodiments consistent with the present application, and various modifications or variations which may be made by those skilled in the art without inventive efforts based on the technical solution of the present invention are still within the protective scope of the present invention.

Claims (9)

1. A rice full supply chain information supervision method based on a parallel block chain and an intelligent contract is characterized by comprising the following steps:
dividing a rice supply chain information monitoring model architecture into three different types of block chains of a main chain, a parallel chain and a relay chain, wherein the main chain nodes are all monitoring departments, upper chain enterprises and consumers, the parallel chain is a data storage chain, and the relay chain is a data cross-chain transfer chain;
dividing 9 parallel chains according to the rice full supply chain link and the related data owner, and respectively storing data of corresponding types: hazardous substance information, enterprise information, consumer information, regulatory agency information, transaction records, cost information, data interaction records, health records, and other information; numbering the 9 parallel chains as 1-9 in sequence;
data owners include enterprises, regulatory agencies, and consumers; the data owned by the enterprise is stored in the 1 st, 2 nd, 5 th, 6 th, 8 th and 9 th parallel chains, the data owned by the supervision organization is stored in the 4 th and 7 th parallel chains, and the data owned by the consumer is stored in the 3 rd parallel chain;
(II) dividing the privacy and the authority of the data, comprising the following steps: the data on the 2 nd, 5 th, 8 th and 9 th parallel chains of the enterprise are shared data, and the data on the 1 st and 6 th parallel chains are unpublished data; the data on the 4 th parallel chain of the supervision mechanism is shared data, and the data on the 7 th parallel chain of the supervision mechanism is unpublished data; the data on the 3 rd parallel chain of the consumer is shared data;
in the access authority, after the identity of the enterprise and the consumer is verified, all shared data can be accessed; when the supervision mechanism carries out supervision action, corresponding data are accessed according to the owned authority;
(III) carrying out data real-time acquisition and chain linking on participating enterprises, supervision departments and consumers related to each batch of the rice supply chain by using an acquisition chain-crossing mechanism; the acquisition cross-chain mechanism involves two intelligent contracts: collecting a cross-chain contract A and a cross-chain contract B;
the method comprises the steps that nodes on a main chain collect data by data collection equipment, cross-link contract A is collected to verify the identity of a request initiator, the data are encrypted and then are stored in a relay chain in a split mode through Hash locking and asymmetric encryption, each node of the relay chain distributes data integrity through game, data are pre-stored according to a data abstract through collection cross-link contracts B to obtain corresponding storage addresses, the addresses are encrypted through the same Hash lock, mutual decryption of the encrypted data is achieved through mutual calling between the collection cross-link contract A and the collection cross-link contract B, and finally, safe storage of the data is achieved within a specified time;
fourthly, when the main chain supervision department needs to call and supervise the data, adopting a supervision chain-crossing mechanism to call the data in a chain-crossing way; the supervisory cross-chain mechanism involves two intelligent contracts: supervising a cross-linkage contract A and supervising a cross-linkage contract B;
a monitoring node of the main chain initiates a data calling and viewing request, a monitoring cross-link contract A verifies the identity of a request initiator, the request data is preprocessed and then sent to a parallel chain, and the parallel chain transmits the data to the monitoring cross-link contract A through consensus; the supervision cross-link contract A carries out Hash locking and asymmetric encryption on data, and then the data are fragmented and transmitted into a relay link; after the game winning nodes on the relay chain integrate the data, the data are sent to a supervision cross-chain contract B; the supervision cross-link contract B encrypts the identity document of the supervision department by using the same Hash lock, and then calls the supervision cross-link contract A mutually to decrypt data; finally, the supervision cross-link contract B sends the data to the supervision department, and the supervision cross-link contract A stores the calling information of the supervision department on a parallel chain;
(V) adopting a concurrency mechanism to preprocess the supervision cross-chain request by the supervision cross-chain contract A; the concurrency mechanism is a data processing method based on K-means quadratic clustering and a bloom filter.
2. The method according to claim 1, wherein in step (one), the enterprises comprise manufacturing enterprises, storage enterprises, processing enterprises, warehousing enterprises, transportation enterprises and sales enterprises; the regulatory agencies comprise the national food administration, the finance department, the health department, the national industry and commerce headquarter, the national quality control headquarter and the agricultural department.
3. The method according to claim 1 or 2, wherein in step (two), the national food service bureau has access to all parallel chain data, the finance department has access to the 2 nd, 3 th, 4 th, 5 th, 6 th, 7 th, 8 th, 9 th parallel chain data, the health department has access to the 1 st, 2 th, 3 th, 4 th, 5 th, 8 th, 9 th parallel chain data, the national business bureau has access to the 2 th, 3 th, 4 th, 5 th, 8 th, 9 th parallel chain data, the national quality inspection bureau has access to the 1 st, 2 th, 3 th, 4 th, 5 th, 7 th, 8 th, 9 th parallel chain data, and the agricultural department has access to the 2 th, 3 th, 4 th, 5 th, 7 th, 8 th, 9 th parallel chain data.
4. The method of claim 1, wherein in step (iii), the uplink data acquisition is performed in the following manner: marking the collection cross-chain contract A as CCSC-A, and the collection cross-chain contract B as CCSC-B;
when data needs to be stored on the block chain, a user sends a request to CCSC-A;
CCSC-A performs: (11) verifying the identity of the user, and opening a storage authority to the user after the user passes the verification; judging the data type, and carrying out standardization processing on the data to form all data D; (12) acquiring a data abstract Ds, and carrying out hash lock encryption on the D to form a ciphertext Dn; acquiring a user public key pkp, and encrypting Dn, Ds and H (N) to form a DATA packet DATA; random number N is the decryption key for D, H (N) is the dongle for D; (13) transmitting the DATA fragments to a relay chain, and storing the DATA fragments to each node of the relay chain; (14) designing a time lock T; in the time T, each node of the relay chain rectifies and restores the DATA through a game selection node; in the reduction process, each node of the relay chain carries out endorsement on the DATA slice; when the time T is over, each node of the relay chain automatically encrypts a DATA slice and returns an encryption result to the CCSC-A for verification; when CCSC-A receives the result returned by more than 51% of nodes in the relay chain, determining that the DATA slice in the relay chain is processed;
after endorsement of each node of the relay chain is completed, the CCSC-B executes: (21) obtaining a user private key skp to decrypt the DATA, and obtaining Ds, Dn and H (N); (22) calling a concurrency mechanism to pre-store Ds and return an address AD; (23) obtaining a random number N, encrypting AD using h (N);
CCSC-A continues to execute: (15) calling CCSC-B, obtaining AD by using N decryption, and storing the AD on a main chain;
CCSC-B continues to execute: (24) decrypting Dn by using N to obtain D, and verifying whether D is tampered; storing D to the parallel block chain of the corresponding type;
the data interaction is carried out within the time T and only once, otherwise, CCSC-A terminates the data uplink.
5. The method of claim 1, wherein in step (IV), the data is called across the chain in the following way: marking a supervision cross-linking contract A as SCSC-A, and marking a supervision cross-linking contract B as SCSC-B;
a supervision department node on a main chain sends a supervision cross-chain request to SCSC-A;
SCSC-a performs: (31) verifying the authority of a supervision department, and accepting a cross-chain request when the verification is passed; (32) preprocessing the supervision cross-chain request by adopting a concurrency mechanism, acquiring the position of a parallel chain where the requested data is located, and putting the data request into a cross-chain waiting queue of each parallel chain; (33) extracting the requested Data from each parallel chain, and integrating to form supervision cross-chain Data; generating a random number M, taking a hash value H (M), and encrypting Data by using H (M) to form a ciphertext Dn; calling a public key pkp of a supervision department to encrypt Dn and H (M) to form a DATA packet DATA; (34) setting a time lock T; storing the DATA packet DATA in each node of the relay chain in a fragmentation mode; gaming is carried out on each node of the relay chain, DATA is sorted and transmitted to SCSC-B; when the time T is over, each node of the relay chain randomly encrypts and locks the DATA fragment and returns the encrypted hash value to the SCSC-A; when the SCSC-A receives more than 51% of node feedback in the relay chain, determining that the cross-chain data in the relay chain is completely destroyed;
SCSC-B performs: (41) acquiring a key skp and a permission authentication certificate S from a supervision department, and decrypting DATA by using the skp to obtain a ciphertext Dn and an encryption lock H (M); (42) encrypting S using h (m);
SCSC-a continues to perform: (35) calling SCSC-B, decrypting by using M to obtain S, and uploading the data interaction record to a parallel chain;
SCSC-B continues to execute: (43) acquiring a random number M, decrypting Dn to obtain Data, verifying whether the Data is tampered, and transmitting the Data to a supervision department when verification is carried out without tampering; meanwhile, the data slices in the relay chain are automatically destroyed; (44) after the Dn is decrypted, a decryption success message is sent to the SCSC-A, and the data is completed in a chain crossing manner;
if the SCSC-A does not receive the message within the time T, the chain crossing fails, the SCSC-A starts emergency measures, and all related chain crossing data are encrypted and blocked.
6. The method as claimed in claim 1 or 5, wherein in the step (V), the data processing method based on K-means quadratic clustering and bloom filter is implemented as follows:
the supervision cross-chain Data packet Data requested by the supervision department comprises Data on a plurality of parallel chains, and each piece of Data (i, j, m) comprises a rice batch i, a link j where the rice Data is located, and an mth parameter on the parallel chains;
firstly, carrying out initial clustering and secondary clustering by using a K-means algorithm;
the initial clustering mode is as follows: initializing a k value, wherein the k value is the number of Data crossing parallel chains in the Data; sorting the m values of all Data strips in the Data packet Data from small to large, averagely dividing the m values into k parts, and solving the mean value of m of each part as an initial centroid;
the secondary clustering mode is as follows: performing secondary clustering on the basis of the initial clustering according to the similarity of the i and j values, so that after Data in the Data packet Data are clustered, the same or similar batches are formed, and the storage positions of links are similar;
clustering the Data packets Data by a K-means algorithm to form K Data blocks; at the moment, the names of the parallel chains of all the elements in each data block can be judged only by verifying a random piece of data in each data block;
designing a bloom filter for each parallel chain, wherein the hash value of the data contained in each parallel chain is mapped onto the bloom filter in advance; when the parallel chain to which the data belongs needs to be verified, judging the data to be determined by utilizing a bloom filter of 9 parallel chains to obtain classification.
7. The method of claim 1, further comprising the step (six), wherein the communication among the main chain, the parallel chain and the relay chain is based on a SPBFT consensus mechanism; for the parallel chain and the relay chain, each node realizes information state migration from the parallel chain to the main chain through an SPBFT consensus mechanism, and realizes consistency of the states of each node of the parallel chain and each node of the main chain; compared with the PBFT consensus mechanism, the SPBFT consensus mechanism adds a Competition step for relay chain consensus.
8. The method of claim 7, wherein the common process of the nodes of the main chain, the parallel chain and the relay chain is as follows:
the SPBFT consensus mechanism comprises the steps of: (I) request, (II) Pre-prepare, (III) Pepart, (IV) Commit, (V) Competition, (VI) Reply;
a client initiates a request message on a main chain, and the main chain broadcasts the message to each node of a parallel chain; each node of the parallel chain independently completes the I-IV step of the SPBFT consensus mechanism; after the reply message is constructed in the VI step, the reply message is bridged to each node of the main chain, the reply message is used as a request to carry out second round of consensus on the main chain, and each node of the main chain directly returns to the client after reaching the reply-1 message;
the consensus of the relay chain is: the client initiates a request message on a main chain, and the main chain broadcasts the message to each node of the relay chain; each node of the relay chain independently completes the I-V step, and after a reply message is constructed in the VI step, the relay chain is bridged to each node of the main chain; the reply message is used as a request to perform the second round of consensus on the main chain, and each node of the main chain directly returns to the client after reaching the reply-2 message.
9. The method of claim 7, wherein the SPBFT consensus mechanism comprises the steps of:
I. request: the client sends a request to the main chain node;
II. Pre-prepare: the main chain node distributes a unique number n to the request, and the request form a pre-prepare message together, and after signature, the pre-prepare message is transmitted to all member nodes; the unique number n consists of three parts, namely a type, a parallel chain number and a request number, wherein the parallel chain number is assigned only when the parallel chains are identified, and the number is preset to be 0 in other situations; the member node refers to a node on a parallel chain or a node on a relay chain;
III, Pepare: after receiving the pre-prefix message, the member node judges the correctness of the message by means of the signature and judges whether the message is received or not; after the correctness is confirmed, the signature of the node and n form a prefix message together, and the message is broadcast to all other member nodes;
IV, Commit: after all nodes receive the prefix message, verifying the correctness through the signature; if the number of the received prepare messages of each node exceeds two thirds of the number of all the nodes, broadcasting commit messages to all the nodes to indicate that the main chain node can carry out the request service;
v, Competition: for relay chain consensus, comprising: initially defining all nodes of a relay chain as trusted nodes; after all nodes of the relay chain receive the Commit message, performing free game on every two nodes, and broadcasting game information, game turns and signatures to other nodes by all nodes, wherein the signatures are signature authentications performed by game failure nodes; after receiving the message, the other nodes determine the winning node by verifying the signature and the number of the signatures; the winning node performs a second round of game and sends game information until the only winning node is selected through multiple rounds of game; the winning node forms game information and other node signatures into a game message competition and sends the game message competition to all nodes of the relay chain;
VI, Reply: all nodes verify the message correctness if receiving the commit message, and complete the request service and construct a reply message to the client if the commit message number exceeds one third of the number of all nodes; for the relay chain consensus, all the nodes receive the competition message, the correctness of the message is verified, the winning node completes the service of the request, and a reply message is constructed and directly replied to the client; the client judges whether the request is completed according to whether the correct reply of more than one third of the nodes is received.
CN202210406686.9A 2022-04-18 2022-04-18 Rice full supply chain information supervision method based on parallel block chain and intelligent contract Pending CN114819891A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210406686.9A CN114819891A (en) 2022-04-18 2022-04-18 Rice full supply chain information supervision method based on parallel block chain and intelligent contract

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210406686.9A CN114819891A (en) 2022-04-18 2022-04-18 Rice full supply chain information supervision method based on parallel block chain and intelligent contract

Publications (1)

Publication Number Publication Date
CN114819891A true CN114819891A (en) 2022-07-29

Family

ID=82536931

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210406686.9A Pending CN114819891A (en) 2022-04-18 2022-04-18 Rice full supply chain information supervision method based on parallel block chain and intelligent contract

Country Status (1)

Country Link
CN (1) CN114819891A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499454A (en) * 2022-09-20 2022-12-20 广西师范大学 Agricultural product data cross-link sharing method based on alliance relay link
CN115618429A (en) * 2022-12-20 2023-01-17 北京理工大学 Product full life cycle management system based on parallel block chain
CN115982208A (en) * 2022-08-24 2023-04-18 淮阴工学院 Cold chain product relevance query method and device based on block chain cross-chain cooperation

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108880863A (en) * 2018-05-26 2018-11-23 江西理工大学 A kind of smart grid equipment safety diagnostic service system based on block chain technology
CN110557394A (en) * 2019-09-06 2019-12-10 杭州复杂美科技有限公司 Parallel chain management method, equipment and storage medium
CN112967074A (en) * 2021-03-29 2021-06-15 北京工商大学 Block chain driven rice supply chain information supervision model construction method
WO2022036909A1 (en) * 2020-08-21 2022-02-24 中诚区块链研究院(南京)有限公司 High security transaction block system
WO2022052091A1 (en) * 2020-09-14 2022-03-17 天津理工大学 Asset and data cross-chain method and system based on blockchain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108880863A (en) * 2018-05-26 2018-11-23 江西理工大学 A kind of smart grid equipment safety diagnostic service system based on block chain technology
CN110557394A (en) * 2019-09-06 2019-12-10 杭州复杂美科技有限公司 Parallel chain management method, equipment and storage medium
WO2022036909A1 (en) * 2020-08-21 2022-02-24 中诚区块链研究院(南京)有限公司 High security transaction block system
WO2022052091A1 (en) * 2020-09-14 2022-03-17 天津理工大学 Asset and data cross-chain method and system based on blockchain
CN112967074A (en) * 2021-03-29 2021-06-15 北京工商大学 Block chain driven rice supply chain information supervision model construction method

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
张新;彭祥贞;许继平;王小艺;李海生;赵峙尧: "基于区块链智能合约的稻米供应链动态监管模型", 《农业机械学报》, 6 December 2021 (2021-12-06) *
成云涛: "基于加权拜占庭容错机制的区块链共识算法研究与应用", 《中国优秀硕士学位论文全文数据库信息科技辑》, 15 December 2021 (2021-12-15), pages 138 - 216 *
洪学海;汪洋;廖方宇;: "区块链安全监管技术研究综述", 中国科学基金, no. 01, 14 March 2020 (2020-03-14) *
许继平;孙鹏程;张新;王小艺;孔建磊;赵峙尧;: "基于区块链的粮油食品全供应链信息安全管理原型系统", 农业机械学报, no. 02, 2 January 2020 (2020-01-02) *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115982208A (en) * 2022-08-24 2023-04-18 淮阴工学院 Cold chain product relevance query method and device based on block chain cross-chain cooperation
CN115982208B (en) * 2022-08-24 2023-09-29 淮阴工学院 Cold chain product relevance query method and device based on block chain cross-chain collaboration
CN115499454A (en) * 2022-09-20 2022-12-20 广西师范大学 Agricultural product data cross-link sharing method based on alliance relay link
CN115499454B (en) * 2022-09-20 2024-03-22 广西师范大学 Agricultural product data cross-link sharing method based on alliance relay links
CN115618429A (en) * 2022-12-20 2023-01-17 北京理工大学 Product full life cycle management system based on parallel block chain

Similar Documents

Publication Publication Date Title
CN114819891A (en) Rice full supply chain information supervision method based on parallel block chain and intelligent contract
CN109034833B (en) Product tracing information management system and method based on block chain
Hamida et al. Blockchain for enterprise: overview, opportunities and challenges
CN110245186B (en) Service processing method based on block chain and related equipment
CN110287268A (en) A kind of digital asset processing method and system based on block chain
CN108829691B (en) Rural electronic commerce data storage method
Mathur et al. A survey on role of blockchain for IoT: Applications and technical aspects
CN113468264B (en) Block chain-based federal learning method and device for poisoning defense and poisoning traceability
Zhong et al. Privacy-protected blockchain system
Jani Smart contracts: Building blocks for digital transformation
CN113836568A (en) Electronic evidence judicial identification method
CN115208628B (en) Data integrity verification method based on block chain
CN110610098A (en) Data set generation method and device
CN113039748B (en) Computer-implemented systems and methods based on neural blockchain
US20210233091A1 (en) System and method for facilitating a record of information of an organism
US20190305934A1 (en) System and methods for recording codes in a distributed environment
Wang Integrity verification of cloud-hosted data analytics computations
CN115630118A (en) Method for reducing node memory space occupation in block chain tracing application
CN113972012A (en) Infectious disease prevention and control cooperative system based on alliance chain and public chain
Van der Laan „Understanding Blockchain”. U
US11876890B2 (en) Anonymization of partners
Drew et al. Optimized combined-clustering methods for finding replicated criminal websites
CN115427980A (en) Context integrity preservation
Li et al. Research on Grain Food Blockchain Traceability Information Management Model Based on Master-Slave Multichain
CN112100657A (en) Data processing method based on block chain

Legal Events

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