# Research on Monitoring and Early Warning of the Mine Backfill System Based on Blockchain Technology
## 3 Model Design
### Data Management Model
The main steps for administrators to query data are as follows:  
Step 10: The dispatcher initiates a data retrieval request to the trust center;  
Step 11: The trust center delivers the data access credentials to the dispatcher;  
Step 12: The dispatcher extracts the CID value of the data to be queried from the blockchain based on the access credentials;  
Step 13: Using the obtained CID value, the dispatcher obtains the encrypted corresponding data from the IPFS and decrypts the original data with the private key;  
The main steps of user query data are as follows;  
Step 14: The user initiates a data retrieval request to the trust center;  
Step 15: The trust center hands over the data access credentials to the user;  
Step 16: The user hands over the data access credentials to the dispatcher;  
Step 17: The dispatcher extracts the CID value of the data to be queried from the blockchain based on the access credentials;  
Step 18: The dispatcher obtains the encrypted corresponding data from the IPFS by virtue of the obtained CID value and decrypts it with the private key to obtain the original data;  
Step 19: The dispatcher sends the decrypted data to the user. At this stage, the IPFS is combined with the blockchain to store the monitoring data. The monitoring data generated by the overlimit warning model are stored in the IPFS, and the CID returned by IPFS is stored on the blockchain to reduce the blockchain volume while ensuring security in the data storage process. However, after the monitoring data are stored in the IPFS, they cannot be directly queried from Fabric. It is necessary for the query node to obtain the address hash value of the query information from the blockchain and then obtain the corresponding data from IPFS according to the hash value. The query process of the administrator node is shown in Figure 5a. The administrator node initiates a data retrieval request and calls the smart contract to verify whether the administrator node has authority for the query. If the administrator node has retrieval authority, the trust center issues a data access credential to the administrator. According to the credential, the CID that is needed to query the monitoring data is returned from the blockchain, the encrypted monitoring data are retrieved from the IPFS according to the CID value, and then the original monitoring data are obtained after decryption using the private key. If the administrator node does not have retrieval rights, verification does not occur, the trust center refuses to issue data access credentials, and the administrator cannot obtain the required hash value. Figure 4: Data management model architecture based on the blockchain. The user's query data needs to be sent as a data retrieval request to the trust center. After verifying its identity, the obtained data access credentials are sent to the administrator. The administrator obtains the original monitoring data based on the credentials and sends them to the user. The specific data retrieval process is shown in Figure 5b. The user node initiates a data query request and consults the smart contract to verify whether it has query authority. If the user node authentication is passed, a data access credential issued by the trust center is obtained, and the user sends the credential to the administrator. The administrator obtains the corresponding CID from the blockchain according to the credential and then requests the corresponding encrypted data from the IPFS according to the CID before using the private key to decrypt and send the original monitoring data to the user. If the user node authentication is not passed, the data query fails.