## 2 Method
### Data and Processing
#### 2.2.2 Data Processing  
Ship data pre-processing is a key step for accurate and efficient data mapping transformation, analysis, and application. The principle of data processing starts with removing abnormal data and updating supplementary data as much as possible. The pre-processing methods used include data de-duplication, data noise reduction, data filling, and data fusion, as shown in Figure 2. The following are specific descriptions of these steps.  
Figure 2: Data processing.  
* _Step 1: Data de-duplication._ For the problem of duplicate redundancy of maritime ship data, data cleaning is carried out by data query and regular matching methods, including redundancy processing by using MMSI and ship name segment and redundancy processing by ship registration number and ship name segment to ensure that ship data can be uniquely identified;
* _Step 2: Data noise reduction._ For the ship data noise problem, the data normalization method is used for standardized field template design and field screening, and in principle, information such as primary key, Chinese name, English name, type, and content is retained, and attribute field information is simplified; for the ship spatial data noise problem, the Douglas-Peuker (DP) method is used for the abnormal ship spatial trajectory extraction thinning to simplify the ship spatial field information to achieve the purpose of clearer data. The DP algorithm is used to determine the key waypoints of the ship's trajectory [35]. These key waypoints can be used to represent the geographical locations where the ship changes course. Figure 3 and Table 2 show the steps of the DP algorithm. Step 1 can be used to generate an approximated line segment between the departure and destination points. Steps (2, 3, \(\ldots\), \(n\)) introduce sub-line segments using various threshold parameters \(\varepsilon\)[23].  
The steps of the DP algorithm (the black line represents the original ship trajectory centerline, and the red line represents the simplified ship trajectory. The idea of the simplified ship trajectory centerline is to approximate the original trajectory in green).
* _Step 3: Data filling._ For the problem of missing ship data, the same kind of cubic spline function interpolation, K-mean clustering, and mean value method [23] are used to estimate and fill the missing data. Making full use of the third-party complete ship data, adopting the method of data interface synchronization, and completing the data filling of MMSI, ship name, ship type, etc., based on the third-party data interface, and completing the filling of spatial information such as port and ship trajectory based on the open GIS data interface make ship data more complete. Data filling effectively improves the integrity of ship data, improves the accuracy of ship data analysis and ship knowledge graph modeling, enhances the distribution characteristics of ship data, and improves the efficiency of ship data analysis and processing. The cultivation process fully considers the nature of ship data and the types of missing values, and combines the goal of building a ship knowledge graph to ensure that the filling process does not introduce noise or deviation;
* _Step 4: Data fusion._ In response to the problem of ship data ambiguity, we adopted data replacement and splicing fusion methods, such as splicing and fusing multiple contact fields to form more accurate contact descriptions, so as to eliminate the heterogeneity between data and improve data integrity and reliability.