A trajectory generation method, device, equipment and storage medium

By dividing the active area into grids and using a clustering algorithm to generate trajectories, it solves the problem of complex object motion trajectory generation processes and achieves fast and accurate trajectory generation.

CN112613546BActive Publication Date: 2024-09-20RUN TECH CO LTD BEIJING
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011491954.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-16
Publication Date
2024-09-20
Estimated Expiration
2040-12-16

AI Technical Summary

Technical Problem

It is difficult to quickly generate object motion trajectories with existing technology, especially when the position of the target object changes rapidly and the amount of data is large, the trajectory generation process is complex and difficult.

Method used

By dividing the active area of ​​the target object into grids, the effective grid is determined, the location points are clustered using a clustering algorithm, the cluster center points are obtained, and they are connected to generate trajectories.

Benefits of technology

The difficulty and complexity of trajectory generation are reduced, rapid trajectory generation is achieved, and the accuracy and readability of the trajectory are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112613546B
    Figure CN112613546B
Patent Text Reader

Abstract

The embodiment of the present invention discloses a trajectory generation method, device, equipment and storage medium. The method includes: dividing the activity area of ​​the target object according to a preset size to obtain multiple grids; determining the position points of the target object contained in the grids, and determining the valid grids according to the grids containing the position points; clustering all the position points contained in each valid grid in the valid grids by a clustering algorithm to obtain the cluster center point corresponding to each valid grid; connecting the cluster center points to obtain the trajectory of the target object. The technical solution provided by the embodiment of the present invention reduces the difficulty and complexity of the trajectory generation process by dividing the grids, determining the cluster center point corresponding to each valid grid, and connecting the cluster center points to obtain the trajectory of the target object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a trajectory generation method, device, equipment and storage medium. Background Art

[0002] During the movement of an object, many discrete spatial displacement points can usually be obtained according to the different positions of the object. After connecting these spatial displacement points, the trajectory of the object can be obtained. For example, the spatial trajectory of a person's daily activities, the route trajectory of a car every day, and the position trajectory of the positioning software every day.

[0003] The current spatial displacement points are usually obtained by changing one position per second or per minute. Since the position changes quickly and there are many spatial displacement points, it is difficult to generate a trajectory. Summary of the invention

[0004] The embodiments of the present invention provide a trajectory generation method, apparatus, device and storage medium, which reduce the difficulty and complexity of the trajectory generation process and can quickly generate a trajectory.

[0005] In a first aspect, an embodiment of the present invention provides a trajectory generation method, the method comprising:

[0006] Divide the activity area of ​​the target object according to a preset size to obtain multiple grids;

[0007] Determine the location point of the target object contained in the grid, and determine the valid grid according to the grid containing the location point;

[0008] Clustering all the position points contained in each of the valid grids by a clustering algorithm to obtain a cluster center point corresponding to each valid grid;

[0009] A connection operation is performed on the cluster center points to obtain the trajectory of the target object.

[0010] In a second aspect, an embodiment of the present invention provides a trajectory generation device, the device comprising:

[0011] A grid division module is used to divide the activity area of ​​the target object according to a preset size to obtain multiple grids;

[0012] An effective grid determination module, used to determine the position points of the target object contained in the grid, and determine the effective grid according to the grid containing the position points;

[0013] A center point determination module is used to cluster all the position points contained in each of the valid grids by a clustering algorithm to obtain a cluster center point corresponding to each valid grid;

[0014] The trajectory generation module is used to perform a connection operation on the cluster center points to obtain the trajectory of the target object.

[0015] In a third aspect, an embodiment of the present invention provides a computer device, the computer device comprising:

[0016] one or more processors;

[0017] A storage device for storing one or more programs;

