# An IoT-Based Encapsulated Design System for Rapid Model Identification of Plant Development
## 4 Software Architecture
### Computer Cloud Layer  
The computer cloud is designed to serve three main functions: (i) telemetry ingestion and analysis, (ii) device maintenance and control, and (iii) presentation of aggregated data and analysis results. The computer cloud was implanted using Microsoft's Azure cloud platform. Individual devices are connected to the cloud services through a central-node IoT device central hub (from Figure 6). In order to implement the aforementioned cloud functionalities, bidirectional communication was established between the IoT device central hub and the devices, enabling both C2D (Cloud to Device) and D2C (Device to Cloud) messages. MQTT protocol was utilized for cloud-device communication, because of its lightweight design and support for bidirectional communication. The devices aggregate their sensor data into a JSON format and send them as a part of an MQTT message payload. Figure 7 shows the device telemetry of JSON data from a single device sensor readout.  
The IoT device central hub aggregates telemetry messages and, through the Device Event Service, publishes them as events. Telemetry events are then routed to subscribed storage services. The cloud data flow was designed following the principles of Lambda architecture, as shown in Figure 8.  
For storing raw telemetry, hot and cold data storage paths are utilized to ensure the real-time operability of the system when large amounts of data are consumed. For hot-path storage, the NoSQL database in document form is used and configured to hold the latest device data. In such a form, telemetry data is accessed and analyzed in real-time and device regulation corrections are performed accordingly. Blob storage is used for cold-path processing, and it stores raw telemetry data, which is used later on in more complex, time-consuming analysis. The data is expected to be collected at 15-min intervals. Device maintenance and control is accomplished by combining the local logic of device-embedded controllers with computer cloud services for device event handling. Devices, along with telemetry data, periodically send status messages, which are aggregated, and device events are analyzed and logged. The computer cloud is designed to ingest and analyze the events, thus enabling real-time monitoring. With device event analysis, the system  
Figure 8: Data flow of Lambda architecture [27].  
Figure 7: Device telemetry data.  
implements logic for automated device control. Moreover, to automate the registration process for new devices, device provisioning events are published and processed. Finally, the cloud supports interfaces for controlling the devices and conducted experiments over HTTPS protocol. This is accomplished through Data Web API, for daemon applications (such as the application running on the central data server), and Portal Web API, for user front-end web application. Cloud computers also offer a possibility for advanced data processing algorithms, using standard AI methods, should they be required, in addition to the developed application-tailored AI algorithms on the central data server.