Conceptual Approach for an Extension to a Mushroom Farm Distributed Process Control System: IoT and Blockchain

,

governance, logistics, marketing, security, agriculture, among others [3]. However, problems such as the (voluntary or involuntary) loss of information on the part of the providers of these services require the creation of new security models.
In innovation accelerating technologies, the Internet of Things (IoT) offers a unique opportunity in the transformation of many industries [4,5], including the agri-food sector. Traditionally this sector has low investment in information and communication technologies (ICT) [6]. In IoT it is possible to include sensors, actuators, navigation systems, cloud-based data services, among others, which provide a wide variety of data to "feed" decision support tools [7].
However, citizens today, as a matter of principle, rely on the information provided by financial and government entities; nevertheless, it is possible to question whether the information provided by both the referred entities and other external entities (e.g., companies that provide IoT, companies that provide cloud storage services) has not undergone any type of alteration. This is difficult to clarify by considering the centralized nature of architecture. Thus, this problem leads to the need to verify whether the information has been modified or not. One of the technologies that have emerged recently and with great potential to meet this need is the blockchain.
A great benefit of the blockchain is being a decentralized information technology that can be applicable in many situations (e.g., cryptocurrency, financial assets, among others). The decentralized nature of the blockchain makes it a technology of equality for all entities in the world, human and machine alike [8]. The blockchain is currently a relevant research topic, with investments of several billion dollars [9].
After analysing all the new challenges associated with the agri-food industry, and particularly with the mushroom production sector, it was possible to perceive that, even with the existing technology [10], there is still an important gap in what concerns the control of the environmental variables of the production areas and the way they are presented; the information associated with these variables would provide an important complement to the established production control system.
One of the technologies that can bring an important contribution to the development of a distributed security system that responds to all the identified needs comes in the form of the IoT devices integrated with blockchain. These devices are composed by a multitude of other small autonomous devices distributed throughout the physical environments; their role is to monitor the existing environmental conditions in a cooperative manner and send the collected data through blockchain to headquarters. Additionally, mushroom production is distributed across multiple sites, with the need to integrate this information into a Mushroom Farm Distributed Process Control System [11].
In the present paper we would like to present a conceptual approach for an extension to a mushroom farm distributed process control system with IoT and blockchain integration that not only allows to collect distributed data on the environmental indicators inherent to the mushrooms production, but also complement the already existent production control system, which is extremely important for the overall success of the farm management information system used by the group managers.
The presented paper is divided in five section, with the first one being the introduction. In the second section, the background and motivation are discussed, and the IoT and blockchain integration is the main goal of the third section. The last two sections consist of the conceptual approach and conclusions.

IoT
The IoT comprises a broad range of technologies, ranging from Radio Frequency Identification (RFID) to Wireless Sensors Networks (WSN) required to communicate over the Internet [9]. An IoT device can take on various forms (e.g., wearable) as well as a broad set of applications covering different areas and needs of society. Due to the increasing number of IoT devices, Ðurić [12] predicts that the number of devices connected will increase 150% by 2020 [13].
IoT presents a fully connected world where things are capable of communicating collected data as well as interacting with each other. This capability enables real-world digital representation through which intelligent applications can be developed in a variety of industries. We can characterize IoT applications because they require the power to operate for long periods of time, require connectivity and generate large amounts of data. However, it also presents a large number of challenges, including memory limitations, processing capacity, communication networks and limited energy supply, among others.
The reliability of the data generated by the IoT devices can be achieved through a distributed service that ensures that they are not changed if all the nodes that participate in the validation and storage of the data have means to verify that it has not been changed.

Blockchain
Satoshi Nakamoto, in 2008 [14], introduced two concepts with a strong impact on the financial markets. Bitcoin was the first concept presented, a cryptocurrency that emphasizes its value with the absence of a centralized authority; the security of the coin is maintained collectively through a decentralized Peer-to-Peer (P2P) network of actors. The second, which has achieved even greater success than the cryptocurrency, is the blockchain.
The blockchain is based on the reliability of transaction verification by a group of unreliable actors. It provides an auditable, secure, transparent, immutable and distributed ledger. All the records stored in the blockchain can be accessed openly and can be checked and grouped by entity at any time. The protocol structures the information in block chain, each block being responsible for storing a set of transactions performed at a given time. Each block refers to the previous block, constituting a string, and adopts a hash-based distributed consensus algorithm Proof-of-Work (PoW).
To support blockchain operation and maintenance, peers must provide the following functionalities: routing, storage, wallet services, and mining [14]. There may be different types of nodes in the network depending on the features provided. The propagation of transactions in the network is guaranteed through the routing function in the P2P network. Storing the string on the node is guaranteed by the storage feature. The security of the keys, which allow the accomplishment of transactions of coins, is assured by the wallet services. The creation of new blocks is the responsibility of the mining function.
Due to the high complexity of the blockchain its implementation presents itself as a huge challenge [15]. To ensure that technology is useful and profitable, all actors must ensure proper implementation and adoption. This is a technology that is still taking the first steps, so there are no consolidated implementation standards yet.

