Next Article in Journal
Deploying IIoT Systems for Long-Term Planning in Underground Mining: A Focus on the Monitoring of Explosive Atmospheres
Previous Article in Journal
Evaluation of the Influence of Vestibular Surface Morphology Variability of Maxillary Incisors on Torque: Examination Using 3D Intraoral Scans
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Storage and Management of Ship Position Based on Geographic Grid Coding and Its Efficiency Analysis in Neighborhood Search—A Case Study of Shipwreck Rescue and Google S2

1
East China Sea Fisheries Research Institute, Chinese Academy of Fishery Sciences, Shanghai 200090, China
2
College of Marine Sciences, Shanghai Ocean University, Shanghai 201306, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2024, 14(3), 1115; https://doi.org/10.3390/app14031115
Submission received: 18 December 2023 / Revised: 24 January 2024 / Accepted: 25 January 2024 / Published: 29 January 2024
(This article belongs to the Section Marine Science and Engineering)

Abstract

:
The marine fishery is a high-risk industry, and when a fishing vessel is in distress at sea, it is essential to protect the lives of the fishermen by implementing a fast and effective rescue for the vessel in distress. In this process, quickly retrieving the closest neighboring vessel in distress based on an effective rescue time is critical to the vessel’s rescue. In order to improve the time efficiency of retrieving the nearest available rescue vessels in the current sea area, this paper proposes a method based on the Google S2 grid coding for ships in distress at sea. The method is divided into three parts: (1) encoding the ship’s position based on the Google S2 algorithm, (2) retrieving the set of available ships in the current sea area based on the effective rescue distance and its corresponding coding level, and (3) sorting the set of available ships in the current sea area according to the proximity to the ship in distress by using the method of “Alternating Grid Sorting Based on Neighborhoods and Different Coding Levels”. The effective rescue distance is set by the rescue time, the type of rescue vessel, and the speed. This paper sets the simulation experiment area as the East China Sea area. Different magnitudes of ship position datasets (1 × 102, 1 × 103, 1 × 104, 1 × 105, 1 × 106) are generated by simulating the scenarios where a ship’s location is reported or collected by AIS or VMS. The temporal retrieval efficiencies of querying based on the two methods, the Euclidean distance and the Google S2 grid encoding, are compared and analyzed. The experimental results show that the total time consumed by the query method based on the Google S2 grid encoding and the query method based on Euclidean distance is reduced by 37.06%, 29.83%, 72.75%, 94.43%, and 94.53%, respectively, in the process of generating the set of rescuable ships retrieved, based on the effective rescue distance. Therefore, the time retrieval efficiency of the maritime vessel search and rescue method based on the Google S2 coding is high, which can effectively improve the query efficiency of rescue vessels in the neighborhood of distressed vessels.

1. Introduction

The marine fishery is an integral part of the global marine economy and an essential link in the marine industry [1,2]. With the development of global marine fisheries, each country has many fishing vessels and fishery workers, and the environment of fishing vessels’ sea operations and routes is becoming increasingly complicated [3]. China has the most significant number of fishing vessels and fishery workers globally, and its fishery production activities are spreading over the world’s major sea areas [4,5]. However, the marine operation of fishing vessels is a high-risk industry. The low freeboard of fishing vessels, the poor resistance of fishing vessels to wind and waves, and the frequent movement of people and cargoes make it highly likely that fishing vessels will be exposed to natural disasters and production accidents during their voyages. The ability to cope with unexpected accidents such as collisions, sinking of fishing vessels, and people falling into the water is weak [6,7,8,9,10,11]. Fishing has long been the most deadly and dangerous occupation in many countries. Various types of safety accidents in the fishing industry have occurred due to increased production and transport activities at sea and extreme weather events. According to the European Maritime Safety Agency (EMSA), the total number of reported marine casualties and incidents over the period from 2014 to 2022 was 23,814, with a yearly average of 2646 casualties and incidents [12]. An emergency rescue service for fishing vessels is an essential element of marine risk prevention and safety, which concerns the precious lives of many fishermen [13,14,15]. When a fishing vessel is involved in an accident at sea, how to quickly and efficiently carry out the effective emergency rescue of the vessel in distress and maximize the protection of the life and safety of the operating personnel of the fishing vessel at sea is currently an important research direction in the field of marine fisheries.
For the problem of the rescue of ships in distress, the existing studies mainly focus on how to design coverage path planning algorithms to maximize the success rate in an effective time, such as the construction of SARCPPF, a maritime search and rescue vessel coverage path planning framework for multiple persons-in-waters [16], or by collecting empirical data through questionnaires and simple randomization techniques to investigate how to improve the effectiveness and efficiency of maritime SAR [17], or how to reasonably and effectively dispatch rescue resources by integrating multiple forms of distress based on the drift prediction path to propose an optimization method for emergency rescue vessel scheduling [18]. Although these studies have made some progress in rescuing ships in distress, the attention to the timeliness of the rescue process needs to be sufficiently prominent.
Maritime accidents generally have a strong suddenness, and the golden time for rescue is so short that the timeliness of rescue has put forward very high requirements [19]. Internationally, it is customary to take the time to the rescue the scene as the primary reference basis for evaluating the level and efficiency of maritime rescue forces. According to the International Maritime Organization statistics, the arrival of rescue forces within two hours can significantly improve the rescue success rate. China issued the Opinions on Strengthening Rescue and Salvage Work which also clearly requires that the arrival time of rescue forces within 100 nautical miles offshore for emergency rescue should not exceed 90 min [20]. When receiving information that a ship is in distress at sea, the maritime search and rescue center at the place of occurrence should, in the shortest possible time, quickly determine the accident situation based on the accident alarm information received, formulate a search and rescue plan because of the actual situation, and dispatch the corresponding vessel to the accident location to carry out emergency rescue operations. 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 Haversine’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 CellID, based on a regular hexahedron and Hilbert curve, and then judge the spatial location relationship of two geographical objects by comparing the CellID [30,31]. Wu 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. Wang 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.

