## 1 Introduction
Ships are the primary unit of maritime search and rescue [21]. According to the International Aviation and Maritime Search and Rescue Manual [22], the National Maritime Search and Rescue Emergency Response Plan [23], and other related information, the rescue of ships in distress at sea is divided into four steps: (1) reporting time and position information by the ship in distress, (2) determining the effective rescue distance and obtaining the set of ships within the effective rescue distance, (3) obtaining the set of ships available for rescue within the effective rescue distance following the proximity of distance, and (4) dispatching the available ships for rescue. Therefore, when a ship is in distress at sea, how to take the ship in distress as the center of the searching radius and quickly and efficiently search the available ships for rescue within the effective rescue distance is one of the most critical issues in ship rescue [24]. For the rescue distance, the most commonly used method is to calculate the Euclidean distance between the wrecked ship and other ships in the current sea area according to the distance proximity to obtain the closest set of ships available for rescue. The commonly used method for calculating the Euclidean distance is [PERSON]'s formula [25; 26; 27; 28]. Problems such as projection and deformation need to be considered when calculating the Euclidean distance. The calculation also needs to be sorted according to the distance, which is a computationally intensive, time-consuming, and space-intensive process in terms of resources [24]. Designing an effective geographical grid coding of vessel positions and researching the retrieval and generation method of available rescue ships is an effective way to improve rescue efficiency. The Google S2 algorithm is a filling curve coding algorithm based on a regular hexahedron proposed by Google in 2011 [29]. When judging the spatial location relationship of two geographical objects, the basic idea of Google S2 is to convert the longitude and latitude of two geographical objects into a CeIIID, based on a regular hexahedron and Hilbert curve, and then judge the spatial location relationship of two geographical objects by comparing the CeIIID [30; 31]. [PERSON] et al. [32] used the Google S2 algorithm for the real-time search of large-scale regional targets. They found that it can significantly improve the retrieval efficiency and further verified the precise searchability of the Google S2 algorithm. [PERSON] et al. [33] proposed a remote sensing image storage method based on Google S2 and HBase, which effectively improved the efficiency of image tile storage and query. In summary, under the situation of a massive ship-position dataset formed by continuous reporting of ship location by AIS or VMS, considering the spatial position of the ship to be rescued, the distance from the emergency rescue vessels to the wrecked ship in the sea area, and the required sailing time, this paper proposes a retrieval and generation method based on Google S2 grid coding for the set of emergency rescue vessels in the neighborhood of a ship in distress at sea. This paper further compares it with the existing method of calculating the Euclidean distances between the ships in terms of the efficiency of the time retrieval to further improve the efficiency and effectiveness of the rescue implementation.