Automatic judgment method for loading and unloading of ship

By applying data processing and machine learning technology in ship management, sorting and screening related features, and training models from AIS data for loading and unloading judgments, the problem of insufficient accuracy and coverage of traditional methods is solved, and more efficient and maintainable automated judgments are achieved.

CN119886987APending Publication Date: 2025-04-25COSCO SHIPPING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510035832.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The traditional automatic judgment method for loading and unloading of ships has problems such as low accuracy, difficulty in covering complex conditions, and time-consuming and laborious code maintenance.

Method used

Data processing, data cleaning and machine learning technology are used to organize features related to loading and unloading judgments, filter and organize data from AIS data, train machine learning models, such as XGBoost model, and perform automatic loading and unloading judgments.

Benefits of technology

It improves the accuracy and coverage of automated judgments of ship loading and unloading, simplifies the process of handling new situations, and reduces code maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119886987A_ABST
    Figure CN119886987A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of shipping informatization and intellectualization, and particularly relates to a ship loading and unloading automation judgment method. The method comprises the following steps: arranging features related to loading and unloading judgment; selecting features, screening and sorting data corresponding to the features, generating hundreds of data, screening repair state data and refueling state data, and eliminating data inconsistent with business experience to form a training data set; selecting a plurality of data from the training data set, training the machine learning model, and performing model parameter optimization in the training process to obtain a trained model; carrying out reverse judgment on the trained model through STS for loading and unloading under special conditions; and two groups of data are randomly extracted to form two data sets, the trained model is adopted for testing, and the testing precision of the two data sets is detected. According to the invention, the accuracy of loading and unloading judgment based on AIS data can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of shipping informationization and intelligentization, and specifically relates to an automatic judgment method for loading and unloading of ships. Background Art

[0002] With the development of digital shipping today, the automation of ship loading and unloading judgment plays an important role in ship management, including:

[0003] 1. Used to transmit the loading and unloading information of the ship. It can provide historical information on the loading and unloading status of the ship to help the captain, crew and related personnel make better decisions.

[0004] 2. Used for ship cargo volume analysis. The judgment of ship loading and unloading is an important source of information for judging the ship's cargo volume. Knowing the loading and unloading situation of the ship at the port is an important basis for obtaining the import and export of cargo.

[0005] 3. Used for rationalization of shore-side transportation scheduling. High-precision judgment of ship loading and unloading can make shore-side transportation more reasonably allocated and scheduled according to ship loading and unloading.

[0006] 4. Used to calculate the operational efficiency of ports, berths, shipping companies, and single ships. The judgment of automated ship loading and unloading can further calculate the operation of ships and port berths and further calculate the operational efficiency.

[0007] Misjudgment of ship loading and unloading may lead to a series of consequences for ship management:

[0008] 1. Inefficient ship management: Incorrect judgments on ship loading and unloading may result in the ship management system being unable to accurately monitor the ship’s loading and unloading information, which may bring difficulties to ship operation management. Loading and unloading can be used to infer the import and export volume of ports, countries, and trade zones. If these judgments are wrong, it may affect the speculation of trade volume and lead to economic losses.

[0009] 2. Inaccurate shore traffic scheduling: Shore traffic scheduling depends on the judgment of the port ship loading and unloading. The wrong judgment of the ship loading and unloading may lead to the wrong information received by the shore, resulting in the inability to accurately schedule shore traffic.

[0010] 3. Inaccurate calculation of the operational efficiency of ports, berths, shipping companies and single ships. The operational efficiency of ports, berths, shipping companies and single ships depends on the judgment of loading and unloading of ships. If the judgment of loading and unloading is wrong, it will affect the inaccurate calculation of various operational efficiencies.

[0011] Therefore, misjudgment in the loading and unloading of ships may have serious impacts on the management of ships, ports, berths, shipping companies and shores, and appropriate measures need to be taken to detect and correct them in a timely manner.

