The Design of Net Database based on WSN

时间:2022-09-28 12:00:42

Abstract: This paper first analyzes the basic concept and characteristics of wireless sensor network database, and introduces the key technology of wireless sensor network database theory. Then the paper analyze database based on wireless sensor network, and design and implement wireless sensor network database TaraxDB, this design can receive, parse the client query and response. Achieved between the client and the database of the sensor network to send queries and receive data, receiving queries and submit data between the client and the user database. The research content mainly includes the function composition of database and network node, and to complete the key technology of query between nodes cooperate.

Keywords: wireless sensor network; database; query process

0 The basic concept and characteristics of WSN database

Many people generally believed that as long as the acquisition of wireless sensor network data in database let users can be treated in the same way for sensing data like using the usual database management system and data acquisition system. However, compared with the traditional data object database management, data wireless sensor network has many new features. First of all, the perception data only perceived material sampled at discrete time domain and space domain, as shown in the diagram, it is difficult to directly respond to complex data query; secondly, wireless sensor network data transmission and high packet loss rate, sensor of frequent node failures, network topology changing, so the perception data obtained is incomplete and inaccurate; furthermore, the wireless sensor network coverage, high density, will produce the redundancy in the time domain and space domain on the perception of huge amounts of data, the data scale is far beyond the traditional database. Therefore, the wireless sensor network, data acquisition system, query processing should contribute to the complex data, can forecast information measurement data, identify abnormal loss or measuring points, can effectively remove the redundant content aware data, reducing the need for storage and transmission of data scale. Obviously, the perception of data management and processing technology is an important and critical task efficient sensor network. But so far, the perception of data management and processing technology is not enough, there are many problems to be resolved. Research on data management and processing technology of perception is a new task and challenge facing the field of database, but also provides new opportunities for the database community.

2 Research on the key technology of wireless sensor network database theory

Because of the sensing data has a series of unique properties, so the traditional database management systems are not suitable for sensor data management, which requires a sensor data management technology newly to assume this mission. The database system of wireless sensor network management is from the sensor data acquisition to the whole process of sensing data query. These will be in the following several aspects to research on theory and technology of sensor database.

(1) Current algebra research

As relational algebra is a foundation of relational database system, to build a sensor database system, must also be a complete algebraic system based on. The sensor data is essentially a data stream, to fully examine the structure of the current algebra on demand based on sensor query. When constructing stream algebra operation, the traditional relationship is a must. At the same time, because of the characteristics of sensor query, also need to express temporal and spatial query.

(2) The study of query optimization

In a relational database, query optimization is to evaluate a query plan based on overhead in the expression; this method has achieved great success in relational database. However, in the sensor database, data is data-flow to access, we cannot know in advance the expression (the data as table tuples), which makes the query optimization method is meaningless. At the same time, the data stream system we are more concerned about the output rate of a query plan results, rather than a query plan cost. Because in the data stream processing, user queries are often persistent, results are continuously generated.

(3) The study of query execution

Data is static in traditional database, the operation of the database is pulled from the static database “(pull)” data, while in the data stream environment, data is automatically generated from the data source, the data is “push (Push)” at the same time, sensing device storage is generally limited, all these make sensor based query execution than traditional relational operations are very different. Some operations in a relational database, for example, selection and projection, no change can apply in data stream environment, some other operations cannot be used directly, for example the aggregation function and sorting.

3 Classification of sensor network database

(1) The centralized structure

Method of data collection in wireless sensor networks is easiest to send data acquisition of each sensor data to the base station (Base Station), the base station is offline (Off-line) analysis, sensor nodes for data without any treatment, simply send or forward sensing data. The centralized structure, query aware data and sensor network access is relatively independent.

(2) The semi distributed structure

The current sensor in general have a certain degree of computing and storage capacity, therefore, some computations can be performed in the original data, which promoted the development of the semi distributed model. In the semi distributed model, sensor data is gathered into a record (instead of the original data), and then is transmitted to the central server for query processing, further. At present, most studies have focused on the semi distributed model.

(3) Distributed structure

Because the distribution of node, data may be stored in distributed database system and query technique to.