[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the trajectory generation method described in any embodiment of the present invention.

[0019] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the trajectory generation method described in any embodiment of the present invention.

[0020] The embodiment of the present invention provides a trajectory generation method, device, equipment and storage medium. First, the activity area of ​​the target object is divided according to a preset size to obtain a plurality of grids. Then, the position points of the target object contained in the grids are determined. The valid grids are determined according to the grids containing the position points. Then, all the position points contained in each valid grid in the valid grids are clustered by a clustering algorithm to obtain the cluster center point corresponding to each valid grid. Finally, the cluster center points are connected to obtain the trajectory effect of the target object. By dividing the grids, determining the cluster center point corresponding to each valid grid, and connecting the cluster center points, the trajectory of the target object is obtained, thereby reducing the difficulty and complexity of the trajectory generation process and being able to quickly generate the trajectory. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A flow chart of a trajectory generation method provided in Embodiment 1 of the present invention;

[0022] Figure 2A A flow chart of a trajectory generation method provided in Embodiment 2 of the present invention;

[0023] Figure 2B A flow chart of determining a valid grid in the method provided in the second embodiment of the present invention;

[0024] Figure 2C A schematic diagram of a grid after division in the method provided in the second embodiment of the present invention;

[0025] Figure 2D A grid diagram including location points in the method provided in the second embodiment of the present invention;

[0026] Figure 2E A schematic diagram of the trajectory of the target object in the method provided in the second embodiment of the present invention;

[0027] Figure 3 A schematic diagram of the structure of a trajectory generating device provided in Embodiment 3 of the present invention;

[0028] Figure 4 A schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0029] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0030] Embodiment 1

[0031] Figure 1 This is a flow chart of a trajectory generation method provided in Embodiment 1 of the present invention. This embodiment is applicable to the case where a trajectory is generated according to the position points of a target object. The trajectory generation method provided in this embodiment can be executed by a trajectory generation device provided in an embodiment of the present invention. The device can be implemented in software and / or hardware and integrated in a computer device that executes this method.

[0032] See also Figure 1 The method of this embodiment includes but is not limited to the following steps:

[0033] S110, dividing the activity area of ​​the target object according to a preset size to obtain a plurality of grids.

[0034] The target object may be a person or an object that can be displaced or have its position changed. The preset size may be pre-designed or may be determined according to specific circumstances.

[0035] Since the position change data of the target object is usually collected once per second or minute, the position of the target object changes quickly, and the collected data is large, so it is difficult to generate a trajectory. In order to generate the trajectory of the target object, it is necessary to first divide the activity area of ​​the target object according to a preset size (for example, 50cm*50cm). After the division, multiple grids can be obtained, each grid corresponding to a part of the activity area, so as to subsequently determine the position point of the target object contained in the grid.

[0036] Exemplarily, the activity area may be represented by some location maps that can form a plane coordinate system, such as a map corresponding to the activity area, so that it can be subsequently divided according to a preset size and the geographical location of the corresponding grid can be obtained.

[0037] Optionally, before dividing the activity area of ​​the target object according to a preset size to obtain a plurality of grids, the method may further specifically include: determining the target object and the activity area corresponding to the target object.

[0038] Specifically, in order to generate the trajectory of the target object, it is necessary to determine what the target object is before dividing the activity area of ​​the target object according to a preset size. After the target object is determined, the corresponding activity area can be determined by the target object. For example, if the target object is a person, the corresponding activity area can be the city where the target object is located. If the target object is a car, the corresponding activity area can be the area formed by the location where the car has traveled. This makes it convenient to subsequently divide the activity area of ​​the target object according to the preset size to obtain multiple grids.

[0039] S120, determining the location points of the target object contained in the grid, and determining a valid grid according to the grid containing the location points.

[0040] Since the location points of the target object are distributed in the active area of ​​the target object, and the grid is divided according to the active area of ​​the target object, the location points of the target object contained in the grid can be determined, and then the valid grid and the invalid grid can be determined according to the grid containing the location points. For example, the grid containing the location points can be determined as a valid grid; the validity of the location points can also be determined first, and then the corresponding grid can be determined as a valid grid according to the validity of the location points.

[0041] S130, clustering all the position points contained in each valid grid by using a clustering algorithm to obtain a cluster center point corresponding to each valid grid.