[0012] In traditional ship management, the automated judgment of ship loading and unloading usually relies on business logic. Developers need to fully understand and apply business logic, including the nature of the ship's berth (whether it is a repair berth), the change in draft before and after the ship berths, whether the previous port and the current port are the same port, whether the previous port is a repair port, etc. This method of judgment based on business logic can accurately cover most of the ship's loading and unloading behaviors, and can be combined with manual verification to improve the accuracy. However, this method has obvious limitations, such as low accuracy and inability to accurately cover a wider range of loading and unloading situations. In addition, due to the lengthy causal logic, the traditional automated judgment of ship loading and unloading needs to break or add the original causal logic every time a new situation is encountered, which is more time-consuming and labor-intensive in code maintenance. Summary of the invention

[0013] The present invention solves the problems that the traditional method for automatic judgment of loading and unloading of ships needs to be combined with rich experience in ship management, is prone to errors, is difficult to cover all complex conditions, and is time-consuming and labor-intensive in code maintenance. A method for automatic judgment of loading and unloading of ships is provided, which is replaced by more advanced methods, such as data processing, data cleaning, machine learning, etc., to improve the accuracy, coverage and efficiency of automatic judgment of loading and unloading of ships.

[0014] The technical solution claimed in the present invention is as follows:

[0015] A method for automatically judging the loading and unloading of a ship comprises the following steps:

[0016] S1: Based on the experience of shipping business, the characteristics related to the judgment of loading and unloading are sorted out; the characteristics can reflect the basis for the judgment of loading and unloading;

[0017] S2: Based on the features selected in S1, the data corresponding to these features are screened and sorted from the AIS data to form a code for automatically screening the feature data. The code is used to generate hundreds of data, screen out the repair status data and refueling status data in the data, and eliminate the data that is inconsistent with business experience. The remaining data constitutes the training data set;

[0018] S3: Select a number of data that are incorrectly judged by traditional loading and unloading automation and data that are correctly judged by traditional loading and unloading automation from the training data set obtained in S2, train the machine learning model, and tune the model parameters during the training process to obtain a trained model;

[0019] S4: For special loading and unloading, the loading and unloading of the main features of the model trained in S3 is not clear through ship-to-ship loading and unloading. The special loading and unloading refers to the loading and unloading of ships instead of ships using port equipment in general ports. The counter-judgment refers to judging the loading and unloading of the current ship by the draft of another ship.

[0020] S5: Randomly extract two groups of data to form two data sets, use the model trained in S3 to test, and detect the test accuracy of the two data sets. If the test accuracy of the two data sets can reach the specified value, output the model, otherwise jump back to S2.

[0021] Preferably, the features in S1 include: the empty and full load conditions of the current port, the nature of loading and unloading at the current port, the operation time at the current port, the loading and unloading conditions of the previous port, the draft change when entering the current port and the next port, whether the previous port is for repairs, whether the previous port and the current port are the same, the empty and full load conditions of the previous port, whether the voyage from the previous port to the current port is refueled, whether the berth at the current port is a berth for a certain type of ship, whether the berth at the current port is a repair berth, whether the current port has a berth for a certain type of ship, whether the Ais data missing rate of the voyage to the current port is greater than 0.9, whether a port is missed in the voyage to the current port, the nature of loading and unloading at the previous port, the number of draft changes in the voyage to the current port, whether the draft changes in the voyage to the current port, and the number of anchorings in the voyage to the current port.

[0022] In the above method, S2 uses PostgreSQL and Python to filter and organize the data corresponding to the selected features from the AIS data, forming a code for automatically filtering feature data.

[0023] Preferably, the draft change between the current port and the next port is obtained by writing Lag and Lead functions in PostgreSQL to find the draft value of the current port and the draft value of the next port corresponding to the timestamp in the python code, and using the difference between the two values.

[0024] Preferably, the number of draft changes in the voyage to the current port is determined by writing Lag and Lead functions to create a sliding window with a length of 10 and a front and back of 5 in PostgreSQL, ensuring that the draft values ​​in the window with a length of 10 are consistent, and if the current draft has changed, it is judged to be an effective draft, and the total number of calculations is the total effective draft number.

[0025] In the above method, the machine learning models described in S3 include: XGBoost model and random forest model; the model parameter tuning described in S3 adopts GridSearch.

