• No results found

3.1.1 Network Model

A sensor network consists of a base station and a set of sensor nodes. Each sensor has multiple sensing capabilities and can sense k types of data. For simplicity, sensors are assumed to have the same sensing range and to consume the same amount of energy, es, per sensing for

the same type of data. Each sensor divides its time into epochs. During each epoch, a sensor only sample data once if needed. It is assumed that time synchronization among sensors can be achieved using schemes like [125]. The coverage requirement specifies a level of coverage required over an area in the field. It is defined per epoch and keeps changing from epoch to epoch. If a coverage requirement lasts more than one epoch, it is repeated through all the epochs in its lifetime. The coverage requirement may arrive at different times within one

q7

epoch1 epoch2 epoch3 epoch4 epoch5 q1,q2 q3 q1 q4 q1 q5 q6

Figure 4: Query example in sensor networks

epoch. Figure4 presents an example scenario of query arrivals.

For each type of data t, the sensing board is either “on” or “off”. Initially, the sensing capabilities are turned off for all sensor nodes when they are deployed in the field in order to save energy consumption. The relevant sensing capabilities at sensor nodes are then turned on or off according to schedules made by the base station for given user queries.

3.1.2 Energy Model

A sensor consumes energy for both sensing and communication. Each sensor, once scheduled to sample the field, must consume energy for sensing and delivering the sensed data back to the base station. In addition, it may also consume energy in order to relay data from other sensors to the base station. Furthermore, to avoid collision, sensors may have to exchange messages for successful data transmissions. These issues, however, are not the focus of this research. Therefore, the energy consumption for message retransmission due to collisions is not considered in our model.

As mentioned above, each sensor consumes es per sensing. A sensor may consume dif-

ferent amounts of energy for message sending and receiving. For simplicity, in the energy model it is assumed that they are the same. Each sensor, once scheduled to sample the field, must also send the sensed data back to the base station. Therefore, it also consumes ec per

3.1.3 Semantic View Definition

Let S = {Si, 1 ≤ i ≤ n} be a set of sensors, ∀Si ∈ S, let D(Si) = {dSij , 1 ≤ j ≤ t}, where

dSij is the type j data sensed by sensor Si. Furthermore, let D = {

S

Si∈SD(Si)} represent

the set of data sensed by the network. Given a group of users, g, a semantic view Vg is now

defined as:

Definition 1. A semantic view Vg =< Dg, Πg >, where Dg is a set of data and Πg is a

set of boolean functions. Πg = {Pgi(), 1 ≤ i ≤ n}. Pgi : D −→ {true, f alse} and Dg =

S

Pg∈Πg{d|d ∈ D and Pg(d) = true}.

Different semantic views may share common interests. The notion “Correlated” is used to define such semantic views.

Definition 2. Given two semantic views, Vgi, and Vgj, Vgi and Vgj are correlated if and only

if Dgi

T

Dgj 6= ∅.

In order for sensors to understand and process semantic views, a set of queries are constructed from a semantic view. Let Q be a set of m queries, Q = {qi, 1 ≤ i ≤ m}, and

the data collected by a query qi, D(qi) = {d|d ∈ D and d satisf ies qi}, the results for Q,

D(Q) then equals to Sq∈Q D(q). Given a semantic view Vg =< Dg, Πg >, a set of queries,

Qg is constructed such that Qg = {q | ∃d ∈ Dg, d ∈ D(q)} and Dg == D(Qg).

The definition of a query is given in the following section.

3.1.4 Query Definition

The following simple declarative language is used to define user queries. The language defines variable, predicate and rule, by which a query is defined.

Definition 3. A variable, V , can be the name of a data attribute sensed by nodes in the network, location of sensors, temporal specification of data sampling or level of coverage requirement.

Definition 4. A predicate, P , is in the format of < V op constant >. “op” is the arith- metical operator, <, >, ≤, ≥, =, or 6=. Each P , specifies a filter on the data to be collected.

Definition 5. A rule, R = (R ∧ P ) || P , is either a conjunction of predicates or a simple predicate.

Definition 6. A query, q, is in the format of AF (V )?R1∨ R2∨ · · · ∨ Rm. AF specifies an

aggregate function on variable V , such as Max, Min, Avg. AF can be null if no aggregation is needed.

The location variable X, Y, Z specifies a location constraint of a query. In other words, a query q is only interested at sensor data in a certain area if a location constraint is given. Otherwise, by default, a query seeks data from all sensors in the network. Another special variable in our query language is Level of Coverage, LoC. LoC enables a user to specify the desired quality of sensing. It enforces that each point in the query q’s target area must be covered by at least LoC different sensors. The default level of coverage is 1 if not specified explicitly.

The temporal variable specifies the interval of query processing. Based on the value of the temporal variable, a user query can be classified into a snapshot query, which is only executed once, or a long-lived query which collects data from the sensor network repeatedly during a specified time period, T , in a specified interval.

A query, q, essentially specifies a set of filters on the sensor data to be collected, in addition to the spatial-temporal constraints and level of coverage requirement. q is eventually mapped to a set of sensor nodes, Sensors(q), whose data meets all the rules in q and the other constraints.

A simple query q in a traffic sensor network can be given as :

W ithinArea(X, Y ) = X ≤ 200 ∧ X ≥ 100 ∧ Y ≤ 200 ∧ Y ≥ 100 F ilter(X, Y, T ) = W ithinArea(X, Y ) ∧ T = 0

q = Avg(Speed)?F ilter(X, Y, T )

The rule “WithinArea” expresses that the potential interesting data are those sensors within a square area from (100,100) to (200,200). T = 0 indicates that this query is a snapshot query. q then shows that the data to be collected should be aggregated as the average speed.