# A GNSS/5G Integrated Three-Dimensional Positioning Scheme Based on D2D Communication
## 2 Methods
### GNSS/5G Integrated Three-Dimensional Positioning Scheme
#### 2.3.1 GNSS/5G Integrated Three-Dimensional Positioning Based on DBSCAN
Besides, as the cooperative nodes and the requesting nodes are ordinary MUs in the network, the positioning method and the signal propagation model for them are the same. Without loss of generality, we firstly focus on MU \(i\) to illustrate the generation of the sample data set before implementing the clustering process. We denote \(p_{i}=(x_{i},y_{i},z_{i})\) as the initial position of MU \(i\), which is inaccurate. The set of the initial positions of all the MUs in the network is \(\mathcal{PI}=\{p_{1},\cdots,p_{i},\cdots,p_{N}\}\). Assume that the nodes, including the BSs and other MUs from which the distance to MU \(i\) is within \(MaxD\), are the reference nodes of MU \(i\), i.e., \(\mathcal{R}_{i}=\{j\in\mathcal{M}\cup\mathcal{N},j\
eq i|d_{ij}\leq MaxD\}\). Then, \(|\mathcal{R}_{i}|\) represents the number of the reference nodes. As any four reference nodes in \(\mathcal{R}_{i}\) can determine the only position of MU \(i\), there are \(a_{i}=C_{|\mathcal{R}_{i}|}^{4}\) positions obtained, which further form the data points in the clustering. These positions are shown as:  
\[\mathcal{K}_{i}=\{pt_{1},\cdots,pt_{l},\cdots,pt_{a_{i}}\} \tag{14}\]  
where \(pt_{l}\) is the position calculated through the \(l\)th combination of the reference nodes. The data points in the clustering are composed of the calculated positions of \(N\) MUs in the network, and accordingly, the data points are shown as \(\mathcal{K}=\{\mathcal{K}_{1},\cdots,\mathcal{K}_{i},\cdots,\mathcal{K}_{N}\}\). Here, we exploit both TOA and RSS measurements to calculate the distance between two nodes, which is probably different. Consequently, the obtained positionsare different. Figure 3: The basic definitions of DBSCAN. We firstly implement two independent clustering process using TOA and RSS measurements, respectively, and then they are integrated through a weighting method. It is obvious that \(\mathcal{R}_{i}\) and \(\mathcal{K}_{i}\) for MU \(i\) are different in these two methods. Hence, as for MU \(i\), we denote \(\mathcal{R}_{t,i}=\left\{j\in\mathcal{M}\cup\mathcal{N},j\
eq i|d_{t,ij}\leq MaxD\right\}\) and \(\mathcal{K}_{t,i}=\left\{pt_{t,1},\cdots,pt_{t,l},\cdots,pt_{t,a_{ij}}\right\}\) for the TOA measurements, and we denote \(\mathcal{R}_{r,i}=\left\{j\in\mathcal{M}\cup\mathcal{N},j\
eq i|d_{r,ij}\leq MaxD\right\}\) and \(\mathcal{K}_{r,i}=\left\{pt_{r,1},\cdots,pt_{r,l},\cdots,pt_{r,a_{ij}}\right\}\) for the RSS measurements. \(a_{t,i}=\mathcal{C}_{|\mathcal{R}_{t,i}|}^{4}\) and \(a_{r,i}=\mathcal{C}_{|\mathcal{R}_{r,i}|}^{4}\) are the numbers of calculated positions for MU \(i\) based on the TOA and RSS measurements, respectively. As a result, the set of the data points in the clustering are \(\mathcal{K}^{\prime}=\left\{\mathcal{K}_{t,1},\cdots,\mathcal{K}_{t,i},\cdots, \mathcal{K}_{t,N}\right\}\) and \(\mathcal{K}^{\prime}=\left\{\mathcal{K}_{r,1},\cdots,\mathcal{K}_{r,i},\cdots,\mathcal{K}_{r,N}\right\}\) for the two kinds of measurements, and the numbers of the data points are denoted as \(DataNum^{\prime}\) and \(DataNum^{\prime}\), respectively. Then, the DBSCAN algorithm is implemented based on the TOA and RSS measurements separately. We take the TOA measurements, for example, and the clustering process based on the RSS measurements is the same. We summarize the DBSCAN based on the TOA measurements in Algorithm 1 as DATM. For further explanation, there are two main steps. Firstly, the positions calculated by the TOA measurements are regarded as the data points in the clustering, and we find the core objects according to \((\varepsilon,MinPts)\), as lines 2 to 7 show. Then, the clusters are formed according to the density of the data points, in which each cluster gather around the position of an MU, as line 8 to 19 indicate. The DBSCAN algorithm based on the RSS measurements is similar to DATM. After obtaining the clustering results based on both of the measurements, the results are weighted according to their variance.