# Blockchain-Based Secure Traceable Scheme for Food Supply Chain

Authors: S. Thangamayan; Kalyani Pradhan; Ganesh Babu Loganathan; S. Sitender; S. Sivamani; Mulugeta Tesema
Journal: Journal of Food Quality
 (2023)

---

## Abstract

The typical food traceability system’s data layer is made up of relational databases managed by core businesses, which cannot ensure data security. It is inefficient and requires a lot of upkeep. The food supply chain has numerous actors, making it difficult for consumers to safeguard their rights when purchasing food with quality issues. Due to the numerous organizations involved in the food supply chain, food safety monitoring and traceability have become challenging. The supply chain’s major organizations have control and administrative authority over the data under the current food traceability system, which is overly centralized for traceability information. The safety and dependability of food may be ensured by using the food traceability system to track food information. We can witness a series of detailed insights into food from the manufacturing source to the consumption terminal. A blockchain-based food tracking system is created as a solution to these issues. On the Ethereum platform, the system was created. It was also employed in the blockchain system, in addition to its features of decentralization, tamper-proof, and traceability. To implement the data update service and the food recall function, introduce the Food and Drug Administration node. Consumers have the option to not only enquire about food traceability throughout the manufacturing process but also to file complaints regarding the traceability system’s rights protection.


---

## Body

## 1. Introduction

In recent years, food safety incidents have occurred frequently, posing a severe threat to people’s health and gradually reducing people’s trust in the domestic food industry [1]. However, with the rapid development of society, people only want to make money quickly. To make more profits, many food companies completely ignore the health and safety of consumers. However, it fools consumers into buying under the guise of high-quality, nutritious, and healthy food, completely disregarding the word integrity. The quality of food is not just a concern of consumers. Food manufacturers also want to know the circulation process of food and related information. Using the food traceability system to trace food information, we can see a series of detailed knowledge of food from the production source to the consumption terminal [2, 3], thus ensuring the safety and reliability of food. Additionally, food producers are interested in learning about the movement of food and related details. The selection of food traceability items should take into account both their high economic worth and the critical interests and needs of the people who will use them. People place the highest value on food, and this priority has always been shared by customers. Once food quality and safety issues have been identified, traceability can be utilized to quickly identify the link where the issue originated and the specific accountable party and prompt the recall of contaminated food.Despite the fact that the national food safety supervision department attaches great importance to the prevention and treatment of food quality and safety, food safety supervision and traceability have become difficult due to many participants in the food supply chain [4, 5]. On the one hand, new technologies and new supervision methods are integrated to restore consumers’ confidence in the food industry and meet consumers’ needs for tracking and mastering food information throughout the process, on the other hand, new technologies and new supervision methods are integrated to improve the supervision strength and supervision efficiency of relevant regulatory authorities. It is imperative to apply it to food traceability so that food information can be traced throughout the process. Once food quality and safety problems are found, traceability can be used to quickly locate the link where the problem occurred and the specific responsible person and recall food with quality problems in time. This is also an effective method to ensure food safety [6–8]. Unfortunately, my country started relatively late in the field of food traceability. The existing food traceability system is too centralized for traceability information, and the core enterprises in the supply chain have the control and management authority of the data, which leads to uncertainty in the security and reliability of the data. In addition, there is information asymmetry between the central bodies of the supply chain, which makes it impossible to verify whether the data has been maliciously tampered with during the circulation process, which significantly increases the difficulty of food safety supervision by the regulatory authorities. New technology and new ways of supervision are being incorporated to strengthen and increase the effectiveness of the relevant regulatory authorities’ oversight. It must be used for food traceability in order for food data to be tracked throughout the process. The system lacks the requisite consumer complaint mechanism and the regulatory authorities’ implemented procedure for food safety recalls. As a result, it will not be able to stop a problematic product from entering the market at the appropriate moment once it poses a health risk. It is impossible to determine whether the data has been deliberately altered during the circulation process because of the information asymmetry between the main supply chain actors.As one of the most popular research directions in the current research field, blockchain technology is a distributed ledger technology [9, 10], which has the characteristics of high efficiency, low cost, safety, and reliability and can be trusted in the traceability system. Scalability is one of the blockchain’s noteworthy drawbacks, even though it is not unbreakable. Blockchain has the potential to be both incredibly inefficient and difficult. One of the most significant drawbacks of the blockchain has always been the originality of the data. It is obvious that various systems, such as the supply chain, financial systems, and others, profit from it. Scalability is one of the blockchain’s notable flaws, even though it is not indissoluble. The blockchain is not unbreakable. Scalability is still a problem for blockchain. Items on a blockchain are not permanent or unchangeable.It has also been proven to have inherent technical advantages in terms of degrees [11, 12]. The data is distributed and stored on the blockchain. To maliciously tamper with the data, more than 51% of the blockchain system’s nodes must be breached simultaneously, which is impractical for a blockchain system with a large number of nodes. Therefore, ensure that the data cannot be tampered with and is safe and reliable. Blockchain technology enables customers to protect their personal details while enabling agencies to create and trade economic value at lower operational sizes. AI systems work to focus control in the hands of the few companies that can collect and process huge volumes of data. Machine learning can use this data to identify patterns and make specific estimates, while blockchain helps to preserve accurate data that is unmodified and everlasting. While data science focuses on using data for effective management, blockchain’s distributed ledger provides data protection. These technologies have a wealth of unrealized potential that can boost effectiveness and productivity.The blockchain-based food traceability system proposed in this paper takes pork as the traceability object, chooses Ethereum as the development platform, and adds farms, slaughterhouses, logistics companies, and sales units as nodes to the blockchain network. The important supply chain enterprise is implemented using Ethereum smart contracts, and the crucial data of supply chain production and distribution is recorded on the blockchain to guarantee that the information cannot be manipulated with. Blockchain-based traceability has the ability to spot false or fake activities while simultaneously facilitating the tracking and tracing of the origin of products and supply chain processes. Analyzed the whole process of the pork supply chain and designed functional modules to meet the nodes of each link. After selecting the software architecture, the system is deployed and tested with the relevant development tools. Consumers can use the traceability code on the food packaging to make traceability queries on this system.