[0042] Among them, clustering algorithms are based on similarity, and the patterns in a cluster have more similarities than the patterns in different clusters. There are many commonly used clustering algorithms, such as partitioning, hierarchical, density, and model algorithms. Partitioning methods include K-Means, K-Means++, and CLARANS.

[0043] After determining the valid grids, for each valid grid, cluster all the position points contained in the current valid grid through the clustering algorithm to obtain the cluster center point corresponding to the current valid grid. Since there are many position points of the target object, if each position point is analyzed, it will consume a lot of manpower and material resources. At this time, using the cluster center point to replace all the position points of the target object in the valid grid can reduce the workload and the complexity of generating trajectories.

[0044] Further, when the target object is in a moving state, since the changes in the moving state are relatively complex, such as sudden acceleration or sudden deceleration, etc., at this time, the time period corresponding to the moving state (such as 9:00 - 10:00, in 24-hour format, and all times in the present invention are in 24-hour format) can be divided according to a preset time period (such as 10 minutes), that is, 9:00 - 9:10, 9:10 - 9:20, …, 9:50 - 10:00, and all position points included in the effective grid corresponding to the first sub-time period (such as the last minute) within the divided time period are clustered once through a clustering algorithm to obtain the corresponding clustering center point, which can reduce the workload and improve the accuracy of the algorithm at the same time.

[0045] This embodiment does not specifically limit the specific values of the preset time period and the first sub-time period.

[0046] Optionally, the clustering algorithm may include the K-Means++ algorithm.

[0047] Specifically, the main idea of the K-Means++ algorithm is: assuming that n initial clustering centers have been selected (0 < n < K, and the value of K is known), then when selecting the (n + 1)-th clustering center: the points farther away from the current existing n clustering centers will have a higher probability of being selected as the (n + 1)-th clustering center, and when selecting the first clustering center (n = 1), it is done by a random method.

[0048] The clustering center point determined by the K-Means++ algorithm in the embodiment of the present invention is more accurate and closer to the actual situation, so the accuracy of the trajectory of the target object finally obtained is also higher.

[0049] S140, perform a connection operation on the clustering center points to obtain the trajectory of the target object.

[0050] After obtaining the clustering center point corresponding to each effective grid, connecting the clustering center points according to a preset rule can obtain the trajectory of the target object. Specifically, the preset rule can be the chronological order of the clustering center points, or the distance between the geographical locations corresponding to each clustering center point, etc. This embodiment does not specifically limit this.

[0051] The technical solution provided in this embodiment first divides the activity area of ​​the target object according to a preset size to obtain a plurality of grids, then determines the position points of the target object contained in the grids, determines the valid grids according to the grids containing the position points, and then clusters all the position points contained in each of the valid grids by a clustering algorithm to obtain the cluster center point corresponding to each valid grid, and finally connects the cluster center points to obtain the trajectory of the target object. By dividing the grids, determining the cluster center point corresponding to each valid grid, and connecting the cluster center points, the trajectory of the target object is obtained, thereby reducing the difficulty and complexity of the trajectory generation process and being able to quickly generate the trajectory.

[0052] Embodiment 2

[0053] Figure 2A This is a flow chart of a trajectory generation method provided by Embodiment 2 of the present invention. This embodiment of the present invention is optimized on the basis of the above embodiment. Optionally, this embodiment provides a detailed explanation of the process of obtaining the trajectory of the target object.

[0054] See also Figure 2A The method of this embodiment includes but is not limited to the following steps:

[0055] S210, dividing the activity area of ​​the target object according to a preset size to obtain a plurality of grids.

[0056] S220, determining the location points of the target object contained in the grid, and determining a valid grid according to the grid containing the location points.

[0057] The location point corresponds to a moment in a preset time period. The preset time period can be preset, such as a day or a week. Generally, various types of positioning technologies can be used to obtain the current location of the positioning device carried by the target object, and the current location can be represented by the location point, and each location point corresponds to a moment in the corresponding preset time period.