[0026] Preferably, GridSearch uses GridSearchCV, where CV stands for cross validation, and the parameter settings are: clf for estimator, and the set param_grid for param_grid, where the settings for param_grid are: n_est is set from 40 to 90; 'accuracy' for scoring; cv is set to 5; verbose is set to 1; n_jobs is set to 3; max_depth is set from 2 to 20; learning_rate is set from 0.001 to 0.5; reg_lambda is set from 0.5 to 1.0; reg_alpha is set from 0.0000001 to 0.001; booster is set to 'gbtree'; objective is set to 'multi:softmax'; num_class is set to 2.

[0027] Preferably, when the machine learning model selects the XGBoost model, during the model training process, the objective function formula of the t-th decision tree of XGBoost is as follows:

[0028]

[0029] Where n represents the number of samples; represents the corresponding loss function; y i represents the actual value of sample i; represents the predicted value of sample i by the first t decision trees; Ω(f t ) represents the model complexity of the t-th decision tree, which is a regularization term. The purpose is to penalize more complex models, thereby reducing overfitting;

[0030]

[0031] Where T is the depth of the current tree, and ω is the node value of the leaf node;

[0032] The penalization for more complex models is achieved by reducing the depth of the tree and the weight value of individual leaves.

[0033] Preferably, the port equipment in S4 refers to port equipment, port facilities, and transport pipelines installed in ports.

[0034] Preferably, after the model is trained in step S3, the trained model performs batch judgment on the data in the training data set obtained in S2, and imports the judgment results and the repair and refueling data judged in S2 into the database.

[0035] Beneficial effects:

[0036] The present invention provides a method for automatically judging the loading and unloading of a ship. According to the shipping business experience, the features related to the judgment of loading and unloading are sorted out, and the features can reflect the judgment basis of loading and unloading; according to the selected features, the data corresponding to these features are screened and sorted out from AIS data to form a code for automatically screening feature data, and hundreds of data are generated by the code, and the repair status data and refueling status data irrelevant to loading and unloading in the data are screened out to improve the accuracy of subsequent model prediction, and the data that is contrary to business experience in the data is eliminated to further improve the accuracy of model prediction, and the remaining data constitute a training data set; a number of data with errors in the traditional loading and unloading automation judgment and data with correctness in the traditional loading and unloading automation judgment are selected from the training data set to improve the generalization ability of the subsequent model, and the machine learning model is trained, and the model parameters are tuned during the training process to improve the accuracy of the subsequent model prediction. High model training accuracy, get a trained model; for special loading and unloading situations, the ship undergoes STS operation, and the nature of loading and unloading at the current port is unclear, and the draft change of the current ship is unclear, and whether the previous one is empty or full is unclear. At this time, the main features of the model are unclear, and the model judgment may be inaccurate. In this case, STS is used to perform reverse judgment to improve the judgment accuracy of ship loading and unloading; two groups of data are randomly selected to form two data sets (the number of data in the two data sets is 938 and 999 respectively), and the S3 trained model is used for testing to detect the test accuracy of the two data sets. The test accuracy reaches 99.5%. Compared with the 95% accuracy of the traditional causal logic loading and unloading automation judgment method, the method of machine learning combined with business experience is more accurate, and it is simpler to deal with new situations. It only needs to add features and the model code does not need to be changed. In summary, the present invention can effectively improve the accuracy of loading and unloading judgment based on AIS data, and in the subsequent optimization process, for more complex loading and unloading situations, it is only necessary to add corresponding features to cover them, and the code of the model itself does not need to be changed, which has a better coverage of complex situations and lower code maintenance costs, and solves the problems that traditional automated loading and unloading judgment methods need to be combined with rich ship management experience, are prone to errors, difficult to cover all complex situations, and time-consuming and labor-intensive code maintenance.