## 2. Research Status of Food Traceability

The idea of food traceability originated in Europe. The outbreak of mad cow disease in the UK in 1996 caused people to panic. In addition, the salmonella contamination of pork in Denmark and theEscherichia coli incident in Scotland also prompted the EU to establish a food safety traceability system at the legal level.Foreign research on blockchain technology’s application to food traceability has been carried out earlier. A node, which is a person or machine that has a full copy of the blockchain ledger, a block, which is a data model used to store a series of transactions, and a payment, which is the smallest number of a blockchain systems, make up the blockchain design (records, information, and so on). Whether they are invoked by customers or other blockchain-based, agreements must be processed consecutively in existing blockchain systems without parallel computation. Literature [13] explained how to use and apply blockchain to transport goods more accurately and transparently through the global supply chain through a practical case of applying blockchain to the whole process of egg production and distribution by a company in the Midwest of the United States. Literature [14] proposed a blockchain-based solution that utilizes smart contracts to monitor and manage all communications and transactions of stakeholders in the supply chain network for food safety. Reference [15] proposes a traceable restaurant prototype based on blockchain and product identifiers to achieve more reliable food traceability. Literature [16] successfully designed and developed a traceability system for Thai agricultural products using blockchain technology and IoT technology, making supply chain management more reliable and enhancing public awareness of food safety and quality control. Literature [17] studied the impact of blockchain technology in agriculture and food supply chains. They pointed out that it is a promising technology for establishing an open and transparent food supply chain. Still, many obstacles and challenges remain in terms of technology, education, policy, and regulation. Literature [18] proposed a food traceability system based on blockchain and IoT, applying new technologies such as blockchain, IoT technology, and fuzzy logic to the traceability food shelf-life management system to establish food supply chain decision support. The entire accessibility of food goods across the supply chain will become possible with the combination of IoT with blockchain. Real-time surveillance and detection of genuine food products from the source, which helps uncover significant bottlenecks, are the main benefits of blockchain and IoT in the food supply chain. IoT (Internet of Things) technology is used in smart agriculture for monitoring and management. Implementing IoT in the field has improved farmers’ production and efficiency in order to maximise agriculture [19, 20].In recent years, domestic blockchain technology has become very popular, and many enterprises, universities, and start-up companies have also begun to invest in blockchain technology. Literature [21] proposed a blockchain-based pharmaceutical traceability system, which realized the functions of drug anticounterfeiting and traceability information query. Literature [22] applied blockchain technology to build a trusted traceability model for the entire grain, oil, and food supply chain, ensuring the safety and providing reliability of stored data and accurate and credible traceability information. Literature [23] constructed a quality information database of the rice industry chain through blockchain technology and designed an intelligent management system using the food risk assessment and safety traceability technology of hazard factors to achieve efficient management and control of food quality and safety. Literature [24] proposed a double-chain structure of transaction blockchain (TBC) and regulatory blockchain (RBC), proving that the double-chain design is efficient and scalable.


