## 2 SRD Model Based on TDOA Algorithm  
The TDOA algorithm is calculated by locating the difference in timestamps between the signal sent by the tag and the signal received at each base station [13]. Based on the knowledge of mathematical geometry, it is known that at least three distance differences are required to determine the position of a point in three-dimensional space. The trajectory of a dynamic fixed point at a distance difference from two base stations is a hyperbola [14,15]. The schematic diagram of the TDOA localization algorithm is shown in Figure 1.  
UWB positioning tags send a UWB signal to the outside, and all base stations within the wireless coverage range of the tags will receive the wireless signal. The distance between the tags and different UWB positioning base stations is different, and the time nodes at which different base stations receive the signal of the same tag are different, thus obtaining an \"arrival time difference\". There is a target M with coordinates \((x,y,z)\) and four base stations, which include one primary base station and three secondary base stations with coordinates \((x_{i},y_{i},z_{i}),i=1,2,3,4\). The distance \(d_{i}\) from the target M to each base station is written as follows (1):\[d_{i}=\sqrt{\left(x-x_{i}\right)^{2}+\left(y-y_{i}\right)^{2}+\left(z-z_{i}\right) ^{2}} \tag{1}\]  
In this way, three or more localization base stations are required to determine the location of the target to be measured [16]. \(d_{i,1}\) represents the difference in distance from the target M to the primary base station, and each of the secondary base stations is defined as follows (2):  
\[d_{i,1}^{2}=\left(d_{i}-d_{1}\right)^{2} \tag{2}\]  
where \(d_{1}\) represents the distance from target M to the main base station as \(d_{1}=\sqrt{\left(x-x_{1}\right)^{2}+\left(y-y_{1}\right)^{2}+\left(z-z_{1} \right)^{2}}\). Because it is too complex, the calculation process of the localization algorithm is based on the squared-range-based least squares method. The SRD is simple to calculate and has strong stability. In conjunction with the SRD model, Equation (2) is rewritten in vector form as follows (3):  
\[\hat{\mathbf{d}}_{i,1}^{2}=\left.\left(\mathbf{d}_{1}^{2}-\left|\left|\mathbf{x}-\mathbf{d}_{ i}\right|\right|_{2}\right)^{2}\right. \tag{3}\]  
where \(||\bullet||\) denotes the \(\bullet\) Euclidean distance to be obtained. In this study, only planar coordinates are considered for UWB indoor localization in conjunction with the characteristics of the selected indoor environment. The least squares method could be used to solve the hyperbolic nonlinear system of equations using the TDOA method [17]. Equation (3) can be equated to the following constraints (4):  
\[\min\sum_{i=2}^{4}\left(2\mathbf{d}_{i}\mathbf{x}-||\mathbf{x}||^{2}+\mathbf{d}_{1}^{2}-||\bm {d}_{i}||^{2}\right)^{2} \tag{4}\]  
where \(\mathbf{x}= \begin{bmatrix}x\\ y\end{bmatrix} \). Letting \(\mathbf{A}= \begin{bmatrix}2d_{2}&-1\\ 2d_{3}&-1\\ 2d_{4}&-1\end{bmatrix} \), \(\mathbf{b}= \begin{bmatrix}||\begin{matrix}d_{2}\\ d_{3}\\ d_{4}\\ \end{matrix}||_{2}-d_{1}^{2}\\ |d_{4}||_{2}-d_{1}^{2}\end{bmatrix} \), the above problem can be written as follows (5):  
\[\min||\mathbf{Ax}-\mathbf{b}||^{2} \tag{5}\]  
The residuals of the function are \(\mathbf{\varepsilon}=\mathbf{Ax}-\mathbf{b}\). Then, the formula for the sum of squares of the residuals of the function is defined as follows (6):  
\[f(\mathbf{x})=(\mathbf{Ax}-\mathbf{b})^{2}=(\mathbf{Ax}-\mathbf{b})(\mathbf{Ax}-\mathbf{b})^{\mathrm{T}} \tag{6}\]  
Figure 1: Schematic diagram of TDOA algorithm. Deriving both sides of the above Equation (6) with respect to \(\mathbf{x}\), the position coordinates of the target to be measured can be obtained, as shown in Equation (7):  
\[\mathbf{x}=\left(\mathbf{A}^{\mathrm{T}}\mathbf{A}\right)^{-1}\mathbf{A}^{\mathrm{T}}\mathbf{b} \tag{7}\]  
In practice, the measurement error is constantly changing.