[0037] Compared with the traditional automated judgment of loading and unloading, the present invention has the following advantages: it is digital and intelligent, and can quickly and accurately judge the loading and unloading of LNG ships; for complex loading and unloading situations, it only needs to add features on the basis of the original model, and the new features can be combined with the existing features to analyze more complex dimensions and loading and unloading situations, greatly increasing the coverage of the model; in the subsequent model optimization process, it only needs to add data features, and the code of the model itself does not need to be changed, which greatly reduces the maintenance cost of the code.

[0038] After the model is trained in step S3, the trained model performs batch judgment on the data in the training data set obtained in S2, and imports the judgment results and the repair and refueling data judged by S2 into the database, which facilitates the automatic call of the results later. For example, if you need to query the loading and unloading results of a ship, you only need to check the ship's mmsi and the corresponding operation time, and you can use PostgreSQL statements or MySQL statements from the database to directly call the results; you can also call multiple ships, and you only need to use SQL statements to query multiple mmsi to get all the results. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 The present invention is a flowchart of a method for automatically determining the loading and unloading of a ship according to an embodiment of the present invention.

[0040] Figure 2 These are data values ​​corresponding to some features automatically screened out by the embodiment of the present invention.

[0041] Figure 3 This is an example of the judgment result of traditional automated loading and unloading in an embodiment of the present invention.

[0042] Figure 4 This embodiment of the present invention uses the model provided by the present invention to judge the loading and unloading results of CORAL ENERGICE (MMSI=244090097). DETAILED DESCRIPTION

[0043] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0044] The present invention provides a method for automatically judging the loading and unloading of a ship. Figure 1 As shown, the following steps are included:

[0045] S1: Based on the experience of shipping business, sort out the features related to the judgment of loading and unloading; the features can reflect the judgment basis of loading and unloading; in a specific embodiment of the present invention, based on the experience of shipping business, sort out the usable features related to the judgment of loading and unloading, and these features can reflect the judgment basis of loading and unloading. The XGBoost model used in the present invention uses 18 features related to the judgment of loading and unloading, as shown in Table 1.

[0046] Table 1. Parameters related to loading and unloading

[0047] Serial number Feature Description Parameter name 1 Current port empty and full load situation is_full_load 2 Current port loading and unloading characteristics lng_port_type 3 Operating hours at current port berth_duration 4 Loading and unloading situation at the previous port lag_load_type 5 The change in draft between the current port and the next port draught_diff_mode 6 Was the last port for repairs? lag_is_repair 7 Are the previous port and current port the same? is_equal_last_port 8 Empty and full load situation of the previous port lag_is_full_load 9 Whether to refuel from the last port to the current port is_fuel 10 Is the current berth a berth for a certain type of ship? is_in_lng_berth 11 Is the current berth a repair berth? is_in_repair_berth 12 Is there a berth for a certain type of ship in the current port? has_lng_berth 13 Is the missing rate of Ais data for the voyage to the current port greater than 0.9? is_ais_lost 14 Whether there is any missed port in the voyage before the current port is_port_loss 15 The nature of loading and unloading at the previous port lag_port_type 16 Number of draft changes during the voyage to the current port draught_change_time 17 Whether there is a change in draft during the voyage to the current port is_draught_change 18 Number of anchorages during the voyage to the current port total_moor_times

[0048] S2: According to the features selected in S1, the data corresponding to these features are screened and sorted from the AIS data to form a code for automatically screening feature data, and the code is used to generate hundreds of data, screen out the repair status data and refueling status data in the data, and eliminate the data that contradicts business experience in the data. The remaining data constitutes a training data set; in a specific embodiment of the present invention, among the 18 features in Table 1, except for the 5th and 16th features, all are directly obtained by PostgreSQL, and the 5th feature (the change in draft when entering the current port and the next port) and the 16th feature (the number of draft changes in a voyage before the current port) are screened using python and PostgreSQL. Among them, the 5th feature is to find the draft value when entering the current port and the draft value when entering the next port corresponding to the timestamp in the python code in PostgreSQL by writing Lag and Lead functions, and the 5th feature is obtained by the difference between the two values. The 16th feature creates a sliding window with a length of 10 and a front and back 5 in PostgreSQL by writing Lag and Lead functions. It ensures that the draft values ​​in the window with a length of 10 are consistent. If the current draft has changed, it is judged as an effective draft, and the total number of changes is the total effective draft number. Figure 2 The data values ​​corresponding to some features automatically selected.