## 3. Selection of Traceability Objects

The choice of food traceability objects should not only consider people’s vital interests and strong needs but also whether they have high economic value. Food is the most important thing for people, and food has always been consumers’ focus. Therefore, food safety traceability is the most important thing to protect the rights and interests of consumers. Food can be generally divided into agricultural food, dairy products, and meat. In the field of dairy products, food is contracted by a single enterprise from the production source to the sales terminal. Therefore, if the data is to be tampered with, it must be operated by the internal personnel of the enterprise. Consequently, increasing the punishment through legislation is more effective in dealing with this situation.On the other hand, meat is the most common food in people’s daily life. In recent years, food safety incidents such as clenbuterol, water-injected pork, and dead pork have seriously threatened people’s health, and meat is almost a necessary food for people every day. So people pay great attention to the meat. In addition, moving meat from breeding production to sales terminals requires the participation of farms, slaughtering and processing companies, logistics companies, and sales companies, which gives the person in charge of each link the right to modify the data. Compared with meat, except for a few high-end products with high economic value, most of the rest are of low weight, and it is not suitable for traceability in terms of cost and benefits.To sum up, compared with dairy products and agricultural reclamation, consumers have a more robust demand for meat. A series of processes from the production source of the product to the sales terminal are also more critical in the food supply chain. Representative. In addition, the traceability of meat has higher economic value and practical significance. Therefore, this paper selects pork, the most common, moderately priced, popular, and frequently consumed meat in the market, as the traceability object of the traceability system.


## 4. Process Analysis of Pork Supply Chain

### 4.1. Breeding Link

Farms need to record the whole process of breeding information during the breeding process of newborn piglets. The breeding information record is shown in Figure1.Figure 1
Flowchart of breeding information record.


### 4.2. Slaughtering and Processing Links

The slaughtering and processing link is in the middle of the pork supply chain. The specific process is: preslaughter quarantine-shower-stunning-stabbing and bloodletting-scalding and shaving-mechanical peeling-carcass processing-synchronous health inspection-by-product processing-white strip acid removal-segmentation package. Its preslaughter quarantine and postslaughter simultaneous health inspection provide the necessary guarantee for the quality and safety of pork. The information that needs to be traced in the slaughtering and processing process includes preslaughter quarantine information, postslaughter synchronous health inspection information, white strip acid discharge information, packaging-related information, and storage information. Achieving traceability and transparency in the slaughtering and processing of pigs can greatly enhance consumers’ trust in pork safety and promote pork sales. After analyzing the slaughtering and processing of live pigs, the slaughtering process and information recording links.


### 4.3. Logistics and Transportation Links

Cold chain logistics is an indispensable and essential part of the pork supply chain. Transporting pork in a low-temperature environment can significantly ensure its freshness of pork. Therefore, when transporting pork products, logistics transporters need to record the delivery status of the pork, including delivery time, product processing batches, and packaging methods; record cold chain transportation information, including transportation time, vehicle interior temperature and humidity, vehicle information, and operator information; when arriving at the transportation destination, it is necessary to record the relevant arrival information, including destination information, transportation batch, acceptance information, recipient information, and operator information. Meat has a limited shelf life, making it a hazardous item with a condensed selling window. In order to ensure the quality and safety of meat and meat products, cold chain monitoring in the supply chain is crucial. Raw meat and meat products should be stored at temperatures that do not pose a risk to human health since they are likely to encourage the development of pathogenic microorganisms and/or spoiling bacteria. Along the supply chain for beef, there should not ever be a break in the cold chain. The intricacy of the world’s beef supply chain, which frequently involves lengthy transportation routes for moving the product through one country to another.


## 4.1. Breeding Link

Farms need to record the whole process of breeding information during the breeding process of newborn piglets. The breeding information record is shown in Figure1.Figure 1
Flowchart of breeding information record.


## 4.2. Slaughtering and Processing Links

The slaughtering and processing link is in the middle of the pork supply chain. The specific process is: preslaughter quarantine-shower-stunning-stabbing and bloodletting-scalding and shaving-mechanical peeling-carcass processing-synchronous health inspection-by-product processing-white strip acid removal-segmentation package. Its preslaughter quarantine and postslaughter simultaneous health inspection provide the necessary guarantee for the quality and safety of pork. The information that needs to be traced in the slaughtering and processing process includes preslaughter quarantine information, postslaughter synchronous health inspection information, white strip acid discharge information, packaging-related information, and storage information. Achieving traceability and transparency in the slaughtering and processing of pigs can greatly enhance consumers’ trust in pork safety and promote pork sales. After analyzing the slaughtering and processing of live pigs, the slaughtering process and information recording links.


