Building materials supply chain data management system and method based on blockchain and IPFS
Through blockchain and IPFS technology, the problems of low information sharing and data security in traditional engineering materials supply chains are solved, real-time information sharing, high security and traceability of building materials supply chains are realized, and multiple heterogeneous data are met. The storage requirements ensure the compliance and transparency of information.
Patent Information
- Application Number
- CN202310546873.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-15
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2043-05-15
AI Technical Summary
The traditional engineering materials supply chain is divided into various links, and real-time sharing and traceability management of information cannot be achieved. The data is low in security, and it is difficult to effectively store multi-source heterogeneous data, such as audio and video, and other unstructured information.
Adopt a data management system based on blockchain and IPFS, through smart contracts, file sharding modules and data query and storage modules, intelligent supervision of the entire process quality information of the building materials supply chain is realized, and IPFS is used for multivariate heterogeneous data storage. Blockchain records transaction information and compliance verification.
Real-time sharing of information, high data security, and information traceability and compliance inspection are realized, preventing data tampering and loss, and ensuring information transparency and accountability.
Smart Images

Figure CN116662291B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of building material supply chain management, and in particular to a building material supply chain data management system and method based on blockchain and IPFS. Background Art
[0002] The quality of engineering materials is crucial to the safety of buildings. However, the various links in the traditional engineering material supply chain are separated from each other, and it is impossible to achieve real-time information sharing and traceability management, which makes the supervision of material quality difficult and inefficient. In addition, the quality information of engineering materials is often stored in the database of a participant in the supply chain, and the material information is easy to be tampered with. At the same time, when storing multi-source heterogeneous data, traditional storage methods have low data security and are difficult and cumbersome to implement.
[0003] Most of the current research on the quality management of the engineering material supply chain does not consider the management of the engineering material supply chain from the perspective of information flow management. In order to solve this problem, some studies have tried to use information technologies such as RFID (Radio Frequency Identification) and GIS (Geographic Information System) to improve the information management capabilities of the engineering material supply chain. For example, Kim S et al. proposed a ready-mixed concrete logistics management strategy and information system based on RFID, which can improve the efficiency of concrete mixer truck logistics management. However, these studies mainly focus on how to obtain information related to the quality of engineering materials, without considering the traceability and transparency of information, as well as the interaction of information between different participants. Therefore, the automatic interaction of information between participants and the traceability and transparency of quality information are the current research deficiencies in the quality management of the engineering material supply chain.
[0004] At the same time, how to store a large amount of multi-source heterogeneous data is also an urgent problem to be solved. The building materials supply chain data contains unstructured data such as images, audio, and video, which is quite different from the structured data in traditional databases. At present, most ways to store multi-source heterogeneous data are just file paths that store data, which is easy to be tampered with and lost.
[0005] Blockchain technology and IPFS technology can well meet the requirements of supply chain information management. Relevant scholars believe that blockchain technology can greatly reduce the losses caused by human factors and intentional false information, eliminate the trust issues between participants in personnel flow, and IPFS can meet the needs of multi-heterogeneous data storage. However, there are still few literatures studying the application of blockchain technology and IPFS technology in the quality management of engineering material supply chain, and they mainly use qualitative methods to discuss the feasibility of related technology applications, lacking operational methods. Summary of the invention
[0006] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a building materials supply chain data management system and method based on blockchain and IPFS, so as to realize intelligent supervision of quality information of the entire process of the engineering materials supply chain.
[0007] The purpose of the present invention can be achieved by the following technical solutions:
[0008] A building materials supply chain data management system based on blockchain and IPFS, including a user end, a smart contract module, a blockchain, a file sharding module, and a data query and storage module;
[0009] The operations performed by the user end include: providing a building material supply chain file, interacting with the IPFS node, interacting with the smart contract module, and interacting with the file sharding module;
[0010] The smart contract is used to record relevant business logic and compliance verification in the field of building materials supply chain;
[0011] The file slicing module is used to slice the input file and randomly select a key to encrypt the file slices to obtain encrypted file slices;
[0012] The data query and storage module includes an IPFS node and a database for storing the encrypted file fragments;
[0013] The blockchain is used to store the encrypted file segments and transaction information of each link.
[0014] Furthermore, the user terminal interacting with the IPFS node includes:
[0015] The user end provides the building material supply chain file and writes the building material supply chain file into the IPFS node;
[0016] The client receives the file hash value returned by the IPFS node.
[0017] Furthermore, the user terminal interacting with the file slicing module includes:
[0018] The client provides the file hash value returned by the IPFS node to the file sharding module to shard the building material supply chain file.
[0019] Furthermore, the user terminal interacting with the smart contract module includes:
[0020] The user end calls the smart contract module to query the public key;
[0021] When a user queries data through the data query and storage module, the smart contract code will be called to write the relevant data into the blockchain in the form of a transaction.
[0022] Furthermore, the user end is operated by upstream and downstream parties in the building materials supply chain, the information of all parties in the building materials supply chain is stored in the IPFS node, and all parties in the building materials supply chain maintain one or more IPFS nodes as data storage nodes.
[0023] Furthermore, the IPFS node is used to provide data query and storage services. Using the IPFS node for data storage includes the following steps:
[0024] S101, receiving data;
[0025] S102, perform compliance check on the received data, if the check passes, execute step S103, otherwise require the user to re-upload the data;
[0026] S103, packaging the data that has passed the compliance check and generating a data fingerprint;
[0027] S104, upload the packaged data to the IPFS node, and the IPFS node broadcasts the data. The node that receives the broadcast saves a copy of the redundant data locally and uses the data fingerprint generated in S103 as the data index;
[0028] S105. After the data is uploaded to the IPFS node, the system calls the chain code to write the data fingerprint and related business records into the blockchain.
[0029] Furthermore, in step S101, data is collected by the data collection layer of the IPFS node, transmitted to the system through the IPFS data interface, and received by the server running the IPFS node.
[0030] Furthermore, the IPFS node is used to provide data query and storage services. Using the IPFS node to perform data query includes the following steps:
[0031] S201, the user searches for relevant data based on the data fingerprint;
[0032] S202: According to the specified query condition input by the user, the deployed chain code is called to check whether the relevant record exists. If it exists, step S203 is executed, otherwise the query ends;
[0033] S203, read the data fingerprint generated in step S103 in the chain code, and establish a connection with the IPFS service node, waiting for reading and query operations;
[0034] S204, sending the data fingerprint to the IPFS node for query, and the IPFS node returns a corresponding return value;
[0035] S205: Download relevant data files according to the return value, and feed back relevant return results to the user.
[0036] A method for managing building materials supply chain data based on blockchain and IPFS is implemented by applying the above-mentioned building materials supply chain data management system based on blockchain and IPFS. The participants include a general contractor, a supervision unit and a construction unit. The data management method includes the following steps:
[0037] S301. After the construction is completed and the general contractor passes the self-inspection, the chain code is called to submit the relevant business information to the blockchain through the hyperledger, and the key information of the general contractor is added to the end of the relevant business information;
[0038] S302, the supervision unit reviews the relevant general contractor information, calls the relevant chain code to determine whether the information uploaded by the general contractor chain code is compliant, and gives a review approval opinion if it is compliant, otherwise a return opinion is given;
[0039] S303, submitting the review opinions of the supervisory unit to the blockchain through the hyperledger;
[0040] S304. The construction unit calls the chain code for review. If the review is passed, a review pass opinion is given, otherwise a rejection opinion is given;
[0041] S305. Submit the review opinion of the construction unit to the blockchain through the hyperledger.
[0042] Furthermore, the hyperledger includes proposal endorsement, sorting and packaging, and verification and update operations.
[0043] Compared with the prior art, the present invention has the following beneficial effects:
[0044] 1. In view of the diversification of information in the building materials supply chain, the present invention uses IPFS technology as a mechanism for storing multi-heterogeneous data, which meets the actual needs of transmitting unstructured data such as audio, video, and images on the chain, and can effectively prevent data from being tampered with and lost.
[0045] 2. Regarding the real-time sharing of information, the present invention provides that each completed business will be uploaded to the chain in real time, which can be queried in real time and has good timeliness.
[0046] 3. The present invention utilizes blockchain technology. All parties in the building materials supply chain run several blockchain nodes and IPFS nodes. The data is stored locally on the node. No party can modify the data alone, which has high security.
[0047] 4. The present invention stores the building materials supply chain-related data in the data nodes of all parties for a long time, and each organizational node has redundant backup, so that the information can be traced and held accountable.
[0048] 5. The present invention assumes that each business transaction is completed through the on-chain code, and the compliance specifications of the information are verified in advance and encoded into the on-chain code to achieve compliance checking of the on-chain information. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a diagram of the IPFS data storage and query architecture in an embodiment of the present invention;
[0050] Figure 2 This is a flowchart of IPFS data storage and query in an embodiment of the present invention;
[0051] Figure 3 This is a supply chain tracing flow chart in an embodiment of the present invention;
[0052] Figure 4 This is a schematic diagram of the GUI interface of the business system in an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0054] In view of the defects in the prior art, the present invention proposes a building materials supply chain data management system and method based on blockchain and IPFS, which can realize the intelligent supervision of the quality information of the entire process of the engineering materials supply chain, including: (1) information diversification; (2) real-time information sharing; (3) information cannot be tampered with; (4) information traceability and accountability; (5) information compliance inspection.
[0055] like Figure 1 As shown, this is an IPFS (InterPlanetary File System) data storage and query architecture diagram of an embodiment of the present invention. For a building materials supply chain data management system based on blockchain and IPFS proposed by the present invention, the levels involved in the operation of the system include structures such as smart contract modules, blockchain, file sharding modules, and data query and storage modules.
[0056] In this embodiment, the data query and storage module includes an IPFS node and a database.
[0057] Among them, IPFS nodes are carriers of data storage. In the present invention, information of all parties in the building materials supply chain is stored in IPFS nodes, and each party maintains one or more IPFS nodes as data storage nodes. As the core module of the present invention, IPFS nodes can play the role of data backup, data sharing, and data tamper-proofing.
[0058] Figure 1 The user end shown in this embodiment specifically refers to the upstream and downstream parties in the building materials supply chain. All parties can initiate data storage requests and query requests to the IPFS node, and can share relevant building materials supply chain data in real time. The specific contents include: calling smart contracts to query public keys, interacting with IPFS nodes, writing building materials supply chain files to IPFS nodes, receiving file hash values returned by IPFS nodes, and providing file hash values returned by IPFS nodes to the file sharding module to perform operations such as sharding the building materials supply chain files.
[0059] Smart contracts are middleware used to connect users, IPFS and blockchain in this system. Smart contracts record relevant business logic and compliance verification in the current field of building materials supply chain. When users query data through IPFS storage, they will also call smart contract code to write relevant data into the blockchain in the form of transactions.
[0060] In this embodiment, file sharding means that when users store relevant building material supply chain data in the blockchain, it is not completed in the traditional form of uploading the entire file, but the file is processed into slices. After each file is sliced, a key is randomly selected to encrypt the file slices, and the encrypted file slices are stored in the IPFS node or database to ensure data security, and then written into the blockchain. This corresponds to the data storage operation of the building material supply chain.
[0061] like Figure 2 As shown, it is a flowchart of IPFS data storage and query of a specific implementation case of the present invention, including the following steps:
[0062] Step 1: First, the user chooses to store or query data. During the data storage process, the data collected by the data collection layer is transmitted to the system through the IPFS data interface of this system, and the server running the IPFS node receives the data and waits for the next step to be executed; during the data query process, the user can log in to the system by himself to search for relevant data based on the file fingerprint.
[0063] Step 2-1: During the data storage phase, the system will perform compliance verification after receiving the multi-source heterogeneous data uploaded by the user. The verification rules are pre-coded in the system. If the verification passes, it will proceed to the next step. If the verification fails, the user will be asked to upload the data again.
[0064] Step 2-2: In the data query stage, the user enters the specified query conditions, calls the deployed chain code, and queries whether the relevant records exist. If so, proceed to the next step. If not, the query ends.
[0065] Step 3-1: In the data storage phase, the system reads the verified data, packages it, and generates relevant data fingerprints that meet the IPFS specification. Each piece of data is temporarily stored in the server, waiting to be uploaded to the IPFS node.
[0066] Step 3-2: In the data query phase, the system reads the data fingerprint obtained in step 3-1 in the chain code, and establishes a connection with the IPFS service node, waiting for reading and query operations.
[0067] Step 4-1: During the data storage phase, the system uploads the packaged data to the IPFS node. The IPFS node will broadcast this data. The node that receives this broadcast will save a redundant data locally on its node, also using the data fingerprint generated in 3-1 as the data index.
[0068] Step 4-2: In the data query phase, after the system reads the data fingerprint, it sends the fingerprint to the IPFS node for query, and the IPFS node returns the corresponding return value to the system.
[0069] Step 5-1: During the data storage phase, after the data is uploaded to IPFS, the system will call the chain code to write the data fingerprint and related business records into the blockchain.
[0070] Step 5-2: In the data query phase, relevant data files are downloaded according to the return value, and the relevant return results are fed back to the user.
[0071] The present invention proposes a method for managing building materials supply chain data based on blockchain and IPFS, which is implemented based on the above system. The participants include the general contractor, the supervision unit and the construction unit, and all parties work together in related functions. Figure 3 As shown, the data management method includes the following steps:
[0072] Step 1: After the construction is completed and the general contractor passes the self-inspection, the chain code is called to submit the relevant information to the blockchain through the steps of proposal endorsement, sorting and packaging, and verification and update, and the key information of the general contractor is added to the end of the relevant information.
[0073] Step 2-1: The supervisor reviews the relevant general contractor information and calls the relevant chain code to determine whether the information uploaded by the general contractor chain code is compliant. If compliant, give a review and pass opinion and make a record. Go to the next step. If not compliant, record the relevant non-compliant information.
[0074] Step 2-2: After providing the relevant audit information, the supervisory unit will write the audit information into the blockchain through the steps of proposal endorsement, sorting and packaging, and verification and update, and hand it over to the next unit for review.
[0075] Step 3-1: The construction unit calls the chain code for review. The review rules are pre-coded in the chain code. If the review passes, a passing opinion is given. If the review fails, a record is made and the next step is executed.
[0076] Step 3-2: The construction unit submits the review opinions and related review materials to the blockchain through proposal endorsement, sorting and packaging, and verification and update.
[0077] like Figure 4 As shown, it is a schematic diagram of the interface of a building materials supply chain data management system based on blockchain and IPFS constructed in this embodiment. The interface is designed with forms such as order, receipt, and pouring, which allow users to upload order information at different stages.
[0078] In summary, the present invention uses IPFS technology as a mechanism for storing multi-heterogeneous data, which meets the actual needs of transmitting non-structured data such as audio, video, and images on the chain, and can effectively prevent data from being tampered with and lost; combined with blockchain technology, all parties in the building materials supply chain run several blockchain nodes and IPFS nodes, and the data is stored locally on the node. No party can modify the data alone, which is highly secure. At the same time, the present invention sets that each completed business will be uploaded to the chain in real time and can be queried in real time. In a specific implementation, it can be supplemented by email notifications and QR code sharing, so that the information can be shared by all parties in real time.
[0079] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A data management method for building materials supply chain based on blockchain and IPFS, implemented based on a data management system, characterized in that: The data management system includes a user terminal, a smart contract module, a blockchain, a file sharding module, and a data query and storage module; The operations performed by the user end include: providing construction material supply chain files, interacting with IPFS nodes, interacting with the smart contract module, and interacting with the file sharding module; The smart contract is used to record relevant business logic and compliance verification in the field of building materials supply chain; The file slicing module is used to slice the input file and randomly select a key to encrypt the file slices to obtain encrypted file slices; The data query and storage module includes an IPFS node and a database for storing the encrypted file fragments; The blockchain is used to store the encrypted file fragments and transaction information of each link; The interaction between the user terminal and the smart contract module includes: The user side calls the smart contract module to query the public key; When a user queries data through the data query and storage module, the smart contract code will be called to write the relevant data into the blockchain in the form of a transaction; The IPFS node is used to provide data query and storage services. Using the IPFS node for data storage includes the following steps: S101, receiving data; S102: Perform compliance check on the received data. If the check passes, proceed to step S103; otherwise, require the user to re-upload the data. S103: Pack the data that has passed the compliance check and generate a data fingerprint; S104: Upload the packaged data to the IPFS node. The IPFS node broadcasts the data. The node that receives the broadcast saves a copy of the redundant data locally and uses the data fingerprint generated in S103 as the data index. S105. After the data is uploaded to the IPFS node, the system calls the chain code to write the data fingerprint and related business records into the blockchain; The participants of the data management method include the general contractor, the supervision unit and the construction unit, and the data management method includes the following steps: S301. After the construction is completed and the general contractor passes the self-inspection, the chain code is called to submit the relevant business information to the blockchain through the hyperledger, and the key information of the general contractor is added to the end of the relevant business information; S302: The supervisor reviews the relevant general contractor information and calls the relevant chain code to determine whether the information uploaded by the general contractor chain code is compliant. If compliant, a review approval opinion is given; otherwise, a return for repair opinion is given; S303. Submitting the supervisory unit's review opinion to the blockchain via the Hyperledger; S304. The construction unit calls the chain code for review. If the review is passed, a review pass opinion is given; otherwise, a rejection opinion is given; S305. Submit the construction unit's review opinion to the blockchain through the hyperledger.
2. A method for managing building materials supply chain data based on blockchain and IPFS according to claim 1, characterized in that: The interaction between the user terminal and the IPFS node includes: The user end provides the building material supply chain file and writes the building material supply chain file into the IPFS node; The client receives the file hash value returned by the IPFS node.
3. The method for building material supply chain data management based on blockchain and IPFS according to claim 1 is characterized in that: The interaction between the user terminal and the file sharding module includes: The user end provides the file hash value returned by the IPFS node to the file sharding module to shard the building material supply chain file.
4. The method for building material supply chain data management based on blockchain and IPFS according to claim 1 is characterized in that: The user end is used for operations by upstream and downstream parties in the building materials supply chain. The information of all parties in the building materials supply chain is stored in the IPFS node, and each party in the building materials supply chain maintains one or more IPFS nodes as data storage nodes.
5. The method for building material supply chain data management based on blockchain and IPFS according to claim 1 is characterized in that: In step S101, the data collection layer of the IPFS node collects data, transmits it to the system through the IPFS data interface, and the data is received by the server running the IPFS node.
6. The method for building material supply chain data management based on blockchain and IPFS according to claim 1 is characterized in that: The IPFS node is used to provide data query and storage services. Using the IPFS node to perform data query includes the following steps: S201, the user searches for relevant data based on the data fingerprint; S202: Based on the specified query conditions input by the user, the deployed chain code is called to check whether the relevant records exist. If so, step S203 is executed; otherwise, the query ends. S203: Read the data fingerprint generated in step S103 in the chain code, establish a connection with the IPFS service node, and wait for reading and query operations; S204: Send the data fingerprint to the IPFS node for query, and the IPFS node returns a corresponding return value; S205: Download relevant data files according to the return value, and feed back relevant return results to the user.
7. The method for building material supply chain data management based on blockchain and IPFS according to claim 1 is characterized in that: The hyperledger includes proposal endorsement, sorting and packaging, and verification and update operations.
