Trajectory anomaly detection method and apparatus, and computer device and storage medium
Through rasterization processing and location relationship analysis, the problem of high computational complexity in trajectory anomaly detection in the Internet of Vehicles is solved, saving resources and improving detection efficiency.
Patent Information
- Application Number
- PCT/CN2023/127822
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-27
- Filing Date
- 2023-10-30
- Publication Date
- 2024-09-06
AI Technical Summary
In the Internet of Vehicles scenario, the existing technology requires a huge amount of calculation when used for trajectory anomaly detection, resulting in high resource consumption. Especially when there are a large number of vehicles, it is difficult to effectively reduce the consumption of computing and storage resources.
Divide the geographical area into multiple rasters through rasterization processing, determine the target raster to which the location to be detected belongs and the historical raster to which the historical location belongs, and perform anomaly detection based on the positional relationship between rasters, reducing the amount of calculation and storage Resource consumption.
It significantly reduces the consumption of computing resources and storage resources, improves the efficiency of trajectory anomaly detection, and can accurately identify abnormal points in the trajectory, especially in million-level vehicle scenarios.
Smart Images

Figure CN2023127822_06092024_PF_FP
Abstract
Description
Trajectory anomaly detection method, device, computer equipment and storage medium
[0001] Related applications
[0002] This application claims priority to Chinese patent application number 2023102084509, filed on February 27, 2023, entitled “Trajectory Anomaly Detection Method, Device, Computer Equipment and Storage Medium,” the entire text of which is hereby incorporated by reference. Technical Field
[0003] The present application relates to the field of information processing technology, and in particular to a trajectory anomaly detection method, apparatus, computer equipment, and storage medium. Background Art
[0004] With the development of connected vehicle technology, many products can provide diverse business functions based on vehicle trajectories, such as providing information about road congestion ahead. Location information plays a crucial role in these business functions. However, due to system anomalies or hardware data collection errors, aberrant location information may be collected, significantly impacting the accuracy of subsequent calculations.
[0005] Related technologies compare the current location with historical locations to determine if the location is abnormal, and thus whether the trajectory is abnormal. When the vehicle travels over a long time span and accumulates more and more location data, the amount of calculation increases dramatically, requiring high resource consumption.
[0006] Summary of the Invention
[0007] According to various embodiments of the present application, a trajectory anomaly detection method, apparatus, computer device, computer-readable storage medium, and computer program product are provided.
[0008] In one aspect, the present application provides a trajectory anomaly detection method, which is executed by a computer device, and the method includes:
[0009] Obtaining the position to be detected in the moving trajectory generated by the moving object;
[0010] Determining a target grid to which the position to be detected belongs from a plurality of grids obtained by performing a rasterization process based on the actual geographical area;
[0011] Determining at least one historical grid related to the mobile object, where the at least one historical grid is obtained based on a historical position within a preset time range in a movement trajectory generated by the mobile object; and
[0012] An abnormality detection result of the movement trajectory is determined according to a positional relationship between the target grid and the at least one historical grid.
[0013] On the other hand, the present application also provides a trajectory anomaly detection device, the device comprising:
[0014] An acquisition module is used to determine a position to be detected in a moving trajectory generated by a moving object;
[0015] A determination module, configured to determine a target grid to which the position to be detected belongs from a plurality of grids obtained by performing a rasterization process based on an actual geographical area;
[0016] The determining module is further configured to determine at least one historical grid related to the moving object, wherein the at least one historical grid is obtained based on a historical position within a preset time range in the movement trajectory generated by the moving object; and
[0017] A detection module is used to determine an abnormality detection result of the movement trajectory according to the positional relationship between the target grid and the at least one historical grid.
[0018] In another aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned trajectory anomaly detection method when executing the computer program.
[0019] In another aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned trajectory anomaly detection method when executed by a processor.
[0020] In another aspect, the present application further provides a computer program product, comprising computer-readable instructions, which, when executed by a processor, implement the above-mentioned trajectory anomaly detection method.
[0021] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without any creative work.
[0023] FIG1 is a diagram illustrating an application environment of a trajectory anomaly detection method according to an embodiment;
[0024] FIG2 is a diagram illustrating an application environment of a trajectory anomaly detection method according to another embodiment;
[0025] FIG3 is a schematic diagram of a flow chart of a trajectory anomaly detection method according to an embodiment;
[0026] FIG4 is a schematic diagram of each grid in one embodiment;
[0027] FIG5A is a schematic diagram of a history grid associated with a moving object in one embodiment;
[0028] FIG5B is a schematic diagram of a history grid associated with a moving object in another embodiment;
[0029] FIG6 is a schematic diagram of the positional relationship between grids in one embodiment;
[0030] FIG7 is a schematic diagram of grids of different grid sizes according to one embodiment;
[0031] FIG8A is a schematic diagram showing the principle of theoretical grid distance in one embodiment;
[0032] FIG8B is a schematic diagram showing the principle of theoretical grid distance in another embodiment;
[0033] FIG9 is a schematic diagram of a trajectory of a moving object in one embodiment;
[0034] FIG10 is a schematic diagram of the trajectory of a moving object in a tunnel crossing scenario according to an embodiment;
[0035] FIG11 is a schematic diagram of an interface for displaying abnormality detection results in one embodiment;
[0036] FIG12 is a schematic diagram of a process of updating a data set by a server in one embodiment;
[0037] FIG13 is a block diagram of a trajectory anomaly detection device according to one embodiment;
[0038] FIG14 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0039] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0040] In the related art, the distance between positions is calculated to determine whether there is an anomaly in the trajectory. For example, when there are N positions in a trajectory, the distance between each two positions is calculated to determine whether there is an anomaly in the trajectory. The amount of calculation can reach N. 2 For example, the client on the vehicle obtains the vehicle's location at a sampling frequency of 1 second and transmits it to the server. Within 30 minutes, there will be 1,800 location data. If you want to calculate the distance between any two locations in these location data, you need to calculate each of the 1,800 locations in any combination, which requires 1.53 billion calculations. And this is just the amount of calculation for one vehicle. In the current scenario of the Internet of Vehicles, the number of vehicles transmitting data at the same time can be as high as one million, and the number of calculations will reach 1.5 trillion times, which is obviously an extremely large computing task. In addition, location data usually also carries data used for other business functions, such as timestamps, fuel levels, etc., which also consumes huge storage resources.
[0041] In view of this, an embodiment of the present application provides a trajectory anomaly detection method, which determines the correlation between positions through the positional relationship between grids, greatly reduces the amount of calculation, and significantly reduces the consumption of computing resources and storage resources.
[0042] The trajectory anomaly detection method provided in the embodiments of the present application can be applied in the application environment shown in Figure 1. In particular, terminal 102 is connected to server 104 for communication. Terminal 102 and server 104 can be connected directly or indirectly via wired or wireless communication, which is not limited in this application. The data storage system can store data that server 104 needs to process. The data storage system can be integrated with server 104, or it can be placed in the cloud or on other servers.
[0043] The trajectory anomaly detection method provided in embodiments of the present application can be executed independently or collaboratively by the terminal 102 or the server 104. In some embodiments, the terminal 102 or the server 104 obtains a location to be detected in the trajectory generated by the mobile object. For example, the terminal 102 obtains the location to be detected in the trajectory generated by the mobile object for calculation, or the server 104 obtains the location to be detected uploaded by the terminal 102. The terminal 102 or the server 104 determines a target grid to which the location to be detected belongs from multiple grids obtained by rasterization processing based on the actual geographic area; determines at least one historical grid associated with the mobile object, the at least one historical grid being based on historical locations within a preset time range in the trajectory generated by the mobile object; and determines an anomaly detection result for the trajectory based on the positional relationship between the target grid and the at least one historical grid. After determining the anomaly detection result for the trajectory, the server 104 may send the anomaly detection result to the terminal 102. Alternatively, after determining the anomaly detection result for the trajectory, the terminal 102 may report the anomaly detection result to the server 104.
[0044] The terminal 102 may be, but is not limited to, a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, in-vehicle terminal, smart TV, etc. The server 104 may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud computing, cloud storage, and big data. The terminal 102 and server 104 may be connected directly or indirectly via wired or wireless communication, which is not limited in this application.
[0045] The trajectory anomaly detection method provided in the embodiment of the present application can also be applied to the application environment shown in Figure 2. Among them, the terminal 202 is a vehicle-mounted terminal, which is deployed on a manned vehicle or an unmanned vehicle. Multiple terminals 202 are respectively connected to the cloud server 204 for communication. In some embodiments, a long connection is established between the terminal 202 and the cloud server 204, and data is then exchanged based on the long connection, which can avoid the resource consumption caused by frequent connection establishment. The cloud server 204 can process the data transmitted by multiple terminals 202 in parallel computing or distributed computing to achieve trajectory anomaly detection.
[0046] In some embodiments, as shown in FIG3 , a trajectory anomaly detection method is provided. The method can be applied to a terminal or a server, or can be performed collaboratively by the terminal and the server. The following description uses the method applied to a server as an example. The method includes the following steps:
[0047] Step S302: Acquire a position to be detected in the moving trajectory generated by the moving object.
[0048] A mobile object is a moving object. A mobile object can be living or non-living. Mobile objects include, but are not limited to, manned vehicles, unmanned vehicles, drones, pedestrians, and animals. A location to be detected is a location in a movement trajectory that needs to be checked for abnormalities. The movement trajectory generated by a mobile object is a record of the locations that the mobile object passes through during its movement.
[0049] A movement trajectory is a collection of the positions of a moving object over a period of time. The position of a moving object represents its specific location in the real world, typically expressed as longitude and latitude. Generally, a position sequence of the positions of a moving object, sorted by time, can record the path of the moving object during that period.
[0050] In some embodiments, a device (or terminal) mounted on a mobile object can collect the mobile object's location using the Global Positioning System (GPS) or the BeiDou satellite navigation system, and report the collected location to a server. In some embodiments, the terminal mounted on the mobile object runs a location-based service (LBS) and uses various types of positioning technologies to obtain the mobile object's location.
[0051] Specifically, the server obtains the location to be detected within the trajectory of the moving object by: receiving data packets sent back by the device carried by the moving object; parsing the data packets and extracting the location data contained therein to obtain the location to be detected. Typically, the data packets also carry other relevant data about the moving object, such as one or more of altitude, remaining fuel level, remaining battery level, or time.
[0052] In some embodiments, the server can perform real-time anomaly detection on the trajectory of the moving object; when the terminal reports its position to the server in real time, the server uses the position obtained at the current moment as the position to be detected and performs subsequent anomaly detection.
[0053] In other embodiments, the server may perform delayed anomaly detection on the trajectory of the moving object; after the terminal reports its position for a period of time to the server, the server uses each acquired position as a position to be detected in turn and performs subsequent anomaly detection on each position.
[0054] Step S304 : determining a target grid to which the position to be detected belongs from a plurality of grids obtained by performing rasterization processing based on the actual geographical area.
[0055] The server pre-rasterizes the actual geographic area, generating multiple grids corresponding to the actual geographic area. This allows each location of a moving object to be hashed into a different grid. Based on the pigeonhole principle, different locations within the same grid share common characteristics, such as the same speed or a speed difference within a threshold. A grid can be understood as a small grid divided from an actual geographic area.
[0056] In some embodiments, the server performs rasterization processing based on the actual geographical area, including: performing a location-based hashing process on the actual geographical area, thereby dividing the actual geographical area to obtain a plurality of grids. The shape of the grid is usually rectangular, but it can also be a regular geometric shape such as a pentagon or hexagon. In order to simplify the amount of calculation, the grid is usually set to a square. Among them, the location-based hashing process is a location-based hashing process, which can be implemented by a location hashing algorithm. The location hashing algorithm includes but is not limited to one or more of the GeoHash (location hashing) algorithm or the rounding algorithm. The GeoHash algorithm converts the two-dimensional longitude and latitude data into a one-dimensional string, where a string represents a rectangular area, thereby dividing the actual geographical area into a plurality of rectangular areas, each of which is a grid. The rounding algorithm performs a rounding operation on the longitude and latitude data, determines the index information according to the rounded value, and obtains a plurality of grids of a fixed grid size, each grid having its own index information.
[0057] In some embodiments, determining the target grid to which the position to be detected belongs from multiple grids obtained by rasterization processing based on the actual geographical area includes: performing rasterization processing based on the actual geographical area to obtain multiple grids, each grid corresponding to an area in the actual geographical area; and determining the grid in which the position to be detected falls as the target grid to which the position to be detected belongs based on the area corresponding to the grid in which the position to be detected falls.
[0058] For example, in each grid 1 to 9 shown in FIG4 , the server determines grid 5 as the target grid to which the position to be detected P1 belongs based on the grid 5 in which the position to be detected P1 falls.
[0059] In some embodiments, the server performs location-based hashing processing on the location to be detected using the same location hashing algorithm as that used in the rasterization process based on the actual geographic area, thereby determining the target grid to which the location to be detected belongs based on the character string or index information corresponding to the location to be detected.
[0060] Step S306 : determining at least one historical grid related to the moving object, where the at least one historical grid is obtained based on a historical position of the moving trajectory generated by the moving object within a preset time range.
[0061] The preset time range specifies the time period for location anomaly detection. For delayed trajectory anomaly detection, the server can perform anomaly detection on the trajectories of multiple moving objects daily, in which case the preset time range is one day. For real-time trajectory anomaly detection, the server can shorten the preset time range to, for example, 10 minutes, 30 minutes, or 60 minutes.
[0062] In some embodiments, the server may obtain the average duration of each moving trajectory of multiple moving objects in the same actual geographical area based on big data analysis, and adaptively set a preset time range according to the average duration.
[0063] Exemplarily, the server sets a sliding window in stream computing, and the time period corresponding to the sliding window is a preset time range; each trajectory anomaly detection is based on the position obtained within the preset time range corresponding to the sliding window.
[0064] The historical position is a position obtained before the position to be detected within a preset time range. The historical grid is the grid to which the historical position belongs.
[0065] Since network transmission may have packet loss, delay, etc., the actual collection time of the historical position obtained by the server may not be before the actual collection time of the position to be detected.
[0066] For example, at time t, a terminal transmits Package 1 to the server to report that a moving object is at location A, and at time t+1, transmits Package 2 to the server to report that the moving object is at location B. Due to network fluctuations, the server receives Package 2 first, parses it to obtain location B, and performs anomaly detection on location B. After the server receives Package 1 and parses it to obtain location A, location B becomes the historical location of location A.
[0067] In some embodiments, the server determines at least one historical grid related to the mobile object, including: determining all historical locations within a preset time range; determining the historical grids to which all historical locations belong; and using the historical grids corresponding to all historical locations as historical grids related to the mobile object.
[0068] For example, as shown in Figure 5A, the server obtains all historical positions before the position D to be detected, including position A, position B, and position C. The server then uses the historical grid to which position A belongs (corresponding to grid 4), the historical grid to which position B belongs (corresponding to grid 5), and the historical grid to which position C belongs (corresponding to grid 2) as historical grids related to the moving object.
[0069] In other embodiments, the server determines at least one historical grid related to the mobile object, including: determining all historical positions within a preset time range; deduplicating multiple historical positions belonging to the same historical grid to obtain multiple target historical positions, wherein the historical grids corresponding to each target historical position are non-duplicate; and using the historical grids corresponding to each target historical position as the historical grid related to the mobile object.
[0070] The server performs deduplication processing on multiple historical locations belonging to the same historical grid to determine the target historical location, including: selecting one of the multiple historical locations belonging to the same historical grid as the target historical location. The server may randomly select any historical location as the target historical location, or the server may select a historical location with a later collection time.
[0071] For example, as shown in Figure 5B , the server obtains historical locations prior to the target location D, each belonging to a different historical grid, including location A, location B, and location C. Since location A and location B belong to the same historical grid (corresponding to grid 5), the server determines that the target historical location is location C, or one of location A or location B. Furthermore, the server determines that the historical grids corresponding to the target historical locations are historical grids associated with the mobile object, that is, the historical grids associated with the mobile object are grids 5 and 2.
[0072] To ensure data remains up-to-date during real-time detection, thereby improving detection accuracy, in some embodiments, the server only stores the most recent location data within a grid. Specifically, after the server acquires a location to be detected and determines the target grid to which it belongs, if the server also stores a previously determined historical location belonging to the target grid, the location to be detected replaces the historical location, thereby updating the stored location data. This allows only one piece of location data to be stored for each grid, significantly reducing storage resource consumption.
[0073] Step S308 : determining an anomaly detection result of the movement trajectory according to the positional relationship between the target grid and at least one historical grid.
[0074] Specifically, the server determines the association relationship between the position to be detected and the historical position based on the position relationship between the target grid and the determined at least one historical grid and the association relationship between the grids, thereby determining whether the position to be detected is abnormal.
[0075] Since the spatial and temporal distribution of positions on a normal movement trajectory should be reasonable, based on the pigeonhole principle and combined with actual physical conditions, when a correlation exists between the target grid and the historical grid, the position to be detected belonging to the target grid should also be correlated with the historical positions belonging to the historical grid. If a correlation exists, the position can be determined to be reasonable.
[0076] The server then determines whether the trajectory of the moving object at the position to be detected is abnormal based on the results of determining whether each position in the trajectory is abnormal, and ultimately obtains an abnormality detection result for the trajectory. The abnormality detection result for the trajectory includes a result indicating that there is no abnormality and a result indicating that there is an abnormality.
[0077] The positional relationship between the target grid and at least one historical grid includes any one of an equivalent positional relationship, an adjacent positional relationship, and an independent positional relationship.
[0078] The equivalent position relationship indicates that the target grid is any historical grid in at least one historical grid. When the position relationship between the target grid and the historical grid is the equivalent position relationship, the target grid and the historical grid are essentially the same grid.
[0079] The adjacency relationship indicates that the target grid is adjacent to any of at least one historical grid. Adjacency between a target grid and a historical grid means that the target grid is any of the eight grids surrounding the historical grid and connected to it. As shown in Figure 6, grids 1 through 4 and grids 5 through 9 are all adjacent to grid 5.
[0080] The independent position relationship indicates that the target grid is not any historical grid in the at least one historical grid, and the target grid is not adjacent to any historical grid in the at least one historical grid.
[0081] Still as shown in Figure 6, if the server determines that the target grid is grid 2, if the historical grid to which the historical location belongs is also grid 2, then the target grid and the historical grid are in an equivalent position relationship; if the historical grid to which the historical location belongs is grid 4, then the target grid and the historical grid are in an adjacent position relationship. If the historical grid to which the historical location belongs is grid 9, then the target grid is neither equivalent to nor adjacent to the historical grid, that is, the target grid and the historical grid are in an independent position relationship.
[0082] If all positions in the trajectory are reasonable, the trajectory is normal, that is, the abnormality detection result is no abnormality. If any position in the trajectory is abnormal, the trajectory is abnormal, that is, the abnormality detection result is abnormal.
[0083] In the above-mentioned trajectory anomaly detection method, the target grid to which the target grid belongs is determined by obtaining the position to be detected in the trajectory generated by the moving object and rasterizing the multiple grids based on the actual geographical area. At least one historical grid is determined based on the historical positions within a preset time range in the trajectory generated by the moving object, and the positional relationship between the target grid and the at least one historical grid is determined. The anomaly detection result of the trajectory is determined based on the positional relationship between the grids. This eliminates the need to calculate each two positions one by one, greatly reducing the amount of calculation and time complexity, reducing the consumption of computing resources, and improving the efficiency of detecting abnormal trajectories. In particular, in vehicle network scenarios, the number of vehicles connected to the network at the same time can reach millions, so the savings in computing resources and storage resources are more significant, and the improvement in the efficiency of detecting abnormal trajectories is more obvious.
[0084] In actual scenarios, due to problems such as poor network signals during signal transmission, the position in the moving trajectory may drift, or some sections may be missing (for example, a moving object passing through a tunnel). In related technologies, since it is necessary to determine whether the position is abnormal through position adsorption or pairwise position calculation, these positions are likely to be misjudged as abnormal, which in turn leads to abnormal trajectory detection. In addition, the terminal usually transmits the real-time collected position data back to the server in real time, but there may be problems such as packet loss and delay during network transmission, and after asynchronous processing, calculation and storage on the server, some position data are no longer arranged in the original sequence order when performing abnormality detection. This not only leads to additional computational complexity, but also leads to abnormal trajectory detection. In the trajectory anomaly detection method provided in the embodiment of the present application, for positions where drift or large span occurs, the positional relationship between the grid and the historical grid is used to judge. When there is a correlation between the grids, and the grid size is fixed, there is also a correlation between the positions of the grids with the correlation, and they can be well identified as normal positions. Therefore, by utilizing the spatial distribution law of the trajectory and combining it with actual physical conditions, it is possible to accurately analyze and warn of the existence of position points that violate objective physical laws, thereby greatly improving the accuracy of trajectory anomaly detection.
[0085] In some embodiments, before determining the target grid to which the position to be detected belongs from multiple grids obtained by rasterizing the actual geographic area, the method further includes: determining at least one grid size based on road features in the actual geographic area; and rasterizing the actual geographic area according to the at least one grid size to obtain multiple grids.
[0086] Road characteristics include, but are not limited to, one or more of road congestion, road width, road density, or road traffic volume. Road characteristics can be used to reflect the travel speed on the road. Therefore, based on the road characteristics of different regions in the actual geographic area, the grid size corresponding to each region can be determined, thereby obtaining one or more grid sizes corresponding to the actual geographic area.
[0087] For example, a larger grid size can be set in high-speed areas, and a smaller grid size can be set in low-speed areas (such as city centers and ramp areas). That is, the higher the speed in an area, the larger the corresponding grid size; the lower the speed in an area, the smaller the corresponding grid size. Alternatively, a larger grid size can be set in areas with sparse roads, and a smaller grid size can be set in areas with dense roads. That is, the greater the road density in an area, the smaller the corresponding grid size, and the smaller the road density in an area, the larger the corresponding grid size.
[0088] In some embodiments, determining at least one grid size based on road features in the actual geographic area includes determining a grid size corresponding to each region based on the road features of each region in the actual geographic area. The server rasterizing the actual geographic area according to the at least one grid size to obtain a plurality of grids includes rasterizing the actual geographic area according to the grid sizes corresponding to each region to obtain a plurality of grids.
[0089] In some embodiments, the server determines a grid size for the actual geographical area, and performs rasterization processing on the actual geographical area according to the grid size to obtain multiple grids.
[0090] As shown in FIG7( a ), the server determines a grid size for the actual geographical area, and performs rasterization processing on the actual geographical area according to the grid size to obtain multiple grids of the same size.
[0091] When a grid size is set, as shown in FIG7( b ), the server may also adaptively increase the grid size (or decrease the grid size, not shown) according to the road characteristics of the actual geographical area.
[0092] As shown in Figure 7(c), the server determines the grid size corresponding to each area in the actual geographical area based on the road characteristics of each area, and then rasterizes the actual geographical area according to the grid size corresponding to each area to obtain multiple grids. The size of each grid can be the same or different, showing a dense and sparse state.
[0093] When the grid size is set to a square, as shown in FIG7( d ), the server may further divide the grid according to road features, so that each grid is a square of different sizes.
[0094] In the above embodiment, by adaptively adjusting the grid size according to the road characteristics of the actual geographical area, the spatial distribution pattern of the trajectory and the actual physical conditions can be combined to make the anomaly detection result more accurate.
[0095] In some embodiments, at least one grid size is determined based on road features in the actual geographic area, including: dividing the actual geographic area based on the road features in the actual geographic area to obtain at least one characteristic area; for each characteristic area, determining the theoretical grid distance between any two positions when position sampling is performed at a preset sampling interval; based on the theoretical grid distance of each characteristic area, determining the grid size corresponding to each characteristic area, the grid size corresponding to each characteristic area constitutes at least one grid size corresponding to the actual geographic area.
[0096] Specifically, the server divides the actual geographic area based on road features within the area to obtain at least one characteristic area, with different characteristic areas corresponding to different grid sizes. Because the frequency of sampling the positions of moving objects is pre-set, the server determines, based on the preset sampling interval, the theoretical grid distance between any two positions when position sampling is performed at the preset sampling interval. The theoretical grid distance refers to the maximum planar distance between any two positions within the same grid.
[0097] Among them, the server determines, for each feature area, the theoretical grid distance between any two positions when position sampling is performed at a preset sampling interval, including: the server calculates, based on the pre-set theoretical moving speed corresponding to each feature area, the theoretical grid distance between any two positions when the moving object moves according to the theoretical moving speed and position sampling is performed at a preset sampling interval.
[0098] For example, the preset sampling interval is t, and the preset theoretical moving speed is Speed max (unit is kilometers per hour), the relationship between the theoretical moving speed and the theoretical grid distance D (unit is meters) can be expressed by the following formula:
[0099] As shown in Figure 8A, taking a square grid as an example, the theoretical grid distance D is the distance between the diagonals. Assuming the grid has a side length of d, the maximum plane distance between any two positions in the same grid is Right now
[0100] Therefore, after determining the theoretical grid distance, the server can determine the grid size corresponding to each feature area based on the theoretical grid distance of each feature area. For example, the server can use the theoretical grid distance as the side length of a square grid. In another example, the server can use a multiple of the theoretical grid distance as the grid side length, and so on. If the grid is not square, the server can actually adjust the grid size based on the theoretical grid distance. Thus, the grid size corresponding to each feature area constitutes at least one grid size corresponding to the actual geographic area.
[0101] In the above embodiment, by combining actual physical conditions and adaptively adjusting the grid size according to the road characteristics of the actual geographical area, it is possible to combine the spatial distribution pattern of trajectories and specifically divide different grid sizes for the actual geographical area. When anomaly detection is subsequently performed on the locations within the grid, the anomaly detection results are more accurate.
[0102] In some embodiments, for each feature area, the theoretical grid distance between any two positions when position sampling is performed at a preset sampling interval is determined, including: for each feature area, determining the theoretical moving speed corresponding to the targeted feature area; determining the theoretical grid distance between any two positions sampled when the moving object moves according to the theoretical moving speed and position sampling is performed at a preset sampling interval.
[0103] Specifically, the server determines the theoretical speed corresponding to each feature area. The theoretical speed refers to the maximum speed of a moving object. The theoretical speed can be set based on experience, for example, the theoretical speed of a vehicle in an urban area should not exceed 120 km / h. The size of the grid is determined by the theoretical speed.
[0104] In the scenario of anomaly detection of moving objects in a city, in order to accurately detect whether the trajectories of different moving objects in the same city are abnormal, the preset theoretical moving speed can be reduced and the granularity can be increased, so that abnormal results can be detected more sensitively.
[0105] In the face of cross-city or even cross-provincial scenarios, the trajectories of different moving objects that do not belong to the same province obviously do not intersect. At this time, the preset theoretical moving speed can be increased and the granularity can be reduced, so that it is possible to more clearly judge whether there is a large-span jump anomaly at the location. Therefore, the theoretical moving speed can be set according to the purpose and application scenario of trajectory anomaly detection. For example, in order to detect whether there is a large-span jump anomaly at the location, the theoretical moving speed can be set to 500KM / h to reduce many unnecessary misjudgments.
[0106] After determining the theoretical movement speed corresponding to the targeted feature area, the server then calculates the theoretical grid distance between any two sampled positions, assuming the object moves at the theoretical speed and samples the object's position at a preset sampling interval. The grid size can then be determined based on the theoretical grid distance.
[0107] In the above embodiment, by combining actual physical conditions and adaptively adjusting the grid size according to the road characteristics of the actual geographical area, it is possible to combine the spatial distribution pattern of trajectories and specifically divide different grid sizes for the actual geographical area. When anomaly detection is subsequently performed on the locations within the grid, the anomaly detection results are more accurate.
[0108] In some embodiments, each grid in the plurality of grids has its own grid code. As shown in FIG4 , each grid has its own code, such as grid 1, grid 2, and so on. Accordingly, determining the target grid to which the position to be detected belongs from the plurality of grids obtained by rasterization processing based on the actual geographic area includes: obtaining location information of the position to be detected; performing a hash operation on the location information of the position to be detected to obtain a target grid code corresponding to the position to be detected; and determining, among the plurality of grids, the grid having the target grid code as the target grid to which the position to be detected belongs.
[0109] Specifically, after obtaining the location to be detected, the server extracts its location information. This location information, for example, is latitude and longitude data. The server performs a hash operation on the location information to obtain a target grid code corresponding to the location to be detected. The target grid code indicates the grid to which the location to be detected belongs. The server can then use the target grid code to find the corresponding grid among multiple grids. Specifically, the server identifies the grid with the target grid code as the target grid to which the location to be detected belongs.
[0110] In some embodiments, when the server performs a hash operation on the location information of the location to be detected, it needs to adopt the same location hashing algorithm as that used in the rasterization process based on the actual geographical area.
[0111] In the above embodiment, by performing a hash operation on the location information of the location to be detected, the grid to which the location to be detected belongs is obtained, and then anomaly detection is performed based on the correlation relationship between the grids. There is no need to calculate the specific latitude and longitude data of the location to be detected, which greatly reduces the amount of calculation and improves the efficiency of anomaly detection.
[0112] Combined with Figure 8A, the speed, time difference, and distance of each position in the same grid conform to the objective physical laws, so there is a correlation between the positions, and each position is reasonable and there is no abnormality. As shown in Figure 8B, still taking the square grid as an example, when two grids are adjacent, the distance between any two position points in the grid will not exceed The theoretical grid distance
[0113] Assume that the preset sampling interval is t and the preset theoretical moving speed is Speed max (unit is kilometers per hour), the relationship between the theoretical moving speed and the theoretical grid distance can be expressed by the following formula:
[0114] Therefore, after setting a reasonable grid size, the position points in the same grid or adjacent grids have a reasonable correlation relationship.
[0115] Taking the trajectory shown in Figure 9 as an example, the first position data of the moving object belongs to grid A, and the second position data also belongs to grid A. The second position data must have a reasonable association with the first position data. Until a certain position belongs to grid B, there is no position point associated with this position in grid B. However, because grid B is adjacent to grid A, the position points have a reasonable relationship. By analogy, the area covered by the grid [AP] formed by the entire trajectory is a complete and clear trajectory sequence. This process only requires determining the grid to which each position belongs and calculating a few adjacency relationships. The computational complexity is far less than the floating-point calculations between two positions.
[0116] In contrast, the traditional method of calculating the distance and speed relationship between each two positions to determine whether there is an abnormality requires O(n 2 ) level of calculation. However, after the application determines the ownership by the grid method, the possible maximum distance and maximum speed can be confirmed based on the formula deduction, without the need to accurately calculate the specific speed value. The time complexity of the calculation is O(n 2 ) is reduced to O(n). Assuming that there are 64 sampling points in Figure 9, the time complexity of the calculation in the traditional method is O(n 2 ), 2016 calculations are required; while the time complexity of the calculation in this application is O(n), which only requires 64 calculations, which can greatly reduce the amount of calculation and greatly reduce the consumption of computing resources and storage resources.
[0117] In view of this, in some embodiments, the server determines the abnormality detection result of the movement trajectory based on the positional relationship between the target grid and at least one historical grid, including: determining whether there is an association relationship between the position to be detected and the historical position corresponding to the at least one historical grid based on the positional relationship between the target grid and at least one historical grid; if there is no association relationship, determining that there is an abnormality in the movement trajectory.
[0118] Specifically, the server determines whether a correlation exists between the position to be detected and the historical position corresponding to the at least one historical grid based on the positional relationship between the target grid and at least one historical grid. If a correlation exists between the positional relationship between the target grid and any of the historical grids, the server determines that a correlation exists between the position to be detected and the historical position corresponding to the at least one historical grid. Furthermore, the server determines that there is no anomaly at the current position to be detected. If there is no anomaly at any position in the movement trajectory, the server determines that there is no anomaly in the movement trajectory.
[0119] If there is no correlation between the target grid and any of the historical grids, the server can determine that there is no correlation between the target grid and the historical position corresponding to at least one historical grid. Furthermore, the server can determine that there is an abnormality in the movement trajectory.
[0120] In the above embodiment, anomaly detection is performed through the correlation between grids, without the need to calculate the specific data of the location to be detected, which greatly reduces the amount of calculation, reduces the consumption of computing resources and storage resources, and significantly improves the efficiency of anomaly detection.
[0121] In some embodiments, based on the positional relationship between the target grid and at least one historical grid, determining whether there is an association relationship between the position to be detected and the historical position corresponding to the at least one historical grid includes: when the positional relationship between the target grid and at least one historical grid is an equivalent positional relationship, determining whether there is an association relationship between the position to be detected and the historical position corresponding to the historical grid equivalent to the target grid.
[0122] Specifically, when the server determines that the positional relationship between the target grid and at least one historical grid is an equivalent positional relationship, that is, when the target grid is the historical grid previously recorded in this anomaly detection, the server can directly determine that there is an association relationship between the target grid and the historical grid, and then directly determine that there is an association relationship between the position to be detected and the historical position corresponding to the historical grid equivalent to the target grid.
[0123] For example, the server records the grid A to which the previous location to be detected, P1, belongs. When performing anomaly detection on the next location to be detected, P2, this recorded grid A serves as the historical grid. If the server determines that the target grid to which the location to be detected, P2, belongs is also grid A, the server directly determines that the location to be detected, P2, is associated with the location to be detected, P1, within grid A. The server then determines that there is no anomaly at the location to be detected, P2.
[0124] In some embodiments, based on the positional relationship between the target grid and at least one historical grid, determining whether there is an association relationship between the position to be detected and the historical position corresponding to the at least one historical grid includes: when the positional relationship between the target grid and at least one historical grid is an adjacent positional relationship, determining whether there is an association relationship between the position to be detected and the historical position corresponding to the historical grid adjacent to the target grid.
[0125] Specifically, when the server determines that the positional relationship between the target grid and at least one historical grid is an adjacent positional relationship, that is, when the target grid is adjacent to the historical grid previously recorded in this anomaly detection, the server can directly determine that there is an association relationship between the target grid and the historical grid, and then directly determine that there is an association relationship between the position to be detected and the historical position corresponding to the historical grid equivalent to the target grid.
[0126] For example, the server records the grid A to which the previous location to be detected, P1, belongs. When performing anomaly detection on the next location to be detected, P2, this recorded grid A serves as the historical grid. If the server determines that the target grid to which the location to be detected, P2, belongs is grid B, and since grids A and B are adjacent, the server directly determines that the location to be detected, P2, is associated with the location to be detected, P1, within grid A. The server then determines that there is no anomaly at location to be detected, P2.
[0127] In the above embodiment, anomaly detection is performed through the correlation between grids, without the need to calculate the specific data of the location to be detected, which greatly reduces the amount of calculation, reduces the consumption of computing resources and storage resources, and significantly improves the efficiency of anomaly detection.
[0128] In practice, after the trajectory is collected, it may not form a complete and contiguous grid relationship due to network interruption, positioning signal anomalies, or missing tunnels. In other words, there may be jumps between the location and the historical location.
[0129] As shown in Figure 10, the complete trajectory should be within the area covered by the grid [AK]. However, the moving object enters a tunnel at position P1. Due to a lack of signal inside the tunnel, no position data is collected. The moving object exits the tunnel at position P2, at which point normal position collection and reporting resumes. In Figure 10, trajectory segments AE and FK can form an association, but segments E and F are several kilometers or even tens of kilometers apart.
[0130] In view of this, in some embodiments, based on the positional relationship between the target grid and at least one historical grid, it is determined whether there is an association relationship between the position to be detected and the historical position corresponding to the at least one historical grid, including: when the positional relationship between the target grid and the at least one historical grid is an independent positional relationship, determining at least one target historical position from the historical positions corresponding to the at least one historical grid; respectively determining the movement feature data between the position to be detected and the at least one target historical position; for each target historical position, based on at least one movement feature data, determining whether there is an association relationship between the position to be detected and the targeted historical position.
[0131] Specifically, if the target grid and at least one historical grid are independent of each other, that is, the target grid and the historical grid are neither the same grid nor adjacent, further determination is required. For example, as shown in Figure 10, when the server obtains the target location P2 and determines that the target grid to which P2 belongs is grid F, grid F is not adjacent to grids A through E.
[0132] The server then determines at least one target historical location from the historical locations corresponding to at least one historical grid. For each historical grid, the server may select any historical location within the corresponding historical grid as the target historical location corresponding to the historical grid.
[0133] The server then determines the motion characteristic data between the location to be detected and at least one target historical location. The motion characteristic data may include, for example, average motion speed, actual distance, or actual time interval (the time difference between acquisition times). For example, if the server acquires target historical location P1 at acquisition time t1 and the location to be detected at acquisition time t2, the actual time interval is |t2-t1|. For each target historical location, the server can determine whether there is a correlation between the location to be detected and the target historical location based on at least one motion characteristic data, such as, for example, one or more of the average motion speed, actual distance, or actual time interval, combined with objective physical laws.
[0134] If, based on at least one piece of motion feature data, the server determines that the movement of the moving object conforms to objective physical laws, the server determines that an association exists between the position to be detected and the target historical position. Conversely, if the server determines that the movement of the moving object does not conform to objective physical laws, for example, after moving the actual distance at the theoretical moving speed, the time it takes to reach P2 from P1 is much longer than the actual time interval; or, after moving the actual time interval at the theoretical moving speed, the distance moved is much shorter than the actual distance; or, the average moving speed calculated based on the actual distance and the actual time interval exceeds the theoretical moving speed, the server determines that no association exists between the position to be detected and the target historical position.
[0135] In the above embodiment, anomaly detection is performed through the correlation between grids, without the need to calculate the specific data of the location to be detected, which greatly reduces the amount of calculation, reduces the consumption of computing resources and storage resources, and significantly improves the efficiency of anomaly detection.
[0136] In some embodiments, the positions obtained by sampling the movement trajectory of the moving object correspond to time information. Accordingly, determining the movement characteristic data between the position to be detected and at least one target historical position includes: determining the actual distance between the position to be detected and the at least one target historical position; or determining the actual time interval between the position to be detected and the at least one target historical position based on the time information corresponding to each of the position to be detected and the at least one target historical position.
[0137] Specifically, after obtaining the location to be detected, the server calculates the actual distance to at least one target historical location based on the location information (e.g., longitude and latitude) of the location to be detected. When the terminal transmits a data packet to the server, the data packet also carries time information. The server can then calculate the actual time interval between the location to be detected and at least one target historical location based on the acquisition time corresponding to the location to be detected.
[0138] Furthermore, for each target historical location, based on at least one mobile feature data, determine whether there is an association relationship between the location to be detected and the target historical location, including: for each target historical location, based on one or more of the actual distance or actual time interval between the location to be detected and at least one target historical location, determine whether there is an association relationship between the location to be detected and the target historical location.
[0139] In some embodiments, the server combines the actual distance and theoretical moving speed to determine the difference between the calculated duration and the actual time interval; if the difference is obviously inconsistent with objective physical laws, the server determines that there is no correlation between the position to be detected and at least one target historical position.
[0140] In some embodiments, the server determines the difference between the calculated distance and the actual distance based on the actual time interval and the theoretical moving speed; if the difference is obviously inconsistent with the objective physical laws, the server determines that there is no correlation between the position to be detected and at least one target historical position.
[0141] In some embodiments, the server determines the difference between the calculated average moving speed and the theoretical moving speed based on the actual distance and the actual time interval; if the difference is obviously inconsistent with the objective physical laws, the server determines that there is no correlation between the position to be detected and at least one target historical position.
[0142] In the above embodiment, by combining objective physical laws, the corresponding distance, duration, or speed and other mobile features are calculated through mobile feature data, and then the correlation relationship between the positions in two grids belonging to independent position relationships is determined, which greatly reduces the amount of calculation, reduces the consumption of computing resources and storage resources, and significantly improves the efficiency of anomaly detection. In addition, when the positions of two moving objects in different locations are identified as the trajectory of the same moving object (for example, when two moving objects upload data through a terminal, the terminal has the same ID), the position point on the trajectory will jump between the real positions of the two different moving objects. Under such a trajectory distribution, it is inevitable that the calculation of the correlation relationship mentioned above will not be satisfied, and it will exceed the reasonable speed of cognition. The server can accurately detect the anomaly of the position in the trajectory.
[0143] In some embodiments, the above method further includes: when the abnormal detection result of the mobile trajectory indicates that the position to be detected is an abnormal location point, the server issues an alarm prompt to the user account bound to the mobile object. For example, the user binds the mobile object to the user account in advance through the device loaded on the mobile object, so as to view the historical trajectory or trajectory abnormality results, etc. When the server determines that the abnormal detection result of the trajectory of the mobile object indicates that the position to be detected is an abnormal location point, the server issues an alarm prompt to the user account to prompt the user to check the abnormality in time. Exemplarily, the user can query the abnormal detection result through the user account, and the interface shown in Figure 11 is displayed. The location data in Figure 11 is shown as jumping between two cities within a time interval. Therefore, by sending an alarm prompt to the user account in a timely manner, the risk prompt can be given to the user in a timely manner, and the user experience is high.
[0144] However, in actual scenarios, there may be a situation where the positions of two moving objects in different locations are identified as the trajectory of the same moving object. Taking the mobile object as a vehicle as an example, location-based services are usually provided by software service providers. When users register and bind their user accounts, they are usually bound to the terminal device of the vehicle. In this process, the device code of the vehicle-connected terminal device needs to be obtained. When the vehicle manufacturer provides the device code of the vehicle terminal to the software service provider, it may take encryption and other measures to avoid the leakage of the real device code. This may result in the device codes of different vehicles obtained by the software service provider being the same, resulting in conflicts in user accounts, and then causing users in different regions to repeatedly jump to different locations when driving the vehicle. The trajectory anomaly detection method provided in the embodiment of the present application can solve this problem well.
[0145] To this end, in some embodiments, the above method also includes: when the abnormal detection result of the mobile trajectory indicates that the position to be detected is an abnormal position point, and the actual distance of the position to be detected relative to the mobile trajectory exceeds a preset threshold, determining that there is an account abnormality risk in the user account bound to the mobile object, wherein the account abnormality risk is used to prompt the equipment manufacturer of the equipment carried by the mobile object to perform equipment detection.
[0146] When the abnormal detection result of the movement trajectory indicates that the position to be detected is an abnormal position point, the server determines whether the position to be detected is caused by data error (such as collection equipment failure, etc.) or a large-span jump in position.
[0147] When the server determines that the actual distance of the detected position relative to the moving trajectory exceeds the preset threshold, it can be determined that there is a large span jump between the detected position and other positions, and there is a high risk of the above-mentioned user account conflict, that is, account abnormality risk.
[0148] In the above embodiment, when it is determined that there is a risk of account abnormality in the user account, a prompt can be sent to the device manufacturer of the device carried by the mobile object to prompt the device manufacturer of the device carried by the mobile object to perform device inspection, so as to cooperate with the device manufacturer to take remedial measures such as upgrades to avoid subsequent serious functional abnormalities.
[0149] It is easy to understand that the above-mentioned alarm prompt method is only an example and can be appropriately adjusted according to actual conditions in specific application scenarios; those skilled in the art should be aware that reasonable deformation and appropriate adjustments made to the above-mentioned alarm prompt method are within the scope of protection of this application.
[0150] The present application also provides an application scenario, which applies the above-mentioned trajectory anomaly detection method. Specifically, the application of the trajectory anomaly detection method in this application scenario is as follows: obtaining the position to be detected in the vehicle's moving trajectory; determining the target grid to which the position to be detected belongs from multiple grids obtained by rasterization processing based on the actual geographical area; determining at least one historical grid related to the vehicle, at least one historical grid is obtained based on the historical position in the vehicle's moving trajectory within a preset time range; determining the abnormality detection result of the moving trajectory based on the positional relationship between the target grid and at least one historical grid. Of course, it is not limited to this. The trajectory anomaly detection provided by this application can also be applied in other application scenarios, such as location-based map services.
[0151] In one example, as shown in FIG12 , when performing trajectory anomaly detection, the server simultaneously maintains a data set in the form of a dictionary mapping of <geocode, raster location information>.
[0152] The server uses streaming computing to acquire location data over a period of time (preset time range) in the form of a sliding window. For each location to be detected within this sliding window, the server uses a location hashing algorithm to calculate the corresponding geocode of the location to be detected. This geocode is mapped to the raster code. The server then determines the target raster code to which the location to be detected belongs.
[0153] If the geocode already exists in the dataset, indicating that the target grid indicated by the current target grid code has been previously recorded, the server will update the corresponding location data in the dataset to ensure that the location data for the corresponding grid in the dataset is the most recent. As a result, the server only needs to record one location data point for each grid, significantly reducing storage resource consumption.
[0154] If the geocode does not exist in the data set, the server checks whether the target grid indicated by the current target grid code is one of the eight grids surrounding the historically recorded grid (i.e., determines whether there is a positional association with the historical grid). If so, the server adds it to the data set.
[0155] If none of the above conditions are met, the server performs further calculations based on the motion feature data of the location to be detected. For example, the server calculates the average speed of the location to be detected and the locations in the existing data set to determine whether the speed conforms to objective physical laws. The server compares the calculated average speed with the set theoretical speed. If the speed exceeds the theoretical speed, the server determines that the location to be detected is abnormal, and further determines that the trajectory anomaly detection result is abnormal.
[0156] Therefore, location data is hashed using geocoding technology and then rasterized into different grids. Trajectories within a grid have close distances and velocities that conform to objective laws, indicating a correlation. Associations between grids are determined by their adjacency. For location data that cannot be associated with other location data, the appropriate separation of the location data is determined by combining the actual distance and time interval with the theoretical movement speed, avoiding interference from tunnels and other conditions, resulting in more accurate anomaly detection results.
[0157] When the grid size is appropriately chosen, most location data can be correlated using grid adjacency, significantly reducing the amount of computation required. Jumping trajectories can be identified as abnormal by calculating whether the speed between grid cells conforms to objective physical laws. This allows for the identification of reasonable jumps and abnormal trajectories with minimal computation.
[0158] In addition, when the order of the location data obtained by the server does not follow the actual time sequence of collection (out-of-order scenario), the anomaly is judged by the positional relationship between the currently determined grid and the previously recorded historical grid. Although the trajectory route cannot be advanced sequentially through grid association as in the ideal situation, even if it is not adjacent to any historical grid, only one calculation needs to be performed to establish the association relationship, and then recursion can be performed when determining other location points again, which can also reduce the amount of calculation and improve the accuracy of anomaly detection.
[0159] In terms of storage, the locations within a single grid are similar, so there's no need to store the location information for every location within the same grid. Whenever newer location data becomes available, it can replace older data within the same grid, significantly reducing storage resource consumption. This storage optimization is particularly significant in scenarios with millions of connected vehicles.
[0160] In some embodiments, the trajectory anomaly detection method provided by embodiments of the present application includes: a server dividing the actual geographic area based on road features in the actual geographic area to obtain at least one characteristic area. For each characteristic area, the server determines a theoretical moving speed corresponding to the characteristic area, and determines a theoretical grid distance between any two positions obtained when position sampling is performed at a preset sampling interval, assuming the moving object moves at the theoretical moving speed.
[0161] The server then determines the grid size corresponding to each feature region based on the theoretical grid distance of each feature region. The grid sizes corresponding to each feature region constitute at least one grid size corresponding to the actual geographic region. Finally, the server rasterizes the actual geographic region according to the at least one grid size, resulting in multiple grids, each with its own grid code.
[0162] The server obtains the position to be detected in the moving trajectory generated by the moving object and obtains the position information of the position to be detected; performs a hash operation on the position information of the position to be detected to obtain a target grid code corresponding to the position to be detected.
[0163] Among the multiple grids, the server determines a grid having a target grid code as a target grid to which the position to be detected belongs, and determines at least one historical grid related to the mobile object, where the at least one historical grid is obtained based on a historical position within a preset time range in the moving trajectory generated by the mobile object.
[0164] In the case that the positional relationship between the target grid and at least one historical grid is an equivalent positional relationship, the server determines that there is an association relationship between the position to be detected and the historical position corresponding to the historical grid equivalent to the target grid.
[0165] In a case where the positional relationship between the target grid and at least one historical grid is an adjacent positional relationship, the server determines that there is an association relationship between the position to be detected and a historical position corresponding to a historical grid adjacent to the target grid.
[0166] If the positional relationship between the target grid and at least one historical grid is an independent positional relationship, the server determines at least one target historical location from the historical locations corresponding to the at least one historical grid, and separately determines movement feature data between the position to be detected and the at least one target historical location. For each target historical location, the server determines whether there is an association between the position to be detected and the target historical location based on the at least one movement feature data.
[0167] The server samples the movement trajectory of the moving object and obtains time information corresponding to the position; the server determines the movement characteristic data between the position to be detected and at least one target historical position, including: determining the actual distance between the position to be detected and at least one target historical position; or, based on the time information corresponding to each of the position to be detected and at least one target historical position, determining the actual time interval between the position to be detected and at least one target historical position. The server then determines, for each target historical position, based on at least one movement characteristic data, whether there is an association between the position to be detected and the target historical position, including: determining, for each target historical position, based on one or more of the actual distance or actual time interval between the position to be detected and at least one target historical position, whether there is an association between the position to be detected and the target historical position.
[0168] In the absence of an association, the server determines that there is an abnormality in the movement trajectory.
[0169] In the above embodiment, by analyzing the spatial distribution pattern of the position data in the trajectory, combined with the objective and reasonable theoretical moving speed as the calculation condition, the position data is hashed and classified by means of rasterization to reduce the data dimensions involved in the calculation. The amount of data that needs to be calculated is further reduced by judging the grid adjacency. At the same time, because raster classification avoids the repeated storage of similar trajectories, the amount of data that needs to be stored within a time window can be significantly optimized. Conversely, when the same resource quota is used, the efficient computing and storage performance of the algorithm can be used to set a longer time window for trajectory analysis, which can achieve better detection results.
[0170] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0171] Based on the same inventive concept, embodiments of the present application also provide a trajectory anomaly detection device for implementing the aforementioned trajectory anomaly detection method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more trajectory anomaly detection device embodiments provided below can be found in the limitations of the trajectory anomaly detection method described above and will not be further elaborated here.
[0172] In some embodiments, as shown in FIG13 , a trajectory anomaly detection device 1300 is provided, comprising: an acquisition module 1301 , a determination module 1302 , and a detection module 1303 , wherein:
[0173] The acquisition module 1301 is used to determine a position to be detected in the moving trajectory generated by the moving object.
[0174] The determination module 1302 is configured to determine the target grid to which the position to be detected belongs from a plurality of grids obtained by performing rasterization processing based on the actual geographical area.
[0175] The determining module 1302 is further configured to determine at least one historical grid related to the moving object, where the at least one historical grid is obtained based on a historical position within a preset time range in the moving trajectory generated by the moving object.
[0176] The detection module 1303 is configured to determine an anomaly detection result of the movement trajectory according to the positional relationship between the target grid and the at least one historical grid.
[0177] In some embodiments, the above-mentioned device further includes a rasterization module for determining at least one grid size based on road features in the actual geographical area; and performing rasterization processing on the actual geographical area according to the at least one grid size to obtain multiple grids.
[0178] In some embodiments, the rasterization module is further used to divide the actual geographical area based on the road features in the actual geographical area to obtain at least one characteristic area; for each characteristic area, determine the theoretical grid distance between any two positions when position sampling is performed at a preset sampling interval; based on the theoretical grid distance of each characteristic area, determine the grid size corresponding to each characteristic area, and the grid size corresponding to each characteristic area constitutes at least one grid size corresponding to the actual geographical area.
[0179] In some embodiments, the rasterization module is also used to determine, for each feature area, a theoretical moving speed corresponding to the feature area; and to determine the theoretical grid distance between any two positions sampled when the moving object moves according to the theoretical moving speed and position sampling is performed at a preset sampling interval.
[0180] In some embodiments, each grid in the multiple grids has its own grid code, and the determination module is further used to obtain the position information of the position to be detected; perform a hash operation on the position information of the position to be detected to obtain a target grid code corresponding to the position to be detected; and determine, among the multiple grids, the grid having the target grid code as the target grid to which the position to be detected belongs.
[0181] In some embodiments, the detection module is further used to determine whether there is an association relationship between the position to be detected and the historical position corresponding to the at least one historical grid based on the positional relationship between the target grid and the at least one historical grid; if there is no association relationship, it is determined that there is an abnormality in the movement trajectory.
[0182] In some embodiments, the positional relationship between the target grid and the at least one historical grid includes any one of an equivalent positional relationship, an adjacent positional relationship, and an independent positional relationship, wherein: the equivalent positional relationship indicates that the target grid is any historical grid in the at least one historical grid; the adjacent positional relationship indicates that the target grid is adjacent to any historical grid in the at least one historical grid; and the independent positional relationship indicates that the target grid is not any historical grid in the at least one historical grid, and the target grid is not adjacent to any historical grid in the at least one historical grid.
[0183] In some embodiments, the detection module is further used to determine that there is an association relationship between the position to be detected and the historical position corresponding to the historical grid equivalent to the target grid when the positional relationship between the target grid and the at least one historical grid is the equivalent positional relationship; and to determine that there is an association relationship between the position to be detected and the historical position corresponding to the historical grid adjacent to the target grid when the positional relationship between the target grid and the at least one historical grid is the adjacent positional relationship.
[0184] In some embodiments, the detection module is also used to determine at least one target historical position from the historical positions corresponding to the at least one historical grid when the positional relationship between the target grid and the at least one historical grid is the independent positional relationship; determine the movement feature data between the position to be detected and the at least one target historical position respectively; and for each target historical position, determine whether there is an association relationship between the position to be detected and the target historical position based on at least one of the movement feature data.
[0185] In some embodiments, the position obtained by sampling the moving trajectory generated by the moving object corresponds to time information; the detection module is also used to respectively determine the actual distance between the position to be detected and at least one target historical position; or, based on the time information corresponding to the position to be detected and at least one target historical position, respectively determine the actual time interval between the position to be detected and at least one target historical position; the detection module is also used to determine, for each target historical position, whether there is an association between the position to be detected and the targeted target historical position based on one or more of the actual distance or actual time interval between the position to be detected and at least one target historical position.
[0186] In some embodiments, the above-mentioned device further includes a first prompt module, which is used to issue an alarm prompt to a user account bound to the moving object when the abnormal detection result of the movement trajectory indicates that the position to be detected is an abnormal position point.
[0187] In some embodiments, the above-mentioned device also includes a second prompt module, which is used to determine that there is an account abnormality risk in the user account bound to the mobile object when the abnormal detection result of the mobile trajectory indicates that the position to be detected is an abnormal position point and the actual distance of the position to be detected relative to the mobile trajectory exceeds a preset threshold, wherein the account abnormality risk is used to prompt the equipment manufacturer of the equipment carried by the mobile object to perform equipment detection.
[0188] It should be noted that the first prompt module and the second prompt module can be the same prompt module or different prompt modules. In some embodiments, the first prompt module and the second prompt module are the same prompt module.
[0189] Each module in the aforementioned trajectory anomaly detection device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a computer device's memory in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0190] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in Figure 14. The computer device includes a processor, a memory, an input / output interface (I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store location data, etc. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a trajectory anomaly detection method is implemented.
[0191] Those skilled in the art will understand that the structure shown in FIG14 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0192] In some embodiments, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0193] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0194] In some embodiments, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0195] It should be noted that the user information (including but not limited to device information of mobile objects, user account information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0196] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0197] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0198] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A trajectory anomaly detection method, executed by a computer device, comprising: Obtaining a position to be detected in a moving trajectory generated by a moving object; Determine the target grid to which the position to be detected belongs from a plurality of grids obtained by rasterization processing based on the actual geographical area; Determine at least one historical grid related to the mobile object, where the at least one historical grid is obtained based on a historical position within a preset time range in a movement trajectory generated by the mobile object; and An abnormality detection result of the movement trajectory is determined according to a positional relationship between the target grid and the at least one historical grid.
2. The method according to claim 1, further comprising: Determining at least one grid size based on road characteristics in the actual geographic area; The actual geographical area is rasterized according to the at least one grid size to obtain a plurality of grids.
3. The method according to claim 2, wherein determining at least one grid size based on road features in the actual geographic area comprises: Based on the road features in the actual geographical area, the actual geographical area is divided to obtain at least one characteristic area; For each feature region, determining a theoretical grid distance between any two positions when position sampling is performed at a preset sampling interval; According to the theoretical grid distance of each characteristic area, the grid size corresponding to each characteristic area is determined, and the grid size corresponding to each characteristic area constitutes at least one grid size corresponding to the actual geographical area.
4. The method according to claim 3, wherein for each feature area, determining the theoretical grid distance between any two positions when position sampling is performed at a preset sampling interval comprises: For each characteristic area, determine the theoretical moving speed corresponding to the characteristic area; Determine a theoretical grid distance between any two positions sampled when the moving object moves at the theoretical moving speed and positions are sampled at a preset sampling interval.
5. The method according to any one of claims 1 to 4, wherein each of the plurality of grids has its own grid code, and determining the target grid to which the position to be detected belongs from the plurality of grids obtained by rasterization processing based on the actual geographical area comprises: Acquire the location information of the location to be detected; Performing a hash operation on the position information of the position to be detected to obtain a target grid code corresponding to the position to be detected; Among the multiple grids, a grid having the target grid code is determined as the target grid to which the position to be detected belongs.
6. The method according to any one of claims 1 to 5, wherein determining the abnormality detection result of the movement trajectory according to the positional relationship between the target grid and the at least one historical grid comprises: Determining whether there is an association relationship between the position to be detected and the historical position corresponding to the at least one historical grid according to the position relationship between the target grid and the at least one historical grid; In the absence of an association relationship, it is determined that the movement trajectory is abnormal.
7. The method according to claim 6, wherein the positional relationship between the target grid and the at least one historical grid comprises any one of an equal positional relationship, an adjacent positional relationship, and an independent positional relationship, wherein: The equivalent position relationship indicates that the target grid is any historical grid among the at least one historical grid; The adjacent position relationship indicates that the target grid is adjacent to any historical grid of the at least one historical grid; The independent position relationship indicates that the target grid is not any historical grid in the at least one historical grid, and the target grid is not adjacent to any historical grid in the at least one historical grid.
8. The method according to claim 6 or 7, wherein determining whether there is an association relationship between the position to be detected and the historical position corresponding to the at least one historical grid according to the position relationship between the target grid and the at least one historical grid comprises: In the case where the positional relationship between the target grid and the at least one historical grid is an equivalent positional relationship, it is determined that there is an association relationship between the position to be detected and the historical position corresponding to the historical grid equivalent to the target grid, and the equivalent positional relationship indicates that the target grid is any historical grid among the at least one historical grid.
9. The method according to any one of claims 6 to 8, wherein determining whether there is an association relationship between the position to be detected and the historical position corresponding to the at least one historical grid according to the position relationship between the target grid and the at least one historical grid comprises: When the positional relationship between the target grid and the at least one historical grid is the adjacent positional relationship, it is determined that there is an association relationship between the position to be detected and the historical position corresponding to the historical grid adjacent to the target grid, and the adjacent positional relationship represents that the target grid is adjacent to any one of the at least one historical grids.
10. The method according to claim 6 or 7, wherein determining whether there is an association relationship between the position to be detected and the historical position corresponding to the at least one historical grid according to the position relationship between the target grid and the at least one historical grid comprises: In a case where the positional relationship between the target grid and the at least one historical grid is the independent positional relationship, determining at least one target historical position from the historical positions corresponding to the at least one historical grid; respectively determining movement characteristic data between the position to be detected and at least one target historical position; For each target historical position, based on at least one of the movement feature data, it is determined whether there is an association relationship between the position to be detected and the target historical position.
11. The method according to claim 10, wherein for each target historical position, determining whether there is an association relationship between the position to be detected and the target historical position based on at least one of the movement feature data comprises: For each target historical position, based on one or more of an actual distance or an actual time interval between the position to be detected and at least one target historical position, it is determined whether there is an association relationship between the position to be detected and the target historical position.
12. The method according to claim 11, wherein the position obtained by sampling the moving trajectory generated by the moving object corresponds to time information, and the step of respectively determining the moving feature data between the position to be detected and at least one target historical position comprises: respectively determining the actual distance between the position to be detected and at least one target historical position; or, According to the time information corresponding to the position to be detected and at least one target historical position, the actual time interval between the position to be detected and at least one target historical position is determined respectively.
13. The method according to any one of claims 1 to 12, further comprising: When the abnormal detection result of the moving trajectory indicates that the position to be detected is an abnormal position point, an alarm prompt is issued to a user account bound to the moving object.
14. The method according to any one of claims 1 to 13, further comprising: When the abnormality detection result of the movement trajectory indicates that the position to be detected is an abnormal position point, and the actual distance of the position to be detected relative to the movement trajectory exceeds a preset threshold, it is determined that the user account bound to the moving object has an account abnormality risk; The abnormal account risk is used to prompt the equipment manufacturer of the equipment carried by the mobile object to perform equipment detection.
15. A trajectory anomaly detection device, the device comprising: An acquisition module, used to determine a position to be detected in a moving trajectory generated by a moving object; A determination module, used to determine the target grid to which the position to be detected belongs from a plurality of grids obtained by rasterization processing based on the actual geographical area; The determination module is further used to determine at least one historical grid related to the moving object, wherein the at least one historical grid is obtained based on a historical position within a preset time range in the moving trajectory generated by the moving object; and The detection module is used to determine the abnormality detection result of the movement trajectory according to the position relationship between the target grid and the at least one historical grid.
16. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 14 when executing the computer program.
17. A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 14 when executed by a processor.
18. A computer program product, comprising a computer program, which implements the method according to any one of claims 1 to 14 when executed by a processor.
Citation Information
Patent Citations
Vehicle driving track monitoring method and system
CN108133611A
Method, device and apparatus for detecting newly added line of logistics network
CN110490507A
Ship trajectory anomaly detection method based on space-time decomposition
CN114357322A
Motion trajectory processing method, medium, apparatus, and device
WO2021115143A1
