Blockchain-Based Safety Management System for the Grain Supply Chain

In recent years, various food-safety issues have aroused public concern regarding safety in the food supply chain. Since grains are closely linked to human life and health, it is necessary to effectively manage information in the grain supply chain. The grain supply chain is characterized by a long life cycle, complex links, various hazards, and heterogeneous information sources. Problems with traditional traceability systems include easy data tampering, difficult hazardous-material information management, the “information isolated island” problem, and low traceability efficiency in the whole supply chain. Blockchain is a distributed computing paradigm characterized by decentralization, network-wide recording, security, and reliability. As such, it can reduce administrative costs and improve the efficiency of information management. Based on literature research and a field investigation of wheat-processing enterprises in Shandong Province, We analyze the operation process of grain supply chain. This study, therefore, proposed a new system architecture in the entire grain supply chain based on blockchain technology and designed a multimode storage mechanism that combines chain storage. This prototype system was tested and verified using actual cases and application scenarios. Compared to traditional systems, the proposed system is characterized by data security and reliability, information interconnection and intercommunication, real-time sharing of hazardous-material information, and dynamic and credible whole-process tracing. As such, this system is highly significant and has reference value for guaranteeing food quality and safety-process traceability.


I. INTRODUCTION
Various food-safety problems and scandals have arisen in recent years, such as mad cow disease [1], mercury-laced rice, toxic milk powder, gutter oil [2], bacteria-infected spinach, the horse-meat scandal [3], and fipronil-contaminated eggs [4]. As a result, the public now pays more attention to food safety. Grain is a basic staple food that is considered important for human health and survival. Grains generally refer to cereals, potatoes, beans, and other crops, as well as processed and semifinished products. The grain supply chain is characterized by a long life cycle, complex links, various hazards, and heterogeneous information sources. Effective information management of the entire grain supply chain can The associate editor coordinating the review of this manuscript and approving it for publication was Quanqing Xu.
improve information disclosure and sharing, reduce hazards in the production process, and ensure food safety.
There are four main problems in the existing supply chain management system for grain. First, the supply chain has many participants, links across regions, and a long cycle. Different enterprises and organizations participate in each link of the supply chain, information sharing is poor, and there are data trust issues among the participants, especially among nonadjacent links in the chain. Thus, management is complex and requires more effective information management [5]- [7]. Second, the supply chain is a centralized system that is usually managed by leading enterprises in the grain supply chain. It is mainly supervised by various laws and regulations, policies, and norms at all levels and is also dependent on the professional ethics of the participants. However, at the computer-information level, there are problems of information loss and easy tampering [8], [9]. Third, there are many complex links in the grain supply chain. Information flow between each link is mainly in the form of data generated by business transactions between different links (e.g., transaction information and commodity information). Records of chemical pollution, insect and mold development, and quality deterioration in the supply chain are imperfect. At present, there is no full life-cycle tracking and monitoring system for such hazards affecting grain safety [10]- [12]. Fourth, in the whole supply chain for grain, most of the basic information is traced by static identification; however, the dynamic, real-time tracing of multidimensional heterogeneous information in the whole life cycle is far more important [13]- [15].
Blockchain technology was initially used in the field of digital currency to guarantee transactions [16]. Since then, blockchain has attracted interest in many industries and has been applied to finance [17], medicine [18], government management [19], and property management [20], among others. Recently, blockchain technology has been introduced in the field of food safety to trace food information [21], [22]. Blockchain is a distributed computing paradigm characterized by decentralization, network-wide recording, low cost, high efficiency, security, and reliability. As such, it can reduce administrative costs, reduce trading risks, improve information credibility, increase regulatory transparency, and implement trusted processes. Therefore, using blockchain in food supply chain information management can potentially eliminate information asymmetry, achieve the synchronous updating of information across all nodes, eliminate productquality problems caused by stakeholders [23], and strengthen information credibility. Given its decentralized nature and ability to prevent data tampering, blockchain can be viewed as a way to overcome the shortcomings of traditional systems.
This study aimed to build a grain supply chain information management solution based on blockchain technology. Its main contributions can be summarized as follows. First, to achieve information security management in the entire grain supply chain, we propose a new system architecture based on blockchain to realize the management and privacy protection of different roles. Second, to improve system storage capacity, we propose a multimode storage mechanism that combines chain storage and a distributed database with multilevel backup. Third, to manage business data and hazard information, improve data reliability, and reduce risk, we used a customized smart contract to control the reading and writing of data.
The rest of this paper is organized as follows. Section 2 reviews the literature on food supply chain management, as well as the use of blockchain, and introduces the main research problems. Section 3 analyzes the business process of the grain supply chain, discusses the system requirements, and designs the system architecture. Section 4 introduces the implementation of the system and the information flow, including the coding, data storage, and smart contract designs. In section 5, the prototype system is shown and analyzed. Finally, section 6 draws the research conclusions, discusses the study's limitations, and proposes directions for future work.