## 4.3. Logistics and Transportation Links

Cold chain logistics is an indispensable and essential part of the pork supply chain. Transporting pork in a low-temperature environment can significantly ensure its freshness of pork. Therefore, when transporting pork products, logistics transporters need to record the delivery status of the pork, including delivery time, product processing batches, and packaging methods; record cold chain transportation information, including transportation time, vehicle interior temperature and humidity, vehicle information, and operator information; when arriving at the transportation destination, it is necessary to record the relevant arrival information, including destination information, transportation batch, acceptance information, recipient information, and operator information. Meat has a limited shelf life, making it a hazardous item with a condensed selling window. In order to ensure the quality and safety of meat and meat products, cold chain monitoring in the supply chain is crucial. Raw meat and meat products should be stored at temperatures that do not pose a risk to human health since they are likely to encourage the development of pathogenic microorganisms and/or spoiling bacteria. Along the supply chain for beef, there should not ever be a break in the cold chain. The intricacy of the world’s beef supply chain, which frequently involves lengthy transportation routes for moving the product through one country to another.


## 5. Design of Pork Traceability Scheme Based on Blockchain

### 5.1. Storage Mechanism Design

The data gathering volume at each link node in the blockchain-based pork supply chain is substantial. This is due to the fact that there are numerous nodes participating in the chain. If all of them are uploaded to the blockchain network at the same time, the upload speed will be quite sluggish, and this would result in a huge rise in the amount that it costs to run the network. In addition to this, the hardware requirements for link nodes will become more stringent. As a result, for the purposes of this article, we shall use the dual-storage technique. Figure2 presents its dual-storage concept. It suggests that pork products flow into an open market system to a great extent. The benchmark of the pork supply chain offers a case study that might guide future growth. It has been generally assumed that the changes in the supply chain for pork are mostly the result of selective customers.Figure 2
Data storage model of pork supply chain.


### 5.2. Design of Pork Traceability Scheme

The structural diagram of the pork traceability system is built after the procedure described above, which includes a study of the pork supply chain and the construction of a storage mechanism for the chain. The data that is kept in the traceability scheme is held in common storage by both the blockchain system and the database. Therefore, implementing a relational database into the blockchain system is a potential solution to the scalability issue that has been raised. In the system of blockchain, just the information summary of the data and its entire data are maintained, but not the data itself. The information is kept in the database for future reference. The database that is used by Industry and Commerce is frequently maintained by the Administration. Each connection node in the blockchain-based supply chain for pork has a sizable data collection volume. This is as a result of the chain’s extensive participation from nodes if they are all simultaneously uploaded to the blockchain network. Only the information summary of the data and its entirety are kept in the blockchain system; the actual data is not kept. The data is saved in the database for future use. To fulfil the goal of traceability, it is required to develop the traceability code for pork products while creating a pork traceability system based on blockchain.After consumers buy food, they can use the code on the package to make traceability queries in the database. If they are sceptical about the information inquired, they can obtain the information summary in the blockchain and the query information in the database similarly.


### 5.3. Proof of Metadata Generation Efficiency Test