[0049] The repair status data and refueling status data are filtered out. Specifically, if the berth where the ship is currently parked is a repair berth, the data will not be involved in the subsequent model training and model judgment, and will be directly judged as a repair status; if there is a refueling record and the name of the current port is the same as the name of the refueling port, the data will not be involved in the subsequent model training and model judgment, and the current port status will be directly judged as refueling.

[0050] Eliminate data that contradicts business experience, specifically: the current port's port nature is a loading port, but the current port's draft change is negative, that is, from the draft change, it should be unloading. If it leads to the current port being judged as unloading, the data should be eliminated, because the port's loading and unloading nature should be more important than the draft change. Similarly, if the current port's port nature is a loading port, and the draft change is positive, while the previous port's loading and unloading is loading, if it leads to the current port's loading and unloading being judged as unloading, the data should also be eliminated.

[0051] S3: Select some data with traditional loading and unloading automation errors and data with traditional loading and unloading automation correct judgments from the training data set obtained in S2. In this embodiment, 430 data are finally selected from the data generated by the code, including 108 data with traditional logic errors and 322 data with traditional logic correct judgments (compared with manual labels). The machine learning model is trained, and the model parameters are tuned during the training process to obtain a trained model. The trained model performs batch judgment on the data in the training data set obtained in S2, and imports the judgment results and the repair and refueling data judged by S2 into the database together, which facilitates the automatic call of the results later. In a specific embodiment of the present invention, the XGBoost model is used for training, and the model parameters are tuned using GridSearch, and the trained model is saved using Python's joblib package. In the process of model parameter adjustment, GridSearch uses GridSearchCV. The CV in GridSearchCV stands for cross validation. The parameter settings are: estimator uses clf, param_grid uses the set param_grid, and the settings of param_grid are: n_est is set from 40 to 90; scoring uses 'accuracy'; cv is set to 5; verbose is set to 1; n_jobs is set to 3; max_depth is set from 2 to 20; learning_rate is set from 0.001 to 0.5; reg_lambda is set from 0.5 to 1.0; reg_alpha is set from 0.0000001 to 0.001; booster is set to 'gbtree'; objective is set to 'multi:softmax'; num_class is set to 2.

[0052] The objective function formula of the t-th decision tree of XGBoost is as follows:

[0053]

[0054] Where n represents the number of samples; represents the corresponding loss function; y i represents the actual value of sample i; represents the predicted value of sample i by the first t decision trees; Ω(f t ) represents the model complexity of the t-th decision tree, which is a regularization term. The purpose is to penalize more complex models (by reducing the depth of the tree and the weight value of a single leaf), thereby reducing overfitting;

[0055]

[0056] Among them, T is the depth of the current tree, and ω is the node value of the leaf node.

[0057] S4: For special loading and unloading situations, STS is used to perform reverse judgment on the loading and unloading of goods for which the main features of the model trained in S3 are unclear; in a specific embodiment of the present invention, the reverse judgment is based on business logic judgment, which has the advantage of improving the accuracy of the overall judgment. The reverse judgment is conditional, that is, the ship has STS operation, and the nature of loading and unloading at the current port is unclear, and the draft of the current ship has changed, and it is unclear whether the previous ship is empty or full. At this time, the main features of the model application are unclear, and the model judgment may be inaccurate, then the draft of another ship can be used to reverse the current ship; the loading and unloading in the special case means that the ship is not loading and unloading with port equipment in the general port, but STS loading and unloading; STS specifically refers to the abbreviation of ship-to-ship, that is, ship-to-ship operation; the port equipment refers to port equipment, port facilities, and transportation pipelines set up in the port; the reverse judgment refers to judging the loading and unloading of the current ship by the draft of another ship; in a specific embodiment of the present invention, if the ship has ship-to-ship operation, and the nature of loading and unloading at the current port is unclear, and the draft of the current ship has changed, and it is unclear whether the previous ship is empty or full, then the draft of another ship can be used to reverse the current ship. If the draft of the other ship is positive, the other ship is loading and the current ship is unloading; if the draft of the other ship is negative, the other ship is unloading and the current ship is loading.

