## 3 Experiments and Discussions
### Time Retrieval Efficiency  
In order to compare the efficiency of the two methods in terms of time consumption, this study first establishes a ship location database. Then, it compares and analyses it using the query method based on traditional Euclidean distances and the query method based on Google S2 grid coding. The time consumption of the two methods can be divided into the time spent on searching the set of emergency rescue vessels in the current sea area based on the adequate rescue time, effective rescue distance, and the time spent on sorting the set of emergency rescue vessels in the current sea area, based on the proximity to the ship in distress. For the query method based on the traditional Euclidean distance, the time spent can be divided into calculating the actual geospatial distances between the ship in distress and the other ships in the current sea area and filtering the set of emergency rescue vessels in the current sea area according to the adequate rescue time and the effective rescue distance. The bubble sort algorithm is used to sort the set of ships available for rescue in the current sea area according to the distance from the ship in distress. For the query method based on the Google S2 geographical grid code, the time spent can be divided into the time spent on processing the grid coding of all ships' positions, and  
Figure 5: The neighborhood’s relationship of the cell, i and j represent the number of the row and column of the cell respectively, in the corresponding face of the Google S2 algorithm. \begin{table}
\begin{tabular}{c c} \hline \hline
**Items** & **Parameters** \\ \hline Operating System & Windows 10 Enterprise \\ CPU & Intel(R) Core (TM) i7-10510U CPU @ 1.80 GHz 2.30 GHz \\ RAM & 8.00 GB \\ MySQL & 8.0.27 \\ Python & 3.6 \\ Haversine & 2.8.0 \\ Pandas & 1.0.0 \\ s2 sphere & 0.2.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Experimental hardware and software environment table. the time spent on filtering and sorting the set of ships available for rescue in the current sea area. Screening the ships available for rescue in the current sea area is performed according to the adequate rescue time and effective rescue distance. The method used to sort the set of ships available for rescue in the current sea area according to the distance from the ship in distress is the \"Alternating Grid Sorting Based on Neighborhoods and Different Coding Levels\" method. The time-consumption measurement method adopts the **timeit** module of Python language, which can accurately measure the execution time of a small piece of code and flexibly avoid the errors that are likely to occur when measuring the execution time, such as garbage collection [38]. In order to minimize the randomness error, an average of 100 measurements for each item is taken as the final result. The spherical distance between two points is one of the most commonly used calculations in geography, which is mainly used to calculate the actual geographic distance between two points and is the most basic operation [25]. Currently, for the problem of geospatial distance calculation based on spherical models, the most common method to calculate the actual geospatial distance between two points is to use [PERSON]'s formula [28]. Taking the calculation of geospatial distance between two points \(A\) and \(B\) on the earth as an example, where _lon1_ and _lat1_ are the radian values of the longitude and latitude coordinates of point \(A\), and _lon2_ and _lat2_ are the radian values of the longitude and latitude coordinates of point \(B\), the calculation of the geospatial distance between points \(A\) and \(B\) is shown in Equation (1). \[ \begin{array}{c}sin\ X=sin\ ((lon1-lon2)\times 0.5)\\ sin\ Y=sin\ ((lat1-lat2)\times 0.5)\\ h=sin\ X\times sin\ Y+cos\ (lat1)\times cos\ (lat2)\times sin\ X\times sinX\\ distance=2\times atan2(sqrt(h),sqrt(1-h))\times 6367000\\ \end{array}