# Context-Driven Service Deployment Using Likelihood-Based Approach for Internet of Things Scenarios
## 4 Proposed Technique
### System Model  
Each node in the network has a finite cache to store its recent service consumption history. In Figure 3, there are six nodes (\(N_{1}\) to \(N_{6}\)), and each is associated with a finite cache (sketched as rectangular boxes with nodes).  
As the services are used, nodes gather temporal service consumption information, and this is used to guide the proposed model in predicting the future contexts of nodes. The cache is updated using the LRU method, and the gathered temporal information is analyzed with the MLE technique to obtain a preferred set of services (and contexts) for which an IoT device has a higher preference. From a context network point of view, an IoT device will be confined within the (set of) context(s) in the near future or become a member of a new context if an IoT device is currently not a member of that context.  
Gathered service consumption information is passed through the MLE algorithm to find the set of services preferred by an IoT device. For ease of analysis, the continuous domain is divided into a set of regular intervals of \(T\) time units starting from \(t_{0}\) (where \(T>0\)), as shown in Figure 4. Then, the temporal service consumption information samples are supplied as an input into the MLE algorithm that, by finding the probabilities of frequently used services, gives some preferred set of services to be used by an IoT device in the near future. For this, the MLE algorithm takes each temporal sample with some  
Figure 2: System flow diagram.  
probability to obtain \(\hat{\lambda}\). After obtaining \(\hat{\lambda}\), the MLE algorithm selects the preferred set of services whose probabilities are higher than or equal to the probability obtained with \(\hat{\lambda}\).  
The service consumption traffic within the network follows a probabilistic distribution, which can be of any type. In an ad hoc scenario, the traffic maintains a standard average over a certain finite interval; hence, [PERSON]'s distribution is more likely to be fitted in the considered smart city IoT scenario. The details of the MLE analysis were presented earlier. The variables \(X_{i}\) and \(\theta\) are the parameters that illustrate the combined-context network and the consumed services, respectively.  
The goal of this approach is to find out whether an IoT device will remain in its current context membership or change its context membership frequently; the MLE algorithm acts as a decision engine for this purpose. After finding the estimation for a combined-context network, it becomes easier to locate the registry shares among the nodes that encounter the maximum likelihood. The greater the likelihood values, the more stable the combined-context network; however, this kind of stability depends on numerous external parameters,  
Figure 4: The continuous domain is divided into a set of regular intervals of \(T\) time units.  
Figure 3: Basic network model shows six nodes (\(N_{1}\) to \(N_{6}\)), and each is associated with a finite cache sketched as a rectangular box.  
such as mobility, context cache size, residual memory, and remaining energy. The proposed approach explores the likelihood-based arrangement of registry shares in a context-aware smart city IoT scenario. The next subsection elaborates on the details of the associated granular/atomic events associated with the distributed service registry.