1 Introduction

With the rapid proliferation of the Internet of Things (IoT) [1] paradigm in our everyday lives, making all the spheres as smart, discovery of the most pertinent IoT resource in the user application space is a mandate. The resource most efficient in terms of its core functionality, Quality of Service (QoS) [2], amongst similar capable resources must be retrieved with minimum human intervention and dynamically. Work carried out in the [1] represents the state of art in the resource discovery field in IoT.

The office automation market segment has seen a growth of smart gadgets, which has overwhelmed traditional workplaces with sophisticated monitoring systems [3] to improve staff productivity. However, the abrupt onset of the COVID pandemic has made working from home the new norm. In the post-COVID age, a hybrid work style model is prevalent, allowing employees to choose between working from home and working in an office, depending on their needs. There won’t be any permanent desk seating reserved for the There won’t be any permanent desk seating assigned to the staff. The office administrator may assign the smart desk to the staff based on need. The office manager can select the IoT resources based on the ranking of capabilities and provide the employee with the ideal smart desk. The ideal office seating position can be found and given to the end employee based on the user’s needs and the capabilities provided by the equipment. The remaining paper is organized as Sect. 2 representing the literature review, Sect. 3 presenting the proposed methodology, Sect. 4 depicts the hardware setup employed, Sect. 5 reprsenting the queries executed and showcases the experimental study, followed by Sect. 6 with conclusion and future work.

2 Literature review

The recent work in discovery of devices in IoT domain is summarized in Table 1.

Table 1 Literature survey

3 Proposed methodology

The pre-processing stage and the resource retrieval stage are the two key stages of the overall technique used for the proposed research work. Unified annotation of the IoT resources from the vendor specified device specifications is carried out in the initial pre-processing stage. Next phase is the attribute selection phase where the key differentiating and QoS specific attributes are selected from the feature set. The IoT protocol enrichment is performed and a semantically enhanced resource repository is created based on the attributes chosen. IoT resources that have been registered are retrieved during the discovery phase based on how closely they fit user requirements. Ranking is done using several criteria decision making. Based on a match between the user’s requirements and the top-ranked IoT resources, the optimum resource is returned.

In Fig. 1, the approach used in the proposed research project is depicted diagrammatically. As demonstrated, the semantic annotation of IoT resources is the first step in the pre-processing stage followed by attribute selection phase. In the CoAP IoT protocol [5], these chosen attributes are enhanced for resource registration and discovery, which is followed by ranked device retrieval [18, 19, 20, 21] based on multi-attribute decision-making. The resource annotated to the standard format from specifications is carried out and the effectiveness of the same is shown in our previous work [22, 23].

Fig. 1
figure 1

Methodology of the proposed work

The discovery engine comprises of solving a multi criteria decision making problem, where the various attributes of the device for the criteria. The protocol is enriched with the attributes and the user query is also semantically eniched. The system generated recommendation for the devices and devices choice based on user preferences, both are considered for ranking the devices. Figure 2 depicts the discovery engine and corresponging discovery workflow. The MADM [24] model based on proximity calculation to the ideal values is computed (Fig. 3).

Fig. 2
figure 2

Resource discovery engine

Fig. 3
figure 3

Flowchart depicting the ranking mechanism of the devices

4 Hardware setup

Case study was conducted in an office setting using the testbed architecture depicted in Fig. 4. Post COVID era, the office administrator would designate the seating arrangement (smart desk) depending on the capabilities of the available smart devices, instead of allocating a dedicated office space. Each smart desk is represented by a smart sensor board. The seating sections of the office are surrounded by a total of 5 smart sensor boards. Each sensor is made up of a variety of different sensor types that can identify the workplace setting. The on-board sensors are interconnected with the Arduino Uno [25]. The seated position is represented by a sensor board with five different types of sensors on each side.

Fig. 4
figure 4

The office layout for the smart office seating discovery

A sensor board that includes five various types of sensors, each capable of monitoring ambient data, serves as a representation of the seated position. The hardware elements utilised to create a single sensor board are displayed in Table 2. Figure 5 shows the circuit diagram for a single board. The Arduino Uno MCU is used to control the four sensors (temperature, light, gas, and occupancy), as shown in Fig. 6. The LED is linked to enable resource search and the visual realisation of sensor board selection. The wireless interface and battery power source for the board are provided by Node MCU Esp8266.

