CAMPUS: A Context-Aware Middleware

2 downloads 0 Views 163KB Size Report
We are developing CAMPUS which is a context-aware middleware ... paper, we define a context model employing on a fuzzy set theory to deal with the context ...
CAMPUS: A Context-Aware Middleware Kenji Hisazumi,1 Tsuneo Nakanishi,1 2 3 Teruaki Kitasuka,1 Akira Fukuda,1 3 {nel, kitasuka, tun, fukuda}@f.csce.kyushu-u.ac.jp Tel, Fax: +81(92)583-7625 Address: 6-1 Kasuga Koen, Kasuga, Fukuoka 816-8580, Japan. Graduate School of Information Science and Electrical Engineering, Kyushu University1 . System LSI Research Center, Kyushu University2 , Computing and Communications Center, Kyushu University3

Abstract In recent years, many researchers have been investigating wearable computer applications. These wearable applications are required to have context-awareness. The middleware which eases to develop context-aware applications is required, since to implement the context-aware application is very messy. We are developing CAMPUS which is a context-aware middleware to ease construct context-aware applications. The context model employed by CAMPUS should be defined formally. It should be able to deal with a context with its quality of the context simultaneously and deal with a transition of situations. In this paper, we define a context model employing on a fuzzy set theory to deal with the context and its quality of context. The context model also can deal with the transition of situations represented with the context free language.

1 . Introduction In recent years many researchers have been investigating wearable computer applications[1][4]. These wearable computer applications should help the user automatically to apprehend the user situation using some datasources such as sensors, namely they should have context awareness. The context means environment states, for example location information, values obtained by sensors, status of computing environment, information in storages and derived information from them. It improves user-friendliness of applications to change application behavior depending on the context. The middleware which eases to develop context-aware applications is required, since to implement the context-aware application is very messy. We are developing CAMPUS which is a context-aware middleware to ease construct context-aware applications. We should model the context formally to antecede developing the middleware. In this paper, we propose the context model defined formally. The model can deal with a context and quality of the context. It also can deal with a transition of the contexts.

2 . The CAMPUS Overview In this section, we describe the CAMPUS overview. We are developing the CAMPUS which eases to develop contextaware applications. The system employing the CAMPUS consists of many datasources, such as sensors and databases, the CAMPUS and context-aware applications which uses context information derived by CAMPUS. The CAMPUS can deal with datasources connected via networks, such as information services on the Internet, sensors in environments, etc. The context model of the CAMPUS has two layers, the real-time context deriving layer and the transitive context deriving layer. The transitive context deriving layer is on the real-time context deriving layer. The real-time context deriving layer derives a context based on a function using some datasources. The function is defined by the application and it is stateless. We consider this layer in Section 3. The transitive context deriving layer deals with continuous transition of the context. We describe this layer in Section 4.

1

Application

Application

Application

CAMPUS

Database

Sensors

Network

DB

Sens ors

Figure 1. The CAMPUS overview

3 . The Real-time Context Deriving Layer In this section, we describe the real-time context deriving layer which derives a context based on predefined function and deals with quality of context. First, we consider the model of the quality of context. The context-aware middleware derives a context using many datasources such as sensors, databases, etc, and notifies the context to the application. The properties of these datasources are different individually, and these properties is variable momentarily. For example, accuracies of datasources are different, and the freshness of the datasource is decreasing momentarily. The middleware derives a context using datasources which have these properties. The application do not know whether the context derived by the middleware is trustable or not. A need for dealing with the quality of the context, refereed as QoC in this paper, is designated by some researchers. Some QoC models are proposed [3][5]. However, these QoC model are not discussed with deriving the context and are not defined formally. We propose a context model employed the fuzzy set theory to deal with a context and its QoC simultaneously. The model is defined formally. The real-time context deriving layer realize this model. In the followings, we describe how to represent the context reflected on QoC, and how to derives the context using that representation.

