## 3 Experiments and Discussions
### Time Retrieval Efficiency
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Algorithm**} & \multicolumn{5}{c}{**Data Volume/Article**} \\ \cline{2-7}  & & \(\mathbf{1\times 10^{2}}\) & \(\mathbf{1\times 10^{3}}\) & \(\mathbf{1\times 10^{4}}\) & \(\mathbf{1\times 10^{5}}\) & \(\mathbf{1\times 10^{6}}\) \\ \hline \multirow{4}{*}{Haversine} & Calculation time & 0.0101 & 0.0573 & 0.5111 & 5.0309 & 55.2705 \\  & Screening time & 0.0040 & 0.0359 & 0.3609 & 3.6078 & 39.1666 \\ \cline{1-1}  & Sorting time & 0.0002 & 0.0144 & 1.9463 & 213.9144 & 25,008.8553 \\ \cline{1-1}  & **Total time** & **0.0143** & **0.1076** & **2.8183** & **222.5531** & **25,103.2924** \\ \cline{1-1}  & Processing time & 0.0044 & 0.0363 & 0.3618 & 3.6651 & 36.7658 \\ \cline{1-1}  & Screening time & 0.0041 & 0.0371 & 0.3560 & 3.7008 & 36.6822 \\ \cline{1-1}  & Sorting time & 0.0005 & 0.0021 & 0.0503 & 5.0226 & 1300.2213 \\ \cline{1-1}  & **Total time** & **0.0090** & **0.0755** & **0.7681** & **12.3885** & **1373.6693** \\ \hline \hline \end{tabular} Note: The time unit is seconds. Calculation time means the time spent on calculating the actual geospatial distance between the ship in distress and other ships in the current sea area. Screening time is spent screening the ships available for rescue in the current sea area according to the adequate rescue time and effective rescue distance. Sorting time is spent sorting the ships available for rescue according to the distance from the ship in distress. Processing time is the time spent processing the grid codes of other ships in the current sea area according to the code level corresponding to the adequate rescue time and effective rescue distance. Comparison of the time efficiency of the two methods is based on the bold content.  
\end{table} 
Table 6: Haversine and Google S2 data retrieval times (unit: s) for different volume levels. Figure 6: Comparison of haversine and Google S2 time retrieval efficiency. (**a**) time consuming to search ships. (**b**) time consuming to sort ships. (**c**) total time for searching and sorting. the grid coding level based on adequate rescue time and effective rescue distance and to convert the grid codes of the ships in the current sea area are 0.0044, 0.0363, 0.3618, 3.6651, and 36.7658 s respectively. The time taken to filter the set of available ships in the current sea area based on the adequate rescue time and effective rescue distance is 0.0041, 0.0371, 0.3560, 3.7008, and 36.6822 s respectively. Using the method of \"Alternating Grid Sorting Based on Neighborhoods and Different Coding Levels\", the time spent on sorting the set of emergency rescue vessels in the current sea area according to the distance from the ship in distress is 0.0005, 0.0021, 0.0503, 5.0226, and 1300.2213 s. The total time consumed is 0.0090, 0.0755, 0.7681, 12.3885, and 1373.6693 s respectively. In summary, under the simulative situations of the different magnitude of ship position datasets (\(1\times 10^{2}\), \(1\times 10^{3}\), \(1\times 10^{4}\), \(1\times 10^{5}\) and \(1\times 10^{6}\)), the querying method based on Google S2 grid coding reduces the total time consumed compared to the querying method based on the traditional Euclidean distance by 37.06%, 29.83%, 72.75%, 94.43%, and 94.53%. The query method based on Google S2 grid coding can effectively reduce the retrieval time and thus better improve rescue efficiency. Based on Figure 6, it can be found that the query computation is based on the traditional Euclidean distance using the Haversine formula, which mainly contains the multiplication operation. The operation speed of multiplication in the computer is reduced by nearly 10 times compared with that of addition and subtraction. The CPU carries out the bit manipulation, such as AND, OR, XOR, and NOT, and bit shifts, and addition and subtraction arithmetics, whose speeds are comparable. Therefore, the calculation of Euclidean distance in terms of arithmetic is relatively slow [39], which results in low query efficiency.