(4) Hierarchical structure

Literature [2] presented a hierarchical structure; this structure contains two level sensor network layers and the network layer. And the integration of network data processing, adaptive query processing and query based on content etc..

4 Analysis and design of WSN client

Architecture of wireless sensor network database is as shown in Fig. 2, the sensor network on all data in an infinite length relationship in table sensors. In the database client, application submitted data query, the query language with standard SQL language, called SQL, this process and the operation of the database, then the database client will query request issued to each node of wireless sensor networks, each node in the query, produce corresponding results in each period, the query is returned to the client a result to the database, database client will be responsible for the data assigned to the application.

4.1 Query processing

Figure 3 is a schematic diagram of the client query processing; these functions are realized by Java code. Application to the database client submits a query, through analysis, optimization, the query is sent to the wireless sensor networks, all the nodes in a routing tree, each node has only one parent node, the query results back along the routing tree, from the leaf nodes through intermediate nodes, step by step to complete the transaction, finally received by the database client, notify the application processing.

4.2 Interact between clients and wireless sensor networks

Wireless sensor network operating system exchange with the data under network layer, because the physical connection and wireless sensor network is accomplished through DART interface of computer serial port and nodes, so below a layer of data exchange message needs to be converted into a message (Packet) to send and receive, and also need proper protocol to ensure that a message receiving and transmitting stable and reliable.

Specific implementation details as follows: Class “MoteIF” package and convert sending and receiving data, it has two members object "sender" and "receive" to complete transform of message and the packets, but also encapsulates a specific data source "PhoenixSource", "PhoenixSource" inherited from the data source "PacketSource" (of this class to achieve reliable communication with the computer serial port or TCP/IP SOCKET between packets), and has automatically add and delete messages in which the characteristics. The database is an event-driven database system, so in the course of these two data communication without exception, also used the event listener mechanism, from the top layer of view, "TaraxDBNetwork" object to "MoteIF "registered listeners become "QueryResuItMsg" or "UartMsg" the listener when a message is received, the event "MessageListener" trigger, "messageReceived" method to achieve it is called; from the layer below it, when the object receives the packet receive event "PacketListenerlF" trigger, "packetReceived" methods it implements is invoked. The two layers of data transmission and reception process shown in Figure 4.

Since the sensor between the client and the network database system, and all the nodes on the network communicate by message passing, and then define the various types of messages on the database system, representing different meaning. For the same type of message at the node and were used nesC structure and Java class represents the client, in order to maintain this consistency, use the Message Interface Generator (MIG) software tools to achieve the transformation of the structure and the Java class represents nesC. And attached a flexible read and set the message for each member variable method, which can reduce re-parse the message format customized programming burden. Figure 4 four message classes, a parent of three sub-classes respectively correspond nesC end node data structure, the parent TOS MSG Message used to send a message, send a query for the three sub-classes respectively, receive the results of and commands sent.

5 Constructions

We analyzed the data architecture and implementation techniques of a wireless sensor network that queries the database. Wireless sensor network databases are becoming a hot research field of the database. With the support of the database, you can better promote wireless sensor network applications. Text of this architecture has good scalability; better data can also be integrated into the processing algorithms.

Reference

[1]J Hill, D Culler.Mica:A Wireless Platform for Deeply Em bedded Networks[J]. IEEE Micro, 2002, 22 (6) :12224.

[2]V Raghunathan, C Schurgers, S Park,et al. Energy2Aware Wireless Micro sensor Networks [J]. IEEE Signal Processing Magazine, 2002,19(2):40250.

[3]Samuel Madden, Michael J Franklin, Joseph M Hellerstein, et al.TAG:A Tiny Aggregation Service for Ad2Hoc Sensor Networks[A].Proc of the 5th Annual Symp on Operating Systems Design and Implementation (OSDI)[C].2002.

[4]University of California at Berkeley. TinyOS[EB/OL].http://webs.cs.berkeley.edu/tos,2004205.

上一篇:Research on the Challenges and Strategies o... 下一篇:Discussion on the Significance and Paths of...

文档上传者