2. Methods

Based on the general steps, the process of “Emergency Rescue Vessels Searching in the Neighborhood of the Ship Based on Google S2 Geocoding During Rescue in Distress at Sea” proposed in this paper is shown in Figure 1. It is mainly divided into three parts: (1) geographical grid coding of ship position based on Google S2, (2) determining the set of ships within the effective rescue distance in the current sea area, and (3) sorting the set of ships available for rescue according to the distance from the ship in distress.

2.1. Geographical Grid Coding of Ship Positions Based on Google S2

In order to facilitate the retrieval of ships available for rescue in the current sea area and the current period, it is necessary to store the position information reported by ships in the current sea area in real time. Fields are established in the database as the unique identification code, the ship identification code, the ship name, the timestamp of the ship position, the latitude and longitude of the ship’s position, the vessel’s speed and direction, the Google S2 code, the ship type, and ship type identification code. When the information about a ship’s position is obtained, it is coded using Google S2. The detailed field information of the table storing the vessel’s position is shown in Table 1.
Google S2 coding is a grid coding algorithm applied to geospatial neighborhoods proposed by Google in 2011, similar to the GeoHash algorithm [32]. The Google S2 algorithm performs a series of transformations of longitude and latitude, which is finally converted to CellID on the Hilbert curve. Then, by comparing the values of CellID to determine if they are in the same area. The maximum coding level of Google S2 is 30, and the corresponding spatial area size is 0.48 cm2, so it can meet most of the application scenarios. The Google S2 algorithm is built on the Hilbert curve. The Hilbert curve has good dimensionality reduction. When n tends to infinity, the n-order Hilbert curve can be approximated to fill the whole plane. In addition, it has better stability. The points adjacent to each other on the Hilbert curve in the original space must be adjacent. Finally, the Hilbert curve is continuous so that it is guaranteed to fill the whole space [30,31]. The Google S2 coding algorithm is shown in Algorithm 1, where lon indicates longitude, lat indicates latitude, and pre indicates code length.
Algorithm 1: Google S2 encoding algorithm
Input: Lon, Lat, Pre
Output: CellID
// Step 1: Convert longitude and latitude to radians
Lat, Lon→S (lat, lon)
// Step 2: Establish a three-dimensional coordinate system with the center of the earth as the origin, and convert the longitude and latitude into points on the spherical rectangular coordinate system
S (lat, on)→f (x, y, z)
// Step 3: Spherical variable plane
f (x, y, z)→g (face, u, v)
// Step 4: Spherical rectangular projection correction
g (face, u, v)→h (face, s, t)
// Step 5: Conversion between points and coordinate axis points
h (face, s, t)→H (face, i, j)
// Step 6: Axis points are converted to values on the corresponding hierarchical Hilbert curves, which are combined with faceted representations to form CellID
H (face, i, j)→CellID
return CellID

2.2. Determine the Set of Ships within Effective Rescue Distance in the Current Sea Area

When a ship is in distress, the position of the ship in danger and other auxiliary information can be reported to the land rescue command center through a Beidou short message [34] or other wireless communication modes. After obtaining the wrecked ship’s position, the land rescue command center determines which ships can provide rescue. It sends out instructions to carry out the scheduling and implementation of a rescue. Generally speaking, the ship closest to the ship in distress is the most effective in carrying out the rescue, but taking into account the rescue effect, rescue capability, and the possibility of participation in rescue, it is also necessary to provide alternative ships within the effective rescue distance according to the distance from the ship in distress in order of precedence.

2.2.1. Determination of Effective Rescue Distance Based on Rescue Time

When a ship is in danger, rescuing the ship in distress as quickly as possible can save the lives of the people on board to the greatest extent. Therefore, the rescue time and effective rescue distance are crucial in searching the neighborhood of the ship in distress for the available ships for rescue. Based on the literature [18,19], we set the rescue time as 0.5 h, 1 h, 1.5 h, 2 h, 3 h, and 12 h, respectively. The effective rescue distance can be calculated by multiplying the ship’s speed and the adequate rescue time of different levels due to different ships having different speeds. In references [24,35], the speed range of fishing vessels during non-fishing operations is 8–10 knots (1 knot = 1 nautical mile/h), and the speed of professional rescue vessels is 15 knots, 20 knots, and 25 knots, respectively. Therefore, the adequate rescue distances corresponding to different speeds at different times are shown in Table 2. Among them, 1 nautical mile is about 1.852 km.

