# 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
### Building Method and Processing Mechanism of the Data Map
#### 4.2.1 Building Method of the Center Ring for Metadata
From inside to outside, the number of nodes in the \(i\)-th line recorded as \(t\_i\), and for the nodes on the \(i\)-th line, the sum of the value of \(X\) coordinate axis and \(Y\) coordinate axis is \(x+y=2\times(n/2+a-(b+1))+i\), at the same time \(x+y<2\times(n/2+a-b)\), \(x\) is from max(\(n/2\), \(n/2+a-(b+1)\)) to \(n/2+a-2\), and \(y\) is from max(\(i-b+2\), max(\(n/2\), \(n/2+a-(b+1)\))) to min(\(i+b-2\), \(n/2+a-2\)). Thus, the shortest distance sum from all nodes in IR-1 to the center ring node is \(D_{IR\_1}=\sum_{i=1}^{b+2}t\_i(\text{mod}(i,2)+\text{fix}(i/2)\times\sqrt{2})\). The number of nodes in area IR-2 is obtained when the number of all nodes in IR is subtracted from the number of nodes in IR-1. The distance of the nodes in the opposite side along the horizontal or vertical direction is respectively 1, 2, 3, and so on. Because the size of the IR-1 will affect the size of the IR-2, it is necessary to discuss the distance sum from nodes in IR-2 to the center ring nodes according to the size of the IR-1 region. Figure 5a shows the case where center node does not have a location in IR-1:  
1. IR-2-1 is below the diagonal line in IR-2, and \(D_{IR\text{-}2\text{-}1}\) represents the shortest distance sum from the nodes (excluding the nodes on diagonal line) in this area to the center ring nodes. Then, \(D_{IR\text{-}2\text{-}1}=\sum_{i=1}^{a-1}(a-i)t\_i\). Where the number of nodes in this area are recorded as \(t\_i\), the values of the \(X\) coordinates axis are \(x=n/2+i\), and for the \(Y\) coordinates axis \(y<n/2+i\). 2. The distance from the center node to the center ring is \(D_{IR\text{-}2\text{-}2}\), with the value \(a\). 3. The \(n_{IR\text{-}2\text{-}3}\) is the number of nodes (excluding the center point) on the diagonal line \(Nl\). The shortest distance sum from them to the center ring node is recorded as \(D_{IR\text{-}2\text{-}3}\). Then, we find that \(D_{IR\text{-}2\text{-}3}=\sum_{i=1}^{n_{IR\text{-}2\text{-}3}}(a-i)\). 4. IR-2-4 represents the area of center node in the vertical (or horizontal) direction (excluding the center point). \(D_{IR\text{-}2\text{-}4}\) represents the distance sum from those nodes in this area to the center ring nodes. As a result, we can find that \(D_{IR\text{-}2\text{-}4}=\sum_{i=1}^{a-1}(a-i)\). Combined with the above analysis, the distance sum \(D_{IR}\) from the nodes in the internal area to the center ring nodes is shown as Equation (3):  
\[D_{IR}=4\times D_{IR\text{-}1}+4\times[2\times D_{IR\text{-}2\text{-}1}+D_{IR \text{-}2\text{-}3}-D_{IR\text{-}2\text{-}4}]+D_{IR\text{-}2\text{-}2} \tag{3}\]  
Figure 5b shows the case where IR-1 contains the center node:  
1. For IR-2-1, the number of nodes in the horizontal and vertical direction is \(a-b+1\), and the distance sum is \(D_{IR\text{-}2\text{-}1}=\sum_{i=1}^{a-b+1}i(a-b+2-i)\). 2. IR-2-2 represents the area of center node in a vertical (or horizontal) direction (excluding the center point) and belongs to the area IR-2. The number of nodes is \(a-b+1\), and its distance sum is \(D_{IR\text{-}2\text{-}2}=\sum_{i=1}^{a-b+1}i\). 3. D\({}_{IR\text{-}1\text{-}1}\) indicates the distance from the center node to the center ring node, and then there is \(D_{IR\text{-}1\text{-}1}=\text{mod}(b+2\text{,}2)+\text{fix}((b+2)/2)\). 4. IR-1-2 represents the area of center node in vertical (or horizontal) direction (excluding the center point) and belongs to the area IR-1. The number of nodes in this area is \(2b-a\). The distance sum from those nodes to the center ring node is \(D_{IR\text{-}1\text{-}2}=\sum_{i=1}^{2b-a-1}\text{mod}(2b-a-1-i,2)+\text{fix} ((2b-a-1-i)/2)\times\sqrt{2}\).