1 Introduction

Internet of Things (IoT) refers to networks of objects, machines, vehicles, and other physical systems with embedded sensing, computing, and communication capabilities [18]. These devices sense and then share real-time information about the physical world. IoT is growing at a highly increasing rate. For example, according to a study by Gartner ([32]), it is believed that, by 2020, there would be 25 Billion connected things. Such connected things produce massive amounts of monitored data produced by sensors and devices. That is why data management has been evolved as one of the recent challenges for IoT systems. Data management policies are one of the main techniques to ensure collecting, managing and disseminating data is performed in a systematic, planned and managed way [37]. Examples of such policies include:

  • Applying face detection algorithms to the recorded videos in places where a robbery happened,

  • Applying algorithms to focus on car plate recognition when an accident happens in a smart city,

  • Calling the fire department when a fire is detected with a detailed request of the number of trucks, appropriate number of fire fighters and required tools.

Depending on the context of the IoT system, data management policies are added to/removed from the IoT system. A naive approach would rely on human intervention expertise to add/remove policies. Doing so is inefficient and error-prone in many applications. Thus, there is a need for a cognitive system that determines which policies to adopt whenever changes are triggered in the system with as minimal human input as possible. This is what we develop in this paper. That is, we present a cognitive method that automatically determines the appropriate policies in an IoT system, by analytically manage the input data and use historical policies and data to learn appropriate actions.

This paper is organized as follows. First, we present the state of the art in Sect. 2. Then, in Sect. 3, we present our methodology for action recommendation for policy-based data management in IoT systems. We lastly present our conclusions and directions for future work in Sect. 4.

2 State of the Art

Data management in IoT systems typically begins with monitoring the data. There has been multiple works in the literature on data monitoring  [2]. Four main monitoring approaches exist, namely sampling and filtering-based monitoring (see, for example,  [39]), probing-based monitoring (see, for example,  [19, 20]), diagnosis-based monitoring (see, for example, [25, 27]), and performance-based monitoring (see, for example, [10, 14]).

In [39], the authors presented an adaptive monitoring framework for IoT devices. The system adapts the frequency of the monitoring as well as the amount of data going through the system. Their system increases the monitoring frequency when the value of monitored metrics gets to a certain pre-specified threshold and decreases it when a quality of service violation is unlikely to happen. The authors developed a monitoring approach that uses probing and is passive in nature.

In [25], the authors adopted a diagnosis-based monitoring approach based, where system faults are identified and then the metric monitoring is adapted accordingly. In [14], the authors developed a method for integration, validation, and description of metrics of software project performance. Katsaros et al. [21] proposed an architectural approach that combines virtualization and physical levels for monitoring data collection, where many open source solutions were combined (e.g. Lattice [11], Ganglia [23], Nagios [15]) so as to get one holistic application covering different layers. They used collectors for data extraction from different virtual and physical layers, and then data externalization to the upper layer using an external data collector. They also proposed a monitoring manager that acts as an orchestrator of the whole monitoring system. That manager controls and provides the required interfaces to add or consume monitoring information.

In [7], the authors proposed a tool, for distributed systems, for monitoring resources that enhances high-performance computing. The tool extracts both the application and resource state, and assigns new resources and/or shut down unused ones based on these states. This happens during the runtime of the application or in future usages. Data collectors are used to collect the data from resources and then the data is stored in a distributed database. Later, a statistical analysis is performed to take decisions on the resource assignment in the application, i.e., whether to keep it as the latest assignment or manually reconfigure it.

As for more specific data management literature on IoT, there has been some recent literature. For example, in [40], the authors formulate some deign principles for IoT data management. They developed optimization algorithms aimed at producing coherent IoT ecosystems, by means of publish/subscribe middleware and linked data that span over cloud infrastructures and mobile networks. In [13], the authors proposed a distributed data service for data collection and processing in IoT systems. They mentioned that their main goal is to enable multiple and different IoT middleware systems to share common data services that is coming from a loosely-coupled provider. To that end, they specified the corresponding techniques for data collection, filteration, storage, and aggregation to allow for efficient real-time data querying.

Padiya et al. [29] addressed the challenge of handling massive sensor data in an interactive fashion via Resource Description Frameworks (RDF). They compared multiple RDF storage mechanisms such as triple store, vertically partitioned table, horizontally partitioned table, column store, among others. They also represented a set of metrics that were designed to take decision for choosing the appropriate RDF data storage technique a priori for IoT systems. In [1], the authors present a survey for data management solutions proposed for IoT or subsystems of IoT. They discussed the different design primitives that they claim to be most important to address in an IoT management solution and showed how they were approached by the proposed solutions. Additionally, they proposed a data management framework for IoT that incorporates the aforementioned design elements and acts as a seed for a comprehensive IoT data management solution.