Motivation
Precision agriculture (PA) is based on an abundant set of techniques and methodologies aimed at the optimization of agricultural crops and providing maximum economic efficiency. The PA instruments allow for a rational use of resources like energy, fertilizers and water, thus decreasing the inherent environmental impact [16].
The PA involves the use of electronic technology to collect large amounts of data from production areas, data that is going to be used in production management activities. One of the most critical issues associated with PA concerns the complexity inherent to the analysis and comprehension of the collected data. This is true due to the criticality associated with the evaluation of the production environment, the specific culture and inherent variability in the referred data. The implemented AP systems must be able to offer solid and effective strategies for the management of the entire production process variability [17].
The main activity of Sousacamp Group is the production of fresh Agaricus bisporus mushrooms. The markets where the Group companies operate are mostly located on the Iberian Peninsula, France, Netherlands and North Africa, and their success strongly depends on the production process optimization, which is already highly industrialized and incorporates several complex technologies. Additionally, the Group's strategy focuses on investment in IS/IT as a vehicle for efficiency gains and competitiveness in respect to its direct competitors [11,18].
In the analysed scientific literature there were no studies that described the implementation of IoT and blockchain integration to PA with the specific focus on mushroom production. In order to address this gap we propose a production monitoring system based on IoT and blockchain integration that meets the following requirements: (1) Develop a distributed monitoring system that amplifies the collection of environmental-related data created by the existent process control system (PCS); (2) Create a distributed IoT and blockchain integration (by all production units) to monitor various production-related indicators (temperature, relative humidity, CO 2 concentration); (3) Develop a decision support system based on data visualization techniques and methodologies, which delivers to the user a set of intuitive dashboards with concentrated information on the production process; (4) In addition, implement an alert functionality responsible for monitoring all critical indicators.

IoT and Blockchain Integration
In recent years, according to Díaz et al. [9], the need to analyse and process data in real time by IoT technology was greatly facilitated by the massification of cloud computing technologies. IoT's growth has created new opportunities by providing mechanisms for acquiring and sharing information. Still, one of the biggest weaknesses of this technology is lack of trust.
Centralized architectures such as those used by the most popular cloud storage applications (e.g., Dropbox, Google Drive, and so on) are in a growth phase due to their characteristics in storing various types of files (documents, photos, videos, music, etc.); however, according to Crosby, et al. [19][20][21], they are faced with challenges in areas such as security, privacy and data control.
A centralized database is more susceptible to hackers, corruption or failures [22]. The main question posed by Crosby et al. [19] is the need to rely on a third party regarding the confidentiality of the data. Confidence is one of the main consequences of decentralization, since there is no need to assess the reliability of the intermediary or other network participants [23]. Thus, decentralization is an important property to take into consideration when choosing an alternative technology.
The blockchain technology, due to its characteristics, allows the verification of any information tampering, thus increasing its validity. Deletion of records kept collectively is impractical and verified for each single transaction that is accessible to participants through public or private distributed ledgers [19]. Participants can view ledgers and analyse transactions. This feature provides transparency [22], while ensuring anonymity by preserving records through the use of cryptography.
IoT technology, because of its centralized model in which a broker or hub controls the interaction between devices, raises questions about security and privacy as well. The issue has to do with the need for some devices to exchange data independently of one another. This problem leads to the application of blockchain technology to facilitate the implementation of decentralized IoT platforms, such as the safe and reliable exchange of data as well as record keeping. In this architecture, the blockchain serves as a general ledger, maintaining a reliable record of all messages exchanged between devices in a decentralized IoT topology.
Thus, it is possible to recognize the potential of the blockchain to overcome most of the problems of using IoT. According to Malviya [24], the use of the blockchain can complement the IoT technology with respect to scalability, reliability, privacy, traceability and information security.
As a conclusion, the functionalities of blockchain technology can contribute in large scale to the development of IoT technology. However, as these technologies are at an early stage, there are still many research challenges.

