An Adaptive Middleware Infrastructure Incorporating Fuzzy Logic for Mobile Computing Ronnie Cheung Department of Computing, Hong Kong Polytechnic University
[email protected] Abstract In a mobile environment where mobile applications suffer from limitation and variation of resource availability, it is desirable to adapt application behaviors to the limitation and variation according to the changing context. To enable mobile applications to implement their own adaptation actions down to the system level, a middleware layer can provide programmable and generic system services for applications. In this paper, we describe a context-aware mobile middleware that facilitates the development of context reasoning and presentation entities, adaptive system services and context-aware mobile applications.
1. Introduction In a mobile computing environment, users are served at anytime anywhere, the mobile systems have to perform two tasks: 1. to sense and reason on the context of operating environment; 2. to react accordingly to the context by adapting to optimize system performance. To achieve context-awareness, a generalized and abstracted contextual description provided by a middleware layer would be adequate compared to the redundant and inefficient approach which is to maintain contexts by applications independently. To enable mobile applications to implement their own adaptation actions down to the system level, a middleware layer would also provide programmable and generic system services for applications. We have developed a context-aware mobile middleware that sits between mobile applications and the operating environment. Issues arise when shifting adaptation actions from mobile applications to a middleware. 1. How does the middleware convey the information of contexts to mobile applications? It is desirable for the middleware to expose a set of generic interface for context subscription and query. 2. How do mobile applications specify the requirements for middleware services like Type of Service or Quality of Service?
Again, a comprehensive set of abstracted interface needs to be identified for negotiating middleware services. 3. How does the middleware know under what situation to carry out adaptations? It is the specific combinations and parameters of middleware services that best adapt to the context, while meeting requirements of the mobile application. A set of programmable middleware services is also required to support adaptation and automated reasoning. Our system provides a complete and allfeatured infrastructure for generic mobile applications to exercise context-awareness based on an established unified baseline architecture that promotes context-aware computing. Furthermore, in order to handle the huge amount of contextual information, middleware services combinations, and uncertainties in adaptation control, our system incorporates fuzzy logic at two levels. The system provides coarse-grain service adaptation, which delivers the most suitable service under certain policies based on the context, and fine-grained precise adaptation control over specific service QoS. Fuzzy logic is applied to both adaptation control and context reasoning to represent and simplify the input factors for adaptation decisions.
2. Related Work Significant work [2] has been done in definitions and requirements for context-aware computing. Context Toolkit is provided for rapid prototyping but does not provide a generic mechanism. A reconfigurable context-sensitive middleware [6] was proposed to provide adaptive object containers (ADC) for runtime context data monitoring and acquisition. The WebPADS project [1] proposed actively deployable and dynamically reconfigurable service chaining for adapting the dramatic changing contexts in the mobile environment. A fuzzy logic controller comprises of a fuzzification interface, a rule base, a data base, a decision-making logic unit and a defuzzification interface is introduced in [4]. In [5], a control-based middleware framework was
Proceedings of the International Conference on Next Generation Web Services Practices (NWeSP’05)
0-7695-2452-4/05 $20.00 © 2005 IEEE
implemented with fuzzy logic to enhance QoS adaptations of a tracking application. These works were all on adaptation for a single aspect. In [3], researchers have developed fuzzy controlled QoS adaptation services in terms of more generic QoS specification.
3. Systems Architecture We have implemented a middleware infrastructure that supports generic context-aware services for adaptive mobile applications. The middleware layer has both the knowledge of applications, OS and operating environment so that the resources are allocated fairly while meet individual demands and achieving optimal overall system performance. In our implementation, several major system modules cooperating with each other to achieve a high level of context awareness: We have implemented a Context Space, which contains Context Detectors objects and a set of Fuzzy Context Composers, which compose low-level context into higher level representation. Examples of context detectors include wrappers for OS events, communication and computing activity. A Fuzzy Context Composer could monitor all networkrelated detectors and determine the quality of connectivity – good, average or poor. The Middleware Service Space is the execution environment for both Public Middleware Services and Application Specific Middleware Services. E.g. a Web caching and prefetching service is categorized as public; a media transcoding service is applicationspecific. Another module is the Fuzzy Adaptation Engine, which adjusts middleware services according to the current context and the requirements of specific ToS and QoS. The hierarchical adaptation engine functions at two levels: the Fuzzy Adaptation Engine continuously finetunes the quantitative parameters of the middleware services in a closed loop. However when the Fuzzy Engine infers that the ever-changing context does not satisfy ToS or QoS anymore, the current services will be switched to others according to predefined policies in the rule base. The last module is the Middleware Manager Space, which coordinates all aspects of the operations. It contains five system components: The Administration Control component manages the admission of middleware services subscription/unsubscription and ToS and QoS negotiation. For ToS and QoS negotiation, the strategy is based on predictive approach rather than reservation approach. Context Manager controls the runtime environment
for the context space. It coordinates and answers queries. Context Repository Manager maintains the records of all contextual information, based on the predicted future trend of the contexts. The Middleware Service Manager controls the execution environment for both public middleware services and application-specific ones. It coordinates with admission control, and controls the resources for newly subscribed services. The ToS and QoS Enforcer monitors ToS and QoS levels for each mobile application with inputs from the Context Space. When the levels fluctuate beyond the guaranteed margin, the Fuzzy Adaptation Engine triggers the appropriate adaptation control to restore the level. Otherwise the Administration Control would have to re-negotiate ToS and QoS with the affected mobile application. With the above modules, the middleware integrates existing platforms seamlessly in a holistic manner.
4. Service Adaptation Our middleware platform provides facilities for implementing context-aware adaptation. Table 1 lists the examples of contextual information that can be identified by the system. In order for applications to co-operate with the middleware framework, we provide the following features: y An API for tracking the context of resources and provides facilities for notifying the application when certain threshold values are reached. y Facilities for defining QoS parameters for adaptation decisions. Table 1. Examples of contextual information Unit Type Contextual Information Processor CPU type, clock rate, utilization RAM size, free space, Secondary Storage Storage size, free space Network type, capacity, data rate, Network delay, error rate Battery maximum lifetime, Power remaining lifetime Color type, depth, screen Display resolution Audio Type of sound supported OS OS name, version Browser Browser name, version One of major features offered by the middleware is to sense external events, monitor and allocate resources. The adaptation is achieved through a collaborative partnership between the OS and
Proceedings of the International Conference on Next Generation Web Services Practices (NWeSP’05)
0-7695-2452-4/05 $20.00 © 2005 IEEE
individual applications. This strategy characterizes the design space between two extremes. At one extreme, the system provides total transparency. The user can request policy changes from the middleware, e.g. switching from a color display to a black-andwhite display window whenever the bandwidth is low. This policy is implemented in the public middleware services. In the other extreme, each mobile application copes with mobility on it own. This is achieved by defining the application-specific middleware services. In addition to applying fuzzy logic for contextual reasoning, our approach features two-level fuzzy control. Another contribution focuses on applying fuzzy logic. The fine-grain adaptation control maintains QoS of middleware service behaviors within a relatively stable segment while coarse-grain service adaptation makes judgments among policies when drastic context change occurs. A policy is a rule of in what best context the most suitable middleware service will be reconfigured and deployed regardless of any specific mobile applications. We implemented a new fuzzy logic framework to determine this right policy by calculating the Fitness Degree, i.e. the distance measurement between the current context and applicable policies, therefore to adopt the policy with the least distance to the current context while compromising others. So the middleware service delivered based on the policy will best adapt to the current context. The relevant logic in Fuzzy Adaptation Engine is Fitness Function (FF) which is used to calculate the fitness degree as below:
surfs websites. The network bandwidth is ideal and a scheduling service is subscribed to prioritize streaming media than discrete images and texts. However, if the user moves into a tunnel and the bandwidth drops abruptly, with fitness degree measurement a predefined policy which is the best service would be prefetching and caching service instead of scheduling in such a context will be reconfigured and deployed.
FF(SI(current),SR(pij) =
[2] A.K. Dey, et al. "A Conceptual Framework and a Toolkit for Supporting the Rapid Prototyping of ContextAware Applications", anchor article of a special issue on Context-Aware Computing, Human-Computer Interaction (HCI) Journal, Vol. 16, 2001.
1 size _ of ( SR( pi j ))
¦
P (best _ value_ of (ci )) P (value_ of (ci , current))
i 1
where SI(current) is the combination of the current context; SR(pij) denotes Standard Reference which represents a specific combination of the most suitable values of context ci when using policy pij to deliver the service Si; size_of(SR(pij)) represents the number of combinations in SR(pij), μ(x) is the membership function appears for i-th context information; ci denotes the i-th context information; 3 is an empirical weight value to adjust the calculation result of fitness degree. FF is implemented in Fuzzy Engine to measure and compare distances between each policy and the current context to select the right policy to deliver best service. E.g. a 3G phone is playing streaming media. Images and texts are displayed when the user
3
5. Conclusion Our implementation facilitates the development of environmental context reasoning and presentation entities, adaptive system services and context-aware mobile applications. In addition to providing generic adaptation services, we implemented various policies for specific applications to meet various QoS requirements. We have also evaluated a video phone service application with different bandwidth conditions. By performing adaptations with predefined policies for optimal performance, the video application is able to achieve a good performance. Acknowledgments
This project is supported by CERG grant number PolyU 5200/04E of the HKSAR.
6. References [1] S.N. Chuang, A.T.S. Chan, J. Cao, Ronnie Cheung, "Dynamic Service Reconfiguration for Wireless Web Access", Proceedings of the Twelve International World Wide Web Conference, ACM Press, 20-24 May 2003, Budapest, Hungary, pp. 58-67, 2003.
[3] G. Ghinea, G.A. Magoulas, C. Siamitros, “Perceptual, considerations in a QoS framework: a fuzzy logic formulation”, IEEE Fourth Workshop on Multimedia Signal Processing, pp. 353 -358, 3-5 Oct. 2001. [4] J.R. Jang, “Self-learning fuzzy controllers based on temporal back propagation”, IEEE Transactions on Neural Networks, vol. 3 (5), pp. 714-713, 1992. [5] Baochun Li and Klara Nahrstedt , A Control-based Middleware Framework for Quality of Service Adaptations, Technical Report, Department of Computer Science, University of Illinois at Urbana-Champaign, June, 1998 [6] S. Yau, et al, “Reconfigurable Context-Sensitive Middleware for Pervasive Computing”. In IEEE Pervasive Computing, pp. 33-40, July-Sept 2002.
Proceedings of the International Conference on Next Generation Web Services Practices (NWeSP’05)
0-7695-2452-4/05 $20.00 © 2005 IEEE