[0058] Optional, Figure 2B This is a flow chart of determining a valid grid in the method provided in the second embodiment of the present invention, such as Figure 2B As shown, the process of determining the effective grid includes but is not limited to the following steps:

[0059] S2201, determining a grid including a location point as a grid to be confirmed.

[0060] The location point may be in the wrong position when the positioning device fails or other abnormal conditions occur. In order to ensure the accuracy of the valid grid, the grid containing the location point is first confirmed as the grid to be confirmed, so that the validity of the location point in the grid to be confirmed can be verified later, and it can be determined which grids in the grid to be confirmed are valid and which are invalid.

[0061] S2202, if it is detected that the location point within the first preset time period within the preset time period is located in different grids to be confirmed, then obtain the geographical locations corresponding to the current location point, the consecutive N location points before the moment corresponding to the current location point, and the consecutive M location points after the moment corresponding to the current location point.

[0062] Among them, the moment corresponding to the current position point, the moments corresponding to the consecutive N position points, and the moments corresponding to the consecutive M position points are all included in the first preset time period. The first preset time period can be pre-designed, and it is within the preset time period. For example, assuming that the preset time period is 7:00-23:00, then the first preset time period can be any time period between 7 o'clock and 23 o'clock, without specific limitation. The specific values ​​of N and M can be set according to actual conditions, and the embodiment of the present invention does not make specific limitations.

[0063] If it is detected that the location point within the first preset time period (for example, 9:30-10:00) within the preset time period (for example, 7:00-23:00) is located in different grids to be confirmed, assuming that the location point within 9:30-10:00 is located in two grids to be confirmed, the geographical locations corresponding to the current location point, the consecutive N location points before the moment corresponding to the current location point, and the consecutive M location points after the moment corresponding to the current location point are obtained, so as to subsequently determine the validity of the current location point based on each geographical location.

[0064] S2203, determining the first distance between the current location point and each of the N location points according to each geographical location, and determining the second distance between the current location point and each of the M location points according to each geographical location, and adding the total number of the first distances and the total number of the second distances to obtain a first total number.

[0065] According to the geographical location corresponding to the current location point and the geographical location corresponding to each of the N location points, the first distance between the current location point and each of the N location points can be determined, and a total of N first distances can be obtained. Similarly, according to the geographical location corresponding to the current location point and the geographical location corresponding to each of the M location points, the second distance between the current location point and each of the M location points can be determined, and a total of M second distances can be obtained. The total number of first distances and the total number of second distances are added together to obtain a first total number, that is, N+M.

[0066] S2204: Determine a first number exceeding the distance threshold in the first distance and a second number exceeding the distance threshold in the second distance, and add the first number and the second number to obtain a second total number.

[0067] The distance threshold may be obtained by the duration corresponding to the first preset time period and the moving speed of the target object, or may be determined according to specific circumstances, and this embodiment does not impose any specific limitation.

[0068] After obtaining N first distances, by comparing each first distance with the distance threshold, a first number of first distances exceeding the distance threshold (assuming it is b, and b≤N) can be obtained, and when the first distance exceeds the distance threshold, it is indicated that the first distance is an abnormal distance. Similarly, after obtaining M second distances, by comparing the second distance and the distance threshold, a second number of second distances exceeding the distance threshold (assuming it is c, and c≤M) can be obtained, and when the second distance exceeds the distance threshold, it is indicated that the second distance is an abnormal distance. Adding the first number and the second number can obtain the second total number, that is, the total number of abnormal distances is b+c.

[0069] S2205, dividing the second total number by the first total number to obtain a corresponding ratio, and determining the validity of the current position point according to the ratio.

[0070] Divide the second total by the first total, and the ratio is The ratio represents the proportion of the total number of abnormal distances in the first total number. The ratio is compared with the preset first threshold. If the ratio is greater than the preset first threshold, the current position point is invalid; if the ratio is less than or equal to the preset first threshold, the current position point is valid, thereby deriving the validity of the current position point, wherein the preset first threshold may be pre-designed or may depend on the specific circumstances, and this embodiment does not impose any specific restrictions.