Figure3 shows how metadata generation works. Because there are so many different storage formats for geospatial information, metadata collection is the first and most crucial step in the production chain when it comes to creating metadata. Organizations like the EU’s INSPIRE have acknowledged the value of metadata. Remember that there is one version of every bit, Nmax is set to 27, and the suggested structure with multibranch nodes progressively forms data domain-based constructs with block sizes of one megabyte, four megabytes, and eight megabytes.Figure 3
1–10 GB metadata generation test.Table1 shows the size of the block in MB. The Litecoin protocol shares the 1 MB block size restriction of the Bitcoin system. However, Litecoin has four times more transactions per second than Bitcoin since its mean block time is 4 times shorter. The block size of Bitcoin Cash is by far the largest of the networks we listed, as you can see in the table above. Ethereum, in comparison, belongs to a whole different section. There, the so-called gas limit rather than a block size limit determines the biggest portion of a block.Table 1
Test data for metadata within 1 GB.
Meta data (MB)Size of block in MB1 MB4 MB8 MB1100.30.40.52100.60.490.663100.70.550.724100.750.660.845100.820.720.956100.880.881.027100.980.911.068101.010.961.089101.051.081.09Metadata production on 1,000 to 10,000 unstructured pieces of data was put to the test in the case presented in Figure4. Approximately one megabyte of unstructured data is included; three copies of the data are present; twenty-seven parameters make up the multibranch proposed structure; and the construction data block is a small field-based proposed file structure. We can see from the graph that the rate at which metadata is generated is directly connected to the quantity of data being processed, which is around 870 items per second.Figure 4
Generating test for attestation metadata within 1 GB.Table2 and Figure 5 illustrate an example of how metadata may be created from data ranging in size from one gigabit up to ten gigabytes. In this test, we generate proposed structures with data block sizes of 16 MB, 24 MB, and 32 MB, and we set the number of data copies to 3. We also increase the value of the parameter Nmax in the multibranch proposed structure to 27 on data that is less than one gigabit in size.Table 2
1–10 GB metadata generation test.
Metadata (GB)Size of block in MB16 MB24 MB32 MB1457281011310141441116175121818614192071620218182224919232610222628Figure 5
Unstructured metadata generation test.Figure6 demonstrates the data proof-verification test. According to laboratory studies, the majority of first-generation 10 G Ethernet switches do not even come close to providing 10 gigabits of speed. However, compared to older equipment that relied on small networks, the most recent backbone switches do offer greater bandwidth and perform better in terms of quality-of-service regulation.Figure 6
1∼10 GB data proof-verification test.


## 5.1. Storage Mechanism Design

The data gathering volume at each link node in the blockchain-based pork supply chain is substantial. This is due to the fact that there are numerous nodes participating in the chain. If all of them are uploaded to the blockchain network at the same time, the upload speed will be quite sluggish, and this would result in a huge rise in the amount that it costs to run the network. In addition to this, the hardware requirements for link nodes will become more stringent. As a result, for the purposes of this article, we shall use the dual-storage technique. Figure2 presents its dual-storage concept. It suggests that pork products flow into an open market system to a great extent. The benchmark of the pork supply chain offers a case study that might guide future growth. It has been generally assumed that the changes in the supply chain for pork are mostly the result of selective customers.Figure 2
Data storage model of pork supply chain.


## 5.2. Design of Pork Traceability Scheme

The structural diagram of the pork traceability system is built after the procedure described above, which includes a study of the pork supply chain and the construction of a storage mechanism for the chain. The data that is kept in the traceability scheme is held in common storage by both the blockchain system and the database. Therefore, implementing a relational database into the blockchain system is a potential solution to the scalability issue that has been raised. In the system of blockchain, just the information summary of the data and its entire data are maintained, but not the data itself. The information is kept in the database for future reference. The database that is used by Industry and Commerce is frequently maintained by the Administration. Each connection node in the blockchain-based supply chain for pork has a sizable data collection volume. This is as a result of the chain’s extensive participation from nodes if they are all simultaneously uploaded to the blockchain network. Only the information summary of the data and its entirety are kept in the blockchain system; the actual data is not kept. The data is saved in the database for future use. To fulfil the goal of traceability, it is required to develop the traceability code for pork products while creating a pork traceability system based on blockchain.After consumers buy food, they can use the code on the package to make traceability queries in the database. If they are sceptical about the information inquired, they can obtain the information summary in the blockchain and the query information in the database similarly.


## 5.3. Proof of Metadata Generation Efficiency Test