2.2.2. Determination of Grid Coding Level Based on Effective Rescue Distance

Different coding levels of the Google S2 algorithm correspond to different actual geospatial range sizes, as shown in Table 3. Depending on the effective rescue distances, the search for rescue vessels in the sea area requires a given grid coding level, and the larger the coding level, the smaller the search range. Table 3 shows the area side length corresponding to different coding levels of Google S2. Different distances correspond to different coding levels. The effective rescue distance and the corresponding Google S2 coding level are derived. The results are shown in Table 4 [36].

2.2.3. Search the Set of Ships Available for Rescue in the Neighborhood of the Ship in Distress According to the Effective Rescue Time

Based on determining the rescue time, effective rescue distance, and Google S2 grid code level, it will search for eligible ships for rescue in the database based on the grid code.
When the land rescue center receives the position information reported by the ship in distress, it must: (1) convert the position information reported by the ship in distress into a grid code of the corresponding Google S2 coding level; (2) determine the rescue time, effective rescue distance, and corresponding Google S2 coding level; and (3) retrieve the set of ships available for rescue in the database based on the grid code, i.e., the set of ships that can provide rescue in the current sea area in the effective rescue time, as shown in Algorithm 2.
Algorithm 2: Searching for vessels available for rescue within the determined effective rescue time and effective rescue distance in a certain sea area
Input: Lon, Lat, Time
Output: SOA
// Step 1: Determine the effective rescue distance according to the effective rescue time
ShipType, Time→Distance
// Step 2: Determining Google S2 encoding level based on effective rescue distance
Distance→Precision
// Step 3: Using Google S2 algorithm to convert the longitude and latitude information of the ship to be rescued into grid coding
(lon, lat, precision)→gridcode
// Step 4: Using grid coding to obtain the set of ships available for rescue
gridcode→ SOA
return SOA

2.3. Sort the Set of Ships Available for Rescue According to the Distance from the Ship in Distress

Generally speaking, the ship closest to the ship in distress is the most effective in carrying out rescue, but considering the rescue effect, rescue capability, and the possibility of participation in the rescue, it is also necessary to provide alternative ships within the effective rescue distance according to the distance from the ship in distress. Therefore, it is necessary to rank the set of ships available for rescue based on the distance from the ship in distress according to the different grid coding levels.
As shown in Figure 2, the yellow and blue grids represent the spatial regions corresponding to the two adjacent coding levels of Google S2. When the ship in distress is located at point a, if the ship available for rescue cannot be found within the yellow grid region where point a is located, the scope can be expanded to search in the previous level of encoder region A. However, when the ship in distress is located at point b, if the ship available for rescue cannot be found within the yellow grid region where point b is located, there are two methods: (1) expanding the scope to search in the previous level of encoder region A, or (2) to retrieve in its neighboring grid coding region B. Obviously, rescue ship c in region B is closer to the ship in distress b than rescue ship d in region A, therefore it is more suitable for rescue. Therefore, to solve the above problem, we propose an “Alternating Grid Sorting Based on Neighborhoods and Different Coding Levels” algorithm, as shown in Figure 3.
When a ship is in distress at sea, if there are other ships within 3 km of it, it can be rescued directly without reporting. Therefore, we set the minimum value of the search distance to 3 km, and the corresponding gridcode level is 11. When querying the rescue time of the ship in distress and the set S of ships available for rescue within the distance, the following needs to occur: (1) determine the effective rescue distance and corresponding Google S2 encoding level; (2) query whether there is a ship that meets the conditions in SOA based on the grid code and store the result in SOA_MD (3); calculate the grid code of the eight neighboring domains around the grid code, query them sequentially in SOA, and save the result in SOA_MD; (4) calculate the coding result grid code with coding level 10 on the previous level of the grid code; (5) repeat steps (2), (3), and (4) until the coding level of the grid code is less than the coding level within the rescue time and effective rescue distance; and (6) output the SOA_MD of the set of ships available for rescue sorted according to the distance from the ship in distress. The specific algorithm is shown in Algorithm 3.
Algorithm 3: Alternative grid sorting based on neighborhood and different coding lengths
Input: Lon, Lat, Time, SOA
Output: SOA_MD
// Step 1: Determination of grid coding level based on effective rescue time and grid coding of ships in distress.
(lon, lat, time)→gridcode
// Step 2: Query the set of ships available for rescue within the same level and neighborhood of the ships in distress in the set of ships available for rescue.
SOA, gridcode→SOA_MD
// Step 3: Query the set of ships available for rescue on the ship in distress and the set of ships available for rescue in the neighborhood until the maximum level is reached.
SOA, gridcode’→SOA_MD
// Step 4: Output the set of ships available for rescue according to the distance from the ship in distress.
return SOA_MD
The Google S2 algorithm cuts the earth into six planes and divides each face into cells. Each independent cell is called a Cell. As shown in Figure 4, it is the coding result of the same coordinate point with different coding levels. In the Google S2 algorithm, each CellID comprises 64 binaries; therefore the encoded result is up to 64 bits long. Among them, the orange area represents the face of the cube. The valid range is 0 to 5, 6 and 7 represent invalid values, the green area represents the coding results with different coding levels, and the blue area represents the marker bit. The minimum and maximum side lengths of the rectangular areas corresponding to different levels are shown in Table 3 [37].
Google S2 encoding results between different levels of the same grid are hierarchically nested. Neighboring levels, or the adjacent hierarchy, are depicted in the difference of two bits in the Google S2 code. Taking the coding level of 8 as an example, in the case of not taking into account its marking bits, the encoding result of level 7 is to remove the last two bits based on the encoding result of level 8; the encoding result increases by two bits for every increase in the encoding level. Therefore, when using it, only the minimum coding level needs to be saved in the database. Other coding levels can be obtained by the conversion of the current coding level and the minimum coding level. For the problem of calculating the neighboring cells of the cell, it is necessary to convert the encoding results to the row and column numbers of the faces and then obtain the row and column numbers of the eight neighboring cells around it, as shown in Figure 5. Finally, the row and column numbers of the eight cells are converted to a CellID and used for retrieval.