[0071] S2206: Determine the grid to be confirmed, in which all the location points are valid, as a valid grid.

[0072] After determining the validity of the current location point according to the above method, the grid to be confirmed, in which all the location points contained are valid, is determined as a valid grid, so that all the location points contained in each valid grid can be clustered separately through a clustering algorithm to obtain the cluster center point corresponding to each valid grid.

[0073] In the embodiment of the present invention, by first determining the validity of the position point and then determining the validity of the grid containing the position point, the adverse effects of position drift or abnormal conditions on the process of obtaining the trajectory can be effectively avoided, thereby improving the accuracy of the final trajectory.

[0074] S230, clustering all the position points contained in each valid grid by using a clustering algorithm to obtain a cluster center point corresponding to each valid grid.

[0075] S240, determining the effective time corresponding to the cluster center point of each effective grid, and performing a connection operation on the cluster center points according to the time sequence of the effective time points to obtain the trajectory of the target object.

[0076] After obtaining the cluster center point corresponding to each valid grid, since the location point corresponds to the moment within the preset time period, the cluster center point also corresponds to the moment within the preset time period, so the effective moment corresponding to the cluster center point of each valid grid can be obtained. After determining the effective moment corresponding to the cluster center point of each valid grid, the cluster center points are connected according to the time sequence of the effective moments to obtain the trajectory of the target object.

[0077] In the embodiment of the present invention, the cluster center points are connected in the time sequence of the effective moments to obtain the trajectory of the target object. This method is relatively simple and the obtained trajectory corresponds to the time, which is convenient for query.

[0078] Optionally, before performing a connection operation on the cluster center points according to the chronological order of the effective moments to obtain the trajectory of the target object, it may also specifically include: when the target object is in a preset situation, if it is detected that the position points corresponding to multiple moments within the preset time period are missing, then obtaining the historical trajectories corresponding to the multiple moments of the target object, and determining the historical trajectories as the effective trajectories corresponding to the target object at the multiple moments; accordingly, performing a connection operation on the cluster center points according to the chronological order of the effective moments to obtain the trajectory of the target object may specifically include: performing a connection operation on the cluster center points and the effective trajectory according to the chronological order of the effective moments and the multiple moments to obtain the trajectory of the target object.

[0079] The historical trajectory can be the trajectory of the target object in the activity area in the last month, or the trajectory of the target object in the activity area in the last week. This embodiment does not limit the specific time. The historical trajectory can be obtained through big data, or through other positioning methods, or it can be a record of previously generated trajectories. This embodiment does not specifically limit the method of obtaining the historical trajectory.

[0080] Specifically, when it is detected that the position points corresponding to multiple moments within a preset time period are missing, the historical trajectories corresponding to the multiple moments of the target object are first obtained, and the historical trajectories are determined as the valid trajectories corresponding to the target object at multiple moments. Then, according to the valid moments corresponding to the cluster center points of each valid grid and the time sequence of multiple moments, the cluster center points and the valid trajectories are connected to obtain the trajectory of the target object.

[0081] In the embodiment of the present invention, when a position point is missing, the readability of the finally obtained trajectory is improved by replacing the missing trajectory with the corresponding historical trajectory.

[0082] Furthermore, the preset scenario may include at least one of the following: the moving speed of the target object reaches a preset threshold, the location of the target object is not covered by the positioning signal, and the positioning function of the device used by the target object is in a turned-off state.

[0083] The preset scenario is a scenario corresponding to the missing location point.

[0084] Exemplarily, the trajectory generation method in the above embodiment is described below by using a specific example. Figure 2C This is a schematic diagram of a grid after division in the method provided in the second embodiment of the present invention. Figure 2D The method provided in the second embodiment of the present invention includes a grid diagram of location points, Figure 2E A schematic diagram of the trajectory of the target object in the method provided in Embodiment 2 of the present invention.

