# An Interoperable Component-Based Architecture for Data-Driven IoT System
## 3 Component-Based IoT Architecture
### Central Control System Component  
The central control system component hosts the central platform and server that manage all the interactions between components. The component is set to provide only general functions such as data or command interchange, data process, and connectivity management of the components to enhance the system's interoperability and reusability. There are five sub-components under this component:  
* Data string decoder: Data string decoder is a sub-component that decodes the data string received from the end devices into a standard, readable-data format. A standardized data format that aggregates all the substantial values from one device is required to prevent data mismatch between devices, considering the possibility of a single device providing more than one type of data. The data format from the end devices generated by the data string generator in the end devices component is explained in the next section. Typically, the data from the end devices have to be processed into a standardized and readable format before being transferred to the data-driven feedback model component for further analysis and the database server for storage. Therefore, the data string decoder identifies the separators between essential data values in a data string and extracts the required data, which contain the sensor's data and the device ID. The extracted data and ID are then be sent to the device identification manager for identification and classification. * Device identification manager: This is the sub-component that identifies and classifies the ID and sensors' data of the end devices and matches them with their corresponding actions. Firstly, the sub-component fetches the device ID from the data string decoder and tries to find a match in the existing device ID registry. If a match is found, the data under the device ID are transferred to the data-driven model selector for further action and also to their corresponding database for data storage simultaneously. The function also automatically creates a new ID for a device if the device ID is not to be found in the repository. The identification of devices is based on their multi-level device ID which enables the segregation of data from the application level down to the device level. The detail explanation of the multi-level naming system for end devices is covered in the next section. * Device connectivity manager: This sub-component handles the connectivity and traffics between each component. The most important function of this sub-component is to maintain the parallel and simultaneous data transmission of end devices and external data sources, with the central control system component. This is to ensure that the data from each end device do not have to wait for their turns to be read. Moreover, the sub-component also ensures that the central control system component only reads a new data string from the end device when the feedback generated by the data-driven model from the previous inbound data has been successfully sent to the corresponding end device. This is to make sure that the feedback signal received by each end device is the feedback generated from the data that they have provided during the last iteration. The interface and communication of this component with the other components are achieved through general, open-sourced protocols: API call and MQTT. Specifically, the usage of MQTT protocols on top of Wi-Fi TCP/IP is suitable for the end device communications as MQTT requires only one single IP address for all the devices connected under the same gateway. This is appealing for the large-scale deployment of this architecture as it can accommodate a larger network of devices. By leveraging the edge devices as a gateway connecting multiple end devices, the end devices are able to exchange data and interact through the single IP address of the edge gateway that they are connected to. In addition, the MQTT protocol's multi-level topic assignment is suitable for the implementation of the multi-level naming system.