## 3 Base Station Deployment and Self-Optimization Positioning Method  
### Trilateration Positioning  
Based on various sensors, numerous positioning technologies have been developed to date, such as GPS positioning [8], visual SLAM positioning [9], UWB positioning [10], and acoustic positioning [11]. On the geometric algorithm level, there are currently methods such as trilateration algorithms, maximum-minimum algorithms, and maximum likelihood algorithms [12]. Due to the low computational complexity and relatively good positioning accuracy of the trilateration positioning algorithm, this paper adopts the trilateration positioning algorithm to calculate the coordinate information of the mobile terminal. The trilateration positioning algorithm is an algorithm based on geometric principles. It performs positioning calculations based on the distances from at least three known coordinate nodes to the target node. The principle is illustrated in Figure 2.  
Figure 1: Curve of acoustic distance measurement error with distance variation. Assuming there are three nodes with known coordinate information distributed across the map, their coordinates are denoted as \((x_{1},y_{1})\), \((x_{2},y_{2})\), and \((x_{3},y_{3})\). Let the coordinate information of the target node be \((x,y)\). The distances from the target node to each of the known nodes are  
\[d_{i}=\sqrt{\left(x-x_{i}\right)^{2}+\left(y-y_{i}\right)^{2}} \tag{2}\]  
Circles are drawn with the known nodes as centers and the distances from the target node to the known nodes as radii. In theory, the three circles should intersect at a single point, which is the coordinate of the target node. The equation for the trilateration algorithm is  
\[ \begin{cases}\left(x-x_{1}\right)^{2}+\left(y-y_{1}\right)^{2}=d_{1}^{2}\\ \left(x-x_{2}\right)^{2}+\left(y-y_{2}\right)^{2}=d_{2}^{2}\\ \left(x-x_{3}\right)^{2}+\left(y-y_{3}\right)^{2}=d_{3}^{2}\end{cases}  \tag{3}\]  
By transforming and converting Equation (3) to obtain Equation (4), the coordinate information of the target node \((x,y)\) can be directly solved for  
\[ \begin{bmatrix}x\\ y\end{bmatrix} = \begin{bmatrix}2(x_{1}-x_{3})&2(y_{1}-y_{3})\\ 2(x_{2}-x_{3})&2(y_{1}-y_{3})\end{bmatrix} ^{-1} \begin{bmatrix}x_{1}^{2}-x_{3}^ {2}+y_{1}^{2}-y_{3}^{2}+d_{3}^{2}-d_{1}^{2}\\ x_{2}^{2}-x_{3}^{2}+y_{2}^{2}-y_{3}^{2}+d_{3}^{2}-d_{2}^{2}\end{bmatrix}  \tag{4}\]  
However, it can be anticipated that in most cases, due to the inaccuracy of ranging results, the three circles may not intersect or they may intersect to form a closed area [13], leading to poor positioning accuracy. To address this issue, [PERSON] et al. [14] proposed an N-times trilateral centroid weighted localization algorithm (NTCWALA). This method involves multiple measurements of the same target coordinates, assigning weights to the measured coordinates each time and then using the weighted average to filter out target coordinates that differ significantly from the weighted average. Finally, a weighted average is taken of the remaining target coordinates, which is used as the coordinate of the target node. This method improves positioning accuracy at the expense of increased time. [PERSON] et al. [15] used the Fang algorithm to determine the coordinates of the positioning target, but the Fang algorithm, which has an analytical solution, is prone to producing dual solutions, and its positioning accuracy significantly decreases when there is a large error in a measurement value. [PERSON] et al. [16] used the least squares positioning algorithm to determine the position of the positioning target, which is simple to implement but tends to yield suboptimal solutions with room for improvement in accuracy. [PERSON] et al. [17] suggested that increasing the number of measurement nodes can improve the precision of ranging measurements, but this would correspondingly increase costs. Figure 2: Trilateration positioning principle.