II. RELATED WORK
There are several traditional solutions for the information management of food and agricultural product supply chains. Governments and enterprises have aimed to build information supervision systems for agricultural product supply chains. By incorporating a traceability system for agricultural products into the legal system, a unified traceability identification code has been established. Pigini and Conti [24] proposed using NFC(Near Field Communication) technology to achieve effective traceability in the food supply chain; this would involve building a system based on NFC labels to collect information about products in each link of the supply chain to achieve tracking. Liu et al. [25] used EPC(Electronic Product Code) coding to construct a cattle-breeding tracking system based on RFID(Radio Frequency Identification), aiming to improve the information traceability of the beef supply chain.
In recent years, the combination of blockchain technology and supply chain information management has become a new trend. Tian [26], [27] proposed a supply chain traceability system for food safety based on HACCP(Hazard Analysis Critical Control Point), blockchain and Internet of things. He also discussed the advantages and disadvantages of RFID and blockchain. That study's proposed traceability system realized the automatic collection and storage of information to improve information transparency and enhance food safety. Caro et al. [28] also proposed a blockchain-based traceability solution using Internet of Things equipment for data collection. Tse et al. [29] proposed applying blockchain to food supply chain information security in China and compared it to the existing supply chain system. Lin et al. [30], moreover, proposed an ICT (Information and communication technology) agricultural model based on blockchain. Mao et al. [31] built a blockchain-based credit-evaluation system to provide more credible information for stakeholders engaged in foodsafety management and the food supply chain. Taking Shandong Province as an example, Mao et al. [32] considered a blockchain-based food supply chain system that eliminates information asymmetry and proposed an improved Byzantine fault-tolerance algorithm to improve operational efficiency. Galvez et al. [22] discussed the application of blockchain to the food supply chain and analyzed relevant cases of traceability in the current food supply chain. Taking soybeans as an example, Salah et al. [33] analyzed the traceability of the grain supply chain and proposed using a smart contract to ensure information safety, credibility, and reliability. Nestle, IBM(International Business Machines Corporation), and Walmart [34] jointly developed a pork supply chain management system based on the Hyperledger Fabric blockchain system. Xie et al. [35] proposed a double chain storage structure and designed a blockchain-based secure data-storage scheme to track agricultural products using the open-source Ethereum VOLUME 8, 2020 platform. Proposing a food-safety traceability system based on blockchain and EPC, Lin et al. [36] designed a dynamic management mechanism for data on and off the chain to solve the problem of data explosion and used Ethereum to test the prototype.
While the abovementioned studies discussed applying blockchain to agricultural supply chain management, few mentioned specific application methods and informationmanagement frameworks. Moreover, while most focused on blockchain's advantages for traceability, traceability is only one issue in the agricultural product supply chain. The present study, therefore, aimed to build a blockchain-based solution for the information security management of the entire grain supply chain. Given the traceability of blockchain itself, the traceability of supply chain information is guaranteed in our model.
To realize a comprehensive blockchain-driven supply chain information management system for grain, the following four technical problems need to be solved: • Data exchange: The grain supply chain is characterized by many nodes, a long supply chain, and wide coverage. Therefore, we need a method that is suitable for the actual situation of the grain supply chain to break the information-island problem between links and promote the connection of information.
• Information encoding: In the existing coding scheme, all links in the supply chain use the same code to identify and track products. However, this is not applicable to the grain supply chain. The production of raw materials in the grain supply chain is seasonal and discontinuous. During processing, grains may be mixed, and using one code is thus not effective. Therefore, a targeted twoway traceability coding scheme is needed to solve the information management problem in the grain supply chain.
• Business privacy issues: Each enterprise in the supply chain has some information that is sensitive and cannot be fully disclosed (e.g., transaction records and cost information). Therefore, it is necessary to classify information uploaded to blockchain, grade the information, distinguish its sensitivity, and ensure that information remains open while private information is not disclosed.
• Data storage: There is a large amount of data of various types in the grain supply chain. Blockchain information is stored in a chain structure composed of blocks, and the data content is stored in the body of the block. However, the size of a block is fixed, it is difficult to store a large amount of data, and data explosion easily occurs. Moreover, blocks are usually stored in the local database of each node in the blockchain network in the form of files; this is not convenient for storing pictures, documents, and other information. Therefore, it is necessary to design a new storage mode to improve the practical application of the system.