[0085] like Figure 2C As shown in , the active area of ​​the target object is divided into multiple grids according to the preset size. Figure 2D As shown in the figure, determine the location points of the target object contained in the grid. Then determine the valid grid based on the grid containing the location points. Figure 2D The 4th and 6th grids in the first row of the grid and the 6th grid in the first row are determined as invalid grids. Finally, all the position points contained in each valid grid are clustered by the clustering algorithm to obtain the cluster center point corresponding to each valid grid. The cluster center points are connected and smoothed to obtain the trajectory diagram of the target object, as shown in the figure. Figure 2E shown.

[0086] The technical solution provided in this embodiment first divides the activity area of ​​the target object according to a preset size to obtain multiple grids, then determines the position points of the target object contained in the grids, determines the valid grids according to the grids containing the position points, and then clusters all the position points contained in each valid grid in the valid grids through a clustering algorithm to obtain the cluster center point corresponding to each valid grid, and finally determines the valid time corresponding to the cluster center point of each valid grid, and connects the cluster center points according to the time sequence of the valid time to obtain the trajectory of the target object. By first dividing the grids, then determining the validity of the position points, and determining the validity of the grids containing the position points, the adverse effects of position drift or abnormal situations on the process of obtaining the trajectory can be effectively avoided. At the same time, by determining the cluster center point corresponding to each valid grid, and connecting the cluster center points according to the time sequence of the valid time, the trajectory of the target object is obtained, thereby reducing the difficulty and complexity of the trajectory generation process, being able to quickly generate the trajectory, and the obtained trajectory is related to time, which enhances readability.

[0087] Embodiment 3

[0088] Figure 3 A schematic diagram of the structure of a trajectory generating device provided in Embodiment 3 of the present invention is shown in FIG. Figure 3 As shown, the device may include:

[0089] A grid division module 310 is used to divide the activity area of ​​the target object into multiple grids according to a preset size;

[0090] The effective grid determination module 320 is used to determine the position points of the target object contained in the grid, and determine the effective grid according to the grid containing the position points;

[0091] The center point determination module 330 is used to cluster all the position points contained in each of the valid grids by a clustering algorithm to obtain a cluster center point corresponding to each valid grid;

[0092] The trajectory generation module 340 is used to perform a connection operation on the cluster center points to obtain the trajectory of the target object.

[0093] The technical solution provided in this embodiment first divides the activity area of ​​the target object according to a preset size to obtain a plurality of grids, then determines the position points of the target object contained in the grids, determines the valid grids according to the grids containing the position points, and then clusters all the position points contained in each of the valid grids by a clustering algorithm to obtain the cluster center point corresponding to each valid grid, and finally connects the cluster center points to obtain the trajectory effect of the target object. By dividing the grids, determining the cluster center point corresponding to each valid grid, and connecting the cluster center points, the trajectory of the target object is obtained, thereby reducing the difficulty and complexity of the trajectory generation process and being able to quickly generate the trajectory.

[0094] Furthermore, the above-mentioned trajectory generating device may further include: an activity area determining module, used to determine the target object and the activity area corresponding to the target object.

[0095] Furthermore, the position point corresponds to a moment within a preset time period; accordingly, the above-mentioned trajectory generation module 340 can be specifically used to: determine the effective moment corresponding to the cluster center point of each effective grid, and connect the cluster center points according to the time sequence of the effective moments to obtain the trajectory of the target object.

[0096] Furthermore, the above-mentioned trajectory generation device may also include: an effective trajectory determination module, which is used to obtain historical trajectories corresponding to the multiple moments of the target object, and determine the historical trajectory as the effective trajectory corresponding to the target object at the multiple moments, before the target object is in a preset situation and the cluster center points are connected according to the time sequence of the effective moments to obtain the trajectory of the target object; accordingly, the above-mentioned trajectory generation module 340 can be specifically used to: according to the time sequence of the effective moment and the multiple moments, the cluster center points and the effective trajectory are connected to obtain the trajectory of the target object.

[0097] Furthermore, the preset scenario includes at least one of the following: the movement speed of the target object reaches a preset threshold, the location of the target object is not covered by a positioning signal, and the positioning function of a device used by the target object is in a turned-off state.

