Trajectory retrieval method, device, equipment, and storage medium
By combining grid coding and index relationship using Hilbert curve in trajectory retrieval, the problem of inaccurate trajectory retrieval in the existing technology is solved, and more efficient and accurate trajectory data retrieval is achieved.
Patent Information
- Application Number
- CN202111145667.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-28
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2041-09-28
AI Technical Summary
The existing technology has the problem of inaccurate trajectory retrieval in spatial location-based trajectory retrieval, especially because the geo-hash encoding method causes the one-dimensional distance to be close but the actual two-dimensional distance to be far, resulting in insufficient retrieval efficiency and accuracy.
The Hilbert curve is used to perform grid coding on the standard plane of the search area. Combined with the index relationship between the original trajectory data and the coding array, trajectory data retrieval is performed through the combination of inverted index and forward index to improve the coding accuracy and retrieval efficiency.
The accuracy and efficiency of trajectory retrieval are improved, the problem of short one-dimensional distance but long two-dimensional distance in the existing technology is solved, and a more accurate trajectory data retrieval solution is provided.
Smart Images

Figure CN113868555B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to the field of artificial intelligence, and specifically to the field of computer vision, intelligent search, and intelligent transportation technology. Background Art
[0002] With the development of Internet technology, the application of positioning technology for mobile terminals is becoming more and more widespread. Since mobile terminals generate a trajectory point every second, various mobile terminals can generate tens of billions of trajectory points every day, which poses a huge challenge to trajectory retrieval based on spatial location. Summary of the Invention
[0003] The present disclosure provides a trajectory retrieval method, apparatus, device, and storage medium.
[0004] According to one aspect of the present disclosure, a trajectory retrieval method is provided, comprising:
[0005] Map the area to be searched onto the standard plane, and use a preset curve to perform grid encoding on the mapped standard plane;
[0006] Determine the target coding array of the area to be searched based on the grid coding result associated with the area to be searched;
[0007] According to the target coding array and the index relationship between the original trajectory data and the original coding array, the target trajectory data associated with the target coding array is determined.
[0008] According to another aspect of the present disclosure, an electronic device is provided, the electronic device comprising:
[0009] at least one processor; and
[0010] a memory communicatively connected to at least one processor; wherein,
[0011] The memory stores instructions that can be executed by at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the trajectory retrieval method of any embodiment of the present disclosure.
[0012] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the trajectory retrieval method according to any embodiment of the present disclosure.
[0013] The technology disclosed herein improves the efficiency and accuracy of trajectory retrieval and provides a new approach to spatial trajectory retrieval.
[0014] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings are used to better understand the present invention and do not constitute a limitation of the present invention.
[0016] Figure 1 is a flow chart of a trajectory retrieval method provided according to an embodiment of the present disclosure;
[0017] Figure 2A is a flowchart of another trajectory retrieval method provided according to an embodiment of the present disclosure;
[0018] Figure 2B Schematic diagram of curve filling effect of a standard plane under different grid coding accuracies provided by an embodiment of the present disclosure;
[0019] Figure 2C is a schematic diagram of a grid coding result provided according to an embodiment of the present disclosure;
[0020] Figure 3A is a flowchart of another trajectory retrieval method provided according to an embodiment of the present disclosure;
[0021] Figure 3B Schematic diagram of the index relationship between the original trajectory data and the original encoding array provided according to an embodiment of the present disclosure;
[0022] Figure 4A is a schematic diagram of a target encoding array and an original encoding array provided according to an embodiment of the present disclosure;
[0023] Figure 4B is a flowchart of another trajectory retrieval method provided according to an embodiment of the present disclosure;
[0024] Figure 5A is a flowchart of another trajectory retrieval method provided according to an embodiment of the present disclosure;
[0025] Figure 5B This is a principle framework diagram of trajectory retrieval provided according to an embodiment of the present disclosure;
[0026] Figure 6 is a structural diagram of a trajectory retrieval device provided according to an embodiment of the present disclosure;
[0027] Figure 7 It is a block diagram of an electronic device used to implement the trajectory retrieval method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0029] Figure 1 This is a flow chart of a trajectory retrieval method provided according to an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to the case of retrieving original trajectory data located in a to-be-retrieved area, and is particularly applicable to the case of retrieving original trajectory data located in a to-be-retrieved area from a large amount of original trajectory data. The method can be executed by a trajectory retrieval device, which can be implemented in software and / or hardware and can be integrated into an electronic device with a trajectory retrieval function. Figure 1 As shown, the trajectory retrieval method provided in this embodiment may include:
[0030] S101 , mapping the area to be searched to a standard plane, and performing grid coding on the mapped standard plane using a preset curve.
[0031] Among them, the area to be searched in this embodiment is the area where trajectory search is required. The area to be searched can be determined based on the trajectory search request sent by the search requester. Optionally, the area to be searched may be directly included in the trajectory search request, for example, a certain urban area in City A. Alternatively, the trajectory search request may provide location information for determining the area to be searched, in which case the area to be searched is determined based on the location information. For example, if at least three location points are given, the area enclosed by the at least three location points may be used as the area to be searched; if a search center and a search radius are given, the search center is used as the center point, and the area within the search radius is used as the area to be searched.
[0032] The standard plane in this embodiment can be a two-dimensional plane obtained by dimensionality reduction and expansion of the three-dimensional spherical plane of the Earth. In this embodiment, the three-dimensional spherical plane of the Earth can be expanded into a single standard plane, i.e., this standard plane encompasses all regions on the Earth. Alternatively, the three-dimensional spherical plane can be expanded into multiple standard planes. For example, each region on the Earth can be projected onto the six faces of a circumscribed cube of the Earth, resulting in six square standard planes. In other words, each standard plane encompasses a portion of the Earth, and these six standard planes, when combined, encompass all regions on the Earth. The specific number of standard planes selected can be determined based on actual needs.
[0033] The preset curve of this embodiment is a pre-selected curve with the characteristics of dimensionality reduction, stability and continuity. The preset curve of this embodiment is preferably the Hilbert curve. Since the Hilbert curve can effectively reduce the dimensionality of multi-dimensional space, when the Hilbert curve is an n-order (n tends to infinity) curve, the position points on the curve basically tend to be stable, and it can be guaranteed to fill the entire standard plane without position mutation problems. Therefore, this embodiment selects the Hilbert curve as the preset curve, which can improve the accuracy of grid encoding of the standard plane. For example, compared with the Z-order curve, it solves the problem of inaccurate retrieval results when the corner position sequence mutation causes the data to be very close in one dimension, but the actual two-dimensional distance is very far.
[0034] Optionally, this embodiment can first map the area to be retrieved from the three-dimensional spherical surface to the two-dimensional standard plane according to the mapping relationship between the three-dimensional spherical surface of the earth and the standard plane, and then use a preset area to grid encode the mapped standard plane. Specifically, a preset curve can be used to curve fill the standard plane mapping the area to be retrieved to divide the standard plane into several small grids, and then each small grid after division can be encoded. For example, the S2 algorithm can be used for encoding to obtain the encoding results corresponding to each small grid, that is, one small grid corresponds to one encoding array.
[0035] It should be noted that, in this embodiment, if the three-dimensional spherical plane of the Earth corresponds to multiple standard planes, this embodiment will first need to select a standard plane that includes the area to be searched from the multiple standard planes, and then perform the operation in this step based on the standard plane. In this embodiment, the code array corresponding to each grid cell may include at least: the grid cell number and the identifier of the standard plane that includes the area to be searched.
[0036] S102 , determining a target coding array of the area to be searched according to the grid coding result associated with the area to be searched.
[0037] Optionally, in this embodiment, the standard plane mapped to the area to be searched has been gridded, and grid coding has been performed on each of the divided grids, i.e., a code array has been obtained for each grid. In this case, the grid associated with the area to be searched mapped to the standard plane, i.e., the grid corresponding to the area to be searched in the standard plane, can be determined, and the grid coding result of the corresponding grid, i.e., the code array of the corresponding grid, can be used as the target code array for the area to be searched.
[0038] It should be noted that when the accuracy of the standard plane division in S101 is small enough, it can be approximately considered that the area to be searched can be composed of multiple grids after division, and the multiple coding groups of the multiple grids are all target coding arrays of the area to be searched.
[0039] S103 , determining the target trajectory data associated with the target coding array according to the target coding array and the index relationship between the original trajectory data and the original coding array.
[0040] The original trajectory data is composed of a series of ordered two-dimensional longitude and latitude coordinate points, and each longitude and latitude coordinate point is collected in real time by a mobile terminal (such as a mobile phone, a vehicle-mounted device, a wearable device, etc.) using the Global Navigation Satellite System (GNNS). Each movement process of each mobile device will form a set of original trajectory data. The original coding array of this embodiment is obtained by encoding the original trajectory data. The specific encoding process can be similar to the process of determining the target coding array of the area to be retrieved, such as mapping the original trajectory data to a standard plane, and using a preset curve to grid-code the mapped standard plane. According to the grid coding result associated with the original trajectory data, the original coding array of the original trajectory data is determined. The specific determination process will be described in detail in the subsequent embodiments.
[0041] It should be noted that in this embodiment, an index relationship has been established between the original trajectory data and the original encoding array obtained by encoding, such as "original encoding array-original trajectory data." Furthermore, the original trajectory data and its corresponding index relationship (i.e., the index relationship between the original trajectory data and the original encoding array) can be pre-stored in the trajectory database.
[0042] Optionally, this embodiment may first retrieve the original code array corresponding to the target code array in the trajectory database (e.g., find the original code array that is consistent with the target code array), i.e., the original code array to be retrieved this time; and then, based on the index relationship between the original trajectory data stored in the trajectory database and the original code array, determine the original trajectory data corresponding to the original code array to be retrieved this time, i.e., the target trajectory data to be retrieved this time.
[0043] The solution of the embodiment of the present disclosure uses a preset curve to perform grid coding on the standard plane that maps the area to be searched to determine the target coding array corresponding to the area to be searched, and then retrieves the original trajectory data corresponding to the target coding array as the target trajectory data based on the index relationship between the original trajectory data and the original coding array. The solution of this embodiment provides a new method for grid coding of location points based on a preset curve, which solves the problem of the existing geohash (GeoHash) coding method that the one-dimensional distance after coding is close, but the actual two-dimensional distance is far, resulting in inaccurate trajectory retrieval, thereby improving the efficiency and accuracy of trajectory retrieval. It provides a new idea for spatial trajectory retrieval.
[0044] Figure 2AFIG2 is a flowchart of another trajectory retrieval method provided according to an embodiment of the present disclosure; FIG2B is a schematic diagram of the curve filling effect of the standard plane under different grid coding accuracies provided according to an embodiment of the present disclosure; Figure 2C This is a schematic diagram of the grid coding result provided according to the embodiment of the present disclosure. Based on the above embodiment, this embodiment further explains in detail how to "map the area to be searched to the standard plane and use a preset curve to grid code the mapped standard plane". Figures 2A-2C As shown, the trajectory retrieval method provided in this embodiment may include:
[0045] S201, determining the standard plane and grid coding accuracy corresponding to the area to be searched.
[0046] The grid coding accuracy can be the degree of fineness of the pre-set grid division of the standard plane. The higher the grid coding accuracy, the finer the grid division. Preferably, the grid coding accuracy of this embodiment is up to 30 levels, covering a range from 0.7 cm to 85,000,000 km. Providing a large number of selectable levels allows for a smoother transition between adjacent levels, effectively avoiding the problem of difficult level selection.
[0047] Optionally, in this embodiment, the standard planes are six square standard planes obtained by projecting all points on the three-dimensional Earth onto the six faces of a circumscribed cube. When determining the standard plane corresponding to the area to be searched from these six standard planes, if the trajectory search request sent by the search requester includes the standard plane corresponding to the area to be searched, the standard plane can be determined directly based on the trajectory search request. Otherwise, the standard plane can be determined by determining which of the six projected standard planes contains the area to be searched, and then using that standard plane as the standard plane for the area to be searched.
[0048] Optionally, in this embodiment, when determining the grid coding accuracy corresponding to the area to be searched, if the trajectory retrieval request sent by the search requester includes the grid coding accuracy, then it can be determined directly based on the trajectory retrieval request; otherwise, the system default grid coding accuracy can be selected.
[0049] S202 , mapping the area to be searched to a standard plane, filling a preset curve in the standard plane according to the grid coding accuracy, and encoding the grid formed by the curve filling.
[0050] Optionally, after determining the standard plane and grid coding accuracy corresponding to the area to be retrieved, this embodiment can first map the area to be retrieved to the standard plane, and then fill the preset curve in the standard plane according to the grid coding accuracy corresponding to the area to be retrieved (such as level 30). After the curve is filled, the standard plane is divided into multiple grids, and then each grid is encoded in turn to obtain the coding array cell corresponding to each grid.
[0051] For example, Figure 2B The effect diagram of filling the Hilbert curve (i.e., the preset curve) in the standard plane under different grid coding accuracy is shown. The higher the grid accuracy, the denser the Hilbert curve filled in the standard plane, and accordingly, the finer the grid dividing the standard plane. Figure 2C The encoding array shown can be regarded as Figure 2B At 30-level grid accuracy, the encoding array corresponds to a grid divided by filling the standard plane with the Hilbert curve. This encoding array is 64 bits, of which the first three digits represent the standard plane number corresponding to the search area, that is, 101. The first non-zero position in the encoding array from the back to the front is the array terminator. In other words, the position before the array terminator is the valid character of the encoding array. It should be noted that when the grid encoding accuracy is 30, the valid character is 33 bits, and when the grid encoding accuracy is 24, the valid character is 27 bits.
[0052] Optionally, this embodiment may also convert the 64-bit binary code array into a decimal code array to facilitate subsequent rapid retrieval.
[0053] S203 , determining a target coding array of the area to be searched according to the grid coding result associated with the area to be searched.
[0054] S204 , determining the target trajectory data associated with the target coding array according to the target coding array and the index relationship between the original trajectory data and the original coding array.
[0055] The solution of the disclosed embodiment offers multiple selectable standard planes and grid coding accuracies. The solution first determines the standard plane and grid coding accuracy corresponding to the area to be searched. Based on the grid coding accuracy, a preset curve is then used to grid-code the standard plane that maps the area to be searched. The target coding array corresponding to the area to be searched is determined. Then, based on the index relationship between the original trajectory data and the original coding array, the original trajectory data corresponding to the target coding array is retrieved as the target trajectory data. When grid-coding location points based on the preset curve, the solution of this embodiment can select the appropriate standard plane and grid coding accuracy based on actual needs, thereby improving the precision of the grid coding and, in turn, the accuracy of trajectory retrieval.
[0056] Figure 3A FIG3 is a flow chart of another trajectory retrieval method according to an embodiment of the present disclosure; FIG3B is a schematic diagram of the index relationship between the original trajectory data and the original coding array according to an embodiment of the present disclosure. In the embodiment of the present disclosure, the index relationship between the original trajectory data and the original coding array includes: a reverse index relationship between the original coding array and the original trajectory number, and a forward index relationship between the original trajectory number and the original trajectory data.
[0057] For example, Figure 3B As shown, the inverted index relationship between a set of original code arrays and the original trajectory numbers is: 3869277663051577529-[Trajectory 1, Trajectory 2, Trajectory 3, Trajectory 4], and the forward index relationship between a set of original trajectory codes and the original trajectory data is: Trajectory 1-Original trajectory data 1. It should be noted that Figure 3B The figure shows the conversion of the 64-bit binary original code array into the decimal original code array. This embodiment can also directly establish an inverted index relationship between the 64-bit binary original code array and the original track number of the track, which is not limited to this.
[0058] Based on the above embodiment, this embodiment further explains in detail how to "determine the target trajectory data associated with the target coding array based on the target coding array and the index relationship between the original trajectory data and the original coding array." Figures 3A-3B As shown, the trajectory retrieval method provided in this embodiment may include:
[0059] S301 : Map the area to be searched onto a standard plane, and perform grid coding on the mapped standard plane using a preset curve.
[0060] S302 : Determine a target coding array of the area to be searched according to the grid coding result associated with the area to be searched.
[0061] S303 : Determine the target trajectory number associated with the target coding array according to the target coding array and the inverted index relationship between the original coding array and the original trajectory number.
[0062] In this embodiment, the original coding array that is consistent with the target coding array (i.e., the original coding array to be retrieved) is found, and based on the inverted index relationship between the original coding array and the original trajectory number, the original trajectory number corresponding to the original coding array to be retrieved is used as the target trajectory number associated with the target coding array. For example, if the target coding array is 3869277663051577530, then according to Figure 3B The inverted index relationship between the original coding array and the original trajectory number shown in the figure shows that the target trajectory coding array is consistent with the original coding array in the second row. Therefore, the trajectory 2, trajectory 5, and trajectory 6 corresponding to the original coding array 3869277663051577530 in the second row are used as the target trajectory numbers associated with the target coding array.
[0063] S304 : Determine the target trajectory data associated with the target trajectory number according to the target trajectory number and the positive index relationship between the original trajectory number and the original trajectory data.
[0064] After determining the target trajectory number, this embodiment can search for the original trajectory data corresponding to the target trajectory number as the target trajectory data associated with the target trajectory number based on the positive index relationship between the original trajectory number and the original trajectory data.
[0065] For example, after determining that the target track numbers associated with the target code array are track 2, track 5, and track 6, according to Figure 3B It can be seen from the positive index relationship between the original trajectory number and the original trajectory data that the original trajectory data 2 corresponding to trajectory 2, the original trajectory data 5 corresponding to trajectory 5, and the original trajectory data 6 corresponding to trajectory 6 are the target trajectory data associated with the target trajectory number.
[0066] The solution of the disclosed embodiment uses a preset curve to perform grid coding on the standard plane mapping the area to be searched to determine the target coding array corresponding to the area to be searched. Then, based on the index relationship between the original trajectory data and the original coding array, when retrieving the original trajectory data corresponding to the target coding array, the trajectory number is first retrieved based on the inverted index relationship, and then the trajectory data is retrieved based on the forward index relationship. The simultaneous introduction of inverted and forward indexes for trajectory retrieval greatly improves the efficiency of trajectory retrieval.
[0067] Figure 4A The following is a schematic diagram of a target encoding array and an original encoding array provided according to an embodiment of the present disclosure. The target encoding array is a 24-level encoding array, meaning its encoding precision is 24 levels; the original encoding array is a 30-level encoding array, meaning its encoding precision is 30 levels. In this embodiment, the encoding precision of the original encoding array is preferably set to the highest precision level, while the precision of the target encoding array can be set based on the precision of the search requester, and is typically less than or equal to the highest precision.
[0068] Figure 4B This is a flow chart of another trajectory retrieval method provided according to an embodiment of the present disclosure; based on the above embodiment, this embodiment further explains in detail how to "determine the target trajectory data associated with the target coding array based on the target coding array and the index relationship between the original trajectory data and the original coding array" when the grid coding accuracy of the target coding array is less than the grid coding accuracy of the original coding array. Figures 4A-4B As shown, the trajectory retrieval method provided in this embodiment may include:
[0069] S401 : Map the area to be searched onto a standard plane, and perform grid coding on the mapped standard plane using a preset curve.
[0070] S402 : Determine a target coding array of the area to be searched according to the grid coding result associated with the area to be searched.
[0071] S403: Determine the original code array associated with the target code array according to the inclusion relationship between the target code array and the original code array.
[0072] Optionally, in the embodiment of the present disclosure, for the same area, the coding array with low coding accuracy includes the coding array with high coding accuracy, for example, Figure 4B The first 24 bits of the 24-level target encoding array are consistent with the first 24 bits of the 30-level original encoding array, which means that the 24-level target encoding array contains the 30-level original encoding array.
[0073] Therefore, when the target encoding array is lower than the encoding accuracy of the original encoding array, this embodiment can select the original encoding array contained in the target encoding array from the original encoding array as the original encoding array associated with the target encoding array. Specifically, it can be to search forward from the last bit at the end of the target encoding array to find the first position that is not 0, which is the array terminator, and obtain the valid characters before the array terminator; and search the original encoding array in the original encoding array for the original encoding array with the same valid characters starting from the first bit as the original encoding array contained in the target encoding array, that is, the original encoding array associated with the target encoding array. For example, Figure 4A The original encoding array shown can be used as the original encoding array associated with the target encoding array.
[0074] S404 , determining the target trajectory number associated with the target coding array according to the original coding array associated with the target coding array and the inverted index relationship between the original coding array and the original trajectory number.
[0075] Illustratively, this embodiment may retrieve the original trajectory number corresponding to the original coding array associated with the target coding array based on the inverted index relationship between the original coding array and the original trajectory number, and use it as the target trajectory number associated with the target coding array.
[0076] S405 , determining the target trajectory data associated with the target trajectory number according to the target trajectory number and the positive index relationship between the original trajectory number and the original trajectory data.
[0077] The solution of the disclosed embodiment can generate an original code array of original trajectory data based on higher coding accuracy. When the coding accuracy of the target code array in the search area is lower than that of the original code array, this embodiment can first locate the high-precision original code array from the low-precision target code array based on the inclusion relationship between the target code array and the original code array. Then, based on the inverted index relationship between the original code array and the original trajectory number, the target trajectory number associated with the target code array is determined. And based on the forward index relationship between the original trajectory number and the original trajectory data, the target trajectory data associated with the target trajectory number is determined. This allows high-precision original trajectory data to be retrieved even when the coding accuracy of the search area is low, thereby improving the accuracy of trajectory retrieval.
[0078] Figure 5A FIG5 is a flow chart of another trajectory retrieval method provided according to an embodiment of the present disclosure; FIG5B is a principle framework diagram of trajectory retrieval provided according to an embodiment of the present disclosure. Based on the above embodiment, this embodiment further explains in detail how to "construct the index relationship between the original trajectory data and the original encoding array". Figures 5A-5B As shown, the trajectory retrieval method provided in this embodiment may include:
[0079] S501 , mapping the original trajectory data to a standard plane, and performing grid coding on the mapped standard plane using a preset curve.
[0080] Specifically, this step maps the original trajectory data onto a standard plane and grid-encodes the mapped standard plane using a preset curve. This process is similar to the process described in the above embodiment, which maps the area to be searched onto a standard plane and grid-encodes the mapped standard plane using a preset curve. For example, the standard plane and grid encoding accuracy corresponding to the original trajectory data can be determined. The original trajectory data is mapped onto the standard plane, and based on the grid encoding accuracy, the preset curve is filled into the standard plane, and the grid formed by the filled curve is encoded. The specific implementation process has been described in the above embodiment and will not be repeated here.
[0081] Optionally, in order to improve the accuracy of trajectory retrieval, this embodiment may set the grid coding accuracy corresponding to the original trajectory data to the highest grid coding accuracy, such as level 30.
[0082] S502 : determining an original coding array of the original trajectory data according to the grid coding result associated with the original trajectory data.
[0083] Specifically, the process of determining the original coding array of the original trajectory data based on the grid coding results associated with the original trajectory data in this step is similar to the process of determining the target coding array of the area to be searched based on the grid coding results associated with the area to be searched described in the above embodiment, and will not be repeated here.
[0084] It should be noted that, since the original trajectory data of this embodiment is composed of a number of trajectory points, each trajectory point is associated with a grid coding result. The grid coding results associated with different trajectory points may be the same or different. In this embodiment, the grid coding results associated with each trajectory point in the original trajectory data may be summarized to obtain the original coding array of the original trajectory data, that is, one original trajectory data corresponds to at least one original coding array.
[0085] S503: Establish an index relationship between the original trajectory data and the original encoding array.
[0086] Specifically, this embodiment can directly establish an inverted index relationship between the original coding array and the original trajectory data, and can also establish an inverted index relationship between the original coding array and the original trajectory number, and a forward index relationship between the original trajectory number and the original trajectory data.
[0087] Optional, such as Figure 5B As shown, in this embodiment, after encoding the original trajectory data and establishing an index relationship between the original trajectory data and the original encoding array, a data storage operation is performed, that is, the established index relationship is stored together with the original trajectory data in the trajectory database.
[0088] S504 , mapping the area to be searched to a standard plane, and performing grid coding on the mapped standard plane using a preset curve.
[0089] S505 , determining a target coding array of the area to be searched according to the grid coding result associated with the area to be searched.
[0090] S506 , determining the target trajectory data associated with the target coding array according to the target coding array and the index relationship between the original trajectory data and the original coding array.
[0091] For example, Figure 5B As shown, in this embodiment, when performing trajectory retrieval, based on the target code array determined in S504-S505, the trajectory database can be queried for the index relationship between the original trajectory data corresponding to the target code array and the original code array, and the target trajectory data associated with the target code array can be determined based on the queried index relationship.
[0092] The solution of the disclosed embodiment processes the original trajectory data, similar to encoding the location points of the area to be searched. It maps the location points in the original trajectory data to a standard plane in the area to be searched, and encodes each location point in the original trajectory data based on a preset curve. This encoding method solves the problem of existing geohash encoding methods, where the encoded one-dimensional distance is close, but the actual two-dimensional distance is far, resulting in inaccurate trajectory retrieval. After encoding, an index relationship is established between the original trajectory data and the original encoding array, facilitating the subsequent rapid retrieval of the original trajectory data contained in the area to be searched.
[0093] Preferably, in the embodiment of the present disclosure, a high-throughput communication interface, namely a representational state transfer style interface Restful API, can be specially set up to realize the communication between the retrieval system and the retrieval requester. Specifically, the trajectory retrieval request containing the area to be retrieved sent by the retrieval requester is received through the representational state transfer style interface Restful API; and / or, the target trajectory data is fed back to the retrieval requester through the Restful API. This embodiment realizes the communication between the retrieval system and the retrieval requester based on the high-throughput Restful API. The advantage of such a setting is that it can improve communication efficiency and is more versatile.
[0094] Figure 6 This is a schematic diagram of the structure of a trajectory retrieval device provided according to an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to the case of retrieving original trajectory data located in the area to be retrieved, and is particularly applicable to the case of retrieving original trajectory data located in the area to be retrieved from a large amount of original trajectory data. The device can be implemented using software and / or hardware, and the device can implement the trajectory retrieval method described in any embodiment of the present disclosure. Figure 6 As shown, the trajectory retrieval device includes:
[0095] A mapping and encoding module 601 is used to map the area to be searched onto a standard plane and perform grid encoding on the mapped standard plane using a preset curve;
[0096] The target array determination module 602 is used to determine the target coding array of the area to be searched based on the grid coding result associated with the area to be searched;
[0097] The target trajectory determination module 603 is configured to determine the target trajectory data associated with the target coding array according to the target coding array and the index relationship between the original trajectory data and the original coding array.
[0098] The solution of the embodiment of the present disclosure uses a preset curve to perform grid coding on the standard plane that maps the area to be searched to determine the target coding array corresponding to the area to be searched, and then retrieves the original trajectory data corresponding to the target coding array as the target trajectory data based on the index relationship between the original trajectory data and the original coding array. The solution of this embodiment provides a new method for grid coding of location points based on a preset curve, which solves the problem of the existing geohash (GeoHash) coding method that the one-dimensional distance after coding is close, but the actual two-dimensional distance is far, resulting in inaccurate trajectory retrieval, thereby improving the efficiency and accuracy of trajectory retrieval. It provides a new idea for spatial trajectory retrieval.
[0099] Furthermore, the mapping encoding module 601 is specifically configured to:
[0100] Determine the standard plane and grid coding accuracy corresponding to the area to be searched;
[0101] The area to be searched is mapped to a standard plane, and according to the grid coding accuracy, a preset curve is filled in the standard plane, and the grid formed after the curve filling is encoded.
[0102] Furthermore, the index relationship between the original trajectory data and the original coding array includes: a reverse index relationship between the original coding array and the original trajectory number, and a forward index relationship between the original trajectory number and the original trajectory data.
[0103] Furthermore, the target trajectory determination module 603 includes:
[0104] a trajectory number indexing unit, configured to determine a target trajectory number associated with the target coding array according to the target coding array and an inverted index relationship between the original coding array and the original trajectory number;
[0105] The trajectory data indexing unit is configured to determine the target trajectory data associated with the target trajectory number according to the target trajectory number and the positive index relationship between the original trajectory number and the original trajectory data.
[0106] Furthermore, if the grid coding accuracy of the target coding array is less than the grid coding accuracy of the original coding array, the track number index unit is specifically used to:
[0107] Determine the original encoding array associated with the target encoding array according to the inclusion relationship between the target encoding array and the original encoding array;
[0108] The target trajectory number associated with the target coding array is determined according to the original coding array associated with the target coding array and the inverted index relationship between the original coding array and the original trajectory number.
[0109] Furthermore, the trajectory retrieval device further includes:
[0110] The mapping and encoding module 601 is further used to map the original trajectory data to a standard plane and perform grid encoding on the mapped standard plane using a preset curve;
[0111] an original array determination module, configured to determine an original coding array of the original trajectory data according to a grid coding result associated with the original trajectory data;
[0112] The index relationship establishing module is used to establish an index relationship between the original trajectory data and the original encoding array.
[0113] Furthermore, the above-mentioned preset curve is a Hilbert curve.
[0114] Furthermore, the trajectory retrieval device further includes a communication module, which is used to:
[0115] Receiving a trajectory search request including a to-be-searched area from a search requester via a Representational State Transfer style interface Restful API; and / or,
[0116] The target trajectory data is fed back to the search requester through the Restful API.
[0117] The above-mentioned product can execute the method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0118] In the technical solutions disclosed herein, the acquisition, storage, and application of any trajectory data involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0119] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0120] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0121] like Figure 7As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. Various programs and data required for the operation of the device 700 can also be stored in the RAM 703. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0122] Various components in device 700 are connected to I / O interface 705, including an input unit 706, such as a keyboard, mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a magnetic disk, optical disk, etc.; and a communication unit 709, such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows device 700 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0123] The computing unit 701 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as the trajectory retrieval method. For example, in some embodiments, the trajectory retrieval method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the trajectory retrieval method described above can be performed. Alternatively, in other embodiments, the computing unit 701 can be configured to perform the trajectory retrieval method by any other suitable means (e.g., via firmware).
[0124] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system comprising at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0125] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0126] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0127] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0128] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0129] A computer system may include a client and a server. The client and server are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services. The server may also be a server in a distributed system or a server integrated with blockchain.
[0130] Artificial intelligence (AI) is the study of how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily encompass computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graphs.
[0131] Cloud computing refers to a technology system that provides network access to elastically scalable shared pools of physical or virtual resources. These resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on-demand in a self-service manner. Cloud computing technology provides efficient and powerful data processing capabilities for the application of technologies such as artificial intelligence and blockchain, as well as for model training.
[0132] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.
[0133] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A trajectory retrieval method, comprising: Map the area to be searched onto the standard plane, and use a preset curve to perform grid encoding on the mapped standard plane; Determine the target coding array of the area to be searched based on the grid coding result associated with the area to be searched; Determining target trajectory data associated with the target coding array according to the target coding array and an index relationship between the original trajectory data and the original coding array; Determining the target trajectory data associated with the target coding array according to the target coding array and the index relationship between the original trajectory data and the original coding array includes: Determining a target trajectory number associated with the target coding array according to the target coding array and an inverted index relationship between the original coding array and the original trajectory number; The target trajectory data associated with the target trajectory number is determined according to the target trajectory number and the positive index relationship between the original trajectory number and the original trajectory data.
2. The method according to claim 1, wherein Mapping the area to be searched to the standard plane and performing grid coding on the mapped standard plane using a preset curve includes: Determine the standard plane and grid coding accuracy corresponding to the area to be searched; The area to be searched is mapped to a standard plane, and according to the grid coding accuracy, a preset curve is filled in the standard plane, and the grid formed after the curve filling is encoded.
3. The method according to claim 1, wherein The index relationship between the original trajectory data and the original coding array includes: a reverse index relationship between the original coding array and the original trajectory number, and a forward index relationship between the original trajectory number and the original trajectory data.
4. The method according to claim 1, wherein If the grid coding accuracy of the target coding array is less than the grid coding accuracy of the original coding array, determining the target trajectory number associated with the target coding array according to the target coding array and the inverted index relationship between the original coding array and the original trajectory number includes: Determine the original encoding array associated with the target encoding array according to the inclusion relationship between the target encoding array and the original encoding array; The target trajectory number associated with the target coding array is determined according to the original coding array associated with the target coding array and the inverted index relationship between the original coding array and the original trajectory number.
5. The method according to claim 1, further comprising: Map the original trajectory data to the standard plane, and use the preset curve to grid encode the mapped standard plane; Determine the original encoding array of the original trajectory data according to the grid encoding result associated with the original trajectory data; An index relationship between the original trajectory data and the original encoding array is established.
6. The method according to any one of claims 1 to 5, wherein The preset curve is a Hilbert curve.
7. The method according to claim 1, further comprising: Receive the trajectory retrieval request containing the area to be retrieved from the retrieval requester through the representational state transfer style interface Restful API; and / or, The target trajectory data is fed back to the search requester through the Restful API.
8. A trajectory retrieval device comprising: A mapping and encoding module is used to map the area to be searched onto a standard plane and perform grid encoding on the mapped standard plane using a preset curve; A target array determination module is used to determine the target coding array of the area to be searched based on the grid coding result associated with the area to be searched; a target trajectory determination module, configured to determine target trajectory data associated with the target coding array based on the target coding array and an index relationship between the original trajectory data and the original coding array; The target trajectory determination module includes: a trajectory number indexing unit, configured to determine a target trajectory number associated with the target coding array according to the target coding array and an inverted index relationship between the original coding array and the original trajectory number; The trajectory data indexing unit is configured to determine the target trajectory data associated with the target trajectory number according to the target trajectory number and the positive index relationship between the original trajectory number and the original trajectory data.
9. The device according to claim 8, wherein The mapping encoding module is specifically used for: Determine the standard plane and grid coding accuracy corresponding to the area to be searched; The area to be searched is mapped to a standard plane, and according to the grid coding accuracy, a preset curve is filled in the standard plane, and the grid formed after the curve filling is encoded.
10. The device according to claim 8, wherein The index relationship between the original trajectory data and the original coding array includes: a reverse index relationship between the original coding array and the original trajectory number, and a forward index relationship between the original trajectory number and the original trajectory data.
11. The device according to claim 8, wherein If the grid coding accuracy of the target coding array is less than the grid coding accuracy of the original coding array, the track number index unit is specifically used to: Determine the original encoding array associated with the target encoding array according to the inclusion relationship between the target encoding array and the original encoding array; The target trajectory number associated with the target coding array is determined according to the original coding array associated with the target coding array and the inverted index relationship between the original coding array and the original trajectory number.
12. The apparatus according to claim 8, further comprising: The mapping and encoding module is further used to map the original trajectory data into a standard plane and perform grid encoding on the mapped standard plane using a preset curve; an original array determination module, configured to determine an original coding array of the original trajectory data according to a grid coding result associated with the original trajectory data; The index relationship establishing module is used to establish an index relationship between the original trajectory data and the original encoding array.
13. The device according to any one of claims 8 to 12, wherein: The preset curve is a Hilbert curve.
14. The apparatus according to claim 8, further comprising a communication module, wherein the communication module is configured to: Receiving a trajectory search request including a to-be-searched area from a search requester via a Representational State Transfer style interface Restful API; and / or, The target trajectory data is fed back to the search requester through the Restful API.
15. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the trajectory retrieval method according to any one of claims 1 to 7.
16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable the computer to execute the trajectory retrieval method according to any one of claims 1 to 7. 17 . A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the trajectory retrieval method according to claim 1 .
Citation Information
Patent Citations
Parallel high-speed railway survey data retrieval method based on grid indexes
CN110297952A
Spatial data indexing method based on GeoSOT global subdivision grid coding
CN112685407A