
and analyzing CPNs named Design/CPN (Jensen and
al, 1999). We have used the resulting model consid-
ering logical and timing constraints for both data and
transactions.
This paper is organized as follow: in Section 2 we
describe the sensor networks and its limitations due to
the existing approach. We show, also, characteristics
of the new architecture, to (Chen et al., 2001; Bonnet
and Seshadri, 2000), for these networks. In Section 3,
we detail the modelling for a real-time database appli-
cation for the sensor network. In Section 4 we show
the model analysis. Finally, in Section 5 conclusions
are presented.
2 SENSOR NETWORKS
The modern sensors are capable of storing and pro-
cessing local data, as well as transferring these data.
Thus, the processing can be made in the sensor net-
work, reducing the use of energy and the data traf-
fic and, consequently, increasing the network life time
(Bonnet et al., 2000).
A sensor network consists on a great device num-
ber connected through communication interfaces that
can be communicated between itself through network
protocols. Each sensor have limited capacity of stor-
age and processing, or either, a sensor has a purpose-
general CPU to process and storage small space to
save programs code and data.
The sensors are not always fixed in an infrastruc-
ture, being power through batteries, making the en-
ergy economy an important task. The communication
consumes much more energy than processing, becom-
ing attractive to reduce the amount of the data flow
between knots by local processing. One another con-
sideration in sensor networks is that knots can inhabit
in hostile environments, what requires a robust sys-
tem for the fast recovery case happens imperfections
(Bonnet and Seshadri, 2000; Bonnet et al., 2000).
The sensors transactions possess time labels. Its
values must be frequently update, since sensors data
become invalid due to the timing constraints. Long-
running query, that periodically recomputation the
sensors transactions results, are a possibility to keep
these update results.
In sensor network, users typically ask three kinds
of queries, (Bonnet and Seshadri, 2000): Histori-
cal queries: these are typically aggregate queries
over historical data obtained from the device net-
work. Snapshot queries: these queries concern the
device network at a given point in time. Long-running
queries: these queries concern the device network
over a time interval.
The warehousing approach represents the state of
the art (Bonnet et al., 2000). The queries processing
on the extracted data of the sensors and the access to
the network are two distinct stages. The sensor net-
work is simply used to collect data. The query mech-
anism proceeds in two steps. First, the data are ex-
tracted of the devices of a form predefined and stored
in a database server. Second, the queries process-
ing are accomplished in the server. This approach
is appropriate to answer query predefined on histor-
ical data. Some disadvantages are visible, such as:
(1) waste of valuable resources for transferring great
amounts of data for the server, where many of these
data are irrelevant and (2) it is not appropriate to an-
swer snapshot and long-running queries.
Considering the disadvantages mentioned in the
warehousing approach and the increase of the sup-
ported functionalities for the sensor, a new approach
is being proposed for these networks. Called ap-
proach distributed (Bonnet and Seshadri, 2000), this
allows that some queries can be processed in the own
device and, also, that the database system to control
the resources that are used. It is primarily targeted
at snapshot and long-running queries; in addition ag-
gregate queries over historical data could be evaluated
against materialized data stored on some devices in-
stead of a centralized server (Bonnet et al., 2000). In
our work, we adopt this approach.
3 RTDB MODEL FOR SENSOR
NETWORKS
In this Section, we describe a model in Coloured Petri
nets of real-time database for sensor network. For
the modelling we use the coloured Petri nets (CPN)
(Jensen, 1997) due to the fact that they offer an envi-
ronment uniform for modelling, formal analysis and
simulation of discrete events systems, allowing to a
simultaneous visualization of its structure and behav-
ior.
In the model, we consider two sensors, two up-
date transactions, a query transaction and a server
database object. The sensors acquire the data of the
environment, store and transmit the data for the server
database object. This consequently reduce the data
flow in the network and the energy waste. The server
is updated in order to allow that historical query are
accomplished, a time that is not possible to store all
the data in the sensor for a long period of time. Is
important to observe that the sensor data are always
more current than the server data. This difference
happens due to the delay that exists between an ac-
quisition of the data, for the sensor, and the update of
this data in the server.
We show the components that form the model. We
illustrate each one, considering the notation of Petri
nets, where the states (places) are represented by cir-
ICEIS 2004 - DATABASES AND INFORMATION SYSTEMS INTEGRATION
600