III. REQUIREMENT ANALYSIS AND SYSTEM ARCHITECTURE A. BUSINESS PROCESS OF SUPPLY CHAINS
The grain supply chain takes grain and its processed products as the main carrier. It includes grain planting and production, primary grain processing, grain product circulation, deep grain processing, and, finally, transport and distribution to consumers. With grain processing enterprises as its core nodes, the supply chain integrates growers, grainplanting enterprises, grain-distribution enterprises, logistics enterprises, and distributors. Combined with government, research institutions, and financial institutions, these form a network integrating logistics, business flow, information flow, and capital flow. With many enterprises participating in the supply chain, information between nodes is asymmetrical. Moreover, different standards and storage formats make it difficult to transmit information smoothly, and information demand is variable and time-dependent. Supply chain nodes are independent stakeholders who focus only on data and business processing in their respective fields. Given the lack of corresponding interface standards and specifications, there is no information sharing or business integration between them, thus forming ''information islands.'' This information-island problem affects not only enterprise information construction and information sharing in the whole supply chain but also information supervision and traceability.
Based on our analysis, we identified five typical links in the grain supply chain: the grain production link (G1), grain storage link (G2), grain processing link (G3), grain logistics and transportation link (G4), and grain marketing link (G5). G1 includes the planting, growing, and harvesting of grain crops. As is well known, grain crop cultivation has seasonal characteristics and, moreover, the purchase of grain crops has regional characteristics. G2 includes the multipoint and multilevel storage of grain and the storage of processed grain products at all levels. G3 involves the processing of raw grain materials, including primary and deep processing. G4 encompasses the entire grain supply chain, including the purchase of raw materials, storage, processing, and distribution to consumers; all of these require logistics and transportation. G5 includes sales of different grades of grain and its processed products among enterprises and distributors at all levels, including final sales to consumers.
The grain supply chain is a complex network where the five abovementioned links are nested with each other and develop step by step (see Figure 1). The information security management system thus needs to record information for all nodes in the database. The data mainly include the basic attributes of crops, crop quality information, environmental information about each link, the process and operation parameters of crop processing, and the management information of each link. To realize an information security management system, Internet of Things technology can be used to collect data for each link in the supply chain.

B. REQUIREMENT ANALYSIS
The service objects of grain supply chain information management are mainly divided into three categories.

1) GOVERNMENT AND REGULATORY AGENCIES
Macrocontrol of the operation of the whole supply chain and the maintenance and guarantee of grain safety are the main responsibilities of governments and regulatory agencies. Therefore, building a comprehensive information management system for the grain supply chain is conducive to improving the management level and processing efficiency of governments. Governments and regulatory agencies thus need to record all trading information in the grain supply chain through the information management system to facilitate the supervision of the entire grain supply chain and ensure grain safety.

2) ENTERPRISES IN THE SUPPLY CHAIN
For the enterprises that occupy the main body of the grain supply chain, collecting and sorting data in the grain supply chain will help them master market dynamics, analyze changes in supply and demand, and improve operational efficiency and profits. The main needs of grain supply chain enterprises are as follows: 1) data shared on the blockchain must have access rights to ensure that sensitive data are not leaked, and 2) the blockchain system should be easy to deploy and operate.

3) CONSUMERS
The supply chain information management system should provide consumers with supply chain information about the goods they buy to ensure the traceability of the information. According to consumer needs, the system should ensure that data cannot be tampered with to improve credibility. At the same time, consumers should control their data access rights to prevent the disclosure of sensitive information.
C. SYSTEM ARCHITECTURE The information management system architecture proposed in this study is divided into four layers: data collection, cloud service, blockchain network, and application ( Figure 2).