[0058] S5: Randomly extract two groups of data to form two data sets, use the model trained in S3 for testing, and detect the test accuracy of the two data sets. If the test accuracy of the two data sets can reach the specified value, output the model, otherwise jump back to S2; in a specific embodiment of the present invention, 938 randomly extracted data and 999 randomly extracted data are used as test sets to test the accuracy of the model. The test results (938 pieces, the number of judgment errors is 3, and the accuracy rate is 99.7%; 999 pieces, the number of judgment errors is 5, and the accuracy rate is 99.5%) show that the accuracy of the two test sets both reached 99.5%.

[0059] In a specific embodiment of the present invention, after obtaining a trained model through steps S1-S5, the trained model is imported into the joblib package of python. When automatically judging the loading and unloading of a ship, it is only necessary to use python code to obtain the data corresponding to the model features from the database, and import the model with python for prediction, and then update the results to the database with python to complete the judgment of the automated loading and unloading. In some embodiments of the present invention, the characteristics of the ship can be directly input into the trained model. In other embodiments of the present invention, the operation is performed through the database. The purpose is to integrate the invention into a real development system. For example, if the front end needs to call the model results, it can directly obtain the data from the database. For example, if the back end needs to perform further calculations based on the model results, it can directly operate in the database.

[0060] The steps and effects of the present invention are described below by taking the LNG ship CORALENERGICE (MMSI=244090097) as an example. Figure 3 This is an example of the result of traditional automated loading and unloading judgment. It can be found that the traditional judgment method makes wrong judgments on both Klaipeda Port and Brofjordan Port. According to manual experience, Klaipeda Port should be loading and Brofjordan Port should be unloading.

[0061] During the model saving process, the trained model is imported using Python's joblib package, and batch judgments are made on data that are neither repair nor refueling. The results are imported into the database together with the previously judged repair and refueling data.