3.1 . Introduce Fuzzy Set Theory In this subsection we describe an outline of the fuzzy set theory and introduce a fuzzy set theory to represent the context and its QoC. The fuzzy set theory extends a normal set to a fuzzy set. In a normal set every element is either a member or non-member of a set. On the other hand an element in a fuzzy set can be a member of the fuzzy set at a certain degree. We have a fuzzy set denoted by S. An element, denoted by x, is a member of S at g degree. The degree of belonging to the fuzzy set is referred to as grade. The grade is between 0 and 1. When the grade of an element is 0 or 1, the element is not belonging, the element is belonging to the set, respectively. x is not also belonging to S at 1 − g degree. The fuzzy set S is characterized by membership function µ(x) which represents a grade of x. In the fuzzy set theory many operations are defined as same as normal set. To distinguish a fuzzy set and a normal set, a normal set referred to as a crisp set. Next, we consider a context represented with a fuzzy set reflected QoC. To deal with a datasource without considering QoC is as equal as dealing with a datasource as certain datasource. The data reflected QoC information become uncertain data at a certain degree. For example we explain freshness which is one of QoC. Data obtained immediately is 100% certain data. A certainty of the data, elapsing a certain time since obtaining, one decreases. On obtaining the location of a user, the user is located at the location surely. After a certain time the location is uncertain, because the user may move anywhere. 2

grade 1 0.8 0.6 0.4 0.2 18

20

19

21

temp

Figure 2. Fuzzification of temperature sensors

We represent data of the datasource as a fuzzy set. An element of the fuzzy set is data from the datasource. A grade of that element is a truthfulness of the element. The truthfulness of the element is calculated from QoC. After representing data as a fuzzy set using data from the datasource and QoC, we operate fuzzy sets from some datasources under the fuzzy set theory to derive contexts. At last, we translate a context represented as a fuzzy set to a certain data which can be dealt with by an application, and the application changes its behavior using the data. In this concept, we can deal with context and its QoC simultaneously in a uniform manner.

3.2 . Fuzzification the Datasources We should fuzzify data from the datasource to a fuzzy set appropriately to operate context data and QoC simultaneously. In this section we consider fuzzification of the datasource. The fuzzy set representing a context should be reflected on some kind of QoC: Coverage, Resolution, Accuracy, Repeatability, Frequency and Timeliness. Moreover, a context should be reflected on trustability in a pervasive computing environment which has many datasources in that environment, because we do not know whether a datasource, especially in a public space, is trustable or not. To represent a context reflected on various QoC as a fuzzy set, we operate as follows: we define a membership function reflecting on each QoC, and we multiply these membership functions by the data. We describe the fuzzification using temperature sensors for instance. We have temperature sensors t1 , t2 . There are in a same room and we can obtain data of them via a certain network. The accuracy of t1 and t2 is 2 degrees and 1 degrees respectively. Figure 2 shows fuzzy sets fuzzified from ti and t2 , when t1 and t2 marks 19 degree and 20 degree. We fuzzify that higher accuracy data are more truthful than lower accuracy data. Figure 3 shows fuzzy sets fuzzified t1 reflected on target location. This figure shows transients of fuzzy sets among a beeline between t1 and t2 . t1 is located at distance 0 and t2 is located at distance 10. Distance of them is 10. Distance less than 0 and more than 10 is out of the room. In this figure the truthfulness of the datasource at a certain location is monotonic decreasing function. The truthfulness out of the room is 0 because of meaningless. In the following, we define the fuzzification formally. We have n datasources. Data vi (1 ≤ i ≤ n) from datasources consists of sets of data di (1 ≤ i ≤ n) and vector of QoC qi (1 ≤ i ≤ n). qi is a vector which contains QoC data obtained from datasouces. For instance, qi is {accuracy, resolution, obtained time, sensor location}. The situation of the target is denoted by s. Freshness is a one of QoC changed by the situation of the target s. When we fuzzify a certain data with freshness and coverage, the situation of the target is {time, location}. di and qi is invariable unless the datasources changes. si is changed momentarily. A function ei which encodes the datasources data and QoC to a fuzzy set is shown as follows: φi = ei (di , qi , si ) φi is a fuzzy set reflected on data from vi . ei is defined individual datasources, since properties of the datasources are different individually.