1) DATA ACQUISITION LAYER
The data collection layer is responsible for collecting business data and hazard information in the whole life cycle of the grain supply chain. Data acquisition is mainly completed by electronic tags, various sensors, code scanning guns, cameras, and data terminals, among other means.

2) CLOUD SERVICE LAYER
The cloud service layer includes the node database and the information database. The node database is the independent database of each node in the blockchain network, which is responsible for storing the data of the entire grain supply chain and the data of the blockchain network. The information database is responsible for storing some data the system does not need to reach consensus. The database architecture for grain supply chain information management was constructed by a cloud server. The advantages of a cloud database are its convenient deployment and perfect security mechanism, which can realize rapid database deployment, reduce operational costs, and improve resource utilization.

3) BLOCKCHAIN NETWORK LAYER
The blockchain network layer is the system architecture, which differs from traditional systems. It takes the enterprises, regulatory departments, and third-party research institutions in the grain supply chain as the nodes of the blockchain, builds the blockchain network, and deploys and implements the smart contract.

4) APPLICATION LAYER
The application layer consists of the business system and the application service system. The business system is developed based on the blockchain platform, which is mainly used to obtain and manage key information in the grain supply chain. The application service system is used to query and supervise the supply chain information of all roles in the supply chain.
The business system includes a coding module, blockchain interaction module, data processing module, and monitoring module.
• Coding module: This module mainly assigns codes to information that needs to be on the chain. By identifying VOLUME 8, 2020 the key information generated in each link of the grain supply chain, it creates corresponding codes for the uploaded data, which are convenient for data archiving and querying.
• Blockchain interaction module: This module supports data interaction and smart contract deployment. Data interaction includes building a suitable blockchain platform for querying key information in the supply chain. Smart contract deployment ensures data authenticity and expands the supply chain information management system by verifying contracts for all roles in the supply chain.
• Data processing module: This module mainly focuses on the various data interaction channels of data producers in the supply chain so that all participants can perform data synchronization, data chain functions, and data view functions, among others.
• Monitoring module: This module monitors the whole life cycle of the grain supply chain and the operation of the whole system. Tracing, risk assessment, prediction, and early warning are achieved by analyzing supply chain data stored in the database. The application service system includes a business interaction module and a privacy protection module.
• Business interaction module:This module supports information interaction with the business system through the interface and visually processes information in the grain supply chain. It is an interactive interface for users to manage information in the grain supply chain.
• Privacy protection module: This module mainly performs rights controls for system users, the encryption and decryption of private information, and the generation of keys.

A. CODING DESIGN
Grain and its processed products are mixed during storage and transportation. The coding method used in traditional supply chains cannot meet the unique needs of the grain supply chain. Therefore, this study followed the principle of ''one link, one coding'' when designing the coding system. When the ownership of products in the grain supply chain changes, the system generates a new product code according to the supply chain link of the current product to mark the current supply chain link and organization of the grain product. EPC is a new-generation coding system based on a uniform global identification system that can uniquely identify objects in the supply chain. By reading the EPC tag, the identified product information can be obtained. EPC has three coding methods: 64 bit, 96 bit, and 256 bit. We referred to the EPC-64 III coding scheme to design an information coding scheme for the grain supply chain (Figure 3). EPC-64 III encoding consists of four parts: version number, domain name management, object classification, and serial number. Domain name management consists of 26 bits, which is used to identify the type of supply chain node enterprise and enterprises where grain is located. We used each enterprise's 18 bit unified social credit code and 4 bit node-type identification code for the domain name management field in the code. Object classification has 13 digits in total. Seven bits are used to record grain categories, including raw materials, primary processing products, and deep processing products. Referring to the ''Grain Information Classification and Coding-Grain and Processed Products Classification and Code'' standard in China's grain industry, we established the appropriate coding information database. Six bits are reserved; the serial number is 23 bits. The first 12 bits are used to record the specific time of the current information, and the last 11 bits are used to record the order number of the current information. To ensure that the product data in each link are related to each other, we introduced the concepts of source code and destination code in the coding scheme. The source code represents the previous link of the current link, and the destination code indicates the product code of the current link. At the same time, the destination code acts as the source code of the next link.

