1、1Research on Database Design based on Wireless Sensor NetworkAbstract: This paper analyzes the composition of architecture and sensor nodes in wireless sensor networks, component models running on the nodes embedded operating system and programming model based on nesC. Then, we analyze network datab
2、ases based on wireless sensor, design and implement wireless sensor network database TaraxDB, focused on design and implement the receiving client inquiries, analysis and presentation, send queries and receive results between the database client and sensor networks, database client Receive query and
3、 submit the results between the client and the user. The main feature on the database, including front-end and network nodes, as well as the completion of key technical queries collaboration between nodes. Keywords: wireless sensor network; database; query process 0 Introduction Wireless sensor netw
4、ork database consisting of database that wireless sensor network data collected from the surface, 2allowing users typically use as database management systems and data acquisition systems as processing sensory data on it. However, compared with traditional database management data objects , data -aw
5、are wireless sensor networks have many new features . First, the perception data is only perceived physical phenomena discrete temporal and spatial sampling , it is difficult to respond to complex data queries directly ; Secondly , wireless sensor network data transmission packet loss rate, the sens
6、or node failures frequently changing network topology , so perception of the data obtained are incomplete and inaccurate ; Moreover , wireless sensor network covering domain , the distribution of high-density, will generate a huge amount on temporal and spatial perception data redundancy , data scal
7、e far beyond the traditional database . Therefore, the wireless sensor networks, effective data collection mechanisms should help query processing of complex data , measurement data can identify anomalies , forecast information is lost or measuring point outside , can effectively remove redundant se
8、nsing data content , the need to reduce the size of data storage and transmission . Obviously , data management and research perception is a processing technology to achieve high efficiency of the sensor network is 3important and critical tasks. But so far , aware data management and processing tech
9、nology research are not many , there are a lot of problems to solve. Perception research data management and processing technologies are new tasks and new challenges facing the database community , but also provides new opportunities for the database community . 1 Structure of the sensor network dat
10、abase Sensor network database is to store data (including the list of sensors and their associated attributes, such as location) composite applications and sensor data. Some of the current structure of the sensor network data management system has the following four categories: centralized structure
11、, semi-distributed architecture, distributed architecture, the hierarchical structure. (1) Centralized architecture Data acquisition method of wireless sensor network is to collect data from each sensor and sent periodically to the base station, carried by the base Off-line analysis processing, the
12、sensor node itself and the collection of data without any treatment, simply send or forward-aware data. This centralized architecture, the access network and the sensor sensing the query data is relatively independent. 4(2) Semi-distributed architecture The current sensors generally have certain com
13、puting and storage capacity, and therefore, certain calculations may be performed on the raw data, which promotes the development of semi-distributed model. In the semi-distributed model, the sensor data are aggregated into some kind of record (rather than raw data) , which is then transmitted to a
14、central server for further query processing. Currently, most studies have focused on the semi-distributed model. Representative system Fjord, cornell university Cougar, etc. Berkeley University. (3) Distributed architecture Since the distribution of nodes, you can use the data storage system and the
15、 distributed database query techniques. This model in computing and communications are all carried out on the sensor. This configuration of distributed model is that it assumes that all the sensors have the same conventional computer communications and computing power, it is only suitable for a larg
16、e communication overhead event keyword-based query system. This is at least the current very realistic. (4) Hierarchical structure The structure contains two levels of sensor network layer and the network layer. And the integration of network data 5processing, adaptive query processing and query bas
17、ed on content etc. In sensor networks, each sensor node has a certain computing and storage capacity. Each sensor node to complete the 3 tasks, accept commands from the agency, local computation, the data will be sent to agents, each agent to complete 5 tasks: to accept a query from a user, the sens
18、or node sends control commands and other information, receiving data from the sensor nodes, processes the query, the query results are returned to the user. The agent node received from the sensor node data, a plurality of agent nodes distribution to process the query and returns the results to the
19、user, the computation and communication tasks are distributed to each proxy node. 2 The technology of wireless sensor database Wireless sensor network database data distribute “store“ on each node to establish a connection between the storage nodes via ad-hoc networks, forming a distributed database
20、. Static data on all nodes and dynamic data be into the data retrieval applications. Currently, foreign research in this regard mainly have TinyDB and COUGAR system. Both systems have in common, but TinyDB better account of the energy savings, and the query selection, aggregation, grouping and other
21、 operations have better support. We will combine TinyDB system 6to discuss the design and implementation of wireless sensor network databases. Wireless sensor network database is divided into two parts: one to run the database on the front of the base station, which serves as the application to acce
22、ss the data interface; Second embedded query execution engine running on each node, and the node activity is responsible for the implementation of the query administration. 2.1 The front end design of wireless sensor network database Wireless sensor network front-end database run in wireless sensor
23、network base station, the base station can be PC, can also be a special XScale based Micro server and other equipment. Wireless sensor network database provides a query interface and command SQL like interface to the application, only need to use the SQL language to get interested in the data from t
24、he sensor network. The query language has the following format: SELECT select-list FROM sensorsWHERE where-clause GROUP BY gb-list HAVING having-list EPOCH DURATION integer Figure 1 is the structure of wireless sensor network front-end database. Receive a new SQL query, front verify and interpret th
25、e query according to the metadata, the query content can be saved to a Java object (here we express it in 7Q). Not only records the query field information to search for a list in Q, including field name, type, and records the information role in the field of expression, including aggregation operat
26、ion, the filtering operation etc. Each query is assigned a unique ID, to identify the query and identification data according to the results of the ID in the implementation process. Registered in the query management that verified by the query Q is then transmitted to the sensor network. In the proc
27、ess of sending, Q content will be broken into multiple packets. Subcontracting rules query each field, each expression corresponds to a packet, in addition, each packet needs to include some public information. The communication interface layer calls the appropriate serial communication component se
28、nds these packets to the wireless sensor networks root (or emulator) , after the way the network relay broadcast; Finally, each node will receive packets reorganization, and get the query on the node and complete the inquiry . In front of the structure, the core is a query management, which is respo
29、nsible for sending queries and receiving results, according to the complexity of the query are stored in a different queue. During the execution of the 8query, it receives from the communication interface layer packet different results, after unpacking, analyzing data within the package, extract the
30、 query ID, the new data will be distributed to the corresponding results of queries. There are multiple queries simultaneously executed at the time specified for each query cycle may vary, in order to avoid each query request itself cyclically waiting for data, the results of the query management pr
31、ocess large amounts of data packets, these packets belonging to different queries, query management, data distribution mechanisms to avoid the occurrence of blocking queries. Database front-end also supports the query results are stored in a relational database stored. 2. 2 The realization of wirele
32、ss sensor network nodes To receive and send the query by the front-end database, query execution and data collection by the relevant nodes of the query execution engine. The lightweight query execution engine is responsible for data collection and transmission in the TinyOS operating system support,
33、 cooperative nodes to complete the query aggregation, filtering, grouping and other functions. Node engine consists of several components which are connected, each component provides the function follows the 9interface specification for certain, very low coupling degree. Figure 2 describes the struc
34、ture of the query execution engine node. Data in wireless sensor networks need to get from the database on each node, each node maintains its own separate various attribute data. Data on the nodes can be divided into three categories: one is a constant properties, including the node ID, packet locat
35、ion; introspection second property, such as voltage, time stamp, the parent node in the network topology, etc.; third species is the sensor sensing data. Data Access Components node is responsible for providing a unified interface to access these properties, the internal organization of the componen
36、t attribute node for the data on the table, each record in the table to save the property name, type, and property values. If it is a constant value, then the property value recorded directly; If the amount is property, the record can obtain the corresponding components of the data. Fig.3 is equival
37、ent to a small node data access components within the data repository nodes can effectively according to the appropriate data field names to find and locate. 2.3 Interact with clients and wireless sensor networks 10Wireless sensor network operating system exchange with the data under network layer,
38、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 re
39、ceiving 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 “Ph
40、oenixSource”, “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