# Data Access Based on a Guide Map of the Underwater Wireless Sensor Network
## 4 The DAGM Framework and Method of UWSN Data Storage and Query  
### DAGM Framework and Flow  
In order to decrease the delay of data access and the total energy consumption in UWSN, the framework and flow of the DAGM is shown in Figure 2. The framework is divided into three parts, that are data storage, data map and data query.  
Figure 2: The framework and flow of DAGM. (**a**) The framework; (**b**) The flow.  
Figure 2a shows the data map that is the core of DAGM. The data map includes building the center ring for storing metadata, for metadata diffusion, and for synchronization, as well as data query sentence processing, data transmission routing generation, and so on.  
The procedure of DAGM is shown in Figure 2b. According the basic ideas of DAGM, firstly, the center ring that is composed of different nodes is established. When any node in the center ring receives a piece of metadata, they will merge it into the metadata set that has been stored in this node, and diffuse the metadata to the other node in the center ring along double directions. When all nodes in center ring perform same process, the metadata synchronization is finished. Thus, the data map is formed. When a center ring node receives a data query sentence, the query sentence is split into meta-query sentences. Then, the meta-query will be compared with the metadata in this node. If data is found in the network, the center ring nodes will establish data transmission routing, and return the query result \"_ready to receive data_\" and data transmission routing to user. At the same time, the routing and specific data requests will be sent to the storage node. If there is no data that meeting the requirement in the network, the result \"_query failed_\" is returned to the user.  
Due to the limited energy in the network, and considering that generally sensor nodes work in clusters, we can regard one cluster as a partial area of the network. In the process of data storage, when the arbitrary sensor node \(i\) in an area generates data, the storage node identification number and lattice ID number of this area can be determined by GHT. Then the greedy perimeter stateless routing (GPSR) [47] is adopted to transmit data form sensor node to storage node for storing; at the same time, metadata consisting of content abstract and a storage location abstract could be generated by the storage node. After that, storage nodes will send metadata to the nearest center ring node by multiple hops.  
Data query includes a query strategy and a data-receiving strategy. Under the different times and in different application backgrounds, users require different data granularity and quality of service (QoS) in the network. Sometimes they require original precise data in network, while at times they only require integration data, with types including average, minimum, maximum, and so on. Therefore, the data query sentence includes data types, granularity, QoS, etc., which can decrease redundant data that reduce the delay and energy consumption on communication. In remote data transmission of underwater environment, where the energy consumption is huge, bandwidth is low and error rate is high, so data is transmitted in network to the user by multiple hops according to data transmission routing.