3

0.8 0.6 grade 0.4 0.2 0 17

15 10 18 19 temp

5

distance

20 210

Figure 3. Fuzzified data reflected on target location

3.3 . Deriving the Context In this subsection, we explain how to derive the context. Data from a datasource is encoded to a fuzzy set as described before. We derive a context to operate some fuzzy sets from datasources under the fuzzy set theory. A context ψi (1 ≤ i ≤ m) is shown as follows: ψi = fi (φ1 , . . . , φn , ψ1 , . . . , ψi−1 ) fi is defined using fuzzy set operations. A ψi is also a fuzzy set. All ψi are partially ordered, namely fi is not recursive directly or indirectly. These operations under the fuzzy set theory is similar with the relational algebra. It allows us to consider defining the function fi as same as the query of the relational database, namely we can use modeling techniques of the relational database. In the following, we describe two case of deriving a context, using homogeneous datasources case and using heterogeneous datasources case, for example. In using homogeneous datasources case, we derive a context using some homogeneous datasources. For example, GPS[2], Active BAT[4],WiPS[6], etc are homogeneous datasources of location information. Figure 4 shows a fuzzy set which is a result of algebraic sum of two temperature sensors, for instance. The algebraic sum is defined in fuzzy set theory. We compose some homogeneous datasources like this example. In using heterogeneous datasources case, we derive a context using some heterogeneous datasources. The target can obtain its location. The Figure 5 shows the transient of results of composing temperature sensor t1 ,t2 among beeline between them. We fuzzify t2 as same as Figure 3, and calculate algebraic sum of them. The Figure 6 shows a fuzzy set of which the target is at distance 6. It is a cross section of Figure 5 at distance 6. Figure 6 represents derived temperature at distance 6. We describe how to use these results from the application, in next subsection.

3.4 . Defuzzification of the Context We should translate a context to non-fuzzy data for the application, since the derived context ψi is a fuzzy set. There are two types to translate a context to a application usable data. First one is to calculate representative value. Another one is to calculate similarity between a context and an application defined fuzzy set. To calculate a representative value from a fuzzy set is referred as defuzzification. In generally, we calculate a centroid of the fuzzy set to defuzzification. There is a fuzzy set ψi and the membership function of ψi is µψi , the centroid of ψi is given as follows: R xµψi (x) dx ci = R µψi (x) dx 4

grade 1 0.8 0.6 0.4 0.2 18

20

19

21

temp

Figure 4. A result of algebraic sum of temperature sensor t1 , t2

1 0.75 grade 0.5 0.25 0 17

15 10 18 19 temp

5

distance

20 210

Figure 5. A result of algebraic sum of two temperature sensor reflected on location information

5

grade 0.8

0.6

0.4

0.2

18

20

19

21

temp

Figure 6. Fuzzy set represented temperature at distance 6 (a section of Figure 5 at distance 6) 0.8

0.6

0.4

0.2

18

19

19.5

20

21

Figure 7. The representative value of Figure 6

For example, when the fuzzy set given in Figure 6, the representative value of it is shows as Figure 7. To calculate similarity between a context ψi and an application specified fuzzy set a, the application defines ambiguous context represented by a fuzzy set, and we calculate similarity of them. ψi and a are on a fuzzy universal set U and their membership function is µψi and µa , the similarity s is given as follows: _ s= (µψi (x) ∧ µa (x)) x∈U

W

x∈U ()

is an operation which calculates a max value in (). When ψi and a are given, the similarity is calculated as Figure 8.

4 . Transitive Context Deriving Layer In section 3, we consider how to derive a context and quality of context. In this model, the transition of situations is dealt with hardly, since the model is targeted at snapshot of the context. In this section, we explain the transitive context deriving layer and how to describe the transition of situation. We describe this layer using a scenario called “remindfully umbrella”. Remindfully Umbrella: The Remindfully Umbrella equips a umbrella location sensor, a user location sensor and a weather sensor. The umbrella location sensor senses any one of locations, home, office and outside. The user goes to the office with the umbrella when the weather is rainy. The user may forget the umbrella when goes back him/her home and the weather is fine. The umbrella notifies the user in this situation with sound or light. 6