3. Experiments and Discussions

3.1. Experimental Area and Data

In order to verify the performance of this research method, a Google S2 coding-based search method for marine vessel rescue was implemented in this study using the Python programming language. The experiment takes the East China Sea (23°00′ N–33°10′ N, 117°11′ E–131°00′ E) as the spatial range, and generates different magnitudes of ship position datasets (1 × 102, 1 × 103, 1 × 104, 1 × 105, and 1 × 106) by simulating the scenario in which the AIS or VMS systems collect the ship’s location information at minute intervals. The effective number of bits is retained at 8. The hardware and software environment used is shown in Table 5.

3.2. 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 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 Haversine’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).
s i n X = s i n l o n 1 l o n 2 × 0.5 s i n Y = s i n l a t 1 l a t 2 × 0.5 h = s i n X × s i n Y + c o s l a t 1 × c o s l a t 2 × s i n X × s i n X d i s t a n c e = 2 × a t a n 2 s q r t h , s q r t 1 h × 6367000
Suppose that Point P (124.083164° E, 28.104374° N) is the ship’s distressed location, the rescue time is set to 0.5 h, and the effective rescue distance based on Table 2 is 7 km. The corresponding Google S2 coding level based on Table 4 is 10, corresponding to a hexadecimal grid code of 34566d. It is necessary to compare and analyze the time retrieval efficiency of the traditional Euclidean distance-based query method and Google S2 grid coding-based query method when considering different numbers of ships in the current sea area.
The query method based on the traditional Euclidean distance first needs to calculate the distance between the ship in distress and all the ships in the current database, and then, based on the effective rescue distance, determine the set of ships in the current sea area that can provide rescue. Finally, according to the distances between the ship in distress and the available ship in the current sea area for rescue, the set of ships needs to be sorted. As shown in Table 6, when the number of ship position records in the current sea area is 1 × 102, 1 × 103, 1 × 104, 1 × 105, 1 × 106, the time taken to calculate the actual geospatial distances between the ship in distress and the other ships in the current sea area are 0.0101, 0.0573, 0.5111, 5.0309, and 55.2705 s. Based on the adequate rescue time and the effective rescue distance, the time spent on screening the set of ships available for rescue in the current sea area is 0.0040, 0.0359, 0.3609, 3.6078, and 39.1666 s. Based on the proximity to the ship in distress, the time spent on sorting the set of ships available for rescue in the current sea area is 0.0002, 0.0144, 1.9463, 213.9144, and 25,008.8553 s. The total time taken is 0.0143, 0.1076, 2.8183, 222.5531, and 25,103.2924 s, respectively. As shown in Figure 6, it can be found that, due to the approximation of the calculation time of the Euclidean distance of a single ship, the calculation elapsed time and screening elapsed time show a linear growth trend with the increase of the data volume as the number of ship positions in the sea area increases. However, its sorting elapsed time shows an exponential growth, which further causes the increase of its total elapsed time.
The query method based on Google S2 grid code first needs to convert the grid code of the ships in the current sea area to the corresponding level, then filter the set of ships available for rescue in the current sea area based on the adequate rescue time and the effective rescue distance, and then finally use the method of “Alternating Grid Sorting Based on Neighborhoods and Different Coding Levels” to sort the set of ships available for rescue in the current sea area according to the proximity to the ships in distress. As shown in Table 6, under the simulative situations of the different magnitude of ship position datasets (1 × 102, 1 × 103, 1 × 104, 1 × 105 and 1 × 106), the time taken to determine 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 × 102, 1 × 103, 1 × 104, 1 × 105 and 1 × 106), 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. The process of sorting the set of ships available for rescue by comparing the distance from the ship in distress has low arithmetic multiplexing, and a single computation consumes a lot of memory. With the increase in the amount of data, its space and time occupation will increase dramatically, so it is not conducive to searching for ships that meet the rescue conditions. The query method based on Google S2 grid encoding searches for rescue ships according to the number of overlapping bits of the 64-bit binary encoding prefix, which only needs to match the prefix of the 64-bit binary encoding, significantly reducing the complexity of the algorithm. At the same time, the encoding results remain unchanged when the ship position points change within the hierarchical range of the grid. This can make caching queries more efficient to increase the query speed of the nearby ships and achieve the rapid search of the eligible rescue ships for the subsequent rescue.
In addition, when different ranges are searched according to the rescue needs, every time the range is reset, for the method of Euclidean distance, all the ship position distance data will be traversed again, which leads to low computing efficiency and large memory occupation and reduces the timeliness of ship rescue. For the method of Google S2, the one-dimensional geographic grid coding, instead of the traditional two-dimensional latitude and longitude, has uniqueness, one-dimensionality, and recursiveness [40], which eliminates the need to calculate the Euclidean distance and store the distance data when searching for the surrounding neighboring ships, achieves the representation of the three-dimensional data (latitude, longitude, and distance) with one-dimensional strings, and reduces the occupation of the memory space.
According to the China Fisheries Statistical Yearbook [41], 12 provinces in China own marine fishing motorized fishing vessels. They are mainly from Guangdong, Hainan, and Fujian provinces. Guangdong Province owns 35,700 motorized fishing vessels, accounting for 22.88% of all marine fishing motorized fishing vessels. Installed with Beidou and other ship position terminals, according to 3 min or an even higher time-frequency collection of a ship’s position information, each collection is marked as a record, and a ship’s position record data for a day is 480. In Guangdong Province, the number of records of the ship’s position for a day is 1.71 × 108 articles. Currently, if the ship position track storage and query method based on latitude, longitude, and Haversine distance is used, the space occupation is large, and the retrieval efficiency is slow. The gridding coding not only saves memory resources but also retains spatial information, reflecting the first law of geography: “Features with Similar Spatial Distance have Similar Spatial Relationships in Space” [42]. The higher the prefix overlap of the grid coding, the closer the spatial distance of the ship is. The indexing efficiency of the one-dimensional indexing is significantly higher than that of the multi-dimensional, which is ensured through continuous iterative subdivision that the grid coding meets the retrieval demand in a particular range to meet the retrieval requirements, improve data processing efficiency, and reduce operating costs.