[0062] After importing the results into the database, the loading and unloading results of CORALENERGICE (MMSI = 244090097) can be analyzed. Figure 4 It can be seen that the results judged by the model in the database ( Figure 4 The load_type_xgboost field in the _load_type_xgboost_field is opposite to the judgment result of traditional automated loading and unloading (1 for loading and 0 for unloading). The status of the ship berthing at Klaipeda Port on September 11 was loading, and the status of the ship berthing at Brofjordan Port on September 14 was unloading, which is consistent with the manual experience judgment, that is, the model judgment is correct.

[0063] It should be noted that the above-described specific implementations can enable those skilled in the art to more fully understand the invention, but do not limit the invention in any way. Therefore, although this specification has described the invention in detail with reference to the drawings and embodiments, those skilled in the art should understand that the invention can still be modified or replaced by equivalents. In short, all technical solutions and improvements that do not deviate from the spirit and scope of the invention should be included in the protection scope of the patent for the invention.

Claims

1. A method for automatically judging the loading and unloading of a ship, characterized in that: The steps include: S1: Based on the experience of shipping business, the characteristics related to the judgment of loading and unloading are sorted out; the characteristics can reflect the basis for the judgment of loading and unloading; S2: Based on the features selected in S1, the data corresponding to these features are screened and sorted from the AIS data to form a code for automatically screening the feature data. The code is used to generate hundreds of data, screen out the repair status data and refueling status data in the data, and eliminate the data that is inconsistent with business experience. The remaining data constitutes the training data set; S3: Select a number of data that are incorrectly judged by traditional loading and unloading automation and data that are correctly judged by traditional loading and unloading automation from the training data set obtained in S2, train the machine learning model, and tune the model parameters during the training process to obtain a trained model; S4: For special loading and unloading, the loading and unloading of the main features of the model trained in S3 is not clear through ship-to-ship loading and unloading. The special loading and unloading refers to the loading and unloading of ships instead of ships using port equipment in general ports. The counter-judgment refers to judging the loading and unloading of the current ship by the draft of another ship. S5: Randomly extract two groups of data to form two data sets, use the model trained in S3 to test, and detect the test accuracy of the two data sets. If the test accuracy of the two data sets can reach the specified value, output the model, otherwise jump back to S2.

2. The method for automatically judging the loading and unloading of a ship according to claim 1, characterized in that: The features described in S1 include: the empty and full load situation of the current port, the nature of loading and unloading at the current port, the operation time at the current port, the loading and unloading situation of the previous port, the draft change when entering the current port and the next port, whether the previous port is for repairs, whether the previous port and the current port are the same, the empty and full load situation of the previous port, whether refueling is carried out in the voyage from the previous port to the current port, whether the berth at the current port is a berth for a certain type of ship, whether the berth at the current port is a repair berth, whether the current port has a berth for a certain type of ship, whether the Ais data missing rate of the voyage to the current port is greater than 0.9, whether a port is missed in the voyage to the current port, the nature of loading and unloading at the previous port, the number of draft changes in the voyage to the current port, whether the draft changes in the voyage to the current port, and the number of anchorings in the voyage to the current port.

3. The method for automatically judging the loading and unloading of a ship according to claim 1 or 2, characterized in that: In S2, based on the selected features, PostgreSQL and Python are used to filter and organize the data corresponding to these features from the AIS data, forming a code for automatically filtering feature data.

4. The method for automatically determining the loading and unloading of a ship according to claim 2, characterized in that: The draft change between the current port and the next port is obtained by writing Lag and Lead functions in PostgreSQL to find the draft value of the current port and the draft value of the next port corresponding to the timestamp in the python code, and using the difference between the two values.

5. The method for automatically judging the loading and unloading of a ship according to claim 2, characterized in that: The number of draft changes in the voyage to the current port is calculated by writing Lag and Lead functions to create a sliding window with a length of 10 and a front and back of 5 in PostgreSQL, ensuring that the draft values ​​in the window with a length of 10 are consistent. If the current draft has changed, it is judged to be an effective draft, and the total number of calculated times is the total effective draft times.

6. The method for automatically judging the loading and unloading of a ship according to claim 1, characterized in that: The machine learning models described in S3 include: XGBoost model and random forest model; the model parameter tuning described in S3 adopts GridSearch.

7. The method for automatically judging the loading and unloading of a ship according to claim 6, characterized in that: GridSearch uses GridSearchCV. The CV in GridSearchCV stands for cross validation. The parameter settings are: estimator uses clf, param_grid uses the set param_grid, and param_grid is set as follows: n_est is set from 40 to 90; scoring uses 'accuracy'; cv is set to 5; verbose is set to 1; n_jobs is set to 3; max_depth is set from 2 to 20; learning_rate is set from 0.001 to 0.5; reg_lambda is set from 0.5 to 1.0; reg_alpha is set from 0.0000001 to 0.001; booster is set to 'gbtree'; objective is set to 'multi:softmax'; num_class is set to 2.

8. The method for automatically judging the loading and unloading of a ship according to claim 6, characterized in that: When the machine learning model uses the XGBoost model, during the model training process, the objective function formula of the t-th decision tree of XGBoost is as follows: Where n represents the number of samples; represents the corresponding loss function; y i represents the actual value of sample i; represents the predicted value of sample i by the first t decision trees; Ω(f t ) represents the model complexity of the t-th decision tree, which is a regularization term. The purpose is to penalize more complex models, thereby reducing overfitting; Where T is the depth of the current tree, and ω is the node value of the leaf node; The penalization for more complex models is achieved by reducing the depth of the tree and the weight value of individual leaves.

9. The method for automatically judging the loading and unloading of a ship according to claim 1, characterized in that: The port equipment mentioned in S4 refers to port equipment, port facilities, and transportation pipelines installed in ports.

10. The method for automatically judging the loading and unloading of a ship according to claim 1, characterized in that: After the model is trained in step S3, the trained model performs batch judgment on the data in the training data set obtained in S2, and imports the judgment results and the repair and refueling data judged in S2 into the database.