[0098] Furthermore, the clustering algorithm includes a K-Means++ algorithm.

[0099] Further, the above-mentioned effective grid determination module 320 can be specifically used to: determine the grid containing the location point as the grid to be confirmed; if it is detected that the location point in the first preset time period within the preset time period is located in a different grid to be confirmed, then obtain the geographical locations corresponding to the current location point, the N consecutive location points before the moment corresponding to the current location point, and the M consecutive location points after the moment corresponding to the current location point, respectively, wherein the moment corresponding to the current location point, the moment corresponding to the N consecutive location points, and the moment corresponding to the M consecutive location points are all included in the first preset time period; determine the current location point and the location points according to each geographical location. The first distance of each of the N location points, and the second distance between the current location point and each of the M location points are determined according to each geographical location, and the total number of the first distances and the total number of the second distances are added to obtain a first total number; the first number of the first distances exceeding the distance threshold and the second number of the second distances exceeding the distance threshold are determined, and the first number and the second number are added to obtain a second total number; the second total number is divided by the first total number to obtain a corresponding ratio, and the validity of the current location point is determined according to the ratio; the grid containing the valid location points to be confirmed is determined as a valid grid.

[0100] The trajectory generation device provided in this embodiment can be applied to the trajectory generation method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0101] Embodiment 4

[0102] Figure 4 A schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention is shown in FIG. Figure 4 As shown, the computer device includes a processor 410, a storage device 420 and a communication device 430; the number of the processor 410 in the computer device can be one or more. Figure 4 A processor 410 is taken as an example; the processor 410, the storage device 420 and the communication device 430 in the computer device can be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0103] The storage device 420, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as the modules corresponding to the trajectory generation method in the embodiment of the present invention (for example, the grid division module 310, the effective grid determination module 320, the center point determination module 330 and the trajectory generation module 340 used in the trajectory generation device). The processor 410 executes various functional applications and data processing of the computer device by running the software programs, instructions and modules stored in the storage device 420, that is, implements the above-mentioned trajectory generation method.

[0104] The storage device 420 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the storage device 420 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the storage device 420 may further include a memory remotely arranged relative to the processor 410, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0105] The communication device 430 is used to realize the network connection or mobile data connection between servers.

[0106] A computer device provided in this embodiment can be used to execute the trajectory generation method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0107] Embodiment 5

[0108] Embodiment 5 of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the trajectory generation method in any embodiment of the present invention is implemented. The method specifically includes:

[0109] Divide the activity area of ​​the target object according to a preset size to obtain multiple grids;

[0110] Determine the location point of the target object contained in the grid, and determine the valid grid according to the grid containing the location point;

[0111] Clustering all the position points contained in each of the valid grids by a clustering algorithm to obtain a cluster center point corresponding to each valid grid;

[0112] A connection operation is performed on the cluster center points to obtain the trajectory of the target object.

[0113] Of course, the computer executable instructions of a storage medium including computer executable instructions provided by an embodiment of the present invention are not limited to the operations of the method described above, and can also execute related operations in the trajectory generation method provided by any embodiment of the present invention.

[0114] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (FLASH), a hard disk or an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0115] It is worth noting that in the embodiment of the above-mentioned trajectory generating device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present invention.