4. Conclusions

When a fishing vessel is distressed at sea, an effective and rapid maritime rescue program can maximize the protection of the life and safety of fishing vessel operators. An effective search and rescue at sea requires a reasonable rescue scheduling program and high timeliness, and its rescue speed is mainly related to the efficiency of data acquisition, storage, and processing, in which the search efficiency of the nearest or neighboring ships is the key to affecting the rescue. Compared with the traditional Euclidean distance method, when generating the different magnitude of ship position datasets by stimulating the scenario where AIS or VMS systems collect the ship’s position at minutes frequency, the proposed Google S2 grid coding neighborhood rescue method for ships in distress at sea reduces the total elapsed time reduced by 37.06%, 29.83%, 72.75%, 94.43%, and 94.53%, respectively. Therefore, the neighborhood rescue method for ships in distress at sea based on Google S2 grid coding facilitates the storage and management of massive oceanic ship information and can be quickly computed in ship search and rescue in order to improve the rescue speed and efficiency and to protect the safety of a fishermen’s life and property. In the future, it is necessary to further compare the consumption of memory resources during the computation process and the search efficiency of ocean-going ship position data to support a comprehensive and large-scale lookup so that the index can be better applied to practical applications.

Author Contributions

Conceptualization, W.Z.; Methodology, W.Z. and B.J.; software and validation, B.J. and H.H.; writing—original draft, B.J.; writing—review and revising, W.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This work was financially supported by the National Key R&D Program of China (2023YFD2401303), Central Public-interest Scientific Institution Basal Research Fund, ECSFR, CAFS (2022ZD0402), and CAFS (NO. 2022XT0702).

Data Availability Statement

All experimental data are generated by simulating the scenario in which the AIS or VMS systems collect the ship’s location information at minute intervals. Data are available for research purposes upon reasonable request to the corresponding author.

Acknowledgments

