A method, device and electronic device for determining ship entry status
By analyzing the ship's historical driving and port reporting data, identifying the abnormal driving time period, and using prediction models to determine the ship's port entry status, the problem of inaccurate prediction of ship port entry status in the prior art is solved, and the accuracy and efficiency of prediction are improved.
Patent Information
- Application Number
- CN202210135874.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-15
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2042-02-15
AI Technical Summary
The prediction of the port entry status of ships in the prior art is inaccurate, which leads to inaccurate port reporting data obtained by the maritime department, which requires manual identification, consumes a large amount of human resources and omits statistics.
Based on the historical travel data of the ship to be predicted and the historical port report data, the target latitude and longitude coordinates are determined, the normal distribution of driving time and parking time is analyzed, the abnormal driving time period is identified, and the trained port report behavior prediction model is used to determine the port arrival status of the ship.
It improves the accuracy of the prediction results of ship entry status, reduces the need for manual screening, and improves data accuracy and efficiency.
Smart Images

Figure CN114490913B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular, to a method, a device and an electronic device for determining the port entry status of a ship. Background Art
[0002] Port reporting refers to the act of reporting to the maritime department when a ship enters or leaves a port. When a ship arrives at or leaves a port, it should report the port through the port reporting system so that the maritime department can compile relevant information based on the port reporting data.
[0003] In the actual driving process, some ships do not report the port entry or departure data when entering and leaving the port, which will cause the port reporting data obtained by the maritime department to be inaccurate. Therefore, manual identification and judgment are required to determine whether the ship has entered the port. Manual identification requires port and shipping management personnel to manually screen out abnormal ships based on the ship's driving data, and then determine whether the abnormal ship has entered the port by contacting the relevant personnel of the abnormal ship. However, due to the large number of ships operating in the port, the manual identification method will consume a lot of human resources, and there will be omissions in statistics, resulting in inaccurate prediction results of the port entry status. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a method, a device and an electronic device for determining the port entry status of a ship, which can predict the port entry status of the ship to be predicted based on the historical driving data and historical port reporting data of the ship to be predicted, thereby effectively improving the accuracy of the prediction results of the ship's port entry status.
[0005] The present application provides a method for determining a ship's port entry status, the method comprising:
[0006] Based on the longitude and latitude coordinates of the ship to be predicted in at least one historical travel data and the longitude and latitude coordinates of the berth in at least one historical port reporting data, determining the target longitude and latitude coordinates at which the ship to be predicted has a tendency to enter the port;
[0007] According to the target longitude and latitude coordinates, determining at least one first driving data from the at least one historical driving data, and determining at least one first port reporting data from the at least one historical port reporting data;
[0008] For each piece of first driving data, determining the first port reporting data having the same collection time as the first driving data from the at least one piece of first port reporting data;
[0009] Determine the driving duration determined according to the first driving data and the berthing duration determined according to the first port reporting data having the same collection time as the first driving data as a duration information group for judging whether the ship to be predicted is in an abnormal driving state;
[0010] For each duration information group, a normal distribution analysis is performed on the duration information group, and a time interval corresponding to a duration information group that does not meet the normal distribution requirement is determined as the abnormal driving time period of the ship to be predicted;
[0011] A trained port reporting behavior prediction model is obtained according to the ship type of the ship to be predicted, and the abnormal driving data of the ship to be predicted during the abnormal driving time period is input into the port reporting behavior prediction model to determine the port entry status of the ship to be predicted during the abnormal driving time period.
[0012] Further, the target longitude and latitude coordinates of the ship to be predicted having a tendency to enter the port are determined based on the longitude and latitude coordinates of at least one historical travel data of the ship to be predicted and the longitude and latitude coordinates of the berth of at least one historical port reporting data, including:
[0013] For each driving longitude and latitude coordinate, determine the first target grid area where the location corresponding to the driving longitude and latitude coordinate is located in the target port area;
[0014] Determine the grid code corresponding to the first target grid area as the track grid code corresponding to the longitude and latitude coordinates of the travel;
[0015] For each berth longitude and latitude coordinate, determine a second target grid area within the target port area where the location corresponding to the berth longitude and latitude coordinate is located, and a plurality of third target grid areas around the second target grid area;
[0016] Determine the grid code corresponding to the second target grid area and the grid codes corresponding to the plurality of third target grid areas as the berth grid code corresponding to the longitude and latitude coordinates of the berth;
[0017] For each track grid code, determining whether the track grid code is the same as any one of the plurality of berth grid codes;
[0018] If so, the longitude and latitude coordinates of the vehicle corresponding to the track grid code are determined as the target longitude and latitude coordinates.
[0019] Further, the following steps are performed to determine whether the duration information group meets the normal distribution requirement:
[0020] For the driving duration in the duration information group, determining whether the driving duration meets the normal distribution requirement;
[0021] If not, it is considered that the duration information group does not meet the normal distribution requirement;
[0022] If yes, then judging whether the parking duration in the duration information group meets the normal distribution requirement;
[0023] If not, it is considered that the duration information group does not meet the normal distribution requirement;
[0024] If yes, it is considered that the duration information group meets the normal distribution requirement;
[0025] or,
[0026] For the parking duration in the duration information group, determining whether the parking duration meets the normal distribution requirement;
[0027] If not, it is considered that the duration information group does not meet the normal distribution requirement;
[0028] If yes, then for the driving duration in the duration information group, determine whether the driving duration meets the normal distribution requirement;
[0029] If not, it is considered that the duration information group does not meet the normal distribution requirement;
[0030] If yes, it is considered that the duration information group meets the normal distribution requirement;
[0031] or,
[0032] respectively determining whether the driving duration and the parking duration in the duration information group meet the normal distribution requirement;
[0033] If any one of the driving duration and the parking duration does not meet the normal distribution requirement, it is considered that the duration information group does not meet the normal distribution requirement.
[0034] Further, the following steps are performed to determine whether the driving time meets the normal distribution requirement:
[0035] determining a first standard deviation between the plurality of driving times;
[0036] determining whether a ratio between the driving time and the first standard deviation reaches a first threshold;
[0037] If so, it is considered that the driving duration does not meet the normal distribution requirement.
[0038] Further, the following steps are performed to determine whether the parking duration meets the normal distribution requirement:
[0039] determining a second standard deviation between a plurality of dwell times;
[0040] determining whether a ratio between the parking time and the second standard deviation reaches a second threshold;
[0041] If so, it is considered that the parking duration does not meet the normal distribution requirements.
[0042] Furthermore, the port reporting behavior prediction model is trained in the following manner:
[0043] For each ship type, sample data corresponding to the ship type is obtained, wherein the sample data includes static ship data, original travel data, and original port reporting data of each ship corresponding to the ship type, wherein the original port reporting data includes the original port entry status;
[0044] Based on the sample data corresponding to this type of ship, the original classification model based on the xgboost algorithm is trained to obtain the port reporting behavior prediction model corresponding to this type of ship.
[0045] Furthermore, the original classification model based on the xgboost algorithm is trained based on the sample data corresponding to the ship type to obtain the port reporting behavior prediction model corresponding to the ship type, including:
[0046] Determine the degree of negative correlation between each data feature and the prediction result, and determine a first data feature with the highest degree of negative correlation from the multiple data features; wherein the prediction result is the approach status of the ship to be predicted;
[0047] Determine an importance index for each data feature, and determine a second data feature having the lowest importance index from among the multiple data features;
[0048] Deleting the feature sample data corresponding to the first data feature and the second data feature from the sample data to obtain deleted sample data;
[0049] Determine a training sample set and a test sample set according to the deleted sample data;
[0050] Constructing the original classification model based on the training sample set;
[0051] According to the test sample set, grid search is used to perform hyperparameter learning on the original classification model until the score of the original classification model reaches a score threshold, and the original classification model when the score reaches the score threshold is determined as the port reporting behavior prediction model corresponding to the ship type.
[0052] In a second aspect, an embodiment of the present application further provides a device for determining a ship's port entry status, the device comprising:
[0053] A latitude and longitude coordinate determination module, for determining the target longitude and latitude coordinates of the ship to be predicted that has a tendency to enter the port based on the longitude and latitude coordinates of at least one historical travel data of the ship to be predicted and the longitude and latitude coordinates of the berth of at least one historical port reporting data;
[0054] a first data determination module, configured to determine at least one first driving data from the at least one historical driving data and at least one first port reporting data from the at least one historical port reporting data according to the target longitude and latitude coordinates;
[0055] A second data determination module, for each piece of first travel data, determines, from the at least one piece of first port reporting data, first port reporting data having the same collection time as the first travel data;
[0056] a duration information group determination module, configured to determine the travel duration determined according to the first travel data and the berthing duration determined according to the first port reporting data having the same collection time as the first travel data, as a duration information group for determining whether the ship to be predicted is in an abnormal travel state;
[0057] An abnormal driving time period determination module is used to perform normal distribution analysis on each time information group, and determine the time interval corresponding to the time information group that does not meet the normal distribution requirements as the abnormal driving time period of the ship to be predicted;
[0058] The port entry status prediction module is used to obtain a trained port reporting behavior prediction model according to the ship type of the ship to be predicted, and input the abnormal driving data of the ship to be predicted during the abnormal driving time period into the port reporting behavior prediction model to determine the port entry status of the ship to be predicted during the abnormal driving time period.
[0059] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the method for determining the ship's port entry status as described above are performed.
[0060] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method for determining the ship's port entry status as described above are executed.
[0061] The method for determining the port entry status of a ship provided in the embodiment of the present application determines the target longitude and latitude coordinates with a port entry trend based on the longitude and latitude coordinates of the ship to be predicted and the berth longitude and latitude coordinates, and then determines at least one first driving data and at least one first port reporting data according to the target longitude and latitude coordinates. For each first driving data, the driving time and the berthing time are determined with the first port reporting data with the same collection time as the first driving data, and then the time information group is determined. For each time information group, the time information group is subjected to normal distribution analysis to determine the abnormal driving time period of the ship to be predicted, and the abnormal interval is found by using the normal distribution outlier check method, which can reduce the data range for fusion between the port reporting data and the driving data, and accurately screen out the abnormal driving time period of the abnormally driving ship, and finally predict only the abnormal driving time period when predicting the port entry status of the ship to be predicted. The abnormal driving data of the ship to be predicted in the abnormal driving time period is input into the trained port reporting behavior prediction model to determine the port entry status of the ship to be predicted in the abnormal driving time period. The method for determining the ship's port entry status provided by the present application greatly improves the accuracy of the prediction results of the ship's port entry status compared with the determination methods in the prior art.
[0062] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0064] Figure 1 A flow chart of a method for determining the port entry status of a ship provided in an embodiment of the present application;
[0065] Figure 2 A flowchart of a method for determining target latitude and longitude coordinates provided in an embodiment of the present application;
[0066] Figure 3 A schematic diagram of the structure of a device for determining the port entry status of a ship provided in an embodiment of the present application;
[0067] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0068] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0069] Port reporting refers to the act of reporting to the maritime department when a ship enters or leaves a port. When a ship arrives at or leaves a port, it should report the port through the port reporting system so that the maritime department can compile relevant information based on the port reporting data.
[0070] In the actual driving process, some ships do not report the port entry or departure data when entering and leaving the port, which will cause the port reporting data obtained by the maritime department to be inaccurate. Therefore, there are two ways to determine whether the ship has entered the port. The first is to manually identify and judge, and the second is to use algorithm statistics to identify and judge to determine whether the ship has entered the port. In manual identification, port and shipping management personnel are required to manually screen out abnormal ships based on the ship's driving data, and then determine whether the abnormal ship has entered the port by contacting the relevant personnel of the abnormal ship. However, due to the large number of ships operating in the port, the manual identification method will consume a lot of human resources, and there will be omissions in statistics, resulting in inaccurate prediction results of the port entry status.
[0071] When the algorithm is counting, it is necessary to manually set multiple critical value parameters in advance, such as the upper and lower timestamps, the longitude and latitude of the berthing point and the distance from the port terminal, etc. In theory, the driving data cannot directly determine whether the ship is in the port based on the ship speed being 0 and the upper and lower trajectory data being greater than a certain value, and the port time of different ships is differentiated and personalized. For example, small boats are very flexible and the docking time is very short, while some ships dock for a long time, so there are often misjudgments when judging whether to enter the port.
[0072] Based on this, an embodiment of the present application provides a method for determining the status of a ship entering a port, which solves the problem of inaccurate prediction of the status of a ship entering a port in the prior art.
[0073] See also Figure 1 , Figure 1 This is a flow chart of a method for determining the port entry status of a ship provided in an embodiment of the present application. Figure 1As shown in , the method for determining the port entry status of a ship provided in an embodiment of the present application includes:
[0074] S101, based on the longitude and latitude coordinates of at least one historical travel data of the ship to be predicted and the longitude and latitude coordinates of the berth in at least one historical port reporting data, determining the target longitude and latitude coordinates of the ship to be predicted that has a tendency to enter the port.
[0075] It should be noted that a ship is a means of transport that can sail or anchor in waters for transportation or operations, and has different technical performance, equipment and structural types according to different usage requirements. The ship to be predicted refers to a ship that needs to be predicted. Historical driving data refers to the driving data generated by the ship to be predicted during its historical driving process. Specifically, historical driving data may include AIS data. The AIS system is the abbreviation of the Automatic Identification System (Automatic Identification System), which is composed of shore-based (base station) facilities and ship-borne equipment. It is a new type of digital navigation aid system and equipment that integrates network technology, modern communication technology, computer technology, and electronic information display technology. Through the AIS system, ships can continuously send their identity, location, heading and other AIS data to nearby ships and shore authorities on public wireless channels. AIS data may include the ship's speed, longitude, latitude, position accuracy, AIS timestamp, etc. The longitude and latitude coordinates of the driving are the longitude and latitude in the historical driving data. The historical port reporting data refers to the relevant data reported to the maritime department when the predicted ship enters and leaves the port in history. The historical port reporting data may include the ship identification number, the ship MMSI (Maritime Mobile Service Identify), the port entry identification, the port entry time, the port departure time, the port, the port berth longitude, the port berth latitude, etc. The berth longitude and latitude coordinates are the port berth longitude and port berth latitude in the historical port reporting data. The target longitude and latitude coordinates with a port entry trend refer to the longitude and latitude coordinates when the predicted ship is about to approach the target port. The target port is the port where the predicted port is about to arrive. Here, in the specific implementation, each historical driving data and each historical port reporting data carry a ship identification number, and each different ship identification number represents a different ship. In the specific implementation, each ship will have its own ship identification number. The ship identification number refers to the unique code used to permanently identify the ship, in order to facilitate ship identification, strengthen ship management, maintain water traffic safety, and protect the water environment. Each piece of historical driving data and historical port reporting data obtained will carry a ship identification number to distinguish which historical data belongs to which ship.
[0076] Here, it should be noted that the above examples of data included in the historical driving data and the historical port reporting data are only examples. In practice, the data included in the historical driving data and the historical port reporting data are not limited to the above examples.
[0077] For the above step S101, in the specific implementation, the longitude and latitude coordinates of the travel in at least one historical travel data and the longitude and latitude coordinates of the berth in at least one historical port reporting data generated by the ship to be predicted in the historical travel process within the historical time are obtained. Here, the historical travel data and historical port reporting data generated by the ship to be predicted in the past five years can be obtained, and the historical travel data and historical port reporting data generated by the ship to be predicted in the past three months can also be obtained. This application does not make specific restrictions. Then, based on the longitude and latitude coordinates of the travel and the longitude and latitude coordinates of the berth, the target longitude and latitude coordinates of the ship to be predicted with a tendency to enter the port are determined.
[0078] See also Figure 2 , Figure 2 Flow chart of the method for determining the target latitude and longitude coordinates provided in the embodiment of the present application. Figure 2 As shown in, the target longitude and latitude coordinates of the ship to be predicted with a tendency to enter the port are determined based on the longitude and latitude coordinates of at least one historical travel data of the ship to be predicted and the longitude and latitude coordinates of the berth of at least one historical port reporting data, including:
[0079] S201, for each travel longitude and latitude coordinate, determining a first target grid area in a target port area where a location corresponding to the travel longitude and latitude coordinate is located.
[0080] It should be noted that the target port refers to the target port that the ship to be predicted is expected to arrive at, and the target port area is the area corresponding to the location of the target port within a certain range. According to the embodiment provided in the present application, during the specific implementation, the ship to be predicted will have a target port that is expected to arrive at, but during the actual driving process, it may dock at a non-target port for some reason. When docked at a non-target port, it cannot be regarded as the ship to be predicted being in the port entry state, so it is necessary to determine the target port and target port area of the ship to be predicted. The first target grid area refers to the grid area where the location corresponding to the longitude and latitude coordinates of the driving is located.
[0081] For the above step S201, in the specific implementation, it is first necessary to determine the target port of the ship to be predicted, and then determine the target port area where the target port is located. Then, for each longitude and latitude coordinate of the travel, first determine whether the longitude and latitude coordinate of the travel is located in the target port area. If so, determine the first target grid area located in the target port area according to the longitude and latitude coordinate of the travel. Here, it is necessary to grid the longitude and latitude range within the target range according to space. Here, the target range can be a city or a sea area, and this application does not make specific restrictions on this. When performing grid division, a grid accuracy can be preset, for example, the grid accuracy is one kilometer, so that the area corresponding to a grid is a range of one kilometer * one kilometer. If the longitude and latitude coordinates of the travel are located in the target port area, for all grid areas in the target port area, determine in which grid area the longitude and latitude coordinates of the travel are located, and determine the grid area that falls into it as the first target grid area.
[0082] S202: Determine the grid code corresponding to the first target grid area as the track grid code corresponding to the longitude and latitude coordinates of the travel.
[0083] It should be noted that the grid code refers to a grid code corresponding to a grid area. As an optional implementation, the GEOHASH open source coding specification can be used to grid code each grid area, with a coding length of 6 bits, and each grid area has a unique grid code. The method of using GEOHASH to grid code each grid area is described in detail in the prior art, and will not be repeated here.
[0084] Here, it should be noted that the above examples of the grid coding method are only examples. In fact, the grid coding method is not limited to the above examples.
[0085] Regarding the above step S202, in a specific implementation, after determining the first target grid area, the grid code corresponding to the first target grid area is determined, and the grid code is used to determine the track grid code corresponding to the driving longitude and latitude coordinates.
[0086] S203, for each berth longitude and latitude coordinate, determining a second target grid area in the target port area where the location corresponding to the berth longitude and latitude coordinate is located, and a plurality of third target grid areas around the second target grid area.
[0087] It should be noted that the second target grid area is the grid area where the location corresponding to the longitude and latitude coordinates of the berth is located. The third target grid area is the grid area located around the second target grid area.
[0088] For the above step S203, the description of how to determine the second target grid area where the location corresponding to the berth longitude and latitude coordinates is located in the target port area is the same as the description in step S201, and can achieve the same technical effect, which will not be repeated. After determining the second target grid area, it is also necessary to determine the grid area around the second target grid area as the third target grid area. For example, eight grid areas around the second target grid area can be selected as the third target grid area, and this application does not make specific limitations on this.
[0089] S204: Determine the grid code corresponding to the second target grid area and the grid codes corresponding to the plurality of third target grid areas as the berth grid code corresponding to the longitude and latitude coordinates of the berth.
[0090] For the above step S204, in the specific implementation, after determining the second target grid area and multiple third target grid areas, determine the grid code corresponding to the second target grid area and the grid code corresponding to the multiple third target grid areas, and use the determined grid code to determine the trajectory grid code corresponding to the longitude and latitude coordinates of the driving.
[0091] S205 , for each track grid code, determining whether the track grid code is the same as any one of the plurality of berth grid codes.
[0092] With respect to the above step S205, after the trajectory grid code corresponding to each driving longitude and latitude coordinate and the berth grid code corresponding to each berth longitude and latitude coordinate are determined, for each trajectory grid code, it is determined whether the trajectory grid code is the same as any one of the multiple berth grid codes. If so, step S206 is executed, which is equivalent to the corresponding driving longitude and latitude coordinates and the berth longitude and latitude coordinates being in the area corresponding to the same target port.
[0093] S206: If yes, the longitude and latitude coordinates corresponding to the track grid code are determined as the target longitude and latitude coordinates.
[0094] Regarding the above step S206, in a specific implementation, if it is determined that the track grid code is the same as any one of the multiple berth grid codes, the longitude and latitude coordinates corresponding to the track grid code are determined as the target longitude and latitude coordinates.
[0095] S102: Determine at least one first driving data from the at least one historical driving data according to the target longitude and latitude coordinates, and determine at least one first port reporting data from the at least one historical port reporting data.
[0096] It should be noted that the first driving data refers to driving data whose longitude and latitude coordinates are the same as the target longitude and latitude coordinates in the historical driving data. The first port reporting data refers to port reporting data whose longitude and latitude coordinates are the same as the target longitude and latitude coordinates in the historical port reporting data.
[0097] With respect to the above step S102, since both the historical driving data and the historical port reporting data carry longitude and latitude coordinates, after determining the target longitude and latitude coordinates in step S101, at least one first driving data with the target longitude and latitude coordinates is determined from at least one historical driving data. At least one first port reporting data with the target longitude and latitude coordinates is determined from at least one historical port reporting data.
[0098] S103: for each piece of first driving data, determine, from the at least one piece of first port reporting data, first port reporting data having the same collection time as the first driving data.
[0099] It should be noted that the collection time refers to the time when the driving data or port reporting data is collected. Here, the driving data and port reporting data generated by the ship to be predicted during the driving process will have the collection time.
[0100] Regarding the above step S103, during the specific implementation, for each first driving data, it is determined whether the collection time of the first driving data is the same as the collection time of any first port reporting data in each first port reporting data. If they are the same, the first port reporting data having the same collection time as the first driving data is determined from at least one first port reporting data.
[0101] S104, determining the driving duration determined according to the first driving data and the berthing duration determined according to the first port reporting data having the same collection time as the first driving data as a duration information group for judging whether the ship to be predicted is in an abnormal driving state.
[0102] It should be noted that the travel time refers to the cumulative travel time of the ship to be predicted in a certain voyage. The berthing time refers to the stay time of the ship to be predicted when it enters a certain port. The duration information group refers to a data group containing the travel time and the berthing time. The abnormal driving state refers to the abnormal state of the ship to be predicted during the driving process, such as the state of not entering the port at the target port entry time.
[0103] With respect to the above step S104, in the specific implementation, the historical driving data carries the driving time of the ship to be predicted during the driving process, the historical port reporting data carries the berthing time of the ship to be predicted at the port, and the first driving data is determined from the historical driving data, and the first port reporting data is determined from the historical port reporting data. Therefore, for each first driving data, the driving time can be determined, and for each first port reporting data with the same collection time as the first driving data, the berthing time can be determined. And the driving time corresponding to the determined first driving data and the berthing time corresponding to the first port reporting data with the same collection time as the first driving data are determined as a time information group for judging whether the ship to be predicted is in an abnormal driving state.
[0104] S105, for each duration information group, performing normal distribution analysis on the duration information group, and determining the time interval corresponding to the duration information group that does not meet the normal distribution requirement as the abnormal driving time period of the ship to be predicted.
[0105] It should be noted that normal distribution analysis is a data analysis of each duration information group. Normal distribution requirement refers to a preset requirement for determining whether a duration information group is abnormal. Abnormal driving time period refers to a time period corresponding to when the ship to be predicted does not travel normally or does not enter the port normally.
[0106] For the above step S105, in the specific implementation, for each time information group, the duration information group is subjected to normal distribution analysis to determine whether the time information group meets the normal distribution requirements. If not, the time interval corresponding to the duration information group that does not meet the normal distribution requirements is determined as the abnormal driving time period of the ship to be predicted. Here, the start time point and the end time point of the abnormal driving can be determined according to the time interval corresponding to the duration information group that does not meet the normal distribution requirements, and then the abnormal driving time period is determined according to the start time point and the end time point.
[0107] As an optional implementation, for the above step S105, since the duration information group includes two duration data, if one of the duration data does not meet the normal distribution requirement, it is considered that the duration information group does not meet the normal distribution requirement. Therefore, when judging whether the duration information group meets the normal distribution requirement, the following three methods are included:
[0108] Method 1: for the driving duration in the duration information group, determine whether the driving duration meets the normal distribution requirement; if not, it is considered that the duration information group does not meet the normal distribution requirement; if so, for the parking duration in the duration information group, determine whether the parking duration meets the normal distribution requirement; if not, it is considered that the duration information group does not meet the normal distribution requirement; if so, it is considered that the duration information group meets the normal distribution requirement.
[0109] In method 1, it is first determined whether the driving duration in the duration information group meets the normal distribution requirement. If it does not meet the normal distribution requirement, it is directly determined that the duration information group does not meet the normal distribution requirement, and there is no need to determine the parking duration in the duration information group. If the driving duration meets the normal distribution requirement, it is determined whether the parking duration meets the normal distribution requirement. If the parking duration does not meet the normal distribution requirement, it is determined that the duration information group does not meet the normal distribution requirement. If the parking duration meets the normal distribution requirement, it is considered that the duration information group meets the normal distribution requirement.
[0110] Method 2: for the parking duration in the duration information group, judging whether the parking duration meets the normal distribution requirement; if not, it is considered that the duration information group does not meet the normal distribution requirement; if so, judging whether the driving duration in the duration information group meets the normal distribution requirement; if not, it is considered that the duration information group does not meet the normal distribution requirement; if so, it is considered that the duration information group meets the normal distribution requirement;
[0111] In method 2, first determine whether the parking time in the time information group meets the normal distribution requirement. If it does not meet the normal distribution requirement, then directly determine that the time information group does not meet the normal distribution requirement, and there is no need to determine the driving time in the time information group. If the parking time meets the normal distribution requirement, then determine whether the driving time meets the normal distribution requirement. If the driving time does not meet the normal distribution requirement, then determine that the time information group does not meet the normal distribution requirement. If the driving time meets the normal distribution requirement, then it is considered that the time information group meets the normal distribution requirement.
[0112] Method three: respectively determine whether the driving duration and parking duration in the duration information group meet the normal distribution requirement; if any one of the driving duration and the parking duration does not meet the normal distribution requirement, it is considered that the duration information group does not meet the normal distribution requirement.
[0113] In method three, it is determined whether the driving time and parking time in the time information group meet the normal distribution requirements. If one of the information does not meet the normal distribution requirements, the driving time does not meet the normal distribution requirements or the parking time does not meet the normal distribution requirements, then it is considered that the time information group does not meet the normal distribution requirements.
[0114] As an optional implementation, whether the driving duration meets the normal distribution requirement is determined by the following steps:
[0115] A: Determine the first standard deviation between multiple driving times.
[0116] It should be noted that the standard deviation is the arithmetic square root of the variance. The standard deviation can reflect the degree of dispersion of a data set.
[0117] Regarding the above step A, since multiple first driving data are determined, there are multiple driving durations, and the first standard deviation is determined according to the multiple driving durations determined. Here, how to calculate the standard deviation between multiple data is described in detail in the prior art and will not be repeated here.
[0118] B: Determine whether the ratio between the driving duration and the first standard deviation reaches a first threshold.
[0119] It should be noted that the first threshold refers to a threshold preset in advance and used to determine whether the driving time meets the normal distribution requirements. For example, the first threshold can be set to 3, and this application does not make specific limitations on this.
[0120] For the above step B, in the specific implementation, after determining the first standard deviation, determine whether the ratio between the driving time and the first standard deviation reaches the first threshold, that is, determine whether the driving time reaches a preset multiple of the first standard deviation. If so, execute step C.
[0121] C: If yes, it is considered that the driving duration does not meet the normal distribution requirements.
[0122] Regarding the above step C, during specific implementation, if it is determined that the ratio between the driving time and the first standard deviation reaches the first threshold, it is considered that the driving time does not meet the normal distribution requirement.
[0123] As an optional implementation, whether the parking duration meets the normal distribution requirement is determined by the following steps:
[0124] a: Determine the second standard deviation between multiple parking times.
[0125] For the above step a, since multiple first parking data are determined, there are multiple parking durations, and the second standard deviation is determined according to the multiple parking durations. Here, how to calculate the standard deviation between multiple data is described in detail in the prior art and will not be repeated here.
[0126] b: Determine whether the ratio between the parking time and the second standard deviation reaches a second threshold.
[0127] It should be noted that the second threshold refers to a threshold preset in advance and used to determine whether the parking time meets the normal distribution requirements. For example, the first threshold can be set to 3, and this application does not make specific limitations on this.
[0128] Regarding the above step b, in the specific implementation, after determining the second standard deviation, it is determined whether the ratio between the parking time and the second standard deviation reaches the second threshold, that is, it is determined whether the parking time reaches a preset multiple of the second standard deviation. If so, step C is executed.
[0129] c: If yes, it is considered that the parking duration does not meet the normal distribution requirements.
[0130] Regarding the above step c, during specific implementation, if it is determined that the ratio between the parking time and the second standard deviation reaches the second threshold, it is considered that the driving time does not meet the normal distribution requirement.
[0131] S106, obtaining a trained port reporting behavior prediction model according to the ship type of the ship to be predicted, and inputting the abnormal driving data of the ship to be predicted during the abnormal driving time period into the port reporting behavior prediction model to determine the port entry status of the ship to be predicted during the abnormal driving time period.
[0132] It should be noted that the ship type refers to the type of ship to which the ship to be predicted belongs. There are different ship types according to different classification methods. For example, according to the purpose, there are civilian ships and military ships; according to the hull material, there are wooden ships, steel ships, cement ships and fiberglass ships; according to the navigation area, there are ocean-going ships, near-sea ships, coastal ships and inland ships; according to the power plant, there are steam ships, internal combustion engine ships, steamships and nuclear-powered ships; according to the propulsion method, there are paddle steamers, propeller ships, flat-rotating propeller ships and sail-assisted ships; according to the navigation method, there are self-propelled ships and non-self-propelled ships; according to the navigation status, there are displacement ships and non-displacement ships. Abnormal driving data refers to the historical driving data of the ship to be predicted during the abnormal driving time period. The port reporting behavior prediction model refers to a model used to predict the port entry status of the ship to be predicted. The port entry status can include that the ship to be predicted has entered the port and the ship to be predicted has not entered the port.
[0133] Regarding the above step S106, in the specific implementation, after the abnormal driving time period of the ship to be predicted is determined in step S105, the abnormal driving data of the ship to be predicted in the abnormal driving time period is obtained from the historical driving data. Then, according to the ship type of the ship to be predicted, the port reporting behavior prediction model corresponding to the ship type is obtained, and the abnormal driving data of the ship to be predicted in the abnormal driving time period is input into the port reporting behavior prediction model to determine the port entry status of the ship to be predicted in the abnormal driving time period. Here, in the process of model construction and training, the sample data contains both driving data and port reporting data, so that the driving data and port reporting data can be integrated, and the behavioral characteristics of the ship entering and leaving the port and the mechanical characteristics of the ship itself are used for model training, which can more accurately learn the port reporting critical value and more accurately judge the port reporting behavior.
[0134] As an optional implementation, the port reporting behavior prediction model is trained in the following manner:
[0135] Step 1061, for each ship type, obtain sample data corresponding to the ship type.
[0136] It should be noted that the sample data refers to each training data used to construct and train the port reporting behavior prediction model. According to the embodiment provided by the present application, the sample data may include the ship static data, original driving data and original port reporting data of each ship corresponding to the ship type. Here, the ship static data refers to the information data of the ship, such as the ship tonnage, ship length and engine power. The original driving data refers to the driving data of the ship in the driving state. The data types contained in the original driving data are the same as the data types contained in the historical driving data mentioned in the above embodiment of the present application, and will not be repeated here. The original port reporting data refers to the port reporting data of the ship in the normal port entry and exit state. The data types contained in the original port reporting data are the same as the data types contained in the historical port reporting data mentioned in the above embodiment of the present application, and will not be repeated here. The original port reporting data also includes the original port entry state, that is, whether the ship enters the port under the normal port entry and exit state.
[0137] For the above step 1061, for each ship type, all sample data corresponding to the ship type for training the port reporting behavior prediction model are obtained, including the ship static data, original driving data and original port reporting data of each ship corresponding to the ship type.
[0138] Step 1062: train the original classification model based on the xgboost algorithm based on the sample data corresponding to the ship type to obtain the port reporting behavior prediction model corresponding to the ship type.
[0139] It should be noted that the original classification model refers to the original model used to predict the port entry status of the ship to be predicted.
[0140] For the above step 1062, in the specific implementation, the original classification model based on the xgboost algorithm is trained using the sample data corresponding to the type of ship to obtain the port reporting behavior prediction model corresponding to the type of ship. As an optional implementation, the original classification model based on the xgboost algorithm is trained based on the sample data corresponding to the type of ship to obtain the port reporting behavior prediction model corresponding to the type of ship, including:
[0141] Step 10621, determine the negative correlation degree between each data feature and the prediction result, and determine the first data feature with the highest negative correlation degree from the multiple data features.
[0142] It should be noted that the prediction result refers to the approach status of the ship to be predicted. Data features refer to various data features contained in the sample data, such as ship length, ship speed, ship heading, etc. The negative correlation degree refers to the negative correlation between the data feature and the prediction result. The first data feature refers to the data feature with the highest negative correlation with the prediction result among all the data features of the sample data.
[0143] For the above step 10621, in the specific implementation, for each data feature in the sample data, determine the degree of negative correlation between the data feature and the prediction result. Specifically, the negative correlation degree of the data feature can be calculated using the data exploration and analysis method. First, calculate the mean value, median, mode, minimum value, maximum value, quartile, and standard deviation of each data feature; then calculate the Pearson correlation coefficient between two data features; and calculate the frequency and proportion of each feature of the category feature in the sample data, and finally determine the first data feature with the highest negative correlation from multiple data features.
[0144] Here, it should be noted that the above description of the method for calculating the degree of negative correlation is only an example. In practice, the method for calculating the degree of negative correlation is not limited to the above example.
[0145] Step 10622, determine the importance index of each data feature, and determine the second data feature with the lowest importance index from the multiple data features.
[0146] It should be noted that the importance index refers to the importance of the data feature to the prediction result. The second data feature refers to the data feature with the lowest importance to the prediction result among all the data features of the sample data.
[0147] For the above step 10622, during the specific implementation, for each data feature in the sample data, determine the importance index of the data feature. Specifically, the importance index of the data feature can be calculated using the feature importance evaluation method. XBG provides three ways to evaluate feature importance: weight (the feature importance uses the number of times the feature is used as a partitioning attribute in all trees), gain (the feature importance uses the average reduction in loss when the feature is used as a partitioning attribute), and cover (the feature importance uses the coverage of the sample when the feature is used as a partitioning attribute. According to the embodiment provided in the present application, it is necessary to use cover: XGBRFClassifier (importance_type = 'cover') to evaluate the importance of data features and calculate the importance index of the data feature. Finally, the second data feature with the lowest importance index is determined from multiple data features.
[0148] Here, it should be noted that the above description of the method for calculating the importance index is only an example. In practice, the method for calculating the importance index is not limited to the above example.
[0149] Step 10623: Delete the feature sample data corresponding to the first data feature and the second data feature from the sample data to obtain deleted sample data.
[0150] With respect to the above step 10623, after the first data feature and the second data feature are determined, the feature sample data corresponding to the first data feature and the second data feature are deleted from the sample data to obtain the deleted sample data. In the deleted sample data obtained in this way, data features that are irrelevant and insensitive to the prediction results are excluded, so that the accuracy of model training can be improved when the model is subsequently established and trained.
[0151] Step 10624: Determine a training sample set and a test sample set based on the deleted sample data.
[0152] It should be noted that the training sample set refers to the sample data used to build the model, and the test sample set refers to the sample data used to train the model.
[0153] Regarding the above step 10624, in the specific implementation, after the deleted sample data is determined, the training sample set and the test sample set are determined according to the deleted sample data. As an optional implementation, the deleted sample data can be divided into proportions, for example, a 7:3 ratio, that is, 70% of the deleted sample data is used as the training sample set, and 30% of the deleted sample data is used as the test sample set.
[0154] Step 10625, constructing the original classification model based on the training sample set.
[0155] For the above step 10625, in the specific implementation, the original classification model based on the xgboost algorithm is constructed based on the training sample set determined in step 10624. Here, how to use sample data to construct the original classification model based on the xgboost algorithm is described in detail in the prior art, and will not be repeated here.
[0156] Step 10626, based on the test sample set, use grid search to perform hyperparameter learning on the original classification model until the score of the original classification model reaches a score threshold, and then determine the original classification model when the score reaches the score threshold as the port reporting behavior prediction model corresponding to the ship type.
[0157] It should be noted that hyperparameters are parameters whose values are set before the learning process begins, rather than parameter data obtained through training. Generally, hyperparameters need to be optimized during machine learning, and a set of optimal hyperparameters are selected for the learner to improve the performance and effect of learning. For example, the number of trees or the depth of the tree, the learning rate (multiple modes), the regularization weight, and the adjustment of sample balance are all hyperparameters. Hyperparameter learning refers to the optimization of parameters during model training, which generally involves an effective search for possible values of the parameters, and then the optimal parameters are selected using an evaluation function. Evaluation indicators can be selected as accuracy, f1-score, f-beta, precision, recall, etc. as needed, and this application does not make specific restrictions on this. Grid search refers to the selection of all candidate parameters, through loop traversal, trying every possibility, and the best performing parameter is the final result. The score threshold refers to a value preset in advance to determine whether the original classification model meets the training standard.
[0158] For the above step 10626, in the specific implementation, based on the test sample set determined in step 10624, the grid search method is used to perform hyperparameter learning on the original classification model, and the evaluation function is used to calculate the score of the original classification model until the score of the original classification model reaches the score threshold. At this time, it is considered that the original classification model has reached the training standard, and the original classification model when the score reaches the score threshold is determined as the port reporting behavior prediction model corresponding to the ship type.
[0159] In this way, after the port reporting behavior prediction model is trained, the abnormal driving data of the ship to be predicted during the abnormal driving time period can be input into the trained port reporting behavior prediction model, and the port entry status of the ship to be predicted during the abnormal driving time period can be predicted.
[0160] The method for determining the port entry status of a ship provided in the embodiment of the present application determines the target longitude and latitude coordinates with a port entry trend based on the longitude and latitude coordinates of the ship to be predicted and the berth longitude and latitude coordinates, and then determines at least one first driving data and at least one first port reporting data according to the target longitude and latitude coordinates. For each first driving data, the driving time and the berthing time are determined with the first port reporting data with the same collection time as the first driving data, and then the time information group is determined. For each time information group, the time information group is subjected to normal distribution analysis to determine the abnormal driving time period of the ship to be predicted, and the abnormal interval is found by using the normal distribution outlier check method, which can reduce the data range for fusion between the port reporting data and the driving data, and accurately screen out the abnormal driving time period of the abnormally driving ship, and finally predict only the abnormal driving time period when predicting the port entry status of the ship to be predicted. The abnormal driving data of the ship to be predicted in the abnormal driving time period is input into the trained port reporting behavior prediction model to determine the port entry status of the ship to be predicted in the abnormal driving time period. The method for determining the ship's port entry status provided by the present application greatly improves the accuracy of the prediction results of the ship's port entry status compared with the determination methods in the prior art.
[0161] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of a device for determining the port entry status of a ship provided in an embodiment of the present application. Figure 3 As shown, the determining device 300 includes:
[0162] The latitude and longitude coordinate determination module 301 is used to determine the target longitude and latitude coordinates of the ship to be predicted that has a tendency to enter the port based on the longitude and latitude coordinates of at least one historical travel data of the ship to be predicted and the longitude and latitude coordinates of the berth of at least one historical port reporting data;
[0163] A first data determination module 302, configured to determine at least one first driving data from the at least one historical driving data and at least one first port reporting data from the at least one historical port reporting data according to the target longitude and latitude coordinates;
[0164] The second data determination module 303 is used to determine, for each piece of first travel data, from the at least one piece of first port reporting data, first port reporting data having the same collection time as the first travel data;
[0165] The duration information group determination module 304 is used to determine the travel duration determined according to the first travel data and the berthing duration determined according to the first port reporting data having the same collection time as the first travel data as a duration information group for determining whether the ship to be predicted is in an abnormal travel state;
[0166] The abnormal driving time period determination module 305 is used to perform normal distribution analysis on each time information group, and determine the time interval corresponding to the time information group that does not meet the normal distribution requirements as the abnormal driving time period of the ship to be predicted;
[0167] The port entry status prediction module 306 is used to obtain a trained port reporting behavior prediction model according to the ship type of the ship to be predicted, and input the abnormal driving data of the ship to be predicted during the abnormal driving time period into the port reporting behavior prediction model to determine the port entry status of the ship to be predicted during the abnormal driving time period.
[0168] Further, when the latitude and longitude coordinate determination module 301 is used to determine the target longitude and latitude coordinates of the ship to be predicted that has a tendency to enter the port based on the longitude and latitude coordinates of at least one historical travel data of the ship to be predicted and the longitude and latitude coordinates of the berth of at least one historical port reporting data, the longitude and latitude coordinate determination module 301 is used to:
[0169] For each driving longitude and latitude coordinate, determine the first target grid area where the location corresponding to the driving longitude and latitude coordinate is located in the target port area;
[0170] Determine the grid code corresponding to the first target grid area as the track grid code corresponding to the longitude and latitude coordinates of the travel;
[0171] For each berth longitude and latitude coordinate, determine a second target grid area within the target port area where the location corresponding to the berth longitude and latitude coordinate is located, and a plurality of third target grid areas around the second target grid area;
[0172] Determine the grid code corresponding to the second target grid area and the grid codes corresponding to the plurality of third target grid areas as the berth grid code corresponding to the longitude and latitude coordinates of the berth;
[0173] For each track grid code, determining whether the track grid code is the same as any one of the plurality of berth grid codes;
[0174] If so, the longitude and latitude coordinates of the vehicle corresponding to the track grid code are determined as the target longitude and latitude coordinates.
[0175] Furthermore, the abnormal driving time period determination module 305 determines whether the duration information group meets the normal distribution requirement through the following steps:
[0176] For the driving duration in the duration information group, determining whether the driving duration meets the normal distribution requirement;
[0177] If not, it is considered that the duration information group does not meet the normal distribution requirement;
[0178] If yes, then judging whether the parking duration in the duration information group meets the normal distribution requirement;
[0179] If not, it is considered that the duration information group does not meet the normal distribution requirement;
[0180] If yes, it is considered that the duration information group meets the normal distribution requirement;
[0181] or,
[0182] For the parking duration in the duration information group, determining whether the parking duration meets the normal distribution requirement;
[0183] If not, it is considered that the duration information group does not meet the normal distribution requirement;
[0184] If yes, then for the driving duration in the duration information group, determine whether the driving duration meets the normal distribution requirement;
[0185] If not, it is considered that the duration information group does not meet the normal distribution requirement;
[0186] If yes, it is considered that the duration information group meets the normal distribution requirement;
[0187] or,
[0188] respectively determining whether the driving duration and the parking duration in the duration information group meet the normal distribution requirement;
[0189] If any one of the driving duration and the parking duration does not meet the normal distribution requirement, it is considered that the duration information group does not meet the normal distribution requirement.
[0190] Furthermore, the abnormal driving time period determination module 305 determines whether the driving time meets the normal distribution requirement through the following steps:
[0191] determining a first standard deviation between the plurality of driving times;
[0192] determining whether a ratio between the driving time and the first standard deviation reaches a first threshold;
[0193] If so, it is considered that the driving duration does not meet the normal distribution requirement.
[0194] Furthermore, the abnormal driving time period determination module 305 determines whether the parking time meets the normal distribution requirement through the following steps:
[0195] determining a second standard deviation between a plurality of dwell times;
[0196] determining whether a ratio between the parking time and the second standard deviation reaches a second threshold;
[0197] If so, it is considered that the parking duration does not meet the normal distribution requirements.
[0198] Furthermore, the port entry status prediction module 306 trains the port reporting behavior prediction model in the following manner:
[0199] For each ship type, sample data corresponding to the ship type is obtained, wherein the sample data includes static ship data, original travel data, and original port reporting data of each ship corresponding to the ship type, wherein the original port reporting data includes the original port entry status;
[0200] Based on the sample data corresponding to this type of ship, the original classification model based on the xgboost algorithm is trained to obtain the port reporting behavior prediction model corresponding to this type of ship.
[0201] Furthermore, when the port entry status prediction module 306 is used to train the original classification model based on the xgboost algorithm based on the sample data corresponding to the ship type to obtain the port reporting behavior prediction model corresponding to the ship type, the port entry status prediction module 306 is also used to:
[0202] Determine the degree of negative correlation between each data feature and the prediction result, and determine a first data feature with the highest degree of negative correlation from the multiple data features; wherein the prediction result is the approach status of the ship to be predicted;
[0203] Determine an importance index for each data feature, and determine a second data feature having the lowest importance index from among the multiple data features;
[0204] Deleting the feature sample data corresponding to the first data feature and the second data feature from the sample data to obtain deleted sample data;
[0205] Determine a training sample set and a test sample set according to the deleted sample data;
[0206] Constructing the original classification model based on the training sample set;
[0207] According to the test sample set, grid search is used to perform hyperparameter learning on the original classification model until the score of the original classification model reaches a score threshold, and the original classification model when the score reaches the score threshold is determined as the port reporting behavior prediction model corresponding to the ship type.
[0208] See also Figure 4 , Figure 4This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown in , the electronic device 400 includes a processor 410 , a memory 420 and a bus 430 .
[0209] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, the above-mentioned Figure 1 as well as Figure 2 The steps of the method for determining the ship's port entry status in the method embodiment shown solve the problem of inaccurate prediction of the ship's port entry status in the prior art. The specific implementation method can be found in the method embodiment and will not be repeated here.
[0210] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 as well as Figure 2 The steps of the method for determining the ship's port entry status in the method embodiment shown solve the problem of inaccurate prediction of the ship's port entry status in the prior art. The specific implementation method can be found in the method embodiment and will not be repeated here.
[0211] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0212] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0213] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0214] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0215] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0216] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0217] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for determining the port entry status of a ship, characterized in that: The determination method comprises: Based on the longitude and latitude coordinates of the ship to be predicted in at least one historical travel data and the longitude and latitude coordinates of the berth in at least one historical port reporting data, determining the target longitude and latitude coordinates at which the ship to be predicted has a tendency to enter the port; According to the target longitude and latitude coordinates, determining at least one first driving data from the at least one historical driving data, and determining at least one first port reporting data from the at least one historical port reporting data; For each piece of first driving data, determining the first port reporting data having the same collection time as the first driving data from the at least one piece of first port reporting data; Determine the driving duration determined according to the first driving data and the berthing duration determined according to the first port reporting data having the same collection time as the first driving data as a duration information group for judging whether the ship to be predicted is in an abnormal driving state; For each duration information group, a normal distribution analysis is performed on the duration information group, and a time interval corresponding to a duration information group that does not meet the normal distribution requirement is determined as the abnormal driving time period of the ship to be predicted; A trained port reporting behavior prediction model is obtained according to the ship type of the ship to be predicted, and the abnormal driving data of the ship to be predicted during the abnormal driving time period is input into the port reporting behavior prediction model to determine the port entry status of the ship to be predicted during the abnormal driving time period.
2. The determination method according to claim 1, characterized in that: The method of determining the target longitude and latitude coordinates of the ship to be predicted that has a tendency to enter the port based on the longitude and latitude coordinates of at least one historical travel data of the ship to be predicted and the longitude and latitude coordinates of the berth of at least one historical port reporting data comprises: For each driving longitude and latitude coordinate, determine the first target grid area where the location corresponding to the driving longitude and latitude coordinate is located in the target port area; Determine the grid code corresponding to the first target grid area as the track grid code corresponding to the longitude and latitude coordinates of the travel; For each berth longitude and latitude coordinate, determine a second target grid area within the target port area where the location corresponding to the berth longitude and latitude coordinate is located, and a plurality of third target grid areas around the second target grid area; Determine the grid code corresponding to the second target grid area and the grid codes corresponding to the plurality of third target grid areas as the berth grid code corresponding to the longitude and latitude coordinates of the berth; For each track grid code, determining whether the track grid code is the same as any one of the plurality of berth grid codes; If so, the longitude and latitude coordinates of the vehicle corresponding to the track grid code are determined as the target longitude and latitude coordinates.
3. The determination method according to claim 1, characterized in that: Determine whether the duration information group meets the normal distribution requirement by following the steps below: For the driving duration in the duration information group, determining whether the driving duration meets the normal distribution requirement; If not, it is considered that the duration information group does not meet the normal distribution requirement; If yes, then judging whether the parking duration in the duration information group meets the normal distribution requirement; If not, it is considered that the duration information group does not meet the normal distribution requirement; If yes, it is considered that the duration information group meets the normal distribution requirement; or, For the parking duration in the duration information group, determining whether the parking duration meets the normal distribution requirement; If not, it is considered that the duration information group does not meet the normal distribution requirement; If yes, then for the driving duration in the duration information group, determine whether the driving duration meets the normal distribution requirement; If not, it is considered that the duration information group does not meet the normal distribution requirement; If yes, it is considered that the duration information group meets the normal distribution requirement; or, respectively determining whether the driving duration and the parking duration in the duration information group meet the normal distribution requirement; If any one of the driving duration and the parking duration does not meet the normal distribution requirement, it is considered that the duration information group does not meet the normal distribution requirement.
4. The determination method according to claim 3, characterized in that: The following steps are used to determine whether the driving time meets the normal distribution requirement: determining a first standard deviation between the plurality of driving times; determining whether a ratio between the driving time and the first standard deviation reaches a first threshold; If so, it is considered that the driving duration does not meet the normal distribution requirement.
5. The determination method according to claim 3, characterized in that: Determine whether the parking duration meets the normal distribution requirement by following the steps below: determining a second standard deviation between a plurality of dwell times; determining whether a ratio between the parking time and the second standard deviation reaches a second threshold; If so, it is considered that the parking duration does not meet the normal distribution requirements.
6. The determination method according to claim 1, characterized in that: The port reporting behavior prediction model is trained in the following way: For each ship type, sample data corresponding to the ship type is obtained, wherein the sample data includes static ship data, original travel data, and original port reporting data of each ship corresponding to the ship type, wherein the original port reporting data includes the original port entry status; Based on the sample data corresponding to this type of ship, the original classification model based on the xgboost algorithm is trained to obtain the port reporting behavior prediction model corresponding to this type of ship.
7. The determination method according to claim 6, characterized in that: The original classification model based on the xgboost algorithm is trained based on the sample data corresponding to the ship type to obtain the port reporting behavior prediction model corresponding to the ship type, including: Determine the degree of negative correlation between each data feature and the prediction result, and determine a first data feature with the highest degree of negative correlation from the multiple data features; wherein the prediction result is the approach status of the ship to be predicted; Determine an importance index for each data feature, and determine a second data feature having the lowest importance index from among the multiple data features; Deleting the feature sample data corresponding to the first data feature and the second data feature from the sample data to obtain deleted sample data; Determine a training sample set and a test sample set according to the deleted sample data; Constructing the original classification model based on the training sample set; According to the test sample set, grid search is used to perform hyperparameter learning on the original classification model until the score of the original classification model reaches a score threshold, and the original classification model when the score reaches the score threshold is determined as the port reporting behavior prediction model corresponding to the ship type.
8. A device for determining the port entry status of a ship, characterized in that: The determining device comprises: A latitude and longitude coordinate determination module, for determining the target longitude and latitude coordinates of the ship to be predicted that has a tendency to enter the port based on the longitude and latitude coordinates of at least one historical travel data of the ship to be predicted and the longitude and latitude coordinates of the berth of at least one historical port reporting data; a first data determination module, configured to determine at least one first driving data from the at least one historical driving data and at least one first port reporting data from the at least one historical port reporting data according to the target longitude and latitude coordinates; A second data determination module, for each piece of first travel data, determines, from the at least one piece of first port reporting data, first port reporting data having the same collection time as the first travel data; a duration information group determination module, used to determine the travel duration determined according to the first travel data and the berthing duration determined according to the first port reporting data having the same collection time as the first travel data, as a duration information group for determining whether the ship to be predicted is in an abnormal travel state; An abnormal driving time period determination module is used to perform normal distribution analysis on each time information group, and determine the time interval corresponding to the time information group that does not meet the normal distribution requirements as the abnormal driving time period of the ship to be predicted; The port entry status prediction module is used to obtain a trained port reporting behavior prediction model according to the ship type of the ship to be predicted, and input the abnormal driving data of the ship to be predicted during the abnormal driving time period into the port reporting behavior prediction model to determine the port entry status of the ship to be predicted during the abnormal driving time period.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the method for determining the port entry status of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for determining the port entry status of a ship as claimed in any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Electronic port ship arrival control method
CN112070107A
Ship navigation track prediction method based on ship type
CN112132346A