Table 2 The office seating kit with different sensors
Fig. 5
figure 5

The circuit diagram of a single sensor board

Fig. 6
figure 6

Sensor Board hosting 4 types of sensors connected to Arduino UNO

Using the vendor specifications as a guide, annotation of 20 sensors in a common format is carried out. The framework is developed using Python 3.x.The Arduino Software Development Kit (SDK) is used to register and manage the sensors that the Arduino MCU controls. The language used to interface the sensors with the Arduino MCU is embedded C. RDFLib is used to implement semantically enhanced RD on Berkeley DB.Real-time data collection from the sensors is done using the cloud platform ThingSpeak. Tkinter is used to create a Graphical User Interface (GUI) that visualises all of the aforementioned steps of the suggested framework. The vendor specifications folder is selectable using a GUI interface that is provided in annotated format. An interface for attribute selection that shows the selected attributes. Based on a CoAP client request, the UI will display the semantically enhanced CoAP CORELink format for device registration. The GUI offers resource retrieval that is ranked, captures user preferences, and visualises user queries. The office administrator uses the UI created to choose the ideal seating position for the end employee.

The cloud service ThingsSpeak [17] collects and stores real-time sensor data. The ESP8266WiFi built-in WiFi module allows the sensor boards to communicate wirelessly with the gateway [23]. The enriched CoAP is deployed on the gateway to function as a CoAP server with enriched RD implementation. The CoAP client offers an interface that makes capturing user requirements easier and building queries using SPARQL [26].

5 Result analysis

The Table 3 depicts the various queries executed for device discovery in the smart office setup. All the smart devices in the office setup would register with enriched CoAP repository.The enriched CoAP client would make request to the central enriched CoAP server. The requested query parameters and values are used to perform CoAP repository lookup.

Table 3 Query on the semantic enriched CoAP repository

This section explains the results of the experimental study carried out using proposed methodology. Figure 7 depicts the device registration Table 4 depicts the CoAP CoRELink format for the various queries corresponding to Table 3. The attributes selected in the previous step are enriched in CoRELink and Resorce Directory (RD). The queries are executed and the responses are captured. The queries are executed on traditional CoAP and enriched CoAP and the performance improvement is measured.

The source code for the implementation is available at [link 1] GitHub - vandanacp/IoTResourceDiscoveryProject.

Fig. 7
figure 7

Device registration and discovery with enriched COAP

The devices with the device id as shown in left hand panel of UI in Fig. 7 gets registered to the enriched COAP repository. Th attribute-values are enriched in the COAP COReLink format and sent to COAP server for registration (Fig. 8).

Table 4 Enriched COAP based resource registration and ranked discovery
Fig. 8
figure 8

Device Ranking based on user preference and system generated recommendation

As shown in Fig. 9, there is a reduction of average response time during discovery process by 28% for S-COAP (Semantically enriched) compared to traditional COAP. The discovery time improvement is due to the precise discovery of the devices with the enriched semantics.

Fig. 9
figure 9

Resource discovery time comparison

5.1 Ranked Resource Retrieval

The time taken to rank the devices based on AHP-TOPSIS approach is compared with proposed approach. The SPARQL query is exceuted 20 times and the average time taken is considered for comparison. There is an improvement of 37% in amount of time to rank the devices as shown in the Fig. 10.

Fig. 10
figure 10

Ranking time comparison

The COAP request and response payload is compared with enriched COAP request and response payload size for all the 5 main queries as shown in Fig. 11. During the registration phase, query1, the response size of enriched COAP is nearly comparable with COAP due to the initial registration process in RD. The exact matching resource is retrieved for all the other queries compared to the traditional query, which does a match based on resposnse type. Hence a bandwidth usage reduction of 40% is observed with semantically enriched COAP protocol compared to traditional COAP.

Fig. 11
figure 11

Resource discovery time comparison

6 Conclusion and future work

Through this work, we demonstrate the utility of the suggested framework for resource discovery in a smart IoT-based office test bed for locating the optimal seating arrangement. The discovery of smart office seating based on the proposed methodology was culminated by implementation comprising resource description annotation, attribute selection, protocol enrichment, and ranked resource retrieval. The framework can be extended to design a method to detect the collapse of IoT devices. In case of fault management, the detection of the IoT resource fault and its recovery needs to be modelled. Hence, the discovery framework can be extended in the future to detect the faults of these discovered IoT resources.