Gubbi et al. [18] present a cloud centric vision for the world-wide implementation of IoT. They proposed a cloud implementation based on the interaction of private and public clouds and concluded that there is a need for expanding on the convergence of wireless sensor networks. In a previous work [38], we proposed an adaptive monitoring approach in IoT systems, where a metric value-based change or an environmental one triggers the need to choose which metrics to monitor and at what frequency. While an approach for doing this metric monitoring management was presented, no mention of action policies was discussed. A slightly similar work with an application in healthcare can be found in [4].

As one can see, all the previous works dealing with data management in IoT systems do not consider the issue of the determination of policies governing the IoT system. To the best of our knowledge, the only related literature is that concerned with security and control policies, rather than action policies, which is the focus of our work here. For examples on the latter policy focus, we refer the reader to the papers in [33, 36]. It seems that action policies has been done in an ad-hoc and/or manual manner in the current state of the art. Thus, there is a need to fill this gap in the literature, as well as practical systems, via providing a methodology that handles automated cognitive action recommendation for different events that are monitored within an IoT system. This is what we provide next in this work.

3 Methodology

Figure 1 illustrates the overview of our methodology, where the first step (defined in details in Sect. 3.1) constitutes a recommendation model that gets trained on historical pre-defined/hypothetical events-conditions-actions data. Such a model can then be used for new events-conditions to recommend the actions for such events-conditions. Only in case the recommended actions are not incorporated with a high confidence, they might need some expert validation. The expert validation step is detailed in Sect. 3.2 along with the update of the historical data as per the expert input. We then prioritize the actions recommended by the system in the step detailed in Sect. 3.3 using a model that learns such prioritization from historical data. Lastly, since the system is typically resource-constrained, an optimization mode that chooses the optimal final set of feasible actions to execute, trying to maximize the system utility by giving more resources for the actions with higher priority. We detail this optimization model in Sect. 3.4.

Fig. 1.
figure 1

Overview of our overall methodology

3.1 Recommendation of Action Given an Event-Condition

We assume that we are given a set of event-condition-action triplets. That is, for each given historical or hypothetical event, we are given a condition and a corresponding action. An example of elements of that set in our IoT context would be a robbery (event) that happens at a bank (condition) with the corresponding actions being calling the police and focusing the cameras of the smart cities on plates of cars surrounding the bank. Now, what we want to achieve in this step of our methodology is that whenever a new event-condition happen, the system is able to automatically recommend the best action to take.

In order to achieve this, we develop a classification model that classifies the events-conditions to the corresponding actions. We refer the reader to [6, 17, 26] for extensive analysis of machine learning classification. We note that the events-conditions are typically text data and thus, in order to do such classification, we need to first perform some text mining in order to retrieve the features of these events-conditions. This can be done as follows: We convert each event-condition to a bag of words. This text is transformed in order to get label indexers. The label indexers fit on the whole dataset. Additionally, we develop feature indexers that automatically identify categorical features and have them indexed. Then, we are ready to build the classification model that gets trained on such historical data to predict the recommended action. Several machine learning techniques can be used for each of the two steps. For the text mining, we refer the reader to recent review in [35]. An example of a traditional, but yet very popular, algorithm for the kind of text mining that could fit our purpose here is Term Frequency-Inverse Document Frequency (TF-IDF) [22]. The idea behind TF-IDF is that a numerical statistic is calculated to reflect how important a word is in a corpus. Its value increases proportionally to the number of occurrences of a word in the document, but is often offsetted by the frequency of the word in the corpus. The purpose of this is to adjust for the fact that some words appear very frequently in general. We refer the reader to the reference in [31] for details on how TF-IDF works.

Examples of machine learning classifiers along with their references are Decision Trees [30], Random Forests [8], K-Nearest Neighbor Classification [12], Support Vector Machines [34]), Logistic Regression [24], Naive Bayes [28], and Gradient Boosting Machine (GBM) classifier [9]. We also refer the user to recent similar applications of data mining and classification in [3, 5]. Figure 2 illustrates that whole methodology of action recommendation for a given event-condition.

Fig. 2.
figure 2

Illustration of our action recommendation methodology

3.2 Validating the Learned Actions and Updating the Historical Data