The authors thank the managing editor and anonymous reviewers for their constructive comments.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Chen, M.; Jiang, Q.; Liu, Y. Thoughts on informatization construction of coastal fishing ports in China. J. Fish. Res. 2021, 6, 316–321. [Google Scholar] [CrossRef]
  2. Daniel, P. A vision for marine fisheries in a global blue economy. Mar. Policy 2018, 87, 371–374. [Google Scholar] [CrossRef]
  3. FAO. The State of World Fisheries and Aquaculture 2020; Sustainability in action; FAO: Rome, Italy, 2020. [Google Scholar]
  4. Su, S.; Tang, Y.; Chang, B.; Zhu, W.; Chen, Y. Evolution of marine fisheries management in China from 1949 to 2019: How did China get here and where does China go next? Fish Fish. 2020, 21, 435–452. [Google Scholar] [CrossRef]
  5. Shen, G.; Heino, M. An overview of marine fisheries management in China. Mar. Policy 2014, 44, 265–272. [Google Scholar] [CrossRef]
  6. Ma, K.; Ren, L.; Zeng, J.; Wan, J. Ship rescue path planning considering adverse sea conditions. Mar. Sci. 2021, 45, 39–46. [Google Scholar] [CrossRef]
  7. Wang, C.; Zhang, X.; Cong, L.; Li, J.; Zhang, J. Research on intelligent collision avoidance decision-making of unmanned ship in unknown environments. Evol. Syst. 2019, 10, 649–658. [Google Scholar] [CrossRef]
  8. Han, X. Current status of research on fishing vessels at home and abroad. Ship Eng. 2019, 41, 6–14. [Google Scholar]
  9. Huang, Y. Safety of fishing vessels operating at sea in China and its countermeasures. Shipp. Manag. 2021, 43, 10–12. [Google Scholar] [CrossRef]
  10. Zhang, L.; Wang, H.; Meng, Q.; Xie, H. Ship accident consequences and contributing factors analyses using ship accident investigation reports. Proc. Inst. Mech. Eng. Part O J. Risk Reliab. 2019, 233, 35–47. [Google Scholar] [CrossRef]
  11. Wang, L.; Yun, Y.; Li, Q. Research on Collisions of Fishing Boats Based on Finite Element Method. In Proceedings of the 17th COTA International Conference of Transportation Professionals, Beijing, China, 5–8 July 2018; pp. 4650–4659. [Google Scholar]
  12. Annual Overview of Marine Casualties and Incidents 2023. Available online: https://www.emsa.europa.eu/component/flexicontent/download/7639/5052/23.html (accessed on 24 November 2023).
  13. Li, Z.; Liu, H.; Ai, W. Zhoushan Maritime Search and Rescue Status and Countermeasures. Shipp. Manag. 2018, 40, 28–29. [Google Scholar] [CrossRef]
  14. Yoo, S. Network analysis by fishing type for fishing vessel rescue. Phys. A Stat. Mech. Appl. 2019, 514, 892–901. [Google Scholar] [CrossRef]
  15. Zhou, X.; Cheng, L.; Min, K.; Zuo, X.; Yan, Z.; Ruan, X.; Chu, S.; Li, M. A framework for assessing the capability of maritime search and rescue in the south China sea. Int. J. Disaster Risk Reduct. 2020, 47, 101568. [Google Scholar] [CrossRef]
  16. Wu, J.; Cheng, L.; Chu, S.; Song, Y. An autonomous coverage path planning algorithm for maritime search and rescue of persons-in-water based on deep reinforcement learning. Ocean Eng. 2024, 291, 116403. [Google Scholar] [CrossRef]
  17. Mahadi, C.M.H.C.; Mokhtar, K.; Chuah, L.F.; Chan, S.R.; Suhrab, M.I.R.; Mubashir, M.; Asif, S.; Show, P.L. An organisational search and rescue performance assessment for a cleaner environment. Clean. Eng. Technol. 2023, 14, 100641. [Google Scholar] [CrossRef]
  18. Peng, R.; Kong, D.; Pang, W.; Hong, W. Optimization method of ship dispatching for emergency rescue of personnel falling overboard on offshore platform. China Saf. Sci. J. 2022, 32, 208–215. [Google Scholar] [CrossRef]
  19. Solberg, K.E.; Jensen, J.E.; Barane, E.; Hagen, S.; Kjøl, A.; Johansen, G.; Gudmestad, O.T. Time to Rescue for Different Paths to Survival Following a Marine Incident. J. Mar. Sci. Eng. 2020, 8, 997. [Google Scholar] [CrossRef]
  20. Pan, K.; Pan, H.; He, Y. Strengthening maritime search and rescue capacity building to meet maritime emergency response needs. Shipp. Manag. 2014, 36, 26–29. [Google Scholar] [CrossRef]
  21. Lin, W.; Wang, N.; Gao, Z.; Wu, D. Associated searching and rescuing optimization of salvage vessels and helicopters in remote sea area. J. Traffic Transp. Eng. 2021, 21, 187–199. [Google Scholar] [CrossRef]
  22. International Maritime Organization/International Civil Aviation Organization. International Handbook on Aviation and Maritime Search and Rescue; People’s Communications Press: Beijing, China, 2003; pp. 1–286. [Google Scholar]
  23. National Maritime Search and Rescue Emergency Response Plan. Available online: https://www.gov.cn/yjgl/2006-01/23/content_168935.html (accessed on 24 June 2023).
  24. Zhou, W.; Sui, X.; Guo, X.; Jiang, Y.; Chen, T. Searching method for marine ship rescue based on grid neighborhood query. J. Geo-Inf. Sci. 2021, 23, 1422–1432. [Google Scholar] [CrossRef]
  25. Fan, W.; He, B.; Li, C.; Han, J.; Xu, Y.; Cui, C. Research on Spherical Distance Computation and Accuracy Comparison. Astron. Res. Technol. Publ. Natl. Astron. Obs. China 2019, 16, 69–76. [Google Scholar] [CrossRef]
  26. Prasetya, D.; Nguyen, P.; Faizullin, R.; Iswanto, I.; Armay, E. Resolving the shortest path problem using the haversine algorithm. J. Crit. Rev. 2020, 7, 62–64. [Google Scholar]
  27. Winarno, E.; Hadikurniawati, W.; Rosso, R. Location based service for presence system using haversine method. In Proceedings of the 2017 International Conference on Innovative and Creative Information Technology (ICITech), Salatiga, Indonesia, 2–4 November 2017; pp. 1–4. [Google Scholar] [CrossRef]
  28. Li, X.; Feng, H.; Mei, Y.; Zhao, Y. Geographical Space Distance Calculation Algorithm Based on Three Time Polynomial Fitting Trigonometric Function. Comput. Meas. Control 2016, 24, 199–201. [Google Scholar] [CrossRef]
  29. S2Geometry. Available online: http://s2geometry.io/devguide/s2cell_level.html (accessed on 2 March 2023).
  30. Feng, Q. Research on Large-Scale Real-Time Lookup and Parallel Optimisation Based on Google S2 Algorithm; Hunan University: Changsha, China, 2020. [Google Scholar] [CrossRef]
  31. Liu, Y. Research on Location Privacy Protection Method Based on Google S2; Hunan University: Changsha, China, 2021. [Google Scholar] [CrossRef]
  32. Wu, F.; Feng, Q.; Tang, X. Real-Time Search Method for Large-Scale Regional Targets Based on Parallel Google S2 Algorithm. In Proceedings of the 2019 IEEE 21st International Conference on High Performance Computing and Communications, Zhangjiajie, China, 10–12 August 2019; pp. 1406–1413. [Google Scholar] [CrossRef]
  33. Wang, X.; Wang, R.; Zhan, W.; Yang, B.; Li, L.; Chen, F.; Meng, L. A Storage Method for Remote Sensing Images Based on Google S2. IEEE Access 2020, 8, 74943–74956. [Google Scholar] [CrossRef]
  34. East China Sea Fishery Research Institute; Chinese Academy of Fishery Sciences. Position-Based Marine Fishery Information Serving Method. Chinese Patent ZL2012 10332536.4, 24 September 2014. [Google Scholar]
  35. Zhang, P.; Wang, S. Demonstration of 4000 kW New Marine Rescue Ship Type Scheme. Shipp. Manag. 2021, 4, 26–29. [Google Scholar] [CrossRef]
  36. S2 Cell Statistics. Available online: https://s2geometry.io/resources/s2cell_statistics (accessed on 2 March 2023).
  37. Xiao, K. Study on Fast Retrieval of Remote Sensing Raster Data and Typhoon Path Vector Data Based on GeoHash and Google S2 Encoding; Shanghai Ocean University: Shanghai, China, 2022. [Google Scholar] [CrossRef]
  38. Python Documents. Available online: https://www.docs4dev.com/docs/zh/python/2.7.15/all/library-timeit.html (accessed on 2 March 2023).
  39. Wang, C.; Liu, W.D.; Song, J.X. Computer Organization and Design; Zhejiang University Publishing: Hangzhou, China, 2004. [Google Scholar]
  40. Amir, H.; Ahmed, M.; François, D. Data fusion in automotive applications Efficient big data stream computing approach. Pers. Ubiquitous Comput. 2017, 21, 443–455. [Google Scholar]
  41. National Yearbook of Fisheries Statistics 2020. Available online: https://www.cafs.ac.cn/info/1397/37342.html (accessed on 8 September 2023).
  42. Brahim, M.; Drira, W.; Filali, F.; Hamdi, N. Spatial data extension for Cassandra NoSQL database. J. Big Data 2016, 3, 11. [Google Scholar] [CrossRef]