Approach Proposed
In this section we would like to present a distributed sensing system proposal that not only allows to collect data on the environmental indicators inherent to the mushroom production, but also complements the already existent production control system.
The production of mushrooms is of extreme importance to the Sousacamp Group, since it constitutes the Group's most important revenue source. In order to maintain a sustainable level of performance, the Group decided that it needed to minimize production-related problems by monitoring the environmental conditions of production areas (distributed over multiple units, as shown in Fig. 1), and with this controlling the various stages of the production process and ensuring that the appropriate guidelines and metrics are applied [10,11,18].
IoT devices distributed and integrated with blockchain network contribute in a substantial manner to an effective monitoring of the mushrooms production rooms' environmental conditions, giving extra information to production managers.
The massive collection of data will provide a basis for the desired visual analysis that is composed by dashboards presenting readings of multiple IoT devices distributed in a graphical representation, in a given time interval and using different types of filters.  Additionally, the proposed IoT devices distributed for all nine production units can also be used to detect power failures and possible problems associated with electrical equipment. The proposed architecture for distributed collection in all production units, as can be seen in Fig. 2, consists of a unit that integrates the collection of information from IoT devices and other devices ("Transform"), consolidating all the information collected in the "Data Storage and Integration" that is then passed to the "Data preprocessing" module. This module has as main functionality to handle the first processing of the data so that when they are sent to the blockchain network, they are already in the appropriate format and can serve the decision-making modules without the need to perform any pre-processing. For instance, one can verify that a given equipment is not functioning in full conditions if the environmental indicators values of the room are outside the desired range. As one should expect, the sooner the equipment failures are detected, the easier it will be to fix the problem, thus reducing the risk of production losses.
If a malfunction is detected in its initial stage, one can prevent a crop to be completely lost, mitigating the cost of completely stopping production. Due to this, when an anomaly is detected within the production rooms, the proposed system will send an alert message to all production managers prompting them to take the necessary actions. Through the proposed system, when a given erroneous situation is solved, the production managers also receive a notification indicating that conditions are normalized, and production can continue.
The proposed system architecture (Fig. 3) is subdivided into three large blocks: (1) the IoT devices network with pre-processing and data storage and integration, (2) the back-end and front-end and (3) the blockchain network. The IoT devices are dedicated to the task of obtaining the necessary data to feed the modules of the knowledge generator system and are composed by both back-end and front-end. All modules are responsible for establishing communication with blockchain network, storing the IoT data samples, analysing and providing graphic dashboards to the end-user. The back-end block (Fig. 3) is composed of a set of components ("Decision Making"; "Data Analysis", "Data pre-processing", etc.), and each one is composed in its turn of several applications. The components are connected to a blockchain network including the main database.
In a simple scenario, the components representing "Data Pre-processing" and "Data Acquisition" and their relation to the blockchain network can be described as follows: (i) the "Data Acquisition" module sends the data to the module "Data Pre-processing" through an IoT device; (ii) The data is processed in the "Data Pre-processing" module responsible for creating the final Hash Data (HD) containing the key and block required for storage on the blockchain shared network situated in each of the production units and in the headquarters; (iii) The generated block contains HD and sends to the blockchain network.
One component, which is responsible for saving all HD and transactions in the Main Database, first checks all blocks in the blockchain network. The other components then use similar mechanisms and processes to send data to the system. The system is largely constituted by the blockchain network, which functions as a distributed network for the system.
In the blockchain network, each node after winning the consensus competition creates a new block and assigns all related HD in the block based on timestamps, indicating the block creation time. The developed blocks have two parts (header containing meta information and a body part containing all verified data that are stored in the form of a hash); this is accomplished using a specific algorithm, for example the SHA256 [31]. After the block has been generated, it is transmitted to the blockchain network, where all nodes continue to search. Each node can check a block in the blockchain network according to the defined specification (key); if the key is invalid, it is sent to other neighbouring nodes for data sharing. This means that the blocks are checked by all nodes. The nodes trust each other, which creates an advantage by promoting all decentralized nodes reaching consensus on the validity of the data. In the latter part, several pieces of information are packaged, which serve as an important determent for the block in the blockchain network.
The front-end block is composed of multiple dashboards, integrated into a collaborative system, which allows the end-user to consult different graphics and apply filters that represent several relevant dimensions, such as: the year, room and week of production. Additionally, zoom/drill down features are also provided, as well as the ability to export data in table format or graphics for external use. Finally, when user logs in, a set of relevant warnings are displayed, for example, temperature warnings or alerts of lack of communication of devices.

Conclusions
When perceiving the relevance of the agri-food industry and the inherent need to achieve greater production efficiency and overall control, the research team underwent a thorough analysis on what technologies might fit the identified industry needs and allow for the development of a sustainable and focused solution.
In order to respond to the enumerated challenges, we propose in this manuscript a conceptual approach for an extension to a mushroom farm distributed process control system with IoT and blockchain integration. This conceptual approach, still in a design stage, allows the collection, storage and processing of data to be used in a distributed and scalable, immutable, transparent, auditable and essentially secure manner. However, as these technologies are at an early stage, there are still many research challenges. This proposed approach not only allows to collect distributed data on the environmental indicators inherent to the mushrooms production, but also complements the already existent production control system, which is extremely important for the overall success of the farm management information system used by the group managers.
Future work will specify an information systems architecture for the mushroom production sector that contemplates the vision of the current proposed model, and its emerging advantages, with the critical information subsystems for this sector of activity, i.e., the production control systems, collaborative and document management, enterprise resource planning/customer relationship management, quality management, integration of services with customers and suppliers, maintenance management, legal and social responsibility and, not least, an integrated system of decision support.