A target track estimation method, device, electronic device and storage medium
Through sliding time window technology and data processing methods, the data problem in ship track prediction is solved, the accuracy and practicality of track prediction are improved, and efficient track prediction effect is achieved.
Patent Information
- Application Number
- CN202311666488.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-06
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2043-12-06
AI Technical Summary
The prior art has low trajectory accuracy and insufficient practicality due to data duplication, noise and missing in ship track estimates.
Sliding time window technology is used to determine the inflection point of the route through data sorting, abnormal detection, noise and missing processing, combined with slope fitting, and achieve accurate prediction of the path.
It improves the accuracy and practicality of track prediction, reduces data storage costs, and reduces the inflection point prediction error rate.
Smart Images

Figure CN117892076B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a target track estimation method, device, electronic equipment and storage medium. Background Art
[0002] The current technical solution for ship track estimation is to draw the predicted ship track directly based on the supplier's data. However, the data pulled from the supplier has the following problems: data duplication and noise, data missing in some time periods, and data not sent in strict chronological order. The turning points calculated directly based on the supplier's data are prone to misjudgment errors, which will cause the estimated ship track to appear rough and messy, with low track accuracy and insufficient practicality. Summary of the invention
[0003] The present invention aims to solve one of the technical problems in the related art at least to a certain extent. To this end, the present invention proposes a target track estimation method, device, electronic device and storage medium, which can accurately estimate the ship track.
[0004] On the one hand, an embodiment of the present invention provides a target track estimation method, comprising:
[0005] Obtain the navigation data of the target ship, and obtain ordered data in time series according to the navigation data; the ordered data includes data of several track points;
[0006] A sliding time window is set on the ordered data; the sliding time window is used to obtain a first preset number of track point data from the ordered data;
[0007] Shift the sliding time window on the ordered data by one data unit, and update the track point data in the sliding time window;
[0008] Based on the updated continuous multiple track point data in the sliding time window, determine the slope of each route corresponding to the continuous multiple track point data; and based on the change trend of the slope of the adjacent route, determine the route turning point; and then determine the estimated track corresponding to the sliding time window; then return to the step of translating the sliding time window on the ordered data by one data unit until the ordered data is traversed;
[0009] According to each section of the estimated track, the complete estimated track of the target ship is obtained.
[0010] Optionally, the navigation data of the target ship is obtained, and the ordered data in time series is obtained according to the navigation data, including:
[0011] Continuously acquire the heading data of the target ship, sort the heading data based on the timestamp to obtain ordered data; and periodically update the ordered data based on the continuously acquired heading data;.
[0012] Optionally, the sliding time window includes a start bit and an end bit; the sliding time window is shifted by one data unit on the ordered data, and the track point data in the sliding time window is updated, including:
[0013] Add 1 to the identifier of all track point data referenced by the sliding time window;
[0014] The track point data of the starting position before the update is discarded, and the track point data after the ending position before the update is introduced to update the track point data in the sliding time window.
[0015] Optionally, the method further comprises:
[0016] Perform abnormal data detection on the sliding time window after the track point data is updated, remove the detected abnormal data, and introduce the track point data after the end bit of the updated sliding time window into the sliding time window;
[0017] Among them, abnormal data includes expired data and duplicate data; expired data indicates that the timestamp of the track point data introduced by the update is smaller than the timestamp of the track point data of the starting position before the update; duplicate data indicates that the track point data introduced by the update is the same as any track point data in the sliding time window before the update.
[0018] Optionally, before the step of determining the slope of each route segment corresponding to the continuous plurality of track point data based on the updated continuous plurality of track point data in the sliding time window, the method further includes at least one of the following:
[0019] Traverse all track point data in the updated sliding time window, perform noise point data detection based on adjacent track point data, and remove the detected noise point data;
[0020] Data missing detection is performed on the updated sliding time window. When there is missing data in the sliding time window, the missing data is interpolated.
[0021] Optionally, traverse all track point data in the updated sliding time window, perform noise point data detection based on adjacent track point data, and remove the detected noise point data, including:
[0022] According to the updated sliding time window, based on the latitude and longitude information of the adjacent track point data, combined with the timestamp traversal, the average speed of each group of adjacent track point data corresponding to the route is calculated;
[0023] When the average speed is greater than a preset speed threshold, the track point data corresponding to the average speed is determined to be noise data, and the noise data is then removed.
[0024] Optionally, data missing detection is performed on the updated sliding time window. When there is missing data in the sliding time window, the missing data is interpolated, including:
[0025] According to the timestamps of each track point data in the sliding time window, the timestamp differences of each group of adjacent track point data are determined;
[0026] When the timestamp difference is greater than a preset time threshold, it is determined that there is missing data between adjacent track point data corresponding to the timestamp difference;
[0027] Determine the interpolation quantity according to the timestamp difference and the preset time interval of the adjacent track point data;
[0028] According to the adjacent track point data corresponding to the timestamp difference and the interpolation quantity, the missing data is interpolated by the cubic spline interpolation method.
[0029] On the other hand, an embodiment of the present invention provides a target track estimation device, including:
[0030] The first module is used to obtain the navigation data of the target ship, and to obtain the ordered data in time series according to the navigation data; the ordered data includes a number of track point data;
[0031] The second module is used to set a sliding time window on the ordered data; the sliding time window is used to obtain a first preset number of track point data from the ordered data;
[0032] The third module is used to translate the sliding time window on the ordered data by one data unit to update the track point data in the sliding time window;
[0033] The fourth module is used to determine the slope of each route corresponding to the continuous multiple track point data based on the updated continuous multiple track point data in the sliding time window; and determine the route turning point based on the change trend of the slope of the adjacent route; and then determine the estimated track corresponding to the sliding time window; and then return to the step of translating the sliding time window on the ordered data by one data unit until the ordered data is traversed;
[0034] The fifth module is used to obtain the complete estimated track of the target ship based on the estimated tracks of each segment.
[0035] Optionally, the device further comprises:
[0036] The sixth module is used to detect abnormal data in the sliding time window after the track point data is updated, remove the detected abnormal data, and introduce the track point data after the end bit of the updated sliding time window into the sliding time window; wherein, the abnormal data includes expired data and duplicate data; expired data indicates that the timestamp of the track point data introduced by the update is less than the timestamp of the track point data at the start bit before the update; duplicate data indicates that the track point data introduced by the update is the same as any track point data in the sliding time window before the update.
[0037] Optionally, before executing the fourth module, the device further includes at least one of the following:
[0038] The seventh module is used to traverse all track point data in the updated sliding time window, perform noise point data detection based on adjacent track point data, and remove the detected noise point data;
[0039] The eighth module is used to perform data missing detection on the updated sliding time window, and interpolate the missing data when there is missing data in the sliding time window.
[0040] On the other hand, an embodiment of the present invention provides an electronic device, including: a processor and a memory; the memory is used to store programs; the processor executes the program to implement the above-mentioned target track estimation method.
[0041] On the other hand, an embodiment of the present invention provides a computer storage medium, in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to implement the above-mentioned target track estimation method.
[0042] The embodiment of the present invention first obtains the navigation data of the target ship, and obtains the ordered data in time series according to the navigation data; the ordered data includes a plurality of track point data; a sliding time window is set on the ordered data; the sliding time window is used to obtain the first preset number of track point data from the ordered data; the sliding time window is translated by one data unit on the ordered data to update the track point data in the sliding time window; based on the continuous multiple track point data in the updated sliding time window, the slope of each route corresponding to the continuous multiple track point data is determined; and based on the change trend of the slope of the adjacent route, the route inflection point is determined; and then the estimated track corresponding to the sliding time window is determined; then the step of translating the sliding time window by one data unit on the ordered data is returned until the ordered data is traversed; according to each section of the estimated track, the complete estimated track of the target ship is obtained. The embodiment of the present invention continuously updates the track point data through the sliding time window, which can effectively sort out the time series of the track, and can facilitate data filtering, and fit the route inflection point through the slope determined by the continuous multiple track point data, further improving the track prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solution of the present invention and do not constitute a limitation to the technical solution of the present invention.
[0044] Figure 1 This is a schematic diagram of an implementation environment for target track estimation provided by an embodiment of the present invention;
[0045] Figure 2 It is a flow chart of a target track estimation method provided by an embodiment of the present invention;
[0046] Figure 3 A schematic diagram of the overall processing of AIS data from generation to storage provided by an embodiment of the present invention;
[0047] Figure 4 A schematic diagram of the application principle of the sliding time window provided in an embodiment of the present invention;
[0048] Figure 5 A schematic diagram of the overall process of the target track estimation method provided by an embodiment of the present invention;
[0049] Figure 6 A schematic diagram of the principle of updating a sliding time window provided by an embodiment of the present invention;
[0050] Figure 7 A schematic diagram of an example of noise data provided by an embodiment of the present invention;
[0051] Figure 8 A schematic diagram of an example of data loss provided by an embodiment of the present invention;
[0052] Fig. 9 A schematic diagram of an example of an inflection point provided by an embodiment of the present invention;
[0053] Fig.10 A schematic diagram of the structure of a target track estimation device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0055] It should be noted that, although the functional modules are divided in the system schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first / S100", "second / S200", etc. in the specification, claims and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0056] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0057] To facilitate the understanding of the technical solution of the present invention, the professional names that may appear in the technical solution of the present invention are first explained:
[0058] The Automatic Identification System (AIS) is composed of shore-based 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. The AIS system cooperates with the Global Positioning System (GPS) to broadcast ship dynamics such as ship position, speed, rate of change of course and course, as well as ship static information such as ship name, call sign, draft and dangerous goods, to nearby ships and shore stations via very high frequency (VHF), so that nearby ships and shore stations can timely grasp the dynamic and static information of all ships in the nearby sea, and can immediately communicate and coordinate with each other to take necessary avoidance actions, effectively ensuring the safety of ship navigation.
[0059] It is understandable that the target track estimation method provided in the embodiment of the present invention can be applied to any computer device with data processing and computing capabilities, and this computer device can be various terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, tablet computer, laptop computer, desktop computer, etc., but is not limited to this.
[0060] like Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the invention. Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected to a network wirelessly or wired to complete data transmission and exchange.
[0061] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0062] In addition, the server 101 can also be a node server in the blockchain network. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm.
[0063] The terminal 102 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal 102 and the server 101 may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiment of the present invention.
[0064] Based on the example Figure 1 In the implementation environment shown, an embodiment of the present invention provides a target track prediction method. The target track prediction method is applied to the server 101 as an example for explanation below. It can be understood that the target track prediction method can also be applied to the terminal 102.
[0065] Reference Figure 2 , Figure 2 The flowchart of the target track prediction method applied to the server provided by the embodiment of the present invention, the execution subject of the target track prediction method can be any of the aforementioned computer devices (including servers or terminals). Figure 2 , the method comprises the following steps:
[0066] S100, obtaining navigation data of a target ship, and obtaining ordered data in time series according to the navigation data;
[0067] It should be noted that the ordered data includes a number of track point data; in some embodiments, step S100 may include: continuously acquiring the heading data of the target ship, sorting the heading data based on the timestamp to obtain the ordered data; and periodically updating the ordered data based on the continuously acquired heading data.
[0068] S200, setting a sliding time window on the ordered data;
[0069] It should be noted that the sliding time window is used to obtain a first preset number of track point data from the ordered data.
[0070] S300, shifting the sliding time window on the ordered data by one data unit, and updating the track point data in the sliding time window;
[0071] It should be noted that the sliding time window includes a start bit and an end bit; in some embodiments, step S400 may include: adding 1 to the identifier of all track point data referenced by the sliding time window; discarding the track point data of the start bit before the update, and introducing the track point data after the end bit before the update to update the track point data in the sliding time window.
[0072] Among them, the identifiers of all track point data referenced by the sliding time window are increased by 1, that is, the identifiers of all track point data referenced by the sliding time window from the start position to the end position are increased by 1. The sliding time window is shifted by one data unit on the ordered data. Correspondingly, the identifiers of each track point data referenced in the sliding time window are all one bit larger than before the shift. For example, before the shift, the data referenced by the sliding time window are 1 to 8, and after the shift, the data referenced by the sliding time window are 2 to 9.
[0073] In some embodiments, the method may further include: performing abnormal data detection on the sliding time window after the track point data is updated, removing the detected abnormal data, and introducing the track point data after the end bit of the updated sliding time window into the sliding time window; wherein the abnormal data includes expired data and duplicate data; expired data indicates that the timestamp of the track point data introduced by the update is less than the timestamp of the track point data at the start bit before the update; duplicate data indicates that the track point data introduced by the update is the same as any track point data in the sliding time window before the update.
[0074] S400, based on the updated continuous multiple track point data in the sliding time window, determine the slope of each route corresponding to the continuous multiple track point data; and based on the change trend of the slope of the adjacent route, determine the route turning point; and then determine the estimated track corresponding to the sliding time window; then return to the step of translating the sliding time window on the ordered data by one data unit until the ordered data is traversed;
[0075] It should be noted that, in some embodiments, before the step of determining the slopes of each route segment corresponding to the continuous multiple track point data in the updated sliding time window, the method may also include at least one of the following: traversing all track point data in the updated sliding time window, performing noise data detection based on adjacent track point data, and removing the detected noise data; performing data missing detection on the updated sliding time window, and when there is missing data in the sliding time window, interpolating the missing data.
[0076] In some embodiments, traversing all track point data in the updated sliding time window, performing noise data detection based on adjacent track point data, and removing the detected noise data may include: according to the updated sliding time window, based on the latitude and longitude information of the adjacent track point data, traversing and calculating the average speed of the route corresponding to each group of adjacent track point data in combination with the timestamp; when the average speed is greater than a preset speed threshold, determining that the track point data corresponding to the average speed is noise data, and then removing the noise data; wherein the noise data is no longer used to traverse and calculate the average speed of subsequent adjacent track point data.
[0077] In some embodiments, data missing detection is performed on the updated sliding time window, and when there is missing data in the sliding time window, the missing data is interpolated, which may include: determining the timestamp difference of each group of adjacent track point data based on the timestamp of each track point data in the sliding time window; when the timestamp difference is greater than a preset time threshold, determining that there is missing data between adjacent track point data corresponding to the timestamp difference; determining the number of interpolations based on the timestamp difference combined with a preset time interval of adjacent track point data; interpolating the missing data using a cubic spline interpolation method based on the adjacent track point data corresponding to the timestamp difference combined with the interpolation number.
[0078] S500: According to each section of the estimated track, a complete estimated track of the target ship is obtained.
[0079] In order to explain the principle of the technical solution of the present invention in detail, the overall process of the model training method of the present invention is described below in combination with some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and cannot be regarded as a limitation of the present invention.
[0080] First of all, it should be noted that in some large-scale ship projects, the number of ships reaches thousands, and the real-time data generated by all ships is at least 40 million pieces per day, an average of 500 pieces of data per second, and all data are required to be stored in real time. Based on these data, it is necessary to draw the navigation tracks of all ships, and it is difficult to accurately predict the navigation tracks with the existing technology. In addition, the data pulled from the supplier has the following problems: there are duplications and noise in the data, and there are missing data in some time periods. Drawing the estimated ship track directly based on the data provided by the supplier will be very rough and messy, the track accuracy is low, and the practicality is insufficient. Therefore, the present invention proposes a target track estimation method based on a sliding time window. The navigation data cited in the embodiment of the present invention is AIS data, and the data involved in the present invention is the AIS data of ships in a specific area provided by the supplier, and the data provided includes two parts: static data and dynamic data of the ship. The static data of the ship is mainly the parameter information of the registered ship (such as ship ID, size, maximum speed, maximum cruising range, etc.), which is registered in advance and generally does not change. The other part is the ship's AIS data, which is sent to the operator in real time, mainly including the ship's real-time navigation data (such as ship ID, latitude and longitude, current speed, current heading, etc.). Figure 3 As shown, the details are as follows:
[0081] Ship side: mainly generates data and then reports it to the supplier side. This is an existing technology and does not belong to the link involved in the present invention, so it will not be described in detail here.
[0082] Supplier side: The AIS data reported by the ship will be stored in the supplier's data queue, and the business side will request to pull data from the data queue. This is an existing technology and does not belong to the link involved in this invention, so it will not be described in depth here.
[0083] Business side: The business side requests to pull all the transmitted AIS data (i.e., navigation data) through the http protocol, and the pulled data is processed in parallel by multi-threading, and then stored in the database. The target track estimation method based on the sliding time window proposed in the present invention is applied in the process of data processing.
[0084] To facilitate the understanding of the technical solution, the meaning of the sliding time window is given here. Figure 4 Assuming that data A1, A2, A3, ..., Am, etc. represent data reported per second, the sliding time window can be 8, that is, the window can accommodate up to 8 data (track point data). The inflection point window is similar. The present invention uses 4 consecutive data to calculate the inflection point. Here, "sliding" means moving one data to the right each time.
[0085] The sliding time window mentioned in the present invention uses quantity as the window, and the default window length is 60 data (this can be configured, the default is 60, under normal circumstances, each ship will report once per second, 60 is a cache of about 60 seconds). Assuming there are 60 data, one data is shifted right each time, that is, 59 data are still in the window, and so on until all data are traversed. The embodiment of the present invention adopts a sliding window. Since it may involve data interpolation and inflection point calculation, the present invention adopts the concept of a sliding window. The sliding window here is similar to the sliding window of the TCP protocol.
[0086] Exemplarily, the method logic of the embodiment of the present invention is implemented on the data side, such as Figure 5 As shown, the main process is as follows:
[0087] Step 1: Update the cached data in the sliding time window. Assume that the capacity of the time window Window is WindowSize (i.e. the first preset number, which can be configured, the default is 100 data), that is, the current window will accommodate WindowSize data. Because different ship trajectories are independent of each other, the data will be classified according to different ship IDs, and multiple threads will process ship trajectories independently and in parallel. Here and in the following processes, they are all processed for the same ship ID.
[0088] like Figure 6 , assuming that the data index of the current window Window is IndexStart (i.e. the starting position) to IndexEnd (i.e. the ending position), when the cached data needs to be updated, the Window moves right, IndexStart = IndexStart + 1, and then a data is added from another CacheList, IndexEnd = IndexEnd + 1, and IndexEnd now represents the newly added data. CacheList is the data cached in advance and sorted from small to large according to the timestamp. When the CacheList data is less than half of the MaxCacheSize (this can be configured, for example, the default MaxCacheSize is 500, and it will be automatically supplemented when it is less than 250), (MaxCacheSize-NowCacheSize) data will be added from the data obtained from the operator, and then sorted for CacheList. Each time the window is updated, an element is taken from the CacheList and inserted into the window.
[0089] The data inside the window is also ordered and stored in a binary search tree structure. Each node of the search tree represents one or more elements, and WindowSize is the number of nodes in the search tree.
[0090] Step 2: Determine and remove expired data. Before the new data insertion window, assume the maximum and minimum timestamps of the window are Tmax and Tmin. If the most recently updated data Tk < Tmin, then this data will be discarded. That is, after the order is disrupted by more than WindowSize positions, the data will be considered expired and invalid. If the data is discarded, an element will be retrieved from the CacheList again and inserted into the window.
[0091] Here, an explanation is given as to why the data is updated from the CacheList to the window instead of directly from the data obtained from the supplier: Because during the test of the operator interface, it was found that although many data are sorted from small to large, there are still some data that do not appear in order. That is, overall, they are not strictly arranged in ascending order of time. Therefore, WindowSize quantities are cached in the CacheList in advance and then sorted, so as to ensure that the data in the window is strictly ordered. After a large number of tests, the number of data discarded for a single ship per day will not exceed 60. It is learned from the supplier that this out-of-order data may be the data retransmitted under very poor ship network conditions.
[0092] Step 3: Determine and remove duplicate data. Before the new data is inserted into the window, it will be checked whether the element to be inserted is duplicate. If it already exists, it will be discarded, and an element will be retrieved from the CacheList again and inserted into the window; otherwise, it will be inserted directly. When reaching this step, it means that the window update is successful.
[0093] Step 4: Determine and remove noise data. As Figure 7 shown, noise data (seriously deviating from normal data) may be due to problems with the ship's reported data or positioning problems.
[0094] Looking at the ship's trajectory, the noise is generally very obvious. And through the observation of a large amount of data, there are at most 1 to 2 noise points per ship ID per minute, and the quantity is not large. Considering that the economic speed of the ship is between 15 knots and 20 knots (28 kilometers per hour to 37 kilometers per hour), that is, the ship moves very slowly, and the maximum speed of each ship when leaving the factory is clear. Therefore, in order to more accurately depict the ship's trajectory, the present invention proposes a method for determining and removing noise based on abnormal speed detection. Assume that the adjacent data are A i and A j , and the corresponding longitude and latitude are (lng i , lat i ) and (lng j , lat j ), and the corresponding timestamp interval is T ij . The distance L between A i and A j can be calculated through the longitude and latitudeij , the calculation formula is as follows:
[0095] dlon=lng2-lng1
[0096] dlat=lat2-lat1
[0097] tmp=sin(dlat / 2)^2+cos(lat1)*cos(lat2)*sin(dlon / 2)^2
[0098] distance=2*math.asin(math.sqrt(tmp))*6371
[0099] The average radius of the earth is 6371 km, the distance unit is km, math.asin() is used to calculate the arc sine value of the value, math.sqrt() is used to calculate the square root of the value, and then the average speed V is obtained. ij =L ij / T ij ,
[0100] Here we directly determine V ij The rationality of A j Is it a noise point? Because we can obtain the maximum speed MaxV and other information of the ship's registration. If V ij >MaxV*SpeedRate, then determine A j If it is noise, remove it directly, otherwise continue processing. SpeedRate can be configured here, the default is 1.2.
[0101] For example, if the data sequence is A1, A2, A3, A4, A5, A6. First, A1 and A2 are used to determine the noise point. If A2 is not, then A2 and A3 are used to determine the noise point. If A3 is, then A3 is removed, and then A2 and A4 are used to determine the noise point. This process is repeated until all nodes in the window are traversed.
[0102] Step 5: Check if the data is missing. Missing data means that some AIS data reports are missing for a long continuous period of time, which will cause the ship's trajectory to be distorted. For example, there is no data reported at 18:00:00, and then no data reported at 18:01:21, and no reported data is received during this period. According to the characteristics of ship operation, ships report information at least once per second. If there is no report for a long time, data loss or other abnormal conditions may occur. In order to more accurately describe the predicted ship trajectory, it is necessary to determine whether the data is missing. If missing, the ship trajectory is supplemented by interpolation. This is achieved by dynamically determining whether the interval of data reception exceeds the maximum threshold. Specifically, calculate all time intervals of the data in the window, then sort them from small to large, take the median as the benchmark, and record it as MidTimeInterval. Then traverse all time intervals. If the interval Interval exceeds MidTimeInterval*IntervalRate, it is determined that the interval needs to be interpolated, and go to step 6. Otherwise, it is not necessary, and go to step 8. Among them, IntervalRate represents the interval rate, which is generally greater than 1 and the default is 2. Reference Figure 8 ,from Figure 8 As you can see, there are 3 time periods with missing data.
[0103] Step 6: Dynamically calculate the interpolation interval. There may be multiple time intervals that need to be interpolated, and you can traverse and interpolate them one by one. Assume A i and A j The timestamp is [a, b], and the data is determined to be missing (i.e., ba>MidTimeInterval*IntervalRate). The cubic spline interpolation adopted by the present invention, considering that the cubic spline interpolation needs to confirm the distribution interval, can be determined by the following method: InsertCnt=max(round((ba) / MinGapTime),2) The time length of each interval is (ba) / InsertCnt. The round function represents rounding up, MinGapTime represents the minimum time interval (i.e., the preset time interval, the default is 0.5s), and the final number of inserted intervals InsertCnt is at least 2.
[0104] Step 7: Data interpolation and marking of data sources. According to step 6, the number of time intervals InsertCnt is calculated, and the time series interval [a,b] can be divided into InsertCnt intervals, namely [(a,x1), (x1,x2), ... (x InsertCnt-1 ,b)], the time length of each interval The function values corresponding to the trajectory points are y1,y2,…,y InsertCnt , if these points satisfy the interpolation function F(x), and F(x) = ai *x^3+b i *x^2+c i *x+d i Among them, a i , b i 、c i ,d i are the unknown coefficients. Through interpolation calculation, we can get a series of (x i ,y i ) values are added to the window and the data type is marked as interpolated.
[0105] As can be seen above, the amount of window data will increase after the sliding time window Windows undergoes interpolation, which is normal. Through a large number of tests, the average interpolation process is about 10 times per hour, which means that interpolation is not required in most cases. Therefore, the interpolation process does not consume too much time.
[0106] Step 8: Update the inflection point window and calculate the track inflection point. At this point, the noise in the ship data has been removed, and the missing data has been completed through interpolation. Now it is necessary to calculate the inflection point of the ship. From a mathematical point of view, the inflection point is the point of minimum or maximum value, but considering that the ship data is discrete data, it is not feasible to directly derive it, and a new solution is needed. Reference Fig. 9 As shown, the box encloses the turning point.
[0107] The present invention proposes a method for calculating the inflection point using four consecutive points (inflection point window). Assuming that the four consecutive points in the inflection point window are (x1, y1), (x2, y2), (x3, y3), and (x4, y4), the slopes of every two points are k1, k2, and k3, and the specific formula is as follows:
[0108]
[0109]
[0110]
[0111] If k1*k3>=0, there is no inflection point; if k1*k3<0, there is an inflection point. In this case, if k2*k1<=0 and k2*k3>0, (x2,y2) is marked as an inflection point; if k2*k1>0 and k2*k3<=0, (x3,y3) is marked as an inflection point; in other cases, (x2,y2) and (x3,y3) are marked as inflection points.
[0112] Here is an example. Assume that the ship follows the trajectory form of F(x) = x*x, that is, a parabola with the axis of symmetry x = 0, then
[0113] Assuming that the x values of the current window are (-0.5, -0.2, -0.1, 0.5), k1 is calculated to be -0.7, k2 is -0.3, k3 is 0.4, and the inflection point is x = -0.1;
[0114] Assuming that the x values of the current window are (-0.2, -0.1, 0.1, 0.5), k1 is calculated to be -0.3, k2 is 0.0, and k3 is 0.6. At this time, the inflection points are x = -0.1 and x = 0.1;
[0115] Assuming that the x values of the current window are (-0.1, 0.05, 0.2, 0.4), k1 is calculated to be -0.05, k2 is 0.25, k3 is 0.6, and the inflection point is x = 0.05;
[0116] It should be noted that this method of calculating the turning point is not mathematically complete, that is, there are cases where the turning point is misjudged. However, the misjudgment rate of this calculation on the ship trajectory is still very low. This is because the ship data is relatively dense (at least data per second), the ship speed is generally low and does not make drastic continuous turns, so this method performs well. After a large number of tests, the misjudgment rate of data per hour is less than 5%. Most of these misjudgments are errors when the ship enters or leaves the port. These errors can be corrected manually and are generally acceptable.
[0117] Step 9: The processed data is stored in the database. The data processed by the window will be stored in time. If all the data has been processed, the whole process ends. Otherwise, move the sliding time window and go to step 1, and repeat until the processing is completed.
[0118] In summary, the embodiment of the present invention implements a target track estimation method based on a sliding time window. Compared with the prior art, the embodiment of the present invention has at least the following beneficial effects:
[0119] 1) Data filtering method based on sliding time window, including duplicate data filtering and noise data removal, reduces data storage costs.
[0120] 2) The data completion method based on nonlinear interpolation can detect whether the data is missing in real time, and dynamically complete the data according to time, thereby improving the completeness of the data.
[0121] 3) The inflection point calculation method based on sliding window and linear fitting reduces the inflection point prediction error rate and improves the track prediction accuracy.
[0122] On the other hand, Fig.10As shown, an embodiment of the present invention provides a target track estimation device 1000, including: a first module 1010, used to obtain navigation data of a target ship, and to obtain ordered data in time series according to the navigation data; the ordered data includes a plurality of track point data; a second module 1020, used to set a sliding time window on the ordered data; the sliding time window is used to obtain a first preset number of track point data from the ordered data; a third module 1030, used to translate the sliding time window on the ordered data by one data unit, and update the track point data in the sliding time window; a fourth module 1040, used to determine the slope of each route corresponding to the continuous plurality of track point data in the updated sliding time window; and based on the change trend of the slope of the adjacent routes, determine the route inflection point; and then determine the estimated track corresponding to the sliding time window; then return to the step of translating the sliding time window on the ordered data by one data unit until the ordered data is traversed; a fifth module 1050, used to obtain a complete estimated track of the target ship according to each estimated track.
[0123] In some embodiments, the device may also include: a sixth module, used to detect abnormal data in the sliding time window after the track point data is updated, remove the detected abnormal data, and introduce the track point data after the end bit of the updated sliding time window into the sliding time window; wherein the abnormal data includes expired data and duplicate data; expired data indicates that the timestamp of the track point data introduced by the update is less than the timestamp of the track point data at the start bit before the update; duplicate data indicates that the track point data introduced by the update is the same as any track point data in the sliding time window before the update.
[0124] In some embodiments, before executing the fourth module, the device may further include at least one of the following:
[0125] The seventh module is used to traverse all track point data in the updated sliding time window, perform noise point data detection based on adjacent track point data, and remove the detected noise point data;
[0126] The eighth module is used to perform data missing detection on the updated sliding time window, and interpolate the missing data when there is missing data in the sliding time window.
[0127] The contents of the method embodiments of the present invention are all applicable to the device embodiments. The functions specifically implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0128] On the other hand, an embodiment of the present invention further provides an electronic device, which includes at least one processor and at least one memory for storing at least one program; taking one processor and one memory as an example.
[0129] The processor and the memory may be connected via a bus or other means.
[0130] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0131] The electronic device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0132] It should be noted that the computer-readable medium shown in the embodiment of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an 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 above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0133] The contents of the method embodiments of the present invention are all applicable to the system embodiments. The functions specifically implemented by the system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method.
[0134] Another aspect of an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the above method.
[0135] The contents of the method embodiments of the present invention are all applicable to the computer-readable storage medium embodiments. The functions specifically implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0136] The embodiment of the present invention also discloses a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above method.
[0137] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a 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 from the order 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 or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0138] It should be noted that, although several modules of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0139] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation of the present invention.
[0140] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.
[0141] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0142] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0143] The logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution device, apparatus or device (such as a computer-based device, a device including a processor, or other device that can fetch instructions from an instruction execution device, apparatus or device and execute the instructions), or in conjunction with such instruction execution device, apparatus or device. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution device, apparatus or device, or in conjunction with such instruction execution device, apparatus or device.
[0144] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0145] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0146] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0147] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
[0148] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. A target track estimation method, It is characterized in that include: Acquire navigation data of the target ship, and obtain sequential data in time series according to the navigation data; the sequential data includes data of a plurality of track points; Setting a sliding time window on the ordered data; the sliding time window is used to obtain a first preset number of track point data from the ordered data; Shifting the sliding time window on the ordered data by one data unit, and updating the track point data in the sliding time window; Traversing all the track point data in the updated sliding time window, performing noise point data detection based on the adjacent track point data, and removing the detected noise point data; The traversing of all the track point data in the updated sliding time window, performing noise point data detection based on the adjacent track point data, and removing the detected noise point data includes: According to the updated sliding time window, based on the latitude and longitude information of the adjacent track point data, combined with the timestamp traversal, the average speed of the route corresponding to each group of adjacent track point data is calculated; When the average speed is greater than a preset speed threshold, determining that the track point data corresponding to the average speed is noise data, and then removing the noise data; Based on the updated continuous plurality of track point data in the sliding time window, the slopes of each route corresponding to the continuous plurality of track point data are determined; and based on the change trend of the slopes of adjacent routes, the route turning point is determined; and then the estimated track corresponding to the sliding time window is determined; and then the step of translating the sliding time window on the ordered data by one data unit is returned until the ordered data is traversed; According to the estimated tracks in each section, the complete estimated track of the target ship is obtained.
2. The target track estimation method according to claim 1, It is characterized in that The step of obtaining navigation data of the target ship and arranging the navigation data to obtain ordered data in time series includes: The heading data of the target ship is continuously acquired, and the heading data is sorted based on a timestamp to obtain ordered data; and the ordered data is periodically updated based on the continuously acquired heading data.
3. The target track estimation method according to claim 1, It is characterized in that The sliding time window includes a start bit and an end bit; the step of shifting the sliding time window on the ordered data by one data unit to update the track point data in the sliding time window includes: Add 1 to the identifiers of all the track point data referenced by the sliding time window; The track point data at the start position before updating is discarded, and the track point data at one position after the end position before updating is introduced to update the track point data in the sliding time window.
4. The target track estimation method according to claim 3, It is characterized in that The method further comprises: Perform abnormal data detection on the sliding time window after the track point data is updated, remove the detected abnormal data, and introduce the track point data one digit after the end digit of the updated sliding time window into the sliding time window; Among them, the abnormal data includes expired data and duplicate data; the expired data indicates that the timestamp of the track point data introduced by the update is smaller than the timestamp of the track point data of the starting position before the update; the duplicate data indicates that the track point data introduced by the update is the same as any of the track point data in the sliding time window before the update.
5. The target track estimation method according to claim 1, It is characterized in that Before the step of determining the slopes of each route segment corresponding to the continuous plurality of track point data based on the updated continuous plurality of track point data in the sliding time window, the method further includes: Data missing detection is performed on the updated sliding time window, and when there is missing data in the sliding time window, the missing data is interpolated.
6. The target track estimation method according to claim 5, It is characterized in that The performing data missing detection on the updated sliding time window, and when there is missing data in the sliding time window, interpolating the missing data, comprises: Determine the timestamp difference of each group of adjacent track point data according to the timestamp of each track point data in the sliding time window; When the timestamp difference is greater than a preset time threshold, determining that there is missing data between the adjacent track point data corresponding to the timestamp difference; Determine the interpolation quantity according to the timestamp difference and the preset time interval of the adjacent track point data; The missing data is interpolated using a cubic spline interpolation method according to the adjacent track point data corresponding to the timestamp difference and in combination with the interpolation quantity.
7. A target track estimation device, It is characterized in that include: The first module is used to obtain navigation data of the target ship, and to obtain sequential data in time series according to the navigation data; the sequential data includes a number of track point data; A second module is used to set a sliding time window on the ordered data; the sliding time window is used to obtain a first preset number of track point data from the ordered data; A third module is used to translate the sliding time window on the ordered data by one data unit to update the track point data in the sliding time window; A seventh module is used to traverse all the track point data in the updated sliding time window, perform noise point data detection based on the adjacent track point data, and remove the detected noise point data; The traversing of all the track point data in the updated sliding time window, performing noise point data detection based on the adjacent track point data, and removing the detected noise point data includes: According to the updated sliding time window, based on the latitude and longitude information of the adjacent track point data, combined with the timestamp traversal, the average speed of the route corresponding to each group of adjacent track point data is calculated; When the average speed is greater than a preset speed threshold, determining that the track point data corresponding to the average speed is noise data, and then removing the noise data; The fourth module is used to determine the slopes of each route corresponding to the continuous plurality of track point data in the updated sliding time window; and determine the route turning point based on the change trend of the slopes of adjacent routes; and then determine the estimated track corresponding to the sliding time window; and then return to the step of translating the sliding time window on the ordered data by one data unit until the ordered data is traversed; The fifth module is used to obtain the complete estimated track of the target ship according to the estimated tracks of each segment.
8. An electronic device, It is characterized in that including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 7.
9. A computer storage medium having stored therein a program executable by a processor, It is characterized in that The program executable by the processor is used to implement the method according to any one of claims 1 to 7 when executed by the processor.
