A method, system and storage medium for calculating ship mileage
By supplementing breakpoints in the trajectory data of multiple ships and correcting environmental factors, the problems of trajectory interruption and invalid displacement in the AIS system were solved, high-precision mileage calculation was achieved, adapting to complex environments, and improving transportation safety and energy efficiency management.
Patent Information
- Application Number
- CN202510789606.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-06-13
AI Technical Summary
Traditional AIS systems are susceptible to weather, obstructions or electromagnetic interference, which can lead to track interruption or data loss. They do not take into account the invalid displacement of ships while moored, resulting in inflated mileage statistics.
By acquiring the trajectory data of multiple ships, the breakpoints are determined and recursively supplemented, the invalid displacement is filtered out in combination with the environmental compensation factor, the location points of the invalid displacement are determined using multi-dimensional methods, the distance between adjacent points is corrected using the environmental factor, and the voyage mileage is calculated using the Haversine formula.
It enhances the accuracy of mileage and the fault tolerance of the system, reduces errors, adapts to actual scenarios, and provides transportation safety and energy efficiency management.
Smart Images

Figure CN120296285B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of ship mileage calculation, and in particular to a method, system and storage medium for calculating the mileage of a ship. Background Art
[0002] With the rapid development of the global shipping industry, accurate measurement and analysis of ship mileage has become a core requirement for ensuring transportation safety, optimizing route planning, fuel consumption accounting and management, and ship energy efficiency management. Ship mileage is a key indicator for measuring ship operating costs and efficiency. The accuracy and reliability of its calculation method directly affects the economic benefits and scientific decision-making of shipping companies.
[0003] As a core technology for maritime safety and communications, the Automatic Identification System (AIS) broadcasts ship dynamic information (such as position, speed, and heading) and static information (such as ship name, size, and cargo type) in real time via the VHF band, providing a high-frequency, wide-coverage data foundation for ship mileage calculation.
[0004] Traditional AIS-based systems first filter out abnormal values (such as out-of-limit longitude and latitude or sudden speed changes) from AIS messages, and use linear interpolation to complete the time-aligned trajectory points for missing data. By parsing the longitude and latitude coordinates in the periodically reported AIS messages, a sequence of discrete position points is extracted in chronological order. Based on linear interpolation, the system assumes that the ship sails in a straight line at a constant speed between adjacent points and uses the Haversine formula to calculate the shortest spherical distance between adjacent points. This formula uses the trigonometric function transformation of the latitude and longitude difference, combined with the average radius of the earth (6371 kilometers) to estimate the arc length. The great circle distance formula is then used to calculate the total voyage by accumulating all segment distances segment by segment.
[0005] The core limitation of traditional AIS systems is that they are susceptible to weather, obstruction or electromagnetic interference, often resulting in track interruption or data loss, or failing to take into account the invalid displacement of ships while moored (such as anchor drift), resulting in inflated mileage statistics.
[0006] Based on the above problems, this application proposes a method, system and storage medium for calculating the mileage of a ship. Summary of the Invention
[0007] This application proposes the following technical solutions to address one or more technical deficiencies in the above-mentioned prior art.
[0008] Based on the first aspect of the present application, a method for calculating the mileage of a ship is proposed, comprising:
[0009] S1: Obtaining the trajectory data and reporting time of a first ship, and determining whether the trajectory data of the first ship generates a breakpoint within a specified time;
[0010] S2: If the first ship has a breakpoint, obtain the second ship with the largest number of trajectory data points within a specified time, and use the trajectory data of the first ship reported by the second ship as the trajectory data of the first ship at the breakpoint;
[0011] If the time interval between adjacent trajectory data exceeds a preset time threshold, or the distance between adjacent trajectory data exceeds a preset space threshold, then there is a breakpoint between the two adjacent trajectory data;
[0012] S3: Determine whether the second ship has a breakpoint within a specified time. If a breakpoint occurs in the trajectory data of the second ship within the specified time, obtain a third ship with the largest number of trajectory data points within the specified time, and use the trajectory data of the first ship reported by the third ship within the specified time as the trajectory data of the first ship reported by the second ship at the breakpoint.
[0013] S4: Eliminating invalid displacement points from the complete trajectory data of the first ship, calculating the distance between two adjacent points in the valid displacement points in combination with the environmental compensation factor, and accumulating the distances between the two adjacent points in the valid displacement points to obtain the mileage of the ship;
[0014] The calculation formula for the distance between two adjacent points in the effective displacement position calculated by combining the environmental compensation factor is:
[0015] ,
[0016] Where d' and d represent the distances between two adjacent points in the corrected effective displacement, and the distances between two adjacent points in the corrected effective displacement. K1 and K2 represent the weights of ocean current and wind speed, respectively, which are obtained according to the ship type and environmental factors. Vy and Vf represent the speeds of ocean current and wind, respectively, which are positive when the wind is with you and negative when the wind is against you.
[0017] Recursively supplementing ship data can make the trajectory data more robust, thereby enhancing the fault tolerance of the system. Correcting the theoretical distance between adjacent points according to the environment can enhance the accuracy of the mileage.
[0018] Furthermore, after step S3, the method further includes: if there is a breakpoint in the trajectory data of the third ship within the specified time, repeating step S3 until the trajectory data of the first ship at the breakpoint is completed.
[0019] Furthermore, it is determined whether there are any invalid displacement points in the trajectory data of the first ship by using the distance between two adjacent points of the trajectory data, the length of the ship, the change in the heading angle of the ship and the maximum speed of the ship.
[0020] Determining the location points of invalid displacement from multiple dimensions can enhance the adaptability of the present application to actual scenarios and reduce the deviation in mileage.
[0021] Furthermore, if the distance between two adjacent points of the trajectory data is greater than the length of the ship, the two adjacent points are valid displacement position points;
[0022] If the distance between two adjacent points of the trajectory data is less than the length of the ship, the point with the later time between the two adjacent points is the position point of invalid displacement.
[0023] Furthermore, the maximum distance that the ship can travel within a specified time is calculated based on the maximum speed of the ship. If the distance between two adjacent points of the trajectory data exceeds the maximum distance that the ship can travel within the specified time, the point with the later time between the two adjacent points is deemed an invalid position point.
[0024] If the heading angle change of two adjacent points of the trajectory data exceeds a preset heading angle threshold, the point later in time between the two adjacent points is a position point of invalid displacement.
[0025] Furthermore, the calculation formula for the distance between two adjacent points of the trajectory data is:
[0026] When the distance between two adjacent points of the trajectory data is greater than the preset nautical mile threshold, the following calculation formula is used:
[0027] ,
[0028] When the distance between two adjacent points of the trajectory data is less than the preset nautical mile threshold, the following calculation formula is used:
[0029] ,
[0030] Among them, a represents the intermediate variable, Represents the latitude difference between two adjacent points, Δ λ represents the longitude difference between two adjacent points, c represents the central angle between the two adjacent points, R represents the average radius of the earth, d represents the distance between the two adjacent points, and φ1 and φ2 represent the latitudes of the two adjacent points respectively.
[0031] Using the invalid displacement filtering algorithm to filter out the interference segment of the ship trajectory data can make the mileage calculation of the ship more accurate, improve the quality of the data, and reduce the error of the mileage. Using the segmented formula to calculate the distance between adjacent points can take into account the mileage calculation accuracy and efficiency in long-distance navigation.
[0032] Based on the second aspect of the present application, a system for calculating ship mileage is also proposed, comprising:
[0033] The first ship module obtains the trajectory data and reporting time of the first ship, and determines whether the trajectory data of the first ship generates a breakpoint within a specified time;
[0034] Second ship module: If the first ship has a breakpoint, obtain the second ship with the most track data points within the specified time, and use the track data of the first ship reported by the second ship as the track data of the first ship at the breakpoint;
[0035] If the time interval between adjacent trajectory data exceeds a preset time threshold, or the distance between adjacent trajectory data exceeds a preset space threshold, then there is a breakpoint between the two adjacent trajectory data;
[0036] The third ship module determines whether the second ship has a breakpoint within the specified time. If the second ship's trajectory data has a breakpoint within the specified time, the module obtains the third ship with the largest number of trajectory data points within the specified time, and uses the trajectory data of the first ship reported by the third ship within the specified time as the trajectory data of the first ship reported by the second ship at the breakpoint.
[0037] Invalid filtering module: removes invalid displacement position points from the complete trajectory data of the first ship, calculates the distance between two adjacent points of the valid displacement position points in combination with the environmental compensation factor, and accumulates the distances between the two adjacent points of the valid displacement position points to obtain the mileage of the ship;
[0038] The calculation formula for the distance between two adjacent points in the effective displacement position calculated by combining the environmental compensation factor is:
[0039] ,
[0040] Where d' and d represent the distances between two adjacent points in the corrected effective displacement, and the distances between two adjacent points in the corrected effective displacement. K1 and K2 represent the weights of ocean current and wind speed, respectively, which are obtained according to the ship type and environmental factors. Vy and Vf represent the speeds of ocean current and wind, respectively, which are positive when the wind is with you and negative when the wind is against you.
[0041] Based on the third aspect of the present application, a computer program product is further proposed, which has one or more computer programs thereon, and when the computer program is executed by a computer processor, implements any of the methods described above.
[0042] The technical effect of this application is that: this application uses trajectory completion technology to fill in AIS data breakpoints caused by network and other reasons, and calculates the ship's navigation trajectory by integrating the position information, reporting time, and density of reported data reported by multiple ships. At the same time, it accurately identifies the anchoring status and environmental disturbance displacement through the invalid displacement filtering algorithm to form the ship's mileage, providing transportation safety guarantees for offshore wind power operation and maintenance operations, optimizing route planning, reducing fuel consumption and strengthening ship energy efficiency management. It can adapt to actual scenarios, improve the calculation accuracy of ship mileage, and reduce errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Other features, objects and advantages of the present application will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings.
[0044] Figure 1 The present invention provides a flow chart of a method for calculating the mileage of a ship according to an embodiment of the present application.
[0045] Figure 2 This is a framework diagram of a system for calculating ship mileage provided according to an embodiment of the present application.
[0046] Figure 3 It is a structural diagram of a computer system suitable for implementing the electronic device of the embodiment of the present application. DETAILED DESCRIPTION
[0047] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the relevant invention and are not intended to limit the invention. It should also be noted that, for ease of description, only portions relevant to the relevant invention are shown in the accompanying drawings.
[0048] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0049] Figure 1 A method for calculating the mileage of a ship according to the present application is shown, including:
[0050] S1: Obtaining the trajectory data and reporting time of a first ship, and determining whether the trajectory data of the first ship generates a breakpoint within a specified time;
[0051] S2: If the first ship has a breakpoint, obtain the second ship with the largest number of trajectory data points within a specified time, and use the trajectory data of the first ship reported by the second ship as the trajectory data of the first ship at the breakpoint;
[0052] If the time interval between adjacent trajectory data exceeds a preset time threshold, or the distance between adjacent trajectory data exceeds a preset space threshold, then there is a breakpoint between the two adjacent trajectory data;
[0053] S3: Determine whether the second ship has a breakpoint within a specified time. If a breakpoint occurs in the trajectory data of the second ship within the specified time, obtain a third ship with the largest number of trajectory data points within the specified time, and use the trajectory data of the first ship reported by the third ship within the specified time as the trajectory data of the first ship reported by the second ship at the breakpoint.
[0054] S4: Eliminating invalid displacement points from the complete trajectory data of the first ship, calculating the distance between two adjacent points in the valid displacement points in combination with the environmental compensation factor, and accumulating the distances between the two adjacent points in the valid displacement points to obtain the mileage of the ship;
[0055] The calculation formula for the distance between two adjacent points in the effective displacement position calculated by combining the environmental compensation factor is:
[0056] ,
[0057] Where d' and d represent the distances between two adjacent points in the corrected effective displacement, and the distances between two adjacent points in the corrected effective displacement. K1 and K2 represent the weights of ocean current and wind speed, respectively, which are obtained according to the ship type and environmental factors. Vy and Vf represent the speeds of ocean current and wind, respectively, which are positive when the wind is with you and negative when the wind is against you.
[0058] It should be noted that recursive supplementation of ship data can make the trajectory data more robust, thereby enhancing the fault tolerance of the system. By correcting the theoretical distance between adjacent points according to the environment, the accuracy of the mileage can be enhanced.
[0059] It should be noted that, after step S3, the method further includes: if there is a breakpoint in the trajectory data of the third ship within the specified time, repeating step S3 until the trajectory data of the first ship at the breakpoint is completed.
[0060] It should be noted that whether there is an invalid displacement position point in the trajectory data of the first ship is determined by the distance between two adjacent points of the trajectory data, the length of the ship, the change in the ship's heading angle and the maximum speed of the ship.
[0061] It should be noted that if the distance between two adjacent points of the trajectory data is greater than the length of the ship, the two adjacent points are valid displacement points;
[0062] If the distance between two adjacent points of the trajectory data is less than the length of the ship, the point with the later time between the two adjacent points is the position point of invalid displacement.
[0063] It should be noted that the maximum distance a ship can travel within a specified time is calculated based on the ship's maximum speed. If the distance between two adjacent points in the trajectory data exceeds the maximum distance a ship can travel within a specified time, the point with the later time between the two adjacent points will be deemed an invalid position point.
[0064] If the heading angle change of two adjacent points of the trajectory data exceeds a preset heading angle threshold, the point later in time between the two adjacent points is a position point of invalid displacement.
[0065] It should be noted that determining the location points of invalid displacement from multiple dimensions can enhance the adaptability of the present application to actual scenarios and reduce the deviation of mileage.
[0066] It should be noted that the calculation formula for the distance between two adjacent points of the trajectory data is:
[0067] When the distance between two adjacent points of the trajectory data is greater than the preset nautical mile threshold, the following calculation formula is used:
[0068] ,
[0069] When the distance between two adjacent points of the trajectory data is less than the preset nautical mile threshold, the following calculation formula is used:
[0070] ,
[0071] Among them, a represents the intermediate variable, Represents the latitude difference between two adjacent points, Δ λ represents the longitude difference between two adjacent points, c represents the central angle between the two adjacent points, R represents the average radius of the earth, d represents the distance between the two adjacent points, and φ1 and φ2 represent the latitudes of the two adjacent points respectively.
[0072] It should be noted that using the invalid displacement filtering algorithm to filter out the interference segment of the ship trajectory data can make the mileage calculation of the ship more accurate, improve the quality of the data, and reduce the error of the mileage. Using the segmented formula to calculate the distance between adjacent points can take into account the mileage calculation accuracy and efficiency in long-distance navigation.
[0073] It should be noted that this application uses trajectory completion technology to fill data breakpoints, uses invalid displacement filtering algorithm to eliminate interference items, and combines dynamic calibration of multi-source data to achieve high-precision calculation of ship mileage. The implementation of this application has promoted the transformation of ship voyage calculation from "empirical estimation" to "data-driven".
[0074] It should be noted that this application uses trajectory completion technology to fill in data breakpoints in the AIS system caused by network and other reasons, and calculates the navigation trajectory of the ship based on the location information, reporting time, and density of trajectory data reported by multiple ships. At the same time, it uses the invalid displacement filtering algorithm to accurately identify the anchoring status and environmental disturbance displacement, and form the mileage of the ship's navigation, providing transportation safety guarantees for offshore wind power operation and maintenance operations, optimizing route planning, reducing fuel consumption, and strengthening ship energy efficiency management.
[0075] In a specific embodiment, the trajectory data of ship A is obtained and the MMSI number and reporting time of ship A are recorded. If no trajectory data of ship A appears within a specified time, it is determined that a breakpoint has occurred in the trajectory data of ship A during that period, and the trajectory data of ship A at the breakpoint is replaced with the trajectory data of ship A reported by other ships.
[0076] During this period, if ship B generates the most track data points for ship A, the track data of ship A reported by ship B during this period will be used as the data of ship A at the breakpoint.
[0077] If the track data of ship A reported by ship B during this period does not contain any track data within a certain time interval, and the track data of ship A reported by ship B also has a breakpoint within a certain time interval, and ship C has the largest number of track data points of ship A during this time interval, then the track data of ship A reported by ship C will be used to replace the data of ship A at the breakpoint generated by ship B during this time interval;
[0078] If the track data of ship A reported by ship C during this period does not contain any track data within a certain time interval, then the track data of ship A reported by ship C also has a breakpoint within a certain time interval. If the track data of ship A reported by ship D has the largest number of points within this time interval, then the track data of ship A reported by ship D will be used to replace the data of ship A at the breakpoint generated by ship C during this time interval.
[0079] The breakpoints generated by the ships are determined in sequence, and then the density of the trajectory data is compared. The data of the breakpoints of ship A are supplemented to form the complete ship trajectory of ship A;
[0080] Determine whether there are position points with invalid displacements in the ship's trajectory data and filter them out. Specifically, calculate the distance d between two adjacent points e and f in the trajectory data of Ship A, and compare the distance d with the length L of Ship A. If d≥L, the positions of the two points are determined to be position points with valid displacements. If d<L, the point f with a later time among the two points is a position point with an invalid displacement.
[0081] If the change in the course angles of two adjacent points a and b in the trajectory data of Ship A exceeds the course angle threshold, then the point b with a later time is a position point with an invalid displacement.
[0082] Calculate the maximum distance traveled by the ship within a specified time according to the maximum speed of Ship A. If the distance between two adjacent points c and g in the obtained trajectory data exceeds the maximum distance traveled by the ship within the specified time, then the point g with a later time is an invalid position point.
[0083] Delete the position points with invalid displacements in the ship's trajectory of Ship A, correct the distances between the position points with valid displacements with an environmental compensation factor, and accumulate them to form the mileage of Ship A's voyage.
[0084] Figure 2 There is shown a calculation system for the mileage of a ship's voyage, including a first ship module a, a second ship module b, a third ship module c, and an invalid filtering module d.
[0085] In a specific embodiment, the first ship module a is configured to: obtain the trajectory data and reporting time of the first ship, and determine whether there are breakpoints in the trajectory data of the first ship within a specified time.
[0086] In a specific embodiment, the second ship module b is configured to: if there is a breakpoint in the first ship, obtain the second ship with the largest number of trajectory data points within the specified time, and use the trajectory data of the first ship reported by the second ship as the trajectory data of the first ship at the breakpoint.
[0087] If the time interval between adjacent trajectory data exceeds a preset time threshold, or the distance between adjacent trajectory data exceeds a preset space threshold, then there is a breakpoint between the two adjacent trajectory data.
[0088] In a specific embodiment, the third ship module c is configured to: determine whether there is a breakpoint in the second ship within a specified time. If there is a breakpoint in the trajectory data of the second ship within the specified time, obtain the third ship with the largest number of trajectory data points within the specified time, and use the trajectory data of the first ship reported by the third ship during this period as the trajectory data of the first ship reported by the second ship at the breakpoint.
[0089] In a specific embodiment, the invalid filtering module d is configured to: eliminate invalid displacement position points in the complete trajectory data of the first ship, calculate the distance between two adjacent points in the valid displacement position points in combination with the environmental compensation factor, and accumulate the distances between the two adjacent points in the valid displacement position points to obtain the mileage of the ship;
[0090] The calculation formula for the distance between two adjacent points in the effective displacement position calculated by combining the environmental compensation factor is:
[0091] ,
[0092] Where d' and d represent the distances between two adjacent points in the corrected effective displacement, and the distances between two adjacent points in the corrected effective displacement. K1 and K2 represent the weights of ocean current and wind speed, respectively, which are obtained according to the ship type and environmental factors. Vy and Vf represent the speeds of ocean current and wind, respectively, which are positive when the wind is with you and negative when the wind is against you.
[0093] It should be noted that the present application searches for the trajectory data reported by the ship in the historical ship navigation trajectory data source. During the time period when the ship's trajectory data is missing, the application searches for the trajectory data uploaded by other ships in the historical trajectory data source, and determines the time period when the trajectory data of other ships is missing. The same operation is repeated to form the historical trajectory of the ship. The present application adopts recursive ship switching logic to form a chain supplement mechanism, which can ensure the continuity of the trajectory data at the breakpoint, and can also supplement the trajectory data through other ships when the ship signal is interrupted.
[0094] It should be noted that the actual sailing distance of a ship is affected by environmental factors, such as ocean currents and wind speed, which can cause errors in the theoretical distance. Therefore, an environmental compensation factor is introduced to correct the data to more accurately reflect the ship's actual sailing mileage. The environmental compensation factor is calibrated according to the ship type and historical data. Large cargo ships are significantly affected by ocean currents, so they are given a larger K1 value. Sailboats are more sensitive to wind speed, so they are given a larger K2 value.
[0095] It should be noted that the distance between two adjacent points in the position point of effective displacement calculated in combination with the environmental compensation factor is related to the relationship between the environment and speed. If the environmental factors and speed factors are in a nonlinear relationship, or the environmental factors also include the influence of wave height and water temperature, then modifications should be made according to actual conditions to enhance the practicality and adaptability of this application to the environment.
[0096] It should be noted that the ship navigation trajectory of this application is the historical navigation trajectory data of all ships, which is different from the ship navigation trajectory data generated in real time. The real-time generated trajectory data will not be able to upload the real-time generated trajectory data source when the network fails. In contrast, the data source of this application is more complete and accurate.
[0097] It should be noted that this application automates invalid displacement position points, reduces the workload of manual verification of trajectory data, is suitable for large-scale ship monitoring scenarios, can analyze ship performance, optimize ship navigation routes, and provide a large number of value-added services. It solves the core pain points in ship mileage statistics and is more practical and commercially valuable. From trajectory repair to precise mileage output, the technical effect is quantifiable.
[0098] In a specific embodiment, the system described in the present application collects the AIS navigation track data of the "Haidian Yunwei 301" ship, including latitude and longitude and reporting time, and detects that there is no track data reported during the period from 08:10:00 to 08:30:00. The time period is determined to be a breakpoint interval, and the breakpoint is at 08:10:00. The historical track data source system searches for track data reported by nearby ships during the period from 08:10:00 to 08:30:00, and selects the "Haidian Yunwei 301" ship with the largest number of reported track data points. The trajectory data of "02" is used as the trajectory data of "Haidian Operation and Maintenance 301" during this period. If the trajectory data reported by "Haidian Operation and Maintenance 302" between 08:20:00 and 08:30:00 has a breakpoint at 08:20:00, then the trajectory data of other nearby ships during this period are searched in the historical trajectory data source system. The trajectory data of "Haidian Operation and Maintenance 303" with the largest number of trajectory data points reported during this period is selected as the trajectory data of "Haidian Operation and Maintenance 301" during this period.
[0099] The trajectory data of the "Haidian Operation and Maintenance 301" throughout the day were verified one by one. Assuming that the ship is 200 meters long, the ocean current speed on that day is +1.5 knots, and the wind speed is -10 knots, the ocean current weight is 0.08 and the wind speed weight is 0.03 based on the ship type and environmental factors;
[0100] If the distance between two adjacent points A and B in the calculated trajectory data is 50 meters, then the adjacent points are GPS drift noise, and the point B with the later time is an invalid displacement point, so it is removed;
[0101] If the calculated distance between two adjacent points A' and B' in the trajectory data is 250 meters, which is greater than the length of the ship, the two valid displacement position points are retained;
[0102] If the heading angle change of two adjacent points E and F in the trajectory data of "Haidian Operation and Maintenance 301" exceeds the heading angle threshold of 30°, the point F with the later time is considered an invalid displacement point and is removed;
[0103] Based on the maximum speed of "Haidian Yunwei 301" (37 km / h), the maximum distance a ship can travel within the specified time (5 minutes) is calculated to be 3.1 km. The distance between two adjacent points G and H in the trajectory data is calculated to be 4 km, which exceeds the maximum distance a ship can travel within the specified time. Therefore, the later point H is considered an invalid position point and is removed.
[0104] The distance between two adjacent points A' and B' corrected for environmental factors is: 250 (1 + 1.5 × 0.08 - 10 × 0.03) = 205 meters. The total voyage mileage is obtained by adding up the distances between all valid displacement points.
[0105] Reference below Figure 3 , which shows a structural diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application. Figure 3 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0106] like Figure 3 As shown, the computer system includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 302 or programs loaded from a storage unit 308 into a random access memory (RAM) 303. Various programs and data required for system operation are also stored in RAM 303. CPU 301, ROM 302, and RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to bus 304.
[0107] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, mouse, and the like; an output section 307 including devices such as a liquid crystal display (LCD) and speakers; a storage section 308 including devices such as a hard disk; and a communication section 309 including a network interface card such as a LAN card or a modem. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. Removable media 311, such as a magnetic disk, optical disk, magneto-optical disk, or semiconductor memory, is installed in the drive 310 as needed, so that computer programs read from the media can be installed in the storage section 308 as needed.
[0108] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for executing the method illustrated in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via the communication portion 309 and / or installed from removable media 311. When executed by the central processing unit (CPU) 301, the computer program performs the functions defined in the methods of this application. It should be noted that the computer-readable storage medium of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this application, a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such a propagated data signal may take various forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0109] Computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0110] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0111] The modules described in the embodiments of the present application may be implemented by software or hardware.
[0112] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The computer-readable storage medium carries one or more programs. When executed by the electronic device, the electronic device is configured to: obtain trajectory data and reporting time of a first ship, and determine whether a breakpoint occurs in the trajectory data of the first ship within a specified time; if a breakpoint occurs in the trajectory data of the first ship, obtain a second ship with the largest number of trajectory data points within the specified time, and use the trajectory data of the first ship reported by the second ship as the trajectory data of the first ship at the breakpoint; determine whether a breakpoint occurs in the trajectory data of the second ship within the specified time, and if a breakpoint occurs in the trajectory data of the second ship within the specified time, obtain a third ship with the largest number of trajectory data points within the specified time, and use the trajectory data of the first ship reported by the third ship within the specified time as the trajectory data of the first ship reported by the second ship at the breakpoint; eliminate invalid displacement position points in the complete trajectory data of the first ship, calculate the distance between two adjacent points of valid displacement position points in combination with an environmental compensation factor, and accumulate the distances between two adjacent points of valid displacement position points to obtain the mileage of the ship. Finally, it should be noted that the above description is merely a preferred embodiment of the present application and an illustration of the technical principles employed. Persons skilled in the art should understand that the scope of the invention herein is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned inventive concept. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features having similar functions disclosed in this application.
Claims
1. A method for calculating the mileage of a ship, characterized in that: include: S1: Obtaining the trajectory data and reporting time of a first ship, and determining whether the trajectory data of the first ship generates a breakpoint within a specified time; S2: If the first ship has a breakpoint, obtain the second ship with the largest number of trajectory data points within a specified time, and use the trajectory data of the first ship reported by the second ship as the trajectory data of the first ship at the breakpoint; If the time interval between adjacent trajectory data exceeds a preset time threshold, or the distance between adjacent trajectory data exceeds a preset space threshold, then there is a breakpoint between the two adjacent trajectory data; S3: Determine whether the second ship has a breakpoint within a specified time. If a breakpoint occurs in the trajectory data of the second ship within the specified time, obtain a third ship with the largest number of trajectory data points within the specified time, and use the trajectory data of the first ship reported by the third ship within the specified time as the trajectory data of the first ship reported by the second ship at the breakpoint. If there is a breakpoint in the trajectory data of the third ship within the specified time, repeat step S3 until the trajectory data of the first ship at the breakpoint is completed; S4: Eliminating invalid displacement points from the complete trajectory data of the first ship, calculating the distance between two adjacent points in the valid displacement points in combination with the environmental compensation factor, and accumulating the distances between the two adjacent points in the valid displacement points to obtain the mileage of the ship; The calculation formula for the distance between two adjacent points in the effective displacement position calculated by combining the environmental compensation factor is: , Where d' and d represent the distances between two adjacent points in the corrected effective displacement, and the distances between two adjacent points in the corrected effective displacement. K1 and K2 represent the weights of ocean current and wind speed, respectively, which are obtained according to the ship type and environmental factors. Vy and Vf represent the speeds of ocean current and wind, respectively, which are positive when the wind is with you and negative when the wind is against you.
2. The method according to claim 1, characterized in that The distance between two adjacent points of the trajectory data, the length of the ship, the change in the heading angle of the ship and the maximum speed of the ship are used to determine whether there is an invalid displacement position point in the trajectory data of the first ship.
3. The method according to claim 2, characterized in that If the distance between two adjacent points of the trajectory data is greater than the length of the ship, the two adjacent points are valid displacement points; If the distance between two adjacent points of the trajectory data is less than the length of the ship, the point with the later time between the two adjacent points is the position point of invalid displacement.
4. The method according to claim 2, characterized in that Calculate the maximum distance the ship can travel within the specified time based on the ship's maximum speed. If the distance between two adjacent points in the trajectory data exceeds the maximum distance the ship can travel within the specified time, the point with the later time between the two adjacent points is deemed an invalid position point. If the heading angle change of two adjacent points of the trajectory data exceeds a preset heading angle threshold, the point later in time between the two adjacent points is a position point of invalid displacement.
5. The method according to claim 2, characterized in that The calculation formula for the distance between two adjacent points of the trajectory data is: When the distance between two adjacent points of the trajectory data is greater than the preset nautical mile threshold, the following calculation formula is used: , When the distance between two adjacent points of the trajectory data is less than the preset nautical mile threshold, the following calculation formula is used: , Among them, a represents the intermediate variable, Represents the latitude difference between two adjacent points, Δ λ represents the longitude difference between two adjacent points, c represents the central angle between the two adjacent points, R represents the average radius of the earth, d represents the distance between the two adjacent points, and φ1 and φ2 represent the latitudes of the two adjacent points respectively.
6. A system for calculating the mileage of a ship, characterized in that: include: The first ship module obtains the trajectory data and reporting time of the first ship, and determines whether the trajectory data of the first ship generates a breakpoint within a specified time; Second ship module: If the first ship has a breakpoint, obtain the second ship with the most track data points within the specified time, and use the track data of the first ship reported by the second ship as the track data of the first ship at the breakpoint; If the time interval between adjacent trajectory data exceeds a preset time threshold, or the distance between adjacent trajectory data exceeds a preset space threshold, then there is a breakpoint between the two adjacent trajectory data; The third ship module determines whether the second ship has a breakpoint within the specified time. If the trajectory data of the second ship has a breakpoint within the specified time, the module obtains the third ship with the largest number of trajectory data points within the specified time, and uses the trajectory data of the first ship reported by the third ship within the specified time as the trajectory data of the first ship reported by the second ship at the breakpoint. If there is a breakpoint in the trajectory data of the third ship within the specified time, repeat the third ship module until the trajectory data of the first ship at the breakpoint is completed; Invalid filtering module: removes invalid displacement position points from the complete trajectory data of the first ship, calculates the distance between two adjacent points of the valid displacement position points in combination with the environmental compensation factor, and accumulates the distances between the two adjacent points of the valid displacement position points to obtain the mileage of the ship; The calculation formula for the distance between two adjacent points in the effective displacement position calculated by combining the environmental compensation factor is: , Where d' and d represent the distances between two adjacent points in the corrected effective displacement, and the distances between two adjacent points in the corrected effective displacement. K1 and K2 represent the weights of ocean current and wind speed, respectively, which are obtained according to the ship type and environmental factors. Vy and Vf represent the speeds of ocean current and wind, respectively, which are positive when the wind is with you and negative when the wind is against you.
7. A computer program product having one or more computer programs thereon, characterized in that: When the computer program is executed by a computer processor, the method according to any one of claims 1 to 5 is implemented.