[0116] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A trajectory generation method, characterized in that: include: Determine a target object and an activity area corresponding to the target object; Divide the activity area of ​​the target object according to a preset size to obtain a plurality of grids; wherein the number of the target object is a single one; Determine the location point of the target object contained in the grid, and determine the valid grid according to the grid containing the location point; Clustering all the position points contained in each of the valid grids by a clustering algorithm to obtain a cluster center point corresponding to each valid grid; the position points correspond to moments within a preset time period; Performing a connection operation on the cluster center points to obtain the trajectory of the target object; The determining of the effective grid according to the grid containing the position point comprises: Determine the grid containing the location point as the grid to be confirmed; If it is detected that the position points within the first preset time period within the preset time period are located in different to-be-confirmed grids, then the geographical locations corresponding to the current position point, the N consecutive position points before the moment corresponding to the current position point, and the M consecutive position points after the moment corresponding to the current position point are obtained, wherein the moment corresponding to the current position point, the moments corresponding to the N consecutive position points, and the moments corresponding to the M consecutive position points are all included in the first preset time period; Determine a first distance between the current location point and each of the N location points according to each geographic location, and determine a second distance between the current location point and each of the M location points according to each geographic location, and add the total number of the first distances and the total number of the second distances to obtain a first total number; Determine a first number of the first distances exceeding a distance threshold, and a second number of the second distances exceeding a distance threshold, and add the first number to the second number to obtain a second total number; Dividing the second total number by the first total number to obtain a corresponding ratio, and determining the validity of the current position point according to the ratio; The unconfirmed grids that contain valid position points are determined as valid grids.

2. The method according to claim 1, characterized in that The connecting operation is performed on the cluster center points to obtain the trajectory of the target object, including: The effective time corresponding to the cluster center point of each effective grid is determined, and the cluster center points are connected according to the time sequence of the effective time points to obtain the trajectory of the target object.

3. The method according to claim 2, characterized in that Before the cluster center points are connected according to the time sequence of the effective moments to obtain the trajectory of the target object, the method further includes: When the target object is in a preset situation, if it is detected that the position points corresponding to multiple moments within the preset time period are missing, the historical tracks corresponding to the multiple moments of the target object are obtained, and the historical tracks are determined as the valid tracks corresponding to the target object at the multiple moments; Accordingly, the connecting operation is performed on the cluster center points according to the time sequence of the effective moments to obtain the trajectory of the target object, including: According to the time sequence of the effective moment and the multiple moments, the cluster center point and the effective trajectory are connected to obtain the trajectory of the target object.

4. The method according to claim 3, characterized in that The preset scenario includes at least one of the following: the moving speed of the target object reaches a preset threshold, the location of the target object is not covered by a positioning signal, and the positioning function of a device used by the target object is in a turned-off state.

5. The method according to claim 1, characterized in that The clustering algorithm includes the K-Means++ algorithm.

6. A trajectory generating device, characterized in that: include: An activity area determination module, used to determine a target object and an activity area corresponding to the target object; A grid division module, used to divide the activity area of ​​the target object according to a preset size to obtain a plurality of grids; wherein the number of the target object is a single one; An effective grid determination module, used to determine the position points of the target object contained in the grid, and determine the effective grid according to the grid containing the position points; A center point determination module, used to cluster all the position points contained in each of the valid grids by a clustering algorithm to obtain a cluster center point corresponding to each valid grid; the position point corresponds to a moment in a preset time period; A trajectory generation module, used for performing a connection operation on the cluster center points to obtain the trajectory of the target object; The effective grid determination module is specifically used to: determine the grid containing the position point as the grid to be confirmed; if it is detected that the position point in the first preset time period within the preset time period is located in a different grid to be confirmed, then obtain the geographical locations corresponding to the current position point, the N consecutive position points before the moment corresponding to the current position point, and the M consecutive position points after the moment corresponding to the current position point, wherein the moment corresponding to the current position point, the moment corresponding to the N consecutive position points, and the moment corresponding to the M consecutive position points are all included in the first preset time period; determine the current position point and the N consecutive position points according to each geographical location. A first distance of each location point, and a second distance between the current location point and each of the M location points are determined according to each geographical location, and the total number of the first distances and the total number of the second distances are added to obtain a first total number; a first number exceeding a distance threshold in the first distance and a second number exceeding a distance threshold in the second distance are determined, and the first number and the second number are added to obtain a second total number; the second total number is divided by the first total number to obtain a corresponding ratio, and the validity of the current location point is determined according to the ratio; and a grid to be confirmed that contains valid location points is determined as a valid grid.

7. A computer device, characterized in that: The computer device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the trajectory generation method as described in any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the trajectory generation method as described in any one of claims 1 to 5 is implemented.