Unmanned ship trajectory point clustering method and device, electronic equipment and storage medium
By adopting the DBSCAN method in unmanned ship trajectory clustering, the problem of difficulty in discovering hidden trajectory clusters in the existing technology is solved, and sufficient clustering and accurate analysis of unmanned ship trajectory points are achieved, which is suitable for most clustering situations.
Patent Information
- Application Number
- CN202411691126.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-04-25
AI Technical Summary
The prior art is difficult to find hidden trajectory clusters in ship trajectory clustering, and requires accurate prior knowledge, which cannot meet the needs of most clustering situations.
DBSCAN, a density-based spatial clustering method with noise, cluster unmanned ship trajectory points, identify clusters of any shape, provide accurate prior knowledge and easy discovery of hidden trajectory clusters.
Through the DBSCAN clustering method, it can identify clusters of any shape, provide accurate prior knowledge and easy discovery of hidden trajectory clusters, meet the needs of most clustering situations, and is suitable for application fields such as inland maritime supervision and intelligent shipping information push.
Smart Images

Figure CN119884794A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of surface unmanned vehicle information clustering, and in particular relates to an unmanned ship track point clustering method, device, electronic equipment and storage medium. Background Art
[0002] The development of shipping economy has driven the continuous increase in the number of ships. Therefore, extracting clusters of ship motion trajectories with similar characteristics has become the basis for analyzing ship traffic laws and ship behavior patterns.
[0003] In the related art, one method is to classify trajectories by setting a distance threshold, but since only the ship position deviation is considered, its ability to describe similar movements of ships is limited; another method is to use a K nearest neighbor classifier or design a weighted naive Bayes classifier to classify trajectories.
[0004] However, the above clustering methods perform well when the route is fixed, but they require accurate prior knowledge and have difficulty in discovering hidden trajectory clusters, which cannot meet the needs of most clustering situations. Summary of the invention
[0005] In a first aspect, an embodiment of the present invention provides a method for clustering unmanned ship trajectory points, comprising: S1, obtaining an unmanned ship trajectory point set, each trajectory point in the trajectory point set including location information; S2, accessing a first unvisited trajectory point in the trajectory point set, and marking the first trajectory point as visited; S3, when the first trajectory point is determined to be a core point according to a density-based spatial clustering method with noise, classifying the first trajectory point into a new cluster; S4, accessing points that are density-reachable by the first trajectory point, marking the points that are density-reachable by the first trajectory point as visited, and classifying the points that are density-reachable by the first trajectory point into the new cluster; S5, repeatedly executing S2-S4 until all trajectory points in the trajectory point set are visited.
[0006] In some embodiments, determining the first trajectory point as a core point according to a density-based spatial clustering method with noise in S3 includes: determining the first trajectory point as the core point when the number of all trajectory points within a preset neighborhood radius of the first trajectory point is greater than or equal to a preset minimum number of sample points.
[0007] In some embodiments, S3 further includes: if it is determined that the first trajectory point is not a core point according to a density-based spatial clustering method with noise, returning to execute S2.
[0008] In some embodiments, S4 includes: obtaining a sample set corresponding to all trajectory points within a preset neighborhood radius of the first trajectory point; visiting a second trajectory point that has not been visited in the sample set, and marking the second trajectory point as visited; when the second trajectory point is determined to be a core point, updating the sample set according to all trajectory points within a preset neighborhood radius of the second trajectory point; classifying the second trajectory point into the new cluster; and repeating the step of visiting the second trajectory point that has not been visited in the sample set until all trajectory points in the sample set are visited.
[0009] In some embodiments, the S4 further includes: when it is determined that the second trajectory point is not a core point, directly performing the step of classifying the second trajectory point into the new cluster.
[0010] In some embodiments, each track point in the track point set further includes at least one of heading information and speed information.
[0011] In some embodiments, the method further includes at least one of the following: obtaining location information of the center of each cluster; determining an average distance error of each cluster according to the trajectory points corresponding to each cluster; and determining the number of clusters according to the number of repeated executions of S2-S4.
[0012] In a second aspect, an embodiment of the present invention provides an unmanned ship trajectory point clustering device, comprising: an acquisition module, used to execute step S1, wherein S1 includes: acquiring an unmanned ship trajectory point set, each trajectory point in the trajectory point set includes location information; a clustering module, used to execute steps S2-S5, wherein S2 includes: visiting a first trajectory point that has not been visited in the trajectory point set, and marking the first trajectory point as visited; S3 includes: when the first trajectory point is determined to be a core point according to a density-based spatial clustering method with noise, classifying the first trajectory point into a new cluster; S4 includes: visiting points that are density-reachable by the first trajectory point, marking the points that are density-reachable by the first trajectory point as visited, and classifying the points that are density-reachable by the first trajectory point into the new cluster; S5 includes: repeatedly executing S2-S4 until all trajectory points in the trajectory point set are visited.
[0013] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; the memory is used to store computer programs; and the processor is used to implement the steps of the unmanned ship trajectory point clustering method described in any one of the first aspects when executing the program stored in the memory.
[0014] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the unmanned ship trajectory point clustering method as described in any one of the first aspects are implemented.
[0015] The beneficial effects brought by the present invention are as follows:
[0016] It can be seen from the above scheme that an embodiment of the present invention provides a method, device, electronic device and storage medium for clustering unmanned ship trajectory points, the method comprising: obtaining an unmanned ship trajectory point set, each trajectory point in the trajectory point set including location information; visiting a first trajectory point in the trajectory point set that has not been visited, and marking the first trajectory point as visited; when the first trajectory point is determined to be a core point according to a density-based spatial clustering method with noise, classifying the first trajectory point into a new cluster; visiting points that are density-reachable by the first trajectory point, marking the points that are density-reachable by the first trajectory point as visited, and classifying the points that are density-reachable by the first trajectory point into the new cluster; repeating the above steps until all trajectory points in the trajectory point set are visited; that is, by adopting the DBSCAN clustering method, clusters of any shape can be identified, accurate prior knowledge is provided, and hidden trajectory clusters are easy to find, thereby achieving full clustering of unmanned ship trajectory points. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A schematic diagram of a flow chart of a method for clustering unmanned ship trajectory points provided by an embodiment of the present invention;
[0018] Figure 2 for Figure 1 A detailed flow chart of step S4 in the illustrated embodiment;
[0019] Figure 3 A schematic diagram of a flow chart of another unmanned ship trajectory point clustering method provided by an embodiment of the present invention;
[0020] Figure 4 A schematic diagram of the structure of an unmanned ship trajectory point clustering device provided by an embodiment of the present invention;
[0021] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0023] The development of the shipping economy has led to an increasing number of ships. Extracting clusters of ship motion trajectories with similar characteristics is the basis for analyzing ship traffic laws and ship behavior patterns. Therefore, by conducting clustering research on ship trajectories, it can provide basic means and key methods for the research and development and application of technologies such as ship traffic flow feature extraction, route safety planning, and ship anomaly detection, and provide decision-making support and scientific basis for shipping planning, maritime supervision and other work.
[0024] Clustering algorithm is one of the unsupervised learning tasks and plays an important role in the field of machine learning. Its main purpose is to divide a set of randomly distributed data with unknown sample labels into different categories according to the structural characteristics of the samples and the correlation between samples. In the case of unknown training object labels, objects are divided into different categories according to the intrinsic properties and laws between objects, so that objects in the same category are closely related, while objects in different categories are less related. Clustering analysis methods can be divided into five categories according to different learning strategies: hierarchy, density, partition, grid, and model. In clustering analysis, data sets of different categories usually have different densities, and even have large differences.
[0025] In related technologies, the trajectory categories are divided by setting the Hausdorff distance threshold. Similar indicators include Euclidean distance, longest common subsequence distance, dynamic time warping (DTW) distance, etc. However, these indicators only consider the deviation of ship position and have limited ability to describe similar ship movements. Some researchers define comprehensive distance by considering ship position, speed and heading, and divide trajectories with K nearest neighbor classifiers. Other researchers use multiple trajectory features to measure trajectory similarity and design weighted naive Bayes classifiers to prove that considering multi-dimensional features to measure similarity can better capture the differences between different trajectories. Some researchers have proposed a trajectory similarity calculation method based on one-way distance. This method defines the one-way distance as the average of the minimum distances between each point on a ship's trajectory and each point on another trajectory. The spectral clustering algorithm is used to learn the spatial distribution of the trajectory and obtain the normal movement pattern of the ship. Some researchers have integrated K-medoids clustering and naive Bayes classifiers to achieve ship behavior classification and abnormal behavior detection.
[0026] However, the above supervised classification methods perform well when the route is fixed, but they require accurate prior knowledge and are difficult to find hidden trajectory clusters, which cannot meet the needs of most clustering situations.
[0027] In response to the above technical problems, the technical concept of the present invention is to cluster the unmanned ship trajectory points using a density-based spatial clustering of applications with noise (DBSCAN for short), which can identify clusters of any shape, provide accurate prior knowledge and easily discover hidden trajectory clusters, thus meeting the needs of most clustering situations.
[0028] Figure 1 The following is a flow chart of a method for clustering unmanned ship trajectory points provided by an embodiment of the present invention. Figure 1 As shown, the unmanned ship trajectory point clustering method includes:
[0029] Step S1: Obtain a set of unmanned ship track points, each track point in the set of track points including position information.
[0030] Specifically, the Automatic Identification System (AIS) on unmanned ships is a device for exchanging ship-related information between ships and between ships and shore-based facilities. It is widely used in ship supervision and generates a large amount of ship dynamic and static information data, including the ship's position, heading and speed, and stores this information in a database. The track point set D of the unmanned ship is obtained from the database, where each track point includes location information, such as longitude and latitude.
[0031] In some embodiments, each track point in the track point set also includes at least one of heading information and speed information. Specifically, each track point in the track point set D includes multiple information such as position, heading, speed, etc. By fully considering this information in the track similarity metric, the accuracy and analysis effect are improved.
[0032] Step S2: Visit a first unvisited track point in the track point set, and mark the first track point as visited.
[0033] Specifically, the first unvisited track point p in the track point set D is visited, and p is marked as visited. In the initial state, each track point in the track point set D is unvisited.
[0034] Step S3: when the first trajectory point is determined as a core point according to the density-based spatial clustering method with noise, classify the first trajectory point into a new cluster.
[0035] Specifically, the DBSCAN method is used to determine whether the first trajectory point p is a core point. If p is a core point, a new cluster is created and p is added to it.
[0036] In some embodiments, determining the first trajectory point as a core point according to a density-based spatial clustering method with noise in S3 includes: determining the first trajectory point as the core point when the number of all trajectory points within a preset neighborhood radius of the first trajectory point is greater than or equal to a preset minimum number of sample points.
[0037] Specifically, the DBSCAN method requires the pre-determination of the neighborhood radius ε and the minimum number of sample points MinPts; if the number of all trajectory points (including p) in the area centered on p and with ε as the neighborhood radius is not less than MinPts, then p is the core point. After determining that p is the core point, continue to execute S4.
[0038] In some embodiments, S3 further includes: if it is determined that the first trajectory point is not a core point according to a density-based spatial clustering method with noise, returning to execute S2.
[0039] Specifically, if the number of all trajectory points in the area with p as the center and ε as the neighborhood radius is less than MinPts, then p is not a core point. There are two cases where p is not a core point. One is that p is a boundary point (i.e., p is within the preset neighborhood radius of a core point). In this case, there is no need to process point p. It only needs to wait for the subsequent processing to the core point to which p belongs, and p is classified as a point with density reachable by the core point. The other is that p is a noise point. This embodiment does not perform any processing and is automatically ignored. The noise point has been marked as visited in step S2 and will not be visited again in the subsequent process.
[0040] Step S4: visiting points reachable by the first trajectory point density, marking the points reachable by the first trajectory point density as visited, and classifying the points reachable by the first trajectory point density as the new cluster.
[0041] Specifically, in the DBSCAN algorithm, density reachability includes direct density reachability and indirect density reachability (also known as density connectivity), where direct density reachability means that if point q is within the ε neighborhood of point p, and point p is a core point (that is, there are at least MinPts points within the ε neighborhood of p), then point q can be considered to be density reachable by point p; density connectivity means that if there is a point sequence p1, p2, ..., pn, where p1 = p, pn = q, and for all 1≤i≤n-1, pi+1 is density reachable by pi, then p and q can be considered to be density connected. In this step, the points directly density reachable and indirectly density reachable (density connected) of point p are obtained, marked as visited, and classified into the same cluster as point p.
[0042] Step S5, repeating S2-S4 until all the track points in the track point set are visited.
[0043] Specifically, the process then returns to S2, that is, for the next unvisited trajectory point in the trajectory point set D, the next new cluster is classified; and the above process is repeated until all trajectory points in the trajectory point set D have been visited.
[0044] In some embodiments, the method further includes at least one of the following: determining the number of clusters according to the number of repeated executions of S2-S4; obtaining the position information of the center of each cluster; and determining the average distance error of each cluster according to the trajectory points corresponding to each cluster.
[0045] Specifically, at the beginning of the execution of this embodiment, the cluster identifier C is initialized to 0. When each S3 is executed, C=C+1. When the execution of this embodiment is completed, the value of C at this time is the number of clusters.
[0046] In addition, through this embodiment, the center position of each cluster (lon, lat: longitude and latitude of the center of the cluster) can be clustered, and the position information of the unmanned boat on the water can be determined.
[0047] In addition, after the execution of this embodiment is completed, the trajectory point position corresponding to each cluster can be returned, and then the average distance error of each cluster can be determined. The specific process is as follows: determine the cluster for which the average distance error is to be calculated, and all the points in the cluster; for each pair of points in the cluster, calculate the distance between them, which can be the Euclidean distance, etc.; for each pair of points, calculate the error between their actual distance and the expected distance, and the expected distance can be the average distance of all point pairs in the cluster; add the distance errors of all point pairs and divide them by the total number of point pairs to obtain the average distance error.
[0048] The unmanned ship trajectory point clustering method provided by the embodiment of the present invention clusters the unmanned ship trajectory points by adopting the DBSCAN algorithm. It can identify clusters of any shape, provide accurate prior knowledge and easily discover hidden trajectory clusters, meet the needs of most clustering situations, and is suitable for application fields such as inland maritime supervision and intelligent shipping information push. Moreover, this embodiment can make up for the problem of insufficient clustering caused by the existing clustering method using distance as a measure of similarity; it can identify noise and outliers in the data set, so that the clustering results are not affected by noise and outliers; there is no need to set the parameter of the number of clusters in advance, which avoids the disadvantage of low clustering accuracy due to inaccurate grasp of the number of clusters of the data set.
[0049] Based on the above embodiments, Figure 2 for Figure 1 A detailed flow chart of step S4 in the embodiment shown. Figure 2 As shown, step S4 includes:
[0050] Step S41: Obtain a sample set corresponding to all trajectory points within a preset neighborhood radius of the first trajectory point.
[0051] Specifically, the sample set of all trajectory points within the range of the neighborhood radius with the first trajectory point p as the center and ε as the center is denoted as Nε(p), or simply N. Where Nε(p) = {q∈D|Distance(p,q)≤ε}, and Distance(p,q) represents the Euclidean distance from point p to point q.
[0052] Step S42: Visit a second track point in the sample set that has not been visited, and mark the second track point as visited.
[0053] Specifically, the unvisited second trajectory point p' in N is visited, and p' is marked as visited. The unvisited second trajectory point is, for example, a core point p in N, which has been visited and is no longer visited at this time.
[0054] Step S43: Determine whether the second trajectory point is a core point.
[0055] If yes, execute step S44, if no, execute step S45.
[0056] Specifically, all trajectory points are found within the ε neighborhood radius of the second trajectory point p' and saved in the set N'. If the size of the set N' is greater than or equal to the minimum number of sample points MinPts, p' is a core point and step S44 is executed; otherwise, it is a boundary point and step S45 is executed.
[0057] Step S44: Update the sample set according to all trajectory points within a preset neighborhood radius of the second trajectory point.
[0058] Specifically, all trajectory points in the set N' are merged into the sample set N to obtain the updated sample set N.
[0059] Step S45: classify the second trajectory points into the new cluster.
[0060] Specifically, determine whether p' has been classified. If not, classify p' into the same cluster as p. If yes, return to step S42 to continue processing the next unvisited second trajectory point in sample set N. Note that the sample set N at this time is the sample set that has been updated in step S44.
[0061] Step S46, repeating steps S42-S45 until all trajectory points in the sample set are visited.
[0062] Specifically, by repeatedly executing the above steps, all trajectory points and density-connected points in the sample set N are classified into corresponding clusters.
[0063] On the basis of the foregoing embodiment, a sample set corresponding to all trajectory points within a preset neighborhood radius of the first trajectory point is obtained; a second trajectory point that has not been visited in the sample set is visited, and the second trajectory point is marked as visited; when the second trajectory point is determined to be a core point, the sample set is updated according to all trajectory points within a preset neighborhood radius of the second trajectory point; the second trajectory point is classified into the new cluster; when the second trajectory point is determined not to be a core point, the second trajectory point is classified into the new cluster; and the above steps are repeated until all trajectory points in the sample set are visited, thereby realizing rapid classification of points that are density-reachable by core points and points that are density-connected.
[0064] Figure 3 A flow chart of another unmanned ship trajectory point clustering method provided by an embodiment of the present invention, combined with Figure 3 The embodiment of the present invention is described in detail. This embodiment can be understood as an outer loop ( Figure 3 An inner loop ( Figure 3 on the right).
[0065] First, enter the outer loop, the process is as follows:
[0066] (1) Mark all track points in the unmanned ship track point set D as unvisited: Obtain the unmanned ship AIS data from the database, extract the position, heading and speed information of each track point, and form the unmanned ship track point set D; in the initial state, mark each track point as unvisited;
[0067] (2) Loop through each trajectory point p in D, that is, determine whether the current trajectory point p in D has been visited. If so, traverse the next trajectory point in D. If not, mark p as visited and proceed to the next step;
[0068] (3) Determine whether the current trajectory point p is a core point (i.e., whether the number of all trajectory points within the ε neighborhood radius of p is greater than or equal to MinPts). If not, return to execute (2), that is, traverse the next trajectory point in D; if so, add a new class (i.e., cluster) and add p to the class, obtain the sample set N of all trajectory points within the ε neighborhood radius of p, and then process all trajectory points in the sample set N;
[0069] That is, entering the inner loop, the process is as follows:
[0070] (4) Loop through each trajectory point p' in the sample set N, that is, determine whether p' has been visited. If so, traverse the next trajectory point in N. If not, mark p' as visited.
[0071] (5) Determine whether p' is a core point. If so, obtain the set N' of all trajectory points within the ε neighborhood radius of p', add N' to the sample set N, and proceed to the next step; if p' is not a core point, proceed directly to the next step;.
[0072] (6) Determine whether p' is classified. If so, return to execute (4), that is, traverse the next trajectory point in the sample set N. If not, add p' to the class, that is, p' and p are classified into the same cluster;
[0073] (7) Determine whether all trajectory points in the sample set N have been visited. If not, return to execute (4). If so, return to the outer loop.
[0074] Outer loop:
[0075] (8) Determine whether all the track points in the unmanned track point set D have been visited. If not, return to execute (2). If yes, end this embodiment.
[0076] When implementing this embodiment using program code, the main variables may be defined as follows:
[0077] points: input spatial point set;
[0078] eps: density query distance threshold;
[0079] minPts: core object threshold;
[0080] Visited: Mark array, record whether the track point has been visited;
[0081] The main functions defined are as follows:
[0082] dbscan(): DBSCAN clustering algorithm function;
[0083] expand_cluster(): Density accessibility judgment, expansion of clustering;
[0084] distance(): Calculates the Euclidean distance between two points;
[0085] Its dependent library: nlohmann / json.hpp.
[0086] The specific steps of the program code implementation process are as follows:
[0087] 1. Put the executable file into a folder called "bin";
[0088] 2. Open the terminal and run the executable file;
[0089] 3. Enter the command . / dt_targetCluster in the terminal to run the program.
[0090] 4. Enter data in JSON format. The following is a test example:
[0091] {"id":1,"method":"notice-event","content":{"arguments":{"points":[[121.123468,22.12345 6],[121.123567,22.12345678],[121.1234567,22.12345678],[121.1234567,22.12345678]],"confi g":{"DisThreshold":20,"MinNumber":2}}}}
[0092] The above JSON data contains the parameter information of the target clustering, including the coordinate list of the points to be clustered and the configuration parameters (DisThreshold and MinNumber).
[0093] 5. Program running: Once the above JSON data is entered, the system will cluster these points and return a clustering result data in JSON format. The clustering result can include the trajectory points corresponding to each cluster, the center position information of the cluster, the average distance error and the number of clusters.
[0094] Experiments show that when the upper limit of the number of trajectory points is 50, the clustering completion time is ≤0.1s, and the CPU single-core occupancy rate is ≤50% when the algorithm is running.
[0095] In summary, this embodiment uses the information characteristics of the unmanned ship automatic identification system AIS, adopts the density-based DBSCAN clustering technology to filter outliers and extract key information, and uses the law of the position of unmanned ships, combined with the method of threshold screening constraint core points, to achieve accurate calculation in a cyclic recursive manner. This method improves the existing unmanned ship trajectory analysis method, no longer requires accurate prior knowledge, and can more easily discover hidden trajectory clusters. It is suitable for various clustering situations and is suitable for inland maritime supervision, intelligent shipping information push and other application fields.
[0096] Figure 4 A schematic diagram of a structure of an unmanned ship trajectory point clustering device provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the unmanned ship trajectory point clustering device includes:
[0097] The acquisition module 401 is used to execute step S1, wherein S1 includes: acquiring a set of unmanned ship track points, each track point in the set of track points including position information;
[0098] The clustering module 402 is used to execute steps S2-S5, wherein S2 includes: visiting a first unvisited track point in the track point set, and marking the first track point as visited;
[0099] S3 includes: in the case where the first trajectory point is determined as a core point according to a density-based spatial clustering method with noise, classifying the first trajectory point into a new cluster;
[0100] S4 includes: visiting points reachable by the first trajectory point density, marking the points reachable by the first trajectory point density as visited, and classifying the points reachable by the first trajectory point density as the new cluster;
[0101] S5 includes: repeatedly executing S2-S4 until all the track points in the track point set are visited.
[0102] In some embodiments, the clustering module 402 is specifically configured to:
[0103] When it is determined that the number of all trajectory points within a preset neighborhood radius of the first trajectory point is greater than or equal to a preset minimum number of sample points, the first trajectory point is determined to be the core point.
[0104] In some embodiments, the clustering module 402 is further configured to:
[0105] If it is determined that the first trajectory point is not a core point according to the density-based spatial clustering method with noise, the process returns to S2.
[0106] In some embodiments, the clustering module 402 is further configured to:
[0107] Acquire a sample set corresponding to all trajectory points within a preset neighborhood radius of the first trajectory point;
[0108] Visiting a second track point in the sample set that has not been visited, and marking the second track point as visited;
[0109] When the second trajectory point is determined to be a core point, updating the sample set according to all trajectory points within a preset neighborhood radius of the second trajectory point;
[0110] classifying the second trajectory point into the new cluster;
[0111] The step of accessing the unaccessed second track points in the sample set is repeatedly performed until all track points in the sample set are accessed.
[0112] In some embodiments, the clustering module 402 is further configured to:
[0113] In the case where it is determined that the second trajectory point is not a core point, the step of classifying the second trajectory point into the new cluster is directly performed.
[0114] In some embodiments, each track point in the track point set further includes at least one of heading information and speed information.
[0115] In some embodiments, the apparatus further includes an output module 403, and the output module 403 further includes at least one of the following:
[0116] Get the location information of each cluster center;
[0117] Determine the average distance error of each cluster based on the trajectory points corresponding to each cluster;
[0118] The number of clusters is determined according to the number of repeated executions of S2-S4.
[0119] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process and corresponding beneficial effects of the unmanned ship trajectory point clustering device described above can refer to the corresponding process in the aforementioned method example, and will not be repeated here.
[0120] like Figure 5 As shown, an embodiment of the present invention provides an electronic device, including a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.
[0121] Memory 503, used for storing computer programs;
[0122] In one embodiment of the present invention, the processor 501 is used to implement the steps of the unmanned ship trajectory point clustering method provided by any of the above method embodiments when executing the program stored in the memory 503.
[0123] The implementation principle and technical effect of the electronic device provided by the embodiment of the present invention are similar to those of the above embodiment and will not be described in detail here.
[0124] The above-mentioned memory 503 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM. The memory 503 has a storage space for program codes for executing any method steps in the above-mentioned method. For example, the storage space for program codes may include various program codes for implementing various steps in the above method respectively. These program codes can be read from or written into one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such computer program products are usually portable or fixed storage units. The storage unit may have a storage segment or storage space arranged similarly to the memory 503 in the above-mentioned electronic device. The program code can be compressed, for example, in an appropriate form. Generally, the storage unit includes a program for executing the method steps according to an embodiment of the present invention, that is, a code that can be read by a processor such as 501, which, when run by an electronic device, causes the electronic device to execute various steps in the method described above.
[0125] The embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the unmanned ship track point clustering method described above are implemented.
[0126] The computer-readable storage medium may be included in the device / apparatus described in the above embodiment; or it may exist independently without being assembled into the device / apparatus. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.
[0127] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the 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, apparatus, or device.
[0128] An embodiment of the present invention further provides a dock, comprising a dock body and the aforementioned dock pier automatic arrangement system.
[0129] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the dock described above and the corresponding beneficial effects can refer to the corresponding process in the aforementioned method example and will not be repeated here.
[0130] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0131] The above are preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A method for clustering unmanned ship trajectory points, characterized in that: include: S1. Obtain a set of unmanned ship trajectory points, each of which includes position information; S2, visiting a first unvisited track point in the track point set, and marking the first track point as visited; S3, when the first trajectory point is determined as a core point according to a density-based spatial clustering method with noise, classifying the first trajectory point into a new cluster; S4, visiting points reachable by the first trajectory point density, marking the points reachable by the first trajectory point density as visited, and classifying the points reachable by the first trajectory point density as the new cluster; S5. Repeat S2-S4 until all the track points in the track point set are visited.
2. The method according to claim 1, characterized in that The step of determining the first trajectory point as a core point according to a density-based spatial clustering method with noise in S3 includes: When it is determined that the number of all trajectory points within a preset neighborhood radius of the first trajectory point is greater than or equal to a preset minimum number of sample points, the first trajectory point is determined to be the core point.
3. The method according to claim 2, characterized in that The S3 further includes: If it is determined that the first trajectory point is not a core point according to the density-based spatial clustering method with noise, the process returns to S2.
4. The method according to claim 1, characterized in that: The S4 includes: Acquire a sample set corresponding to all trajectory points within a preset neighborhood radius of the first trajectory point; Visiting a second track point in the sample set that has not been visited, and marking the second track point as visited; When the second trajectory point is determined to be a core point, updating the sample set according to all trajectory points within a preset neighborhood radius of the second trajectory point; classifying the second trajectory point into the new cluster; The step of accessing the unaccessed second track points in the sample set is repeatedly performed until all track points in the sample set are accessed.
5. The method according to claim 4, characterized in that The S4 further comprises: In the case where it is determined that the second trajectory point is not a core point, the step of classifying the second trajectory point into the new cluster is directly performed.
6. The method according to any one of claims 1 to 5, characterized in that: Each track point in the track point set further includes at least one of heading information and speed information.
7. The method according to any one of claims 1 to 5, characterized in that: The method further comprises at least one of the following: Get the location information of each cluster center; Determine the average distance error of each cluster based on the trajectory points corresponding to each cluster; The number of clusters is determined according to the number of repeated executions of S2-S4.
8. An unmanned ship track point clustering device, characterized in that: include: The acquisition module is used to execute step S1, wherein S1 includes: acquiring a set of unmanned ship track points, each track point in the set of track points including position information; A clustering module, configured to execute steps S2-S5, wherein S2 includes: visiting a first unvisited track point in the track point set, and marking the first track point as visited; S3 includes: in the case where the first trajectory point is determined as a core point according to a density-based spatial clustering method with noise, classifying the first trajectory point into a new cluster; S4 includes: visiting points reachable by the first trajectory point density, marking the points reachable by the first trajectory point density as visited, and classifying the points reachable by the first trajectory point density as the new cluster; S5 includes: repeatedly executing S2-S4 until all the track points in the track point set are visited.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the unmanned ship trajectory point clustering method described in any one of claims 1 to 7 when executing the program stored in the memory.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the unmanned ship trajectory point clustering method as described in any one of claims 1 to 7 are implemented.