Database Reference
In-Depth Information
clause constrains the sensors affected by the query. “ every ( period )” is a
new expression introduced in COUGAR, indicating a continuous query
where each sensor should return a sample every period of time. As an
example, the query ”every minute, return the abnormal temperatures
(i.e., greater than 40 C ) measured by nodes in the 4th floor” can be
written as follows:
Q3:
SELECT
R.sensor.temperature>40
FROM
R
WHERE
R.S.floor
AND
$every(1 minute)
The first version of COUGAR does not support aggregation queries
based on time windows. For instance, the query “return the average tem-
perature on each floor over the last 10 minutes” cannot be translated into
the above declarative language. Bonnet et al. [27] enhance COUGAR to
support window queries. COUGAR is suitable for both data acquisition
and aggregation in WSNs. However, several applications only require
aggregations, without the raw data. Madden et al. [13] develop TAG
(short for the Tiny AGgregation service) for aggregation in low-power,
distributed, wireless environments. Their goal is to retrieve aggregation
information from the WSNs with low energy consumption. TAG devel-
ops a declarative language for continuous aggregate queries, similar to
COUGAR. Madden et al. [7] introduce another sophisticated system
called TinyDB. Similar to the above two systems, TinyDB allows user
to specify the data collecting manner using a declarative language. It
focuses on reducing the energy cost for acquiring and transmitting data.
The data generated by sensors form a single conceptual table called sen-
sors. Each kind of measurement, e.g., humidity, temperature or light
strength, forms a field in sensors. A tuple contains the samples of differ-
ent measurements acquired by a sensor at a single time-stamp. Newly
acquired tuples are appended at the end of sensor. A query in TinyDB
consists of SELECT, FROM, WHERE and GROUPBY clauses. In ad-
dition, TinyDB incorporates new key words “SAMPLE PERIOD” and
”FOR” to specify the frequency of taking samples and the life time of
the query, respectively. An example of a typical query is as follows:
Q4:
SELECT
nodeid,light, temperature
FROM
sensors
WHERE
SAMPLE PERIOD
$every(1 s)
This query requires the sensors to take samples of light and temper-
ature every 1 second for a period of 10 seconds. Each time a set of
samples is acquired, the sensor should return it to the base station to-
gether with its node id. The results are streams, one for each sensor,
lasting for 10 seconds. They will be finally forwarded to the base station
Search WWH ::




Custom Search