Machine learning classifiers, like the ones we proposed to use in the previous subsection, typically output a score of confidence in the classification assignment. Assuming that the user of our system determines a threshold for the minimum accepted confidence (e.g., 50%), we program the following in our system: If the threshold of assigning an action to an event-condition is equal or above that threshold, then we just apply it. If it is lower, then we let an expert validate that recommended actions of low confidence. This would typically happen when the model encounters new classes of events and conditions pairs.

In the latter case, after the expert review, the expert would either confirm the recommended action or they would update/change it. Note that such expert validation is minimal compared to ad-hoc prior systems where the expert defines all the policies manually. Lastly, the expert recommend actions are used to update the historical events/conditions/actions data to improve the learning model in the future recommendations.

3.3 Learning the Priority of Events-Conditions

The objective of this step is to prioritize the actions recommended by the recommender discussed in Sect. 3.1. We need to do such prioritization because there are typically limited resources in the systems and thus, we might need to do a subset of the recommended actions. Therefore, we want to prioritize these actions so that the ones that the system finally chooses to perform have the highest possible collective priority.

We assume that we are given sets of previous actions and their importance. For example, an action of calling the fire department when a fire occurs is obviously more important than the action of turning off the air conditioning in a building given a certain temperature. That importance could either be a score/weight of importance of each action or a binning classification (e.g., classifying each action in one of five bins, where the first bin corresponds to most important actions, the second one is less important, \(\ldots \), etc.).

Now, the way our prioritization works is similar to our recommendation. That is, we perform some text mining on the actions and the classify them into the importance classes. The classification could be a multi-label classification in case the historical data are labeled into bins, or if could be a binary classification in case the prioritization is in the form of a weight for each action. In the latter case, the score that the model gives for each action corresponds to the predicted weight of such action.

After we prioritized the actions, we note that we cannot just simply rank them in order of the predicted priority and keep fulfilling the capacity of the resources that we have with the ones with the highest weight until that capacity is fulfilled. We cannot do that because, first the resources might be multi-dimensional (e.g., CPU, RAM, network bandwidth, and storage of the devices used for the data flow in our IoT system), and secondly, even if it were one-dimensional (i.e., just one resource type), using such greedy algorithm might not make an optimal use of the available resource capacity. Thus, we formulate a mathematical optimization model in the next section in order to optimally choose the final set of actions that can be feasibly performed.

3.4 An Optimization Module for the Final Action Recommendations

Let the set of resources be R and the set of recommended actions be A. We denote the utilization of each action \(a\in A\) from each resource \(r\in R\) by \(u_{ar}\), and the capacity of resource \(r\in R\) by \(c_r\). We also denote the priority/weight of action \(a\in A\) by \(w_a\). Lastly, our only set of variables here are the ones related with whether we will choose action \(a\in A\) to be executed or not. We let \(X_a\) be such variables, where \(X_a\) is 1 if action \(a\in A\) is chosen, and 0 otherwise. Now, we formulate our mathematical optimization model as follows:

$$\begin{aligned}&\text {max} ~~ ~~ \sum \limits _{a \in A} w_a.X_a \end{aligned}$$
(1)
$$\begin{aligned}&\text {s.t.} ~~ ~~ \sum \limits _{a \in A} u_{ar}.X_r\le c_r,~~ \forall r \in R \end{aligned}$$
(2)
$$\begin{aligned}&\qquad \quad X_r \in \{ 0,1\} \end{aligned}$$
(3)

Where objective function 1 maximizes the sum of the weights of the actions that are to be chosen. Note that such weight is the score of the action, in case the output of the priority learning step is the weight, and it is the reciprocal of the priority/bin case the given priority is the corresponding bin. Constraint 2 ensures that the total utilization of all chosen actions from each resource is less than or equal to the total capacity of that resource. Lastly, constraint 3 ensures that each of our variables is either zero or one.

Model (1–3) is an integer programming model, which might not be easy to solve. However, we note that its structure is a multidimensional knapsack problem, which is well studied in the operations research literature. We refer the reader to the review article in [16] for efficient ways of solving such model.

4 Conclusions and Directions for Future Work

In this paper, we proposed a cognitive system for action recommendation action recommendation for policy-based data management in IoT systems. That is, whenever an event-condition happens in an IoT system, we showed how our system can be used to recommend the optimal set of actions to execute, given the resource constraints of the system, and with minimum human intervention.

There are several directions for future work. First, an implementation of our system with a real-world IoT use case would show the effectiveness of our approach. Second, investigation of different machine learning algorithms in the recommendation and priority determination steps would be helpful in determining which ones are most appropriate for our proposed system. Lastly, one direction for future research to our work is incorporating uncertainty in the observed events and conditions, and designing a system that would recommend actions before such certainty is realized.