B. STORAGE MECHANISM
The grain supply chain has problems with its large amounts and varied types of data while blockchain faces the problem of insufficient storage capacity. We designed a set of storage mechanisms suitable for the information management of the grain supply chain. As shown in Figure 4, the set consists of a blockchain network, node database, and information database.
The blockchain network is the basis of information management for the grain supply chain. Based on the blockchain principle, every link in the grain supply chain is considered a node in the blockchain network. Each node has the function of recording information. Each node calls up the smart contract deployed in the blockchain network through the business system. After consensus, the complete data are stored in the node database, and the hash-encrypted data are saved to the blockchain node in the ledger. The node database is an off-chain database for each blockchain node. The node database consists of a master database and a redundant database. The master database stores the complete data uploaded by each node enterprise to the system and the mapping relationship between the current data and the blocks in the blockchain ledger. The master database of each node stores only the supply chain data of the current node enterprise, including the enterprise's business information, environmental information, and hazardous-material information. To further ensure the safety and credibility of the data under the chain, we designed a redundant database to store a data backup in the master database of nonadjacent nodes. The data in the redundant database can only be written and cannot be modified. Mapping is formed with the master database of nonadjacent nodes to prevent data tampering. Equation 1 shows the backup rules for the redundant database: (1) VOLUME 8, 2020 where k indicates the node that needs to be backed up, n is the number of points in the supply chain, f F indicates the forward backup node, f B is the forward backup node, indicates rounding down, and mod indicates the remainder. When n = 5 and n = 6, the bidirectional redundant backup will be backed up to the same node; thus, unidirectional nonadjacent nodes are used for backup. Figure 4 shows the rules for redundant backup when n = 7. The data of the k node are backed up to the k − 2 and k + 3 nodes while the k node backs up the data from the k − 3 and k + 2 nodes.
The information database in the grain supply chain is mainly used to store public information that is needed when the system is running, such as enterprise type, product type, or evaluation standard.
The blockchain network and node database build a multimode storage mechanism for the grain supply chain, which provides robust data protection for information management. The blockchain ensures that the information is traceable and cannot be tampered with, and the node database solves the problem of blockchain's insufficient storage capacity. The redundant backup mechanism for nonadjacent nodes can reduce the information tampering caused by the interests of adjacent nodes and set database permissions to improve data credibility. At the same time, data are stored to the cloud database, which not only reduces local resource consumption but also realizes the rapid deployment of the database and the remote backup of deployment of the database and the remote backup of database information.

C. SMART CONTRACTS
The smart contract is a key part of the blockchain-driven information management system for the grain supply chain. The whole system needs to realize business logic through a smart contract. The smart contract is a kind of decentralized, self-checking, self-executing binding digital protocol. By setting some execution conditions that can be triggered automatically, it can provide information interaction, value transfer, and other functions for users in the blockchain network [37]. There are two kinds of smart contracts in this system. A custom smart contract is mainly defined according to relevant laws, regulations, and standards. When different conditions are met, different functions are triggered. For example, in the rice supply chain, smart contracts set detection indicators according to China's grain industry standards (e.g., aflatoxin B1≤10µg, Pb≤0.2mg/kg, Ge≤0.2mg/kg, Hg≤0.02mg/kg, moisture, impurity content) and deploy smart contracts to the blockchain network. As shown in Figure 5, when information is uploaded, the node will call up the relevant smart contract to process the uploaded data and compare the data with the indicators in the information database. If the indicators do not meet the preset conditions, the system will execute the preset response rules, upload the data, and report adverse events to the supervisor and the enterprise. If the quality indicators meet the preset conditions, the system will classify and upload them based on the evaluation indicators in the data. This method can monitor supply chain information in real-time. This can help enterprises and regulatory authorities to promptly investigate and deal with potential safety hazards to avoid quality and safety incidents. The other type of smart contract is an expanded one. Smart contracts are expanded mainly to meet the different requirements of different companies in terms of private information and grain quality standards. By changing the smart contract code to meet different needs, the specific needs of enterprises in the grain supply chain are addressed.
Based on the blockchain operating mode, the information management mechanism of the grain supply chain is realized through a smart contract. As mentioned above, production companies create smart contracts and then use them to collect information. Algorithm 1 describes the data-upload process for products produced by grain production enterprises. Data input is realized through the application platform. After unified formatting, the data (production) collection contract is called up. The contract then calls up the relevant subcontracts to obtain the current enterprise information and rawmaterial source information based on the input information and production index information. If the parameters of the raw materials meet the requirements of the production index, Package and upload data Return information ''Data Abort'' and complete outlier data end end else Create destination code Return message ''raw material exception'' and complete outlier data end the contract will create a destination code corresponding to the currently uploaded data and then check whether the uploaded data meet the requirements of the production process. If they meet the requirements, the contract will classify the information and upload it in a package. Finally, it will return an ''upload successful'' message, and the contract call ends. If the requirements are not met, there is a ''data exception warning,'' and abnormal data are returned. If the raw materials do not meet the production index requirements, there is a ''raw materials abnormal'' notification, abnormal data are returned, and the contract ends.
Algorithm 2 shows that each node queries the grain supply chain data through the platform. The logic of the algorithm is applicable to all information query services in the supply chain. Different nodes enter the query information and information types through the platform and call up the data query contract. After the contract receives the data, the contract will call the subordinate's information query module to perform information retrieval according to information type. First, the contract will determine the current user's permissions. If permission verification is successful, the contract will call up the corresponding query module to query information according to the query type. If the target information meets the requirements, the query system will add the number of queries to create a query table corresponding to the current information. It will record the querying user and query time and finally return the query notification and detailed information. The displayed information is determined according to the current user's permissions. If there is no corresponding query Return notification message ''User permission verification failed'' end target, the notification message ''query failed, no record'' is returned. If the authorization verification is unsuccessful, the message ''user authorization verification failed'' is returned.

D. INFORMATION FLOW DESCRIPTION
We instantiated a blockchain network based on the Hyperledger Fabric platform and used a website as a platform for information interaction to manage information in the grain supply chain. Enterprises in all links of the grain supply chain will register on the website. Through the website, we provide certified and controlled Web-based APIs and application programming interfaces to access the blockchain. All companies in the supply chain will be required to use the website to manage supply chain information. Figure 6 shows the transaction process.
All enterprises in the grain supply chain must register with the system in advance. Enterprise nodes are added to the blockchain network through the blockchain platform, and each node has a unique private key. When a supply chain user uploads data, the node will log in to the system with the registered account and verify the user's rights through the blockchain platform. After the node passes verification, the user can upload data. The information is processed in a unified format by the data processing module. At the same time, the coding module generates a unique code for the uploaded data based on information stored in the database. Then, the smart contract is deployed in the blockchain network according to the uploaded data. The smart contract verifies whether the data meet the requirements. Verified data are uploaded to the blockchain network and saved in the blockchain ledger. The uploaded data (e.g., pictures, files, audio, video) will be saved in the corresponding node database of each node. The mapping relationships among blocks are the same in the database under the node chain. If there is a problem with smart contract verification, the block will also be generated. However, a warning will be returned, and the monitoring system will report the adverse events to facilitate real-time processing by relevant enterprises and regulatory authorities.
The smart contracts are key to dealing with business requirements. Most of the business logic in the system must be implemented by calling up smart contracts to obtain results. This system is based on the Hyperledger Fabric platform. Figure 7 shows the smart contract calling logic. In the creation phase of smart contracts, with the start method, the contract container sends a ChaincodeMessage_ REGIS-TER message to the peer node for registration and then waits to receive the message from the peer node. After receiving the ChaincodeMessage_REGISTER message, the peer node will register locally, return a ChaincodeMessage_ REGISTERED message to the smart contract container, and update the status to the established state.
Then, the peer node will send a ChaincodeMessage_ READY message to the smart contract container and update the status to the ready state. After receiving the ChaincodeMessage_REGISTERED message, the container completes the contract registration step, updates the status to the established state, and updates the status to the ready state after receiving the ChaincodeMessage_READY message. Then, the peer node will send a ChaincodeMessage_INIT message to the contract container to initialize the contract. After receiving the ChaincodeMessage_INIT message, the contract container calls up the init method to complete the initialization of the contract. Upon success, it returns a Chain-codeMessage_COMPLETED message and thus completes the deployment work before the contract is called up. When the grain supply chain platform needs to call up a smart contract, the client sends a call request to the corresponding peer node. After the peer node receives the request, it will simulate the execution of the request, sign it, and then call up the smart contract deployed in the contract container to write or query the blockchain using invoke, query, addproduct, and other methods in the contract. Subsequently, the smart contract will return the corresponding requested information to the peer node, and the peer node will then return the information to the client.

V. RESULTS AND ANALYSIS
Wheat always plays a critical role in food security and agricultural modernization of China. In Shandong, one of China's 13 major grain-producing provinces, its arable land area and total grain output rank the third in the whole nation, and its total output value of grain and oil processing always stands at No.1. Therefore, based on a field investigation of wheatprocessing enterprises in Shandong Province, an information management system was constructed for the wheat flour supply chain to test the model. The system of browser/ server structure has been used and the distributed deployment has been achieved on the Hyperledger Fabric platform with the cloud database of MySQL. The system development languages include Go, JavaScript, Html and Css, and data are handled and sent in Json format based on the Nodejs and Bootstrap framework development. Based on Hyperledger Fabric, the prototype system used a VMware virtual machine to deploy the blockchain network. G1, G2, G3, G4, and G5 were taken as five typical links in the grain supply chain, and third-party regulatory agencies were taken as organizations to build the blockchain network. The whole system used a browser/server (B/S) structure through a web portal as the human-computer interface. The web portal sends the request to call up the system's API to realize business logic. Figure 8 shows the monitoring interface. Users can view the running blocks of the whole blockchain network, including block information, the number of chain codes, and the number of nodes. The user can upload supply chain data through the information collection function. The system will automatically call up the smart contract to process the data, check whether the data meet the conditions, and provide a unique code. Then, the data will be saved in the blockchain network to ensure that the data can be traced and cannot be tampered with. Information on different links will be uploaded to the system and saved in the same blockchain. When there is a problem with the product, the regulatory department and the enterprise can quickly track the product's information through the blockchain network and the coding of each link, find the source of the problem, and judge whether the product is authentic and the data have been tampered with. Figure 8(a) shows the latest generated block information. As shown in Figure 8(b), the user clicks on the transaction details to view the details in the block. Through the details, we can see the business data saved in the blockchain network. Table 1 shows the advantages of this system over traditional food supply chain systems. The proposed information management system gives full play to blockchain's advantages, avoids the problem of relying on core enterprises to collect information, makes information interaction among all links more open and transparent, and improves information supervision. Since blockchain information cannot be tampered with, stakeholders' impact on information authenticity is eliminated, and the phenomenon of artificial tampering is prevented. Moreover, the ''trust problem'' between different links in the traditional food supply chain is solved by using blockchain's consensus mechanism. All nodes in the supply chain are in the same network, and each has complete information about the supply chain, which effectively prevents tampering and information loss. Through blockchain, all links in the grain supply chain are managed in the same system, which ensures unified data formatting, supports quick interaction among data in the supply chain, and avoids the ''information island'' phenomenon. This method supports collaboration and verification among stakeholders in the grain supply chain, effectively integrates resources, and maximizes benefits.
For the grain industry and supply chain, this study explores the practical application of the blockchain technology in grain supply chain information management, which can effectively promote the openness and transparency of information in the grain industry, the unified national retrospective earlywarning system, and further improve the regulatory emergency technical system. For academic research, the study on the grain supply chain information management driven by the blockchain can provide a complete and authentic information source, which will also facilitate the further study on the change rule of hazards in the grain supply chain and promote the prevention and control technology of the grain supply chain.

VI. CONCLUSION
This study established an information security management system for the entire grain supply chain based on blockchain. By refining supply chain links, the system requirements were analyzed, and a system design architecture was provided. A multimode storage mechanism was designed to improve blockchain storage efficiency. To achieve business data interaction in the industrial chain as well as hazard information supervision in the whole supply chain, customized smart contracts were designed, and a prototype system was instantiated based on Hyperledger Fabric. A specific application case was used to test the proposed system. The proposed system can achieve the sharing and exchange of information in the entire grain supply chain, ensure the safety and reliability of information storage and transmission, and prevent ''information islands'' and tampering. It can also provide reliable industrial chain information sources for participants, consumers, and third-party supervision departments, as well as hazard-related assessment, prediction, and early warning.
At present, there are still some deficiencies in supply chain information management-namely, the problem of trusted collection. How to ensure the credibility of information sources is a direction for further research. Future work can combine Internet of Things technology and blockchain to achieve credible data collection.