Fresh produce blockchain traceability Automatic Data Collection
The impact of automation can be seen across all industries. Industrial automation, for instance, involves the utilization of control systems such as computers and robots, along with cutting-edge information technologies, to manage various processes [49]. By leveraging technologies like the Internet of Things (IoT) and artificial intelligence (AI), value chains can benefit from enhanced information flow, enabling real-time monitoring and informed decision-making, among other advantages [50].
The proposed platform has an API that allows integration with IoT agents so that these can automatically submit measurements associated with value chain activities. These agents abstract away from the real physical devices and serve as a computational bridge that obtains the indicator’s reading from the sensor, contextualizes it within a value chain organization, activity and defined measurement, and submits it to our traceability platform through the API. The platform may integrate any IoT device, provided a contextualization/integration agent is developed for that device.
Fresh produce blockchain traceability QR Code
QR Codes are the first form of automation we use to obtain or update information quickly. When an operator begins or completes an activity,
scanning the QR Codes on the lots is a fast way to register them in the platform. It is best to use the QR Code for information entry instead of manually typing the ID, except in cases where the QR Code is damaged. These codes contain crucial information, such as the key to the lot or activity, and the UUID assigned to each lot and activity. You can see an example of a QR
Fresh produce blockchain traceability Traceability platform lot QR Code example.
When a user on the frontend scans a lot ID to start traceability, the API will retrieve all activity records. After that, the tracking algorithm in the backend, with all the bulk data and the lot ID, will start by finding the last recorded activity of the lot with the get Activity Id function (see Figure 13). Now, with the activity ID, we can use the collection of input lots to keep going back using the recursive function route Lot. The goal is to obtain all previous activities that yielded lots that have been used as input lots in the current activity, which produced the lot being traced back. Each time the recursive function route Lot recurses, it will save the activity in a track array, and only stops when the activity has no input lots (i.e., represents a harvest) (Figure 13).
Fresh produce blockchain traceability Traceability smart contract code.
To trace forward, the process is the same but using the output lots instead.
After that, the only thing left to do is send the track array to the frontend, where it passes through a map function, presenting the traceability to the user.
This section introduces the key pages of the web application that enable us to track and monitor the product, quality, and sustainability indicators efficiently. These pages provide details of the products, the lots of activities and more.
The product details page as shown in Figure 14, displays comprehensive information about any product on the traceability platform. Any actor can choose from the list of products or search for specific products by typing the name in the search box, which provides real-time results. React and React Bootstrap were the tools used to design the product details page, while we used to send requests to the backend.
The activity details page, as represented by Figure 15 and Figure 16, allows any actor to access comprehensive information about a particular activity. This information includes data related to the location, activity type, timestamps, product, input and output lots, and quality and sustainability measures. Links are available to access detailed information for some of these items. React and React Bootstrap were the technologies used to design the activity details page, while we used Axios to send requests to the backend and Leaflet to create the map.
Computers 13 00112 g015
The register activity page (Figure 17) uses React, React Bootstrap, and other libraries. It is a highly dynamic page that allows for the auto-completion of most fields based on the chosen activity and by scanning the QR Code. The operator can select the type of activity by clicking the respective field and choosing from the options or by typing the name in the respective field, which will filter the activities. The “Product” field is auto-completed upon scanning the QR Code, and manual selection is only necessary if there are no input lots (e.g., harvest). Origin and destination organizations are the final fields that need filling. The latter can be auto-filled with a switch button if the origin and destination are equal, and if they differ, then it has to be chosen manually.
Computers 13 00112 g017
The traceability page (Figure 18) demonstrates an example of backward traceability. Users can initiate tracking of a particular lot by scanning the QR Code or manually entering the ID. React and React Bootstrap were the technologies used to design the traceability page, while we used for backend requests and Leaflet to create the map.
Fresh produce blockchain traceability Performance Tests
As a secondary goal, we aimed to assess the obstacles associated with utilizing blockchain technology. The main challenge we encountered was scalability, and thus, we decided to conduct a speed test by comparing it to another database. Our approach involved creating and reading 1, 10, and 100 activities in MongoDB and Hyperledger Fabric. Figure 19 illustrates the results.
Computers 13 00112 g019