grade

0.8

0.73

0.6 0.4 0.2

derived context

specified context

1

temp

Figure 8. Calculating a similarity between derived context and application specified context

The remindfully umbrella can obtain situations from the real-time context deriving layer. The set of the concerned situation by the application is {home, office, outside}×{near,far}×{fine, rain}. Situations concerned by the umbrella are: departure with rain = {(home, near, rain)} going to the office = {(outside, near, rain), (outside, near, fine)} arrived at the office = {(office, near, rain), (office, near, fine)} working = {(office, far, rain), (office, far, fine)} go back home with fine = {(office, near, fine)} The context-aware application is in one situation at a same time. If we consider series of these situation as a language, we can deal with and describe the transition of situations under the formal language theory. In formal language theory, languages are classified into the phrase structure language, the context free language and the regular language in order of accepting capability. In the context free language and the regular language, we have effective algorithm of the syntax analysis and tools such as yacc. Therefore, we represents a context by the context free language of which terminal symbols are contexts derived by the real-time context deriving layer to allow to control the application based on the transition of situations. In this layer, the series of situations concerned by the application is given as the nonterminal symbol. For example, the situation in which the user may forget the umbrella is described as follows. Where there is a terminal symbol T , T + is one or more successive T.

Forgettable situation ::= "deperture with rain"+ "going to the office"+ "arrived at the office"+ "working"+ "go back home with fine"+ We discuss the runtime and development environment for the transitive context layer. The transitive context layer needs a syntax analysis engine of context free language to derive the context. Most of syntax analysis algorithms uses a parsing table. Dynamic modification of the series of situation is difficult since to make the parsing table is heavy. However, to restrict modification of the series of situations at runtime is no problem, since most of context-aware application need not modify the series of situation. We propose a context-aware runtime environment cooperated with a development environment. The development environment optimizes parsing table in advance. The transitive context layer equips a syntax analysis engine implemented with the pushdown automaton which accepts context free language. The syntax analysis engine derives a nonterminal symbol concerned by the application to obtain a context from the real-time context deriving layer and shift-reduce parsing at every moment. This layer sends the derived context to the application and controls application behavior. The development environment generates the parsing table given with BNF, etc. The development environment optimizes the parsing table using the BDD algorithm which reduces redundant condition of the parsing table.

7

5 . Conclusion Wearable applications are required to have context-awareness. The middleware which eases to develop context-aware applications is required, since to implement the context-aware application is very messy. We are developing CAMPUS which is context-aware middleware to ease construct context-aware applications. In this paper, the context model employed by CAMPUS is defined formally. CAMPUS can deal with a context with quality of the context simultaneously by representing the context as a fuzzy set. CAMPUS encodes a datasource to a fuzzy set reflected on QoC. CAMPUS can derive a context represented with a fuzzy set under the fuzzy set theory, since many operation are defined in the theory. CAMPUS also deal with a transition of situations by describing it with the context free language. In next phase, we will implement a prototype of the proposed model to confirm its practicability.

References [1] G. Chen and D. Kotz. A survey of context-aware mobile computing research. Technical Report TR2000–381, Dartmouth Computer Science Thechnical Report, 2000. [2] Garmin Ltd. About gps. http://www.garmin.com/aboutGPS/. [3] P. Gray and D. Salber. Modelling and using sensed context information in the design of interactive applications. In Proc. of EHCI 2002, pages 317–335, 2001. [4] A. Harter, A. Hopper, P. Steggles, A. Ward, and P. Webster. The anatomy of a context-aware application. In Mobicom 99, ACM Press, pages 59–68, 1999. [5] K. Henricksen, J. Indulska, and A. Rakotonirainy. Modeling context information in pervasive computing systems. In Proc. of Pervasive 2002, pages 167–180, 2002. [6] T. Kitasuka, T. Nakanishi, and A. Fukuda. Location estimation system using wireless ad-hoc network. In Proc. of 5th International Symposium on Wireless Personal Multimedia Communications, pages 305–309, 2002.

8