Figure 1. The flowchart of neighborhood rescue for ships in distress at sea based on Google S2 grid encoding.
Figure 1. The flowchart of neighborhood rescue for ships in distress at sea based on Google S2 grid encoding.
Applsci 14 01115 g001
Figure 2. Google S2 algorithm based retrieval of ships in distress for available rescue ships. Point a and b represent ships in distress in two different situations, point c and d that need to be retrieved in the searching process, represent the most neighboring ships available for rescue for ship a and b, and A and B represent the spatial retrieval region of ships in distress for ships that are available for rescue.
Figure 2. Google S2 algorithm based retrieval of ships in distress for available rescue ships. Point a and b represent ships in distress in two different situations, point c and d that need to be retrieved in the searching process, represent the most neighboring ships available for rescue for ship a and b, and A and B represent the spatial retrieval region of ships in distress for ships that are available for rescue.
Applsci 14 01115 g002
Figure 3. Alternative grid sorting based on neighborhood and different coding levels.
Figure 3. Alternative grid sorting based on neighborhood and different coding levels.
Applsci 14 01115 g003
Figure 4. Coding results at different coding levels for the same location. The encoded result is up to 64 bits long. The orange area represents the face of the cube, the green area represents the coding results with different coding levels, and the blue area represents the marker bit.
Figure 4. Coding results at different coding levels for the same location. The encoded result is up to 64 bits long. The orange area represents the face of the cube, the green area represents the coding results with different coding levels, and the blue area represents the marker bit.
Applsci 14 01115 g004
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.
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.
Applsci 14 01115 g005
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.
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.
Applsci 14 01115 g006
Table 1. Vessel data storage record table named as gridcode_vessels.
Table 1. Vessel data storage record table named as gridcode_vessels.
Column NameData TypeNull/Not NullComments
IDintNot NullUnique identification code
ShipIDintNot NullShip identification code
ShipNamevarchar (50)Not NullShip’s Name
TimedatetimeNot NullTimestamp of position
LongitudefloatNot NullLongitude of position
LatitudefloatNot NullLatitude of position
SpeedfloatNot NullVessel’s speed
DirectionfloatNot NullVessel’s direction
GridCodevarchar (50)Not NullGoogle S2 Code to the ship’s position
ShipTypevarchar (50)Not NullShip Type
ShipTypeIDintNot NullVessel Type ID
Table 2. Effective rescue time and distance of different types of ships (km).
Table 2. Effective rescue time and distance of different types of ships (km).
Speed (Nautical Miles/h)Rescue Time/h
0.511.52312
8 (Fishing boat and Transport ship)7.408014.816022.224029.632044.4480177.7920
9 (Fishing boat and Transport ship)8.334016.668025.002033.336050.0040200.0160
10 (Fishing boat and Transport ship)9.260018.520027.780037.040055.5600222.2400
15 (Professional rescue ship)13.890027.780041.670055.560083.3400333.3600
20 (Professional rescue ship)18.520037.040055.560074.0800111.1260444.4800
25 (Professional rescue ship)23.150046.300069.450092.6000138.9000555.6000
Table 3. Area side length corresponding to different coding levels.
Table 3. Area side length corresponding to different coding levels.
LevelRandom Cell Min Edge LengthRandom Cell Max Edge Length
007842 km7842 km
013921 km5004 km
021825 km2489 km
03840 km1167 km
04432 km609 km
05210 km298 km
06108 km151 km
0754 km76 km
0827 km38 km
0914 km19 km
107 km9 km
113 km5 km
Table 4. Coding level of effective rescue distance corresponding to rescue time.
Table 4. Coding level of effective rescue distance corresponding to rescue time.
Speed (Nautical Miles/h)Rescue Time/h
0.511.52312
8 (Fishing boat and Transport ship)100909080806
9 (Fishing boat and Transport ship)100909080806
10 (Fishing boat and Transport ship)100908080705
15 (Professional rescue ship)100808070705
20 (Professional rescue ship)090807070604
25 (Professional rescue ship)090807070604
Table 5. Experimental hardware and software environment table.
Table 5. Experimental hardware and software environment table.
ItemsParameters
Operating SystemWindows 10 Enterprise
CPUIntel(R) Core (TM) i7-10510U CPU @ 1.80 GHz 2.30 GHz
RAM8.00 GB
MySQL8.0.27
Python3.6
Haversine2.8.0
Pandas1.0.0
s2sphere0.2.5
Table 6. Haversine and Google S2 data retrieval times (unit: s) for different volume levels.
Table 6. Haversine and Google S2 data retrieval times (unit: s) for different volume levels.
AlgorithmData Volume/Article
1 × 1021 × 1031 × 1041 × 1051 × 106
HaversineCalculation time0.01010.05730.51115.030955.2705
Screening time0.00400.03590.36093.607839.1666
Sorting time0.00020.01441.9463213.914425,008.8553
Total time0.01430.10762.8183222.553125,103.2924
Google S2Processing time0.00440.03630.36183.665136.7658
Screening time0.00410.03710.35603.700836.6822
Sorting time0.00050.00210.05035.02261300.2213
Total time0.00900.07550.768112.38851373.6693
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.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Jiang, B.; Zhou, W.; Han, H. Storage and Management of Ship Position Based on Geographic Grid Coding and Its Efficiency Analysis in Neighborhood Search—A Case Study of Shipwreck Rescue and Google S2. Appl. Sci. 2024, 14, 1115. https://doi.org/10.3390/app14031115

AMA Style

Jiang B, Zhou W, Han H. Storage and Management of Ship Position Based on Geographic Grid Coding and Its Efficiency Analysis in Neighborhood Search—A Case Study of Shipwreck Rescue and Google S2. Applied Sciences. 2024; 14(3):1115. https://doi.org/10.3390/app14031115

Chicago/Turabian Style

Jiang, Bohui, Weifeng Zhou, and Haibin Han. 2024. "Storage and Management of Ship Position Based on Geographic Grid Coding and Its Efficiency Analysis in Neighborhood Search—A Case Study of Shipwreck Rescue and Google S2" Applied Sciences 14, no. 3: 1115. https://doi.org/10.3390/app14031115

APA Style

Jiang, B., Zhou, W., & Han, H. (2024). Storage and Management of Ship Position Based on Geographic Grid Coding and Its Efficiency Analysis in Neighborhood Search—A Case Study of Shipwreck Rescue and Google S2. Applied Sciences, 14(3), 1115. https://doi.org/10.3390/app14031115

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop