A method and device for detecting abnormal behaviors of a ship

By preprocessing and compression of AIS message information, combining heading and speed constraints to generate compressed ship trajectories, grid division and index establishment, the problem of inability to detect ship abnormal trajectories online in the prior art is solved, and the acquisition and judgment of multi-dimensional abnormal data is achieved.

CN117216698BActive Publication Date: 2025-08-05WUHAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311108624.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-30
Publication Date
2025-08-05
Estimated Expiration
2043-08-30

AI Technical Summary

Technical Problem

The prior art cannot detect the abnormal trajectory of a ship in online scenarios, and cannot provide abnormal scores according to different characteristics of the ship, resulting in the inability to obtain abnormal data of different characteristics of the ship.

Method used

By obtaining the original message information of AIS, pre-processing and compression, using heading and speed constraints to generate compressed ship trajectories, grid division and index establishment, and abnormal detection is performed based on ship position, heading and speed characteristics.

Benefits of technology

The abnormal detection of ship trajectory in online scenarios is realized, which reduces the calculation amount and improves the calculation efficiency. It can judge whether the ship is abnormal based on multiple ship characteristics and obtains abnormal data of different ship characteristics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117216698B_ABST
    Figure CN117216698B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for detecting abnormal behaviors of ships, relating to the technical field of ship detection. The method includes: obtaining the original message information of the AIS of the ship itself, and preprocessing the original message information to obtain an initial ship trajectory; compressing the initial ship trajectory according to a preset compression algorithm to obtain a compressed ship trajectory; the preset compression algorithm is an algorithm for compressing the initial ship trajectory through course constraint and speed constraint; obtaining the ship trajectory segments according to all the trajectory points in the compressed ship trajectory, dividing the preset research water area into grids, and establishing a ship trajectory segment index; performing abnormal detection on the ship trajectory segments according to the ship trajectory segment index to determine whether the ship itself is abnormal. The present invention realizes the acquisition and judgment of abnormal ship data of multiple ship characteristics in an online scenario of ships.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of ship detection, and particularly to a method and device for detecting abnormal behaviors of ships. Background Art

[0002] Due to the rapid development of maritime trade, waterway transportation has become increasingly important in the global transportation network. The number of various types of ships has increased rapidly to meet the needs of ocean trade. However, this has also brought a series of problems, such as the phenomenon that crew members do not drive ships in accordance with relevant regulations, ships lose control due to bad weather or sea conditions, and fishing boats fish in prohibited fishing areas. Therefore, it has become an urgent problem to be solved in the current Chinese waterway transportation industry to monitor ships with abnormal behaviors in real time, detect them in a timely manner, and take corresponding measures.

[0003] In the prior art, existing methods involve multiple aspects of the method for detecting the trajectories of ships with abnormal behaviors, but these methods all have some defects. For example, methods based on statistics, classification, clustering, and neural networks all require the establishment of complex models, and none of them can provide abnormal scores for different characteristics of ships separately, but only provide a comprehensive ship abnormal score for different characteristics.

[0004] Therefore, there is an urgent need to propose a method and device for detecting abnormal behaviors of ships to solve the technical problems in the prior art that it is impossible to detect the abnormal trajectories of ships in an online scenario, and it is even more impossible to provide abnormal scores for different characteristics of ships separately, resulting in the inability to obtain abnormal data of different characteristics of ships in an online scenario. Summary of the Invention

[0005] In view of this, it is necessary to provide a method and device for detecting abnormal behaviors of ships to solve the technical problems in the prior art that it is impossible to detect the abnormal trajectories of ships in an online scenario, and it is even more impossible to provide abnormal scores for different characteristics of ships separately, resulting in the inability to obtain abnormal data of different characteristics of ships in an online scenario.

[0006] On the one hand, the present invention provides a method for detecting abnormal behaviors of ships, including:

[0007] Obtain the original message information of the AIS of the ship itself, and preprocess the original message information to obtain an initial ship trajectory;

[0008] Compress the initial ship trajectory according to a preset compression algorithm to obtain a compressed ship trajectory; the preset compression algorithm is an algorithm for compressing the initial ship trajectory through course constraint and speed constraint;

[0009] Compress all the trajectory points in the ship trajectory to obtain ship trajectory segments, partition the preset research water area into grids, and establish an index for the ship trajectory segments;

[0010] Perform anomaly detection on the ship trajectory segments according to the ship trajectory segment index to determine whether the ship is abnormal.

[0011] In some possible implementation manners, the preprocessing of the original message information to obtain an initial ship trajectory includes:

[0012] Preprocess the original message information to obtain a preset number of normal message information;

[0013] Extract the ship trajectory from the preset number of normal message information to obtain an initial ship trajectory.

[0014] In some possible implementation manners, the original message information includes a preset number of initial message information;

[0015] The preprocessing of the original message information to obtain a preset number of normal message information includes:

[0016] Decode the preset number of initial message information respectively according to a preset coding format to obtain the decoded message information corresponding to each initial message information;

[0017] Detect all the decoded message information to determine the missing fields and abnormal fields in each decoded message information;

[0018] Fill or replace the missing fields and the abnormal fields according to a preset linear interpolation method to obtain the normal message information corresponding to each initial message information, thereby obtaining a preset number of normal message information.

[0019] In some possible implementation manners, the extraction of the ship trajectory from the preset number of normal message information to obtain an initial ship trajectory includes:

[0020] Detect the preset number of normal message information of the ship to determine the service identification code corresponding to each normal message information;

[0021] Determine all the target message information with the same service identification code in the preset number of normal message information according to the service identification code;

[0022] Sort all the target message information in chronological order to obtain a first ship trajectory;

[0023] Obtain a second ship trajectory according to the time information of all the target message information in the first ship trajectory;

[0024] An initial ship trajectory is obtained based on the spatial information of all the target message information in the second ship trajectory.

[0025] In some possible implementation manners, the compressing the initial ship trajectory according to a preset compression algorithm to obtain a compressed ship trajectory includes:

[0026] Initializing the initial ship trajectory to obtain a trajectory point queue and a set of unvisited trajectory points;

[0027] Calculating a first trajectory point in the set of unvisited trajectory points according to a preset function, the course constraint, and the speed constraint to obtain a calculation result;

[0028] When the calculation result is true, determining whether the first trajectory point is the last trajectory point in the initial ship trajectory;

[0029] If not, deleting the first trajectory point in the set of unvisited trajectory points, adding the first trajectory point to the trajectory point queue, and determining a second trajectory point in the set of unvisited trajectory points, and updating the trajectory point queue based on the second trajectory point;

[0030] If so, obtaining a compressed ship trajectory composed of all the trajectory points in the trajectory point queue.

[0031] In some possible implementation manners, the obtaining the ship trajectory segments according to all the trajectory points in the compressed ship trajectory, performing grid division on a preset research water area, and establishing a ship trajectory segment index includes:

[0032] Determining adjacent trajectory points pairwise according to all the trajectory points in the compressed ship trajectory, and generating trajectory segments corresponding to the adjacent trajectory points;

[0033] Performing grid division on the preset research water area to obtain a preset number of grids;

[0034] Mapping all the trajectory segments into the preset number of grids to obtain target grids passed by each trajectory segment;

[0035] Generating key-value pairs from the grids to the trajectory segments according to the target grids to obtain a ship trajectory segment index.

[0036] In some possible implementation manners, the multiple ship features include ship position features, course features, and speed features;

[0037] The performing anomaly detection on the ship trajectory segments according to the ship trajectory segment index to determine whether the ship is abnormal includes:

[0038] Search for the ship trajectory segment according to the preset radius, preset increment, and the ship trajectory segment index, obtain a set of candidate ship trajectory segments, and thus obtain the neighboring ship trajectory segments in the set of candidate ship trajectory segments that meet the preset increment;

[0039] Perform anomaly detection on the neighboring ship trajectory segments according to the ship position feature and the ship trajectory segment index, and determine whether the ship position of the ship is abnormal;

[0040] When the ship position of the ship is normal, perform anomaly detection on the ship trajectory segment of the ship according to the heading feature and the speed feature, and determine whether the heading and speed of the ship are abnormal.

[0041] In some possible implementation manners, the performing anomaly detection on the neighboring ship trajectory segments according to the ship position feature and the ship trajectory segment index, and determining whether the ship position of the ship is abnormal includes:

[0042] Update the neighboring ship trajectory segments according to the ship trajectory segment index to obtain a set of candidate neighboring ship trajectories;

[0043] Calculate the similarity of each trajectory in the set of candidate neighboring ship trajectories, and determine whether the set of candidate neighboring ship trajectories includes the neighboring ship trajectory of the ship according to the similarity;

[0044] If not, update the number of the neighboring ship trajectory segments according to the preset increment, and update the set of candidate neighboring ship trajectories;

[0045] If so, determine the neighboring ship trajectory of the ship from the set of candidate neighboring ship trajectories;

[0046] Calculate the anomaly score of the ship according to the neighboring ship trajectory to obtain a ship anomaly score;

[0047] Determine whether the ship is abnormal according to the ship anomaly score and the preset ship anomaly threshold.

[0048] In some possible implementation manners, the calculating the similarity of each trajectory in the set of candidate neighboring ship trajectories, and determining whether the set of candidate neighboring ship trajectories includes the neighboring ship trajectory of the ship includes:

[0049] Calculate the lower bound of the similarity of each trajectory in the set of candidate neighboring ship trajectories;

[0050] Calculate the upper bound of the similarity of all trajectories in the complement of the set of candidate neighboring ship trajectories with respect to the initial ship trajectory;

[0051] According to the magnitude relationship between the lower similarity bound and the upper similarity bound, determine whether the candidate set of neighboring ship trajectories includes the neighboring ship trajectory of the ship itself.

[0052] On the other hand, the present invention also provides a ship abnormal behavior detection device, including:

[0053] A trajectory acquisition module, configured to acquire the original message information of the AIS of the ship itself, and preprocess the original message information to obtain an initial ship trajectory;

[0054] A trajectory compression module, configured to compress the initial ship trajectory according to a preset compression algorithm to obtain a compressed ship trajectory; the preset compression algorithm is an algorithm for compressing the initial ship trajectory through course constraint and speed constraint;

[0055] An index generation module, configured to obtain ship trajectory segments according to all trajectory points in the compressed ship trajectory, divide a preset research water area into grids, and establish a ship trajectory segment index;

[0056] An abnormal detection module, configured to perform abnormal detection on the ship trajectory segments according to the ship trajectory segment index, and determine whether the ship itself is abnormal.

[0057] The beneficial effects of adopting the above embodiments are as follows: The ship abnormal behavior detection method provided by the present invention can compress the initial ship trajectory of the ship itself through a preset compression algorithm, so that the compressed ship trajectory of the ship itself can be obtained according to course constraint and speed constraint. While ensuring the course and speed, the data in the ship trajectory is reduced, the calculation amount of abnormal detection is reduced, and the calculation efficiency is improved, so that the ship trajectory in the online scenario can be subjected to abnormal detection. Further, abnormal detection can be respectively performed according to multiple ship characteristics of the ship itself to determine whether the ship itself is abnormal, so that abnormal data of different characteristics of the ship in the online scenario can be obtained, and the acquisition and judgment of multi-dimensional abnormal data of the ship in the online scenario are realized. Brief Description of the Drawings

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative efforts.

[0059] Figure 1 It is a schematic flowchart of an embodiment of the ship abnormal behavior detection method provided by the present invention;

[0060] Figure 2Schematic structural diagram of an embodiment of the compressed ship trajectory provided by the present invention;

[0061] Figure 3 Schematic structural diagram of an embodiment of the ship abnormal behavior detection device provided by the present invention;

[0062] Figure 4 Schematic structural diagram of an embodiment of the electronic device provided by the present invention. Detailed implementation manners

[0063] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.

[0064] Some of the block diagrams shown in the drawings are functional entities, and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor systems and / or microcontroller systems.

[0065] Referring to "embodiment" herein means that a specific feature, structure or characteristic described in conjunction with the embodiment can be included in at least one embodiment of the present invention. The phrase appears in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0066] The embodiments of the present invention provide a ship abnormal behavior detection method and device, which will be described separately below.

[0067] Figure 1 Schematic flowchart of an embodiment of the ship abnormal behavior detection method provided by the present invention, as Figure 1 shown, the ship abnormal behavior detection method includes:

[0068] S101. Obtain the original message information of the AIS of the ship itself, and preprocess the original message information to obtain the initial ship trajectory;

[0069] S102. Compress the initial ship trajectory according to a preset compression algorithm to obtain a compressed ship trajectory; the preset compression algorithm is an algorithm for compressing the initial ship trajectory by heading constraint and speed constraint;

[0070] S103. Obtain ship trajectory segments based on all trajectory points in the compressed ship trajectory, divide the preset research water area into grids, and establish an index for the ship trajectory segments;

[0071] S104. Perform anomaly detection on the ship trajectory segments according to the ship trajectory segment index to determine whether the ship is abnormal.

[0072] Compared with the prior art, the ship abnormal behavior detection method provided by the present invention can compress the initial ship trajectory of the ship through a preset compression algorithm, so that the compressed ship trajectory of the ship can be obtained according to the course constraint and speed constraint. While ensuring the course and speed, the data in the ship trajectory is reduced, the calculation amount of anomaly detection is reduced, and the calculation efficiency is improved, so that the ship trajectory in the online scenario can be detected for anomalies. Further, anomaly detection can be performed respectively according to multiple ship characteristics of the ship to determine whether the ship is abnormal, so that abnormal data of different characteristics of the ship in the online scenario can be obtained, and the acquisition and judgment of multi-dimensional abnormal data of the ship in the online scenario are realized.

[0073] It should be understood that: the method for obtaining the original message information of the ship's AIS in step S101 can be based on the currently obtained original message information in the ship system, or can be to call the historically stored original message information from the storage medium. The original message information is all the message information in the ship system, and the specific data volume is not limited in this invention.

[0074] In some embodiments of the present invention, step S101 includes:

[0075] Preprocess the original message information to obtain a preset number of normal message information;

[0076] Extract the ship trajectory from the preset number of normal message information to obtain the initial ship trajectory.

[0077] In a specific embodiment of the present invention, after obtaining the original message information, due to the instability of the ship during navigation, the original message information may have quality problems. Therefore, the original message information can be preprocessed, and after converting the original message information into normal message information, the ship trajectory is extracted from the normal message information to obtain the initial ship trajectory of the ship.

[0078] In some embodiments of the present invention, the original message information includes a preset number of initial message information;

[0079] Preprocessing the original message information to obtain a preset number of normal message information includes:

[0080] Decode the preset number of initial message information according to the preset encoding format to obtain the decoded message information corresponding to each initial message information;

[0081] Detect all the decoded message information to determine the missing fields and abnormal fields in each decoded message information;

[0082] Fill or replace the missing fields and abnormal fields according to the preset linear interpolation method to obtain the normal message information corresponding to each initial message information, so as to obtain the preset number of normal message information.

[0083] It should be noted that message information can be generated at different times and positions. All the original message information of AIS can include the preset number of initial message information. After preprocessing the initial message information respectively, the preset number of normal message information can be obtained.

[0084] In the specific embodiment of the present invention, the original message information may not be in the same format as the data read by the system of this ship. For the convenience of subsequent use, the original message information can be decoded first. Decoding means obtaining the format that is easy to read by using relevant decoding rules for the original message information of AIS composed of the AICII code encoding format. It is also possible to preprocess the decoded message information obtained after decoding. The message information of AIS on this ship may have quality problems due to different reasons such as bad weather, signal occlusion, equipment failure, and crew operation. When it is detected that there are missing fields and abnormal fields, such problems can be solved by the linear interpolation method.

[0085] It should be noted that: in order to detect the ship's trajectory more accurately, in some embodiments of the present invention, extract the ship's trajectory from the preset number of normal message information to obtain the initial ship's trajectory, including:

[0086] Detect the preset number of normal message information of this ship to determine the service identification code corresponding to each normal message information;

[0087] According to the service identification code, determine all the target message information with the same service identification code in the preset number of normal message information;

[0088] Sort all the target message information in chronological order to obtain the first ship's trajectory;

[0089] According to the time information of all the target message information in the first ship's trajectory, obtain the second ship's trajectory;

[0090] According to the spatial information of all the target message information in the second ship's trajectory, obtain the initial ship's trajectory.

[0091] It should be understood that the target message information includes the Maritime Mobile Service Identity (MMSI).

[0092] In a specific embodiment of the present invention, target message information with the same MMSI can be grouped to obtain all target message information with the same service identification code, and all target message information in each group can be sorted in chronological order to obtain a first ship trajectory; then, the time intervals between adjacent target message information in the first ship trajectory are judged, and the ship trajectories with time intervals greater than a preset interval threshold are segmented, and the trajectories obtained after segmentation are replaced with the corresponding original trajectories in the first ship trajectory to obtain a new second ship trajectory; then, the spatial intervals between adjacent target message information in the second ship trajectory are judged, and the ship trajectories with spatial intervals greater than the preset interval threshold are segmented, and the trajectories obtained after segmentation are replaced with the corresponding original trajectories in the second ship trajectory to obtain the initial ship trajectory of the ship.

[0093] In some embodiments of the present invention, step S102 includes:

[0094] Initialize the initial ship trajectory to obtain the trajectory point queue and the unvisited trajectory point set;

[0095] Calculate the first track point in the unvisited track point set according to a preset function, a heading constraint, and a speed constraint to obtain a calculation result;

[0096] When the calculation result is true, determine whether the first track point is the last track point in the initial ship track;

[0097] If not, deleting the first track point in the unvisited track point set, adding the first track point to the track point queue, determining the second track point in the unvisited track point set, and updating the track point queue based on the second track point;

[0098] If so, the compressed ship trajectory composed of all trajectory points in the trajectory point queue is obtained.

[0099] It should be noted that the ship trajectory compression algorithm includes a preset function, heading constraint and speed constraint. The purpose of the ship trajectory compression algorithm is to convert the initial ship trajectory T = p1 → p2 → ... → p N Find the ship trajectory with the least number of trajectory points under the heading constraint and speed constraint That is, compressing the ship's trajectory.

[0100] In a specific embodiment of the present invention, the specific implementation process of obtaining the ship trajectory with the minimum number of trajectory points is as follows:

[0101] 1. You can first set the heading compression threshold to ∈ and the speed compression threshold to δ, where ∈>0 and δ>0.

[0102] 2. Then the initial ship trajectory can be initialized to obtain the trajectory point queue Q = <p1>and the set of unvisited trajectory points U = {p2, p3, …, p N}; among them, the trajectory point queue Q that can be deleted is <p1>the first node p in i .

[0103] 3. The trajectory points p in U can be processed successively according to the ship trajectory compression algorithm j (i + 1 ≤ j ≤ N), and the specific processing process is as follows.

[0104] 3.1. The first trajectory point in the set of unvisited trajectory points can be processed by executing the preset function Check(p i , p j |∈, δ). If the execution result of the preset function is true, the subsequent steps are executed. If the execution result is false, return to step 3 to process the second trajectory point in the set of unvisited trajectory points, and thus loop.

[0105] 3.2. It can be judged whether the first trajectory point is the last trajectory point j = N in the set of unvisited trajectory points U. If so, the compressed ship trajectory T S is obtained by backtracking. The compressed ship trajectory T S is the shortest path between P i and P j in the preset data structure, and the algorithm ends; if not, delete the first trajectory point in the set of unvisited trajectory points U and add the first trajectory point to the end of the trajectory point queue Q.

[0106] 3.3. Return to step 3 to determine the second trajectory point in the set of unvisited trajectory points, and thus loop until the compressed ship trajectory T S is obtained, as Figure 2 shown. The solid line is the initial ship trajectory T, ∈ = 45°, δ = 10 knot, P1, P3, P4, P6 and P8 are the retained trajectory points, and P2, P5 and P7 are the deleted trajectory points, so as to obtain the compressed ship trajectory T composed of the dotted line S .

[0107] Among them, the course constraint in the ship trajectory compression algorithm means that for any pair of adjacent trajectory points S on the compressed ship trajectory T there is where err c (p i , p j ) is used to represent the compressed course error of the trajectory, which is defined as the maximum value of the course difference between the representative trajectory segment and , as shown in formula (1):

[0108]

[0109] In the formula, Diff c (c1, c2) represents the difference between the headings of c1 and c2, where c1 and c2 are variables, as shown in formula (2):

[0110] Diff c (c1,c2)=min{|c1-c2|,2π-|c1-c2|}, (2)

[0111] Expressed as direction, Represented by P i and P j The generated trajectory segments have directions Defined as P i Course over ground and P j Course over ground The mean of is shown in formula (3):

[0112]

[0113] Among them, the speed constraint in the ship trajectory compression algorithm refers to the speed constraint for T S Any pair of adjacent trajectory points on have where err s (p i ,p j ) is used to characterize the compressed speed error of the trajectory, which is defined as and The maximum value of the difference is shown in formula (4):

[0114]

[0115] Where, Diff s (s1, s2) is expressed as the difference between the speeds of s1 and s2, as shown in formula (5):

[0116] Diff s (s1,s2)=|s1-s2|, (5)

[0117] Expressed as The speed is defined as P i Ground speed As shown in formula (6):

[0118]

[0119] Among them, in step 3.2, the preset data structure G is expressed as G=<V,E> ,V={p1,p2,…,p N }, represented by all trajectory points of the initial ship trajectory T, with P i Starting from P j The directed edge with P as the end point is <p i , p j >, then as shown in formula (7):

[0120]

[0121] Then it can be judged according to formula (8) whether <p i , p j > belongs to E. Formula (8) is as follows:

[0122] err c (p i , p j ) < ∈ ∧ err s (p i , p j ) < δ. (8)

[0123] In step 3.1, according to the preset function Check(p i , p j |∈, δ) to judge whether the directed edge <p i , p j > belongs to E. If the output of Check(p i , p j |∈, δ) is true, it means that formula (8) holds; if the output is false, it means that formula (8) does not hold. The specific judgment process is as follows:

[0124] If the current i of P i is 1, then calculate Sum(p j ), Min(p i , p j ) and Max(p i , p j ). It can be judged according to formula (9). Formula (9) is as follows:

[0125] max{(Sum(p j ) - Sum(p i )) / (j - i) - Min(p i , p j ), Max(p i , p j ) - (Sum(p j ) - Sum(p i )) / (j - i)} ≥ δ (9)

[0126] If formula (9) holds, it means that err s (p i , p j ) ≥ δ, the preset function returns false; otherwise, calculate Fdr(p i , p j ). If indicates that err s (p i , p j ) ≥ δ, formula (8) does not hold, and return false; otherwise, it indicates that formula (8) holds, and the preset function returns true.

[0127] Among them, Sum(p j ) represents the sum of the speeds of the trajectory segments , and the calculation is shown in formula (10):

[0128]

[0129] Min(p i , p j ) and Max(p i , p j ) respectively represent the minimum and maximum speeds of the trajectory segments , and the minimum value is calculated as shown in formula (11):

[0130]

[0131] The maximum value is calculated as shown in formula (12):

[0132]

[0133] Fdr(p i , p j ) can be defined according to formula (13), as shown in formula (13): "

[0134]

[0135] Among them,

[0136] In some embodiments of the present invention, step S103 includes:

[0137] Determine adjacent trajectory points between every two points according to all the trajectory points in the compressed ship trajectory, and generate trajectory segments corresponding to the adjacent trajectory points;

[0138] Perform grid division on the preset research water area to obtain a preset number of grids;

[0139] Map all the trajectory segments of all adjacent trajectory points into the preset number of grids to obtain the target number of grids passed by each trajectory segment;

[0140] Generate key-value pairs from the grid to the trajectory segment according to the target number of grids to obtain the ship trajectory segment index.

[0141] In a specific embodiment of the present invention, it may be to compress the ship trajectory T S for all adjacent trajectory points to generate a total of S N -1 trajectory segments The direction and speed of each trajectory segment are calculated according to formulas (3) and (6) respectively. The compressed ship trajectory can be expressed as: T s = ts1→ts2→…→ts n where and n = N - 1. Replacing the trajectory points with trajectory segments can ensure high efficiency and high precision in the subsequent detection stage.

[0142] In a specific embodiment of the present invention, the trajectory segment index may consist of several key-value pairs. Among them, the key is the grid number corresponding to the preset research water area, and the value is the ship trajectory segment passing through the corresponding grid. Then, the preset research water area is divided into a total of L×W grids according to the preset length L and width W. Then, the following operations are sequentially performed on all trajectory segments: For a certain trajectory segment ts, assume that ts passes through g1, g2,…, g n a total of n grids, and n is the target quantity. Then, add the trajectory segment ts to the value with g i (1≤i≤n) as the key to obtain the index of the trajectory segment ts. Generate indexes for all trajectory segments in the whole compressed ship trajectory according to the above steps to obtain the ship trajectory segment index.

[0143] In some embodiments of the present invention, multiple ship features include ship position feature, heading feature, and speed feature; step S104 includes:

[0144] Search for the ship trajectory segments according to the preset radius, preset increment, and ship trajectory segment index to obtain a set of candidate ship trajectory segments, and thus obtain the neighboring ship trajectory segments that meet the preset increment in the set of candidate ship trajectory segments;

[0145] Perform anomaly detection on the neighboring ship trajectory segments according to the ship position feature and the ship trajectory segment index to determine whether the ship position of the ship is abnormal;

[0146] When the ship position of the ship is normal, perform anomaly detection on the ship trajectory segment of the ship according to the heading feature and the speed feature to determine whether the heading and speed of the ship are abnormal.

[0147] In a specific embodiment of the present invention, multiple ship features can be initialized to obtain ι = K f , C f = {}, i = 1, Among them, f ∈ {l, d, s} represents the detected ship features, l represents the ship position feature, d represents the course feature, s represents the speed feature, ι represents the number of neighboring trajectory segments to be found, and K f represents the number of neighboring trajectories to be found, and C f is the set of neighboring candidate trajectories, representing the trajectories with known distances to at least one trajectory point in the trajectory segment sequence S, and L f represents the length of the query sequence.

[0148] According to the preset radius r = 1, according to the distance to p i The set of candidate ship trajectory segments maintained in ascending order of distance With p i The grid where it is located is the center of the search grid, and search for the ship trajectory ΔC passing through the outermost circle of grids with a side length of 2r - 1 as the search grid area, and add ΔC to the set of candidate ship trajectory segments C ts , if |C ts | ≥ ι, then the first ι elements of C ts at this time are the required ship trajectory segments ι-ns f (p i ); otherwise, let r ← r + 1, re-search the grid area according to the updated r, and perform a loop until the set of candidate ship trajectory segments C ts is obtained, so as to obtain the ι neighboring ship trajectory segments ι-ns i of the trajectory point p f (p i ), among which, f ∈ {l, d, s}, so f can be replaced with l, b, and s, and ι-ns l (p i ) represents the ι trajectory segments with the smallest dis(p, ts), and ι-ns b (p i ) represents the ι trajectory segments with the smallest dis(p, ts) and diff b (p, ts) < τ b for ι trajectory segments, and s and b are the same.

[0149] In some embodiments of the present invention, anomaly detection is performed on the neighboring ship trajectory segments according to the ship position feature and the ship trajectory segment index to determine whether the ship position of the current ship is abnormal, including:

[0150] Update the neighboring ship trajectory segments according to the ship trajectory segment index to obtain a set of neighboring candidate ship trajectories;

[0151] Calculate the similarity of each trajectory segment in the set of neighboring ship trajectory candidates, and determine whether the set of neighboring ship trajectory candidates includes the neighboring ship trajectories of the current ship according to the similarity;

[0152] Otherwise, update the number of neighboring ship trajectory segments according to a preset increment, and update the candidate set of neighboring ship trajectories;

[0153] If so, determine the neighboring ship trajectory of the ship from the candidate set of neighboring ship trajectories;

[0154] Calculate the anomaly score of the ship according to the neighboring ship trajectory to obtain the ship anomaly score;

[0155] Judge whether the ship is abnormal according to the ship anomaly score and the preset ship anomaly threshold.

[0156] It should be noted that during the process of detecting the anomaly of the ship position, the influence of the length of neighboring trajectory segments with different features on the anomaly detection result can be considered through λ of the course feature d and λ of the speed feature s In a specific embodiment of the present invention, λ

[0157] = 0. The neighboring ship trajectory segment ι-ns l (p f ) can be updated according to the initial ship trajectory T to obtain the candidate set C of neighboring ship trajectories i , and the update is shown in formula (14): f It can be judged for i = L

[0158]

[0159] If not, execute i = i + 1, and then return to the step of "updating the neighboring ship trajectory segments according to the ship position feature to obtain the candidate set of neighboring candidate ship trajectories" for loop operation; if so, the lower bound of similarity of each trajectory in the candidate set of neighboring ship trajectories can be calculated, and it can be judged whether the k-nearest neighboring ship trajectories are included in the candidate set of neighboring ship trajectories according to the lower bound of similarity. If so, the anomaly score of the ship can be calculated, and thus it can be judged whether the ship has an anomaly according to the anomaly score and the preset ship anomaly threshold. If the anomaly score is greater than the preset ship anomaly threshold, it is determined that the ship has an anomaly; if it is less than or equal to the preset ship anomaly threshold, there is no anomaly. f

[0160] ​The specific process of anomaly judgment is as follows. The preset ship anomaly thresholds include a ship position anomaly threshold, a course anomaly threshold, and a speed anomaly threshold. First, calculations are performed based on the data of the ship position characteristics to obtain the anomaly score of the ship itself in the ship position characteristics. When the anomaly score of the ship position characteristics is greater than the ship position anomaly threshold, it is determined that the ship itself has an anomaly; otherwise, there is no anomaly. During the detection process of the ship position characteristics, when there is no anomaly for the ship itself, the course characteristics and speed characteristics are then detected and calculated. The process is the same as that of the ship position characteristics detection process. Similarly, when the anomaly score of the course characteristics is greater than the course anomaly threshold or the anomaly score of the speed characteristics is greater than the speed anomaly threshold, the ship itself has an anomaly; otherwise, there is no anomaly.

[0161] In some embodiments of the present invention, calculating the similarity of each trajectory segment in the candidate set of neighboring ship trajectories and determining whether the candidate set of neighboring ship trajectories includes the neighboring ship trajectory of the ship itself includes:

[0162] Calculating the lower bound of the similarity of each trajectory in the candidate set of neighboring ship trajectories;

[0163] Calculating the upper bound of the similarity of all trajectories in the complement of the candidate set of neighboring ship trajectories with respect to the initial ship trajectory;

[0164] Determining whether the candidate set of neighboring ship trajectories includes the neighboring ship trajectory of the ship itself according to the magnitude relationship between the lower bound of the similarity and the upper bound of the similarity.

[0165] In a specific embodiment of the present invention, the lower bound of the similarity LB of each trajectory segment can be calculated according to formula (15) f , LB f (T) represents the lower bound of the similarity between the trajectory segment sequence S and T ∈ C f , as shown in formula (15):

[0166]

[0167] The upper bound of the similarity UB of all trajectories in the complement of the candidate set of neighboring ship trajectories with respect to all ship trajectories can be calculated according to formula (16) l , UB l represents the upper bound of the similarity between the trajectory segment sequence S and all trajectories in, as shown in formula (16):

[0168]

[0169] Among them, is represented as the complement of C f ; far(ι - ns f (p)) represents the farthest distance between the trajectory point p and ι - ns f (p).

[0170] If it indicates that the k-nearest neighbor trajectory being searched for must be included in C f , then the k-nearest neighbor trajectory of this ship can be searched for in C f . If not, update the number ι of neighbor trajectory segments to be searched for according to a preset increment, let ι = ι + Δ, and return to the step of "searching for ship trajectory segments according to ship trajectory segment indexes to obtain a candidate ship trajectory set" for loop operations denotes the k-th largest LB l .

[0171] An empty min-heap H can also be initialized. The elements of H are denoted as <Sim f (S,T),T>, and maintain this heap according to Sim f (S,T); The similarity upper bound UB(T) of each trajectory T in the candidate set of neighbor ship trajectories can also be calculated according to (16), where UB(T) can be calculated according to formula (17):

[0172]

[0173] In the formula denotes the distance between the trajectory point p and the trajectory T. When f = l, as shown in formula (18):

[0174]

[0175] In the formula, dis(p,ts) denotes the distance between the trajectory point p and the trajectory segment ts, defined as the distance from p to the nearest point on ts; when f = d or f = s is equal to dis(p,ts * ), where ts * satisfies formula (19) and formula (20):

[0176]

[0177]

[0178] In the formula, b ∈ {d,s}, τ b is the behavior threshold, λ b is the historical trajectory segment length threshold, diff b (p,ts) denotes the difference in course or speed between p and ts, as shown in formula (21):

[0179]

[0180] According to the calculation of formula (3 ), the process of dir ts , according to the calculation of formula (6) The process of, similarly, the speed can be calculated ts .

[0181] It can also be sorted in descending order of UB f (T) for the trajectories in C f and initialize i = 1. If i < K f , then insert <Sim l (S, T), T> into H, update i according to i = i + 1, and re - judge i < K f ,, thus performing a loop; if i < K f is not established, then judge whether Sim l (S, T i ) > Head(H).sim holds, where Head(H) represents the top - node of the heap H. If so, remove Head(H), insert <Sim l (S, T), T> into H, and then judge whether i = |C L | or i < |C L | ∧ Head(H).sim ≥ UB(T i+1 ) holds. If so, the trajectories corresponding to the elements in H at this time are the k - nearest - neighbor trajectories, and the algorithm ends; if not, let i = i + 1, return to the step of judging whether i < K f is established, and perform a loop; if Sim l (S, T i ) > Head(H).sim does not hold, then directly go to the step of judging whether i = |C L | or i < |C L | ∧ Head(H).sim ≥ UB(T i+1 ) holds, until the k - nearest - neighbor trajectories are obtained.

[0182] Among them, the similarity calculation between the trajectory sequence S and the trajectory T is shown in formula (22):

[0183]

[0184] To better implement the ship abnormal behavior detection method in the embodiments of the present invention,, based on the ship abnormal behavior detection method, correspondingly, the embodiments of the present invention also provide a ship abnormal behavior detection device, as Figure 3 shown, the ship abnormal behavior detection device includes:

[0185] A trajectory acquisition module 301, configured to acquire the original message information of the AIS of the ship itself, and pre - process the original message information to obtain an initial ship trajectory;

[0186] A trajectory compression module 302 is configured to compress an initial ship trajectory according to a preset compression algorithm to obtain a compressed ship trajectory; the preset compression algorithm is an algorithm for compressing the initial ship trajectory by means of course constraint and speed constraint.

[0187] An index generation module 303 is configured to obtain ship trajectory segments based on all the trajectory points in the compressed ship trajectory, divide a preset research water area into grids, and establish a ship trajectory segment index.

[0188] An anomaly detection module 304 is configured to perform anomaly detection on the ship trajectory segments according to the ship trajectory segment index to determine whether the ship is abnormal.

[0189] The ship anomaly behavior detection device provided in the above embodiment can implement the technical solutions described in the above ship anomaly behavior detection method embodiment. The specific implementation principles of the above modules or units can be referred to the corresponding content in the above ship anomaly behavior detection method embodiment, which will not be elaborated here.

[0190] As Figure 4 shown, the present invention also correspondingly provides an electronic device 400. The electronic device 400 includes a processor 401, a memory 402, and a display 403. Figure 4 Only some components of the electronic device 400 are shown, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented.

[0191] In some embodiments, the memory 402 may be an internal storage unit of the electronic device 400, such as the hard disk or memory of the electronic device 400. In other embodiments, the memory 402 may also be an external storage device of the electronic device 400, such as a plug-in hard disk equipped on the electronic device 400, a smart media card (SMC), a secure digital (SD) card, a flash card, etc.

[0192] Furthermore, the memory 402 may also include both the internal storage unit and the external storage device of the electronic device 400. The memory 402 is used to store the application software installed in the electronic device 400 and various types of data.

[0193] In some embodiments, the processor 401 may be a central processing unit (CPU), a microprocessor, or other data processing chips, and is used to run the program code stored in the memory 402 or process data, such as the ship anomaly behavior detection method in the present invention.

[0194] The display 403 can be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. in some embodiments. The display 403 is used to display the information in the electronic device 400 and to display a visual user interface. The components 401-403 of the electronic device 400 communicate with each other via a system bus.

[0195] In some embodiments of the present invention, when the processor 401 executes the ship abnormal behavior detection program in the memory 402, the following steps can be implemented:

[0196] Obtain the original message information of the AIS of this ship, and preprocess the original message information to obtain an initial ship trajectory;

[0197] Compress the initial ship trajectory according to a preset compression algorithm to obtain a compressed ship trajectory; the preset compression algorithm is an algorithm for compressing the initial ship trajectory by heading constraint and speed constraint;

[0198] Obtain ship trajectory segments based on all the trajectory points in the compressed ship trajectory, and divide the preset research water area into grids to establish a ship trajectory segment index;

[0199] Perform abnormal detection on the ship trajectory segments according to the ship trajectory segment index to determine whether this ship is abnormal.

[0200] It should be understood that: when the processor 401 executes the ship abnormal behavior detection program in the memory 402, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiments above.

[0201] Furthermore, the type of the electronic device 400 mentioned in the embodiments of the present invention is not specifically limited. The electronic device 400 can be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of the portable electronic device include, but are not limited to, portable electronic devices equipped with IOS, android, microsoft or other operating systems. The above portable electronic devices can also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (such as a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 400 can also not be a portable electronic device, but a desktop computer with a touch-sensitive surface (such as a touch panel).

[0202] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the programs or instructions are executed by a processor, the method steps or functions of the ship abnormal behavior detection method provided by the above method embodiments can be implemented.

[0203] Those skilled in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware (such as a processor, a controller, etc.) through a computer program. The computer program can be stored in a computer-readable storage medium. Among them, the computer-readable storage medium is a magnetic disk, an optical disk, a read-only memory, or a random access memory, etc.

[0204] The ship abnormal behavior detection method and device provided by the present invention have been introduced in detail above. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A method for detecting abnormal behavior of a ship, characterized in that: include: Obtaining the original AIS message information of the ship and preprocessing the original message information to obtain the initial ship trajectory; The initial ship trajectory is compressed according to a preset compression algorithm to obtain a compressed ship trajectory; the preset compression algorithm is an algorithm for compressing the initial ship trajectory through heading constraints and speed constraints; the heading constraint refers to the Any pair of adjacent trajectory points on ,have ,in Used to characterize the compressed heading error of the trajectory; the speed constraint refers to Any pair of adjacent trajectory points on ,have ,in Used to characterize the compressed speed error of the trajectory; the heading compression threshold is , the speed compression threshold is ; Obtaining ship trajectory segments based on all trajectory points in the compressed ship trajectory, dividing the preset research waters into grids, and establishing a ship trajectory segment index; Performing anomaly detection on the ship trajectory segment according to the ship trajectory segment index to determine whether the ship is abnormal; Multiple ship characteristics include ship position characteristics, course characteristics and speed characteristics; The performing abnormality detection on the ship trajectory segment according to the ship trajectory segment index to determine whether the ship is abnormal includes: Searching the ship trajectory segment according to a preset radius, a preset increment, and the ship trajectory segment index to obtain a set of candidate ship trajectory segments, thereby obtaining a neighboring ship trajectory segment that satisfies the preset increment in the set of candidate ship trajectory segments; performing anomaly detection on the neighboring ship trajectory segments according to the ship position feature and the ship trajectory segment index to determine whether the ship position is abnormal; When the position of the own ship is normal, an abnormality detection is performed on the ship trajectory segment of the own ship according to the heading feature and the speed feature to determine whether the heading and speed of the own ship are abnormal.

2. The method for detecting abnormal ship behavior according to claim 1, characterized in that: The pre-processing of the original message information to obtain the initial ship trajectory includes: Preprocessing the original message information to obtain a preset number of normal message information; The ship trajectory is extracted from the preset number of normal message information to obtain an initial ship trajectory.

3. The method for detecting abnormal ship behavior according to claim 2, characterized in that: The original message information includes a preset number of initial message information; The preprocessing of the original message information to obtain a preset number of normal message information includes: Decoding the preset number of initial message information respectively according to the preset coding format to obtain decoded message information corresponding to each initial message information; Detect all decoded message information and determine the missing fields and abnormal fields in each decoded message information; The missing fields and the abnormal fields are filled or replaced according to a preset linear interpolation method to obtain normal message information corresponding to each initial message information, thereby obtaining a preset number of normal message information.

4. The method for detecting abnormal ship behavior according to claim 2, characterized in that: The extracting the ship trajectory from the preset number of normal message information to obtain the initial ship trajectory includes: Detecting the preset number of normal message information of the ship and determining the service identification code corresponding to each normal message information; According to the service identification code, determining all target message information having the same service identification code in the preset number of normal message information; Sorting all target message information in chronological order to obtain a first ship trajectory; Obtaining a second ship trajectory according to time information of all target message information in the first ship trajectory; An initial ship trajectory is obtained according to the spatial information of all target message information in the second ship trajectory.

5. The method for detecting abnormal ship behavior according to claim 1, characterized in that: The compressing the initial ship trajectory according to a preset compression algorithm to obtain a compressed ship trajectory includes: Initializing the initial ship trajectory to obtain a trajectory point queue and an unvisited trajectory point set; Calculating the first trajectory point in the unvisited trajectory point set according to a preset function, the heading constraint, and the speed constraint to obtain a calculation result; When the calculation result is true, determining whether the first trajectory point is the last trajectory point in the initial ship trajectory; If not, deleting the first track point in the unvisited track point set, adding the first track point to the track point queue, determining a second track point in the unvisited track point set, and updating the track point queue based on the second track point; If so, a compressed ship trajectory consisting of all trajectory points in the trajectory point queue is obtained.

6. The method for detecting abnormal ship behavior according to claim 1, characterized in that: The method of obtaining the ship trajectory segment according to all trajectory points in the compressed ship trajectory, performing grid division on the preset research waters, and establishing the ship trajectory segment index includes: Determining, based on all trajectory points in the compressed ship trajectory, adjacent trajectory points between each other, and generating trajectory segments corresponding to the adjacent trajectory points; Gridding the preset research waters to obtain a preset number of grids; Mapping all trajectory segments to the preset number of grids to obtain a target number of grids that each trajectory segment passes through; A grid-to-track segment key-value pair is generated according to the target number of grids to obtain a ship track segment index.

7. The method for detecting abnormal ship behavior according to claim 1, characterized in that: The performing anomaly detection on the neighboring ship trajectory segment according to the ship position feature and the ship trajectory segment index to determine whether the position of the own ship is abnormal includes: updating the neighboring ship trajectory segments according to the ship trajectory segment index to obtain a candidate set of neighboring ship trajectories; Calculating the similarity of each trajectory in the candidate set of neighboring ship trajectories, and determining whether the candidate set of neighboring ship trajectories includes the neighboring ship trajectory of the own ship based on the similarity; If not, updating the number of the neighboring ship trajectory segments according to the preset increment, and updating the candidate set of the neighboring ship trajectory; If so, determining the neighboring ship trajectory of the ship from the candidate set of neighboring ship trajectories; Calculating the anomaly score of the ship according to the neighboring ship trajectories to obtain a ship anomaly score; Whether the ship is abnormal is determined based on the ship abnormality score and a preset ship abnormality threshold.

8. The method for detecting abnormal ship behavior according to claim 7, characterized in that: The calculating the similarity of each trajectory in the candidate set of neighboring ship trajectories, and judging whether the candidate set of neighboring ship trajectories includes the neighboring ship trajectory of the own ship according to the similarity, includes: Calculating the lower bound of the similarity of each trajectory in the candidate set of neighboring ship trajectories; Calculating an upper bound of similarity between the candidate set of neighboring ship trajectories and all trajectories in the complement set of the initial ship trajectory; According to the magnitude relationship between the lower bound of the similarity and the upper bound of the similarity, it is determined whether the candidate set of neighboring ship trajectories includes the neighboring ship trajectory of the own ship.

9. A device for detecting abnormal behavior of a ship, characterized in that: include: The track acquisition module is used to obtain the original message information of the AIS of the ship and pre-process the original message information to obtain the initial ship track; The trajectory compression module is used to compress the initial ship trajectory according to a preset compression algorithm to obtain a compressed ship trajectory; the preset compression algorithm is an algorithm for compressing the initial ship trajectory through heading constraints and speed constraints; the heading constraint refers to the compressed ship trajectory. Any pair of adjacent trajectory points on ,have ,in Used to characterize the compressed heading error of the trajectory; the speed constraint refers to Any pair of adjacent trajectory points on ,have ,in Used to characterize the compressed speed error of the trajectory; the heading compression threshold is , the speed compression threshold is ; An index generation module is used to obtain ship trajectory segments based on all trajectory points in the compressed ship trajectory, and to perform grid division on the preset research waters to establish a ship trajectory segment index; an anomaly detection module, configured to perform an anomaly detection on the ship trajectory segment according to the ship trajectory segment index, and determine whether the ship is abnormal; Multiple ship characteristics include ship position characteristics, course characteristics and speed characteristics; The performing abnormality detection on the ship trajectory segment according to the ship trajectory segment index to determine whether the ship is abnormal includes: Searching the ship trajectory segment according to a preset radius, a preset increment, and the ship trajectory segment index to obtain a set of candidate ship trajectory segments, thereby obtaining a neighboring ship trajectory segment that satisfies the preset increment in the set of candidate ship trajectory segments; performing anomaly detection on the neighboring ship trajectory segments according to the ship position feature and the ship trajectory segment index to determine whether the ship position is abnormal; When the position of the own ship is normal, an abnormality detection is performed on the ship trajectory segment of the own ship according to the heading feature and the speed feature to determine whether the heading and speed of the own ship are abnormal.

Citation Information

Patent Citations

  • Ship anomaly detection method based on improved trajectory segment DBSCAN clustering

    CN113032502A

  • Ship track behavior anomaly detection method, system and device and storage medium

    CN116608861A