# Context-Driven Service Deployment Using Likelihood-Based Approach for Internet of Things Scenarios
## 4 Proposed Technique  
A user's context will change with time in line with the instantaneous demands for services; however, these changes will usually be confined to a limited number of contexts and will be repeated many times. The probability of a change to a previously known/visited context will be higher than the probability of a change to an unknown or new context. This probability is obtained from long-term observation of the service consumption patterns of users/devices. It would be better if all the services were available within an IoT device itself; however, this is not possible due to the limited capacity of devices. It would thus be more useful to organize a distributed service registry if the required services are available around an IoT device, as this can reduce the necessary search time for a service. The present work considers the reduction in the search space by exploiting the temporal service usage patterns of users/devices blended with the combined context, and this leads to better organization of the distributed service registry to improve the average discovery time for a service. Hence, the overall performance of the system is also likely to improve. The design approach seeks to obtain the required services available around an IoT device in an optimized way to maximize social welfare [37; 40]. Initially, we explore the formation of combined contexts by considering the functional contexts of services in combination with the physical/locational contexts of users/devices, taking into account the dynamics of the service consumption pattern. This also addresses the reduction in the service search space, through which the service search time is likely to be minimized. Subsequently, we analyze the formation of a distributed service registry by considering the temporal service consumption patterns of users/devices in such a way that the services are available around an IoT device in an optimized arrangement to maximize social welfare. Figure 2 illustrates the workflow of the proposed approach at a glance. In addition, for ease of understanding, the detailed steps of the entire procedure are elaborated as follows:  
1. Nodes or devices gather the initial configuration by exchanging their functional-context information and physical neighborhood via message passing. Each node gathers its functional-context information from its service consumption in the recent past and its physical neighborhood by a standard neighbor-discovery protocol. In Figure 2, this combined context neighborhood information is referred to as CN. 2. Through exchanging the combined information about the functional context and physical neighborhood, the context networks are formed. Subsequently, the distributed service registry (DR in Figure 2) is configured for each context network. 3. The system starts attending to the service consumption requests from users. The DR has the information related to each service. The search procedure starts by searching the URL of the service provider for the requested service inside the DR. As the DR is constructed by considering the concept of combined-context awareness, the number of nodes inside a particular context network is relatively small compared to those in the entire network. This is the benefit that the system is likely to obtain by leveraging context awareness through the service consumption patterns of nodes. 4. MLE plays a crucial role here by finding the services that have a high probability of being used according to the consumption history of the recent past. This likelihood is obtained by configuring the CN with those nodes that have similar service consumption patterns. This enhances the chance that a node will be stably inside a particular context network and thus participate in holding the distributed registry shares. 5. The memberships of nodes in certain functional contexts and the context networks themselves will subsequently change over time.