Figure3 shows how metadata generation works. Because there are so many different storage formats for geospatial information, metadata collection is the first and most crucial step in the production chain when it comes to creating metadata. Organizations like the EU’s INSPIRE have acknowledged the value of metadata. Remember that there is one version of every bit, Nmax is set to 27, and the suggested structure with multibranch nodes progressively forms data domain-based constructs with block sizes of one megabyte, four megabytes, and eight megabytes.Figure 3
1–10 GB metadata generation test.Table1 shows the size of the block in MB. The Litecoin protocol shares the 1 MB block size restriction of the Bitcoin system. However, Litecoin has four times more transactions per second than Bitcoin since its mean block time is 4 times shorter. The block size of Bitcoin Cash is by far the largest of the networks we listed, as you can see in the table above. Ethereum, in comparison, belongs to a whole different section. There, the so-called gas limit rather than a block size limit determines the biggest portion of a block.Table 1
Test data for metadata within 1 GB.
Meta data (MB)Size of block in MB1 MB4 MB8 MB1100.30.40.52100.60.490.663100.70.550.724100.750.660.845100.820.720.956100.880.881.027100.980.911.068101.010.961.089101.051.081.09Metadata production on 1,000 to 10,000 unstructured pieces of data was put to the test in the case presented in Figure4. Approximately one megabyte of unstructured data is included; three copies of the data are present; twenty-seven parameters make up the multibranch proposed structure; and the construction data block is a small field-based proposed file structure. We can see from the graph that the rate at which metadata is generated is directly connected to the quantity of data being processed, which is around 870 items per second.Figure 4
Generating test for attestation metadata within 1 GB.Table2 and Figure 5 illustrate an example of how metadata may be created from data ranging in size from one gigabit up to ten gigabytes. In this test, we generate proposed structures with data block sizes of 16 MB, 24 MB, and 32 MB, and we set the number of data copies to 3. We also increase the value of the parameter Nmax in the multibranch proposed structure to 27 on data that is less than one gigabit in size.Table 2
1–10 GB metadata generation test.
Metadata (GB)Size of block in MB16 MB24 MB32 MB1457281011310141441116175121818614192071620218182224919232610222628Figure 5
Unstructured metadata generation test.Figure6 demonstrates the data proof-verification test. According to laboratory studies, the majority of first-generation 10 G Ethernet switches do not even come close to providing 10 gigabits of speed. However, compared to older equipment that relied on small networks, the most recent backbone switches do offer greater bandwidth and perform better in terms of quality-of-service regulation.Figure 6
1∼10 GB data proof-verification test.


## 6. Database Design

### 6.1. Database Design of Breeding Stage

A large amount of data needs to be collected in the breeding stage, so the database design for the breeding stage is shown in Table3, which contains the primary collection information [25, 26].Table 3
Breeding information table.
Field nameType of dataSizeAllow emptyIllustrateFarmIdVarChar30Primary keyFarm numberFarm positVarChar80NoFarm addressFarm ownerVarChar20NoFarm managerEHygieneVarChar20NoEnvironmental health statusPig IdVarChar30NoPig numberPigTypeVarChar20NoPig speciesPigGenderVarChar10NoPig sexCultTimeDateTime—NoEntry timeFeedTypeVarChar20NoType of feedVaccineTypeVarChar20NoTypes of vaccinationsVaccineTimeDateTime—NoVaccination timeOperatorIdVarChar30NoOperator numberHashVarChar256NoData summary


### 6.2. Database Design of Slaughter and Processing Stage

The slaughtering and processing stage is an integral part of the pork supply chain, and a lot of information must be recorded. The database design of this stage is shown in Table4. The data table contains the primary recorded information [27, 28].Table 4
Slaughter and processing information sheet.
Field nameType of dataSizeAllow emptyIllustratePigIdVarChar30Primary keyPig numberHealth statuVarChar20NoHealth statusQuaran dateDateTime—NoQuarantine datePork batchesVarChar20NoPork batchSlaDateDateTime—NoSlaughter dateAcidTimeDateTime—NoAcid discharge timeAmbientTeHuVarChar20NoAmbient temperature and humidityPackIdVarChar30NoPackage numberPackMaterialVarChar20NoPackaging materialsPackTimeDateTime—NoPacking timeMeatPartVarChar20NoPart of meatOperatorIdVarChar30NoOperator numberHashVarChar256NoData summary


### 6.3. Database Design of Logistics Transportation Stage

Logistics transportation involves transporting pigs or pork to a designated destination. The database design at this stage is shown in Table5, which contains the primary record information during the transportation process [29, 30].Table 5
Logistics and transportation information sheet.
Field nameType of dataSizeAllow emptyIllustrateTransportIdVarChar30Primary keyLogistics order numberEnterNameVarChar80NoCompany nameEnterPositVarChar80NoCompany addressEnterOwnerVarChar20NoCEOLicenNumberVarChar20NoTransport license plate numberTransTimeDateTime—NoTransportation timeTransOriginVarChar50NoShipping originTransductionVarChar50NoShipping destinationCarriageTeHuVarChar20NoCabin temperature and humidityDriverNameVarChar20NoDriver nameOperatorIdVarChar30NoOperator numberHashVarChar256NoData summary


### 6.4. Database Design in Sales Stage

The sales stage mainly records the pork storage and sales. The database design of this stage is shown in Table6. This data table contains the primary record data of the sales stage [31, 32].Table 6
Sales information sheet.
Field nameType of dataSizeAllow emptyIllustrateSalesInfoIdVarChar30Primary keySales information numberEnterNameVarChar80NoCompany nameEnterPositVarChar80NoCompany addressStorageTimeDateTime—NoWarehousing timeStorageTeHuVarChar20NoTemperature and humidity in the librarySalesSiteVarChar50NoSales locationShelfTimeDateTime—NoAdded timeOperatorIdVarChar30NoOperator numberHashVarChar256NoData summary


### 6.5. Traceability Coding Design

In designing a pork traceability system based on blockchain, it is necessary to create the traceability code of pork products to achieve the purpose of traceability. According to the “General Specifications for Food Traceability,” pigs must follow one animal, one standard, and the unique number of each pig is used as its unique identity. Pork products must also have a unique traceability code. The design of the traceability code is based on the GSI system code and fully considers the pork from a single entity to multiple divided entities, adopts different coding rules, and implements the form of a unit corresponding to a UN code. Accurate traceability of the process. The design of traceability coding uses UCC/EAN-128 as the carrier to mark meat pieces as GTIN and attribute information codes. Follow the following coding rules when numbering pigs:The number of the ear tag is designed to be 10 digits, of which the number of the farm occupies the first 3 digits, the gender of the pig is placed in the 4th place, the year number is put in the 5th and 6th places, and the serial number of the pig in the farm is placed in the 4th place—last 3 digits. The pig carcass number is designed to be 11 digits; add 1 digit to the left or right side of the pig carcass based on the ear tag code. The meat block code is designed to be 14 digits, and it is only necessary to add 3 digits to the specific part and a serial number of the pig based on the carcass code. The pork code in the sales state is based on the international commodity identification code plus the meat block code.


## 6.1. Database Design of Breeding Stage

A large amount of data needs to be collected in the breeding stage, so the database design for the breeding stage is shown in Table3, which contains the primary collection information [25, 26].Table 3
Breeding information table.
Field nameType of dataSizeAllow emptyIllustrateFarmIdVarChar30Primary keyFarm numberFarm positVarChar80NoFarm addressFarm ownerVarChar20NoFarm managerEHygieneVarChar20NoEnvironmental health statusPig IdVarChar30NoPig numberPigTypeVarChar20NoPig speciesPigGenderVarChar10NoPig sexCultTimeDateTime—NoEntry timeFeedTypeVarChar20NoType of feedVaccineTypeVarChar20NoTypes of vaccinationsVaccineTimeDateTime—NoVaccination timeOperatorIdVarChar30NoOperator numberHashVarChar256NoData summary


## 6.2. Database Design of Slaughter and Processing Stage

The slaughtering and processing stage is an integral part of the pork supply chain, and a lot of information must be recorded. The database design of this stage is shown in Table4. The data table contains the primary recorded information [27, 28].Table 4
Slaughter and processing information sheet.
Field nameType of dataSizeAllow emptyIllustratePigIdVarChar30Primary keyPig numberHealth statuVarChar20NoHealth statusQuaran dateDateTime—NoQuarantine datePork batchesVarChar20NoPork batchSlaDateDateTime—NoSlaughter dateAcidTimeDateTime—NoAcid discharge timeAmbientTeHuVarChar20NoAmbient temperature and humidityPackIdVarChar30NoPackage numberPackMaterialVarChar20NoPackaging materialsPackTimeDateTime—NoPacking timeMeatPartVarChar20NoPart of meatOperatorIdVarChar30NoOperator numberHashVarChar256NoData summary


## 6.3. Database Design of Logistics Transportation Stage

Logistics transportation involves transporting pigs or pork to a designated destination. The database design at this stage is shown in Table5, which contains the primary record information during the transportation process [29, 30].Table 5
Logistics and transportation information sheet.
Field nameType of dataSizeAllow emptyIllustrateTransportIdVarChar30Primary keyLogistics order numberEnterNameVarChar80NoCompany nameEnterPositVarChar80NoCompany addressEnterOwnerVarChar20NoCEOLicenNumberVarChar20NoTransport license plate numberTransTimeDateTime—NoTransportation timeTransOriginVarChar50NoShipping originTransductionVarChar50NoShipping destinationCarriageTeHuVarChar20NoCabin temperature and humidityDriverNameVarChar20NoDriver nameOperatorIdVarChar30NoOperator numberHashVarChar256NoData summary


## 6.4. Database Design in Sales Stage

The sales stage mainly records the pork storage and sales. The database design of this stage is shown in Table6. This data table contains the primary record data of the sales stage [31, 32].Table 6
Sales information sheet.
Field nameType of dataSizeAllow emptyIllustrateSalesInfoIdVarChar30Primary keySales information numberEnterNameVarChar80NoCompany nameEnterPositVarChar80NoCompany addressStorageTimeDateTime—NoWarehousing timeStorageTeHuVarChar20NoTemperature and humidity in the librarySalesSiteVarChar50NoSales locationShelfTimeDateTime—NoAdded timeOperatorIdVarChar30NoOperator numberHashVarChar256NoData summary


## 6.5. Traceability Coding Design

In designing a pork traceability system based on blockchain, it is necessary to create the traceability code of pork products to achieve the purpose of traceability. According to the “General Specifications for Food Traceability,” pigs must follow one animal, one standard, and the unique number of each pig is used as its unique identity. Pork products must also have a unique traceability code. The design of the traceability code is based on the GSI system code and fully considers the pork from a single entity to multiple divided entities, adopts different coding rules, and implements the form of a unit corresponding to a UN code. Accurate traceability of the process. The design of traceability coding uses UCC/EAN-128 as the carrier to mark meat pieces as GTIN and attribute information codes. Follow the following coding rules when numbering pigs:The number of the ear tag is designed to be 10 digits, of which the number of the farm occupies the first 3 digits, the gender of the pig is placed in the 4th place, the year number is put in the 5th and 6th places, and the serial number of the pig in the farm is placed in the 4th place—last 3 digits. The pig carcass number is designed to be 11 digits; add 1 digit to the left or right side of the pig carcass based on the ear tag code. The meat block code is designed to be 14 digits, and it is only necessary to add 3 digits to the specific part and a serial number of the pig based on the carcass code. The pork code in the sales state is based on the international commodity identification code plus the meat block code.


## 7. Comparative Analysis and Case Analysis of Traceability Systems

As the public pays more and more attention to food safety, domestic scholars have also conducted more research on food traceability. Literature [33] designed a beef traceability system by combining wireless sensor networks, two-dimensional barcodes, and NET technologies to realize automatic collection and upload of ambient temperature and humidity. Possibility. Literature [34] applied NFC technology and Internet of Things technology to design a rice traceability system, which realized monitoring and tracking of all rice production and circulation aspects. Consumers can hold smartphones and other devices to query traceability information. Still, when quality problems occur, it is not easy to keep the responsible person accountable due to the problem of information islands in the supply chain. Literature [35] proposed the idea of a blockchain-based agricultural product traceability system but lacked system function design, and the results were still at the level of technical interpretation. Literature [36] combined blockchain and RFID with building a food traceability system. This system is developed on fabric. Participants in the network may now more accurately track the amount of food lost and saved thanks to a digital food system. Blockchain technology, which encourages confidence and transparency while storing digital records in a decentralized and immutable manner, helps decrease food waste. Preservation, improved visibility, transparency, and data integrity together offer a number of advantages that boost trust in extended food supply chains (FSCs). Blockchain can improve traceability, make recalls more effective, and help lower the risk of fake goods and other types of illegal trading. Consumers can obtain food traceability information by scanning the code, and the responsible person can be quickly located when there is a problem with the food. However, the system lacks the necessary consumer complaint mechanism and the food safety recall mechanism implemented by the regulatory authorities. Therefore, once a problem product that may endanger health occurs, it will not be able to prevent it from continuing to flow into the market in time. Literature [37] built a traceability system for agricultural products based on Fabric, which achieved information sharing and a win-win among all parties involved in production, circulation, supervision, and consumption. However, since the data cannot be changed once uploaded to the chain, the system ignores the need for correction of the input data by each link node.To sum up, the design of the food traceability system based on blockchain in this paper has the following advantages: first, multiparty participants trust endorsement, and blockchain decentralization can improve user trust. The second is that the blockchain cannot be tampered with; timestamps and other characteristics can achieve effective accountability in information traceability. The third is to increase the necessary complaint and food recall functions. The fourth is to provide a data correction application function for nodes with incorrect information entry due to mistakes, which will be reviewed and entered by the regulatory authorities.


## 8. Conclusion

From the perspective of food safety, this paper selects the most common, affordable, and popular pork in the market as the traceability object of the traceability system, designs a blockchain-based food traceability system, and innovatively introduces the Food and Drug Administration. Nodes provide data change services for nodes with information input errors in each link. In addition, food recalls can be carried out by the law for food that may be found harmful to health to prevent further influx of problematic food into the market. Consumers can also use the traceability source code on the food packaging to conduct a full-process traceability inquiry of the food so that the food can be purchased with confidence and eaten with peace of mind.



---

*Source: 4728840-2023-01-30.xml*