A path query method and device, electronic equipment, and storage medium

By constructing a path database and querying according to the grid hierarchy, the high complexity of determining whether a point is inside a polygon is solved, achieving fast path querying and resource saving.

CN116303519BActive Publication Date: 2026-04-28ZHIDAO NETWORK TECH (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHIDAO NETWORK TECH (BEIJING) CO LTD
Filing Date
2023-03-24
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing technologies suffer from high time and space complexity in determining whether a point is inside a polygon, resulting in high computational resource consumption and long processing time.

Method used

By pre-constructing a path database, the grid filling results of the target area are obtained, and the path database is queried in descending order of grid level to obtain the target grid path that shares a common grid node with the filled grid. The query is based on the point that is inside the polygon.

Benefits of technology

It significantly reduces algorithm complexity, quickly determines the device path through the target area, and saves computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116303519B_ABST
    Figure CN116303519B_ABST
Patent Text Reader

Abstract

The application discloses a path query method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a grid filling result of a target area, wherein the grid filling result comprises filling grids at multiple grid levels; querying a pre-constructed path database in a high-to-low order of grid levels to acquire a target grid path having a common grid node with the filling grids, wherein the path database comprises multiple device paths, and each device path comprises grid paths at multiple preset grid levels; and obtaining a device path passing through the target area according to the target grid path. The technical scheme can reduce the complexity of point-in-polygon determination calculation and quickly realize path query.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a path query method, apparatus, electronic device, and storage medium. Background Technology

[0002] Currently, location-based service research often involves determining whether a point is inside a polygon. Existing methods mainly include vector product, ray, and area methods. The vector product method involves drawing lines from the test point to each vertex of the polygon. If the sum of the angles formed by these multiple vectors equals 360°, the test point is inside the polygon; otherwise, it is outside. The ray method involves emitting a ray from the test point and counting the number of intersections with the polygon's edges. If the number of intersections is even, the test point is outside; otherwise, it is inside. The area method involves drawing lines from the test point to each vertex of the polygon, forming multiple triangles. If the sum of the areas of all triangles equals the area of ​​the polygon, the test point is inside; otherwise, it is outside.

[0003] The aforementioned calculation methods in the prior art either have high time complexity, space complexity, or high algorithm complexity, resulting in high utilization of computing resources and long processing time. Summary of the Invention

[0004] Based on the aforementioned problems in the prior art, embodiments of this application provide a path query method, apparatus, electronic device, and storage medium to reduce the complexity of determining whether a point is within a polygon and to quickly realize path query.

[0005] The embodiments of this application adopt the following technical solutions:

[0006] In a first aspect, embodiments of this application provide a path query method, the method comprising:

[0007] Obtain the grid filling result of the target area, the grid filling result including the filling grids under multiple grid levels;

[0008] The pre-built path database is queried in descending order of grid level to obtain the target grid path that shares a common grid node with the filling grid. The path database includes multiple device paths, and each device path includes multiple grid paths under a preset grid level.

[0009] The device path passing through the target area is obtained based on the target mesh path.

[0010] Optionally, the plurality of preset grid levels includes multiple levels between a preset highest grid level and a preset lowest grid level, and the plurality of grid levels includes multiple levels that can be filled between the highest grid level and the preset lowest grid level. Before querying the pre-built path database in descending order of grid levels, the method further includes:

[0011] Determine whether the highest fillable grid level is higher than the preset highest grid level;

[0012] If the value is higher, the path database is queried with the preset highest grid level as the first grid level; if the value is not higher, the path database is queried with the highest fillable grid level as the first grid level.

[0013] Optionally, the highest fillable grid level of the target region can be obtained through the following steps:

[0014] Obtain the location of the boundary points of the target area;

[0015] The target area is filled with grids based on the boundary point locations of the target area and the grid filling query method provided by the H3 grid system, and the filling results of the target area at each grid level are obtained. The filling results include filling success information or filling failure information at that grid level.

[0016] The highest fillable grid level is obtained based on the filling results of each grid level.

[0017] Optionally, the path database includes a cache database and a persistent database. The step of querying the pre-built path database in descending order of grid level to obtain target grid paths that share common grid points with the filled grid includes:

[0018] The cache database is queried in descending order of grid hierarchy.

[0019] If the target grid path does not exist in the cache database, the persistent database is queried in descending order of grid level.

[0020] Optionally, the path database can be constructed using the following steps:

[0021] Acquire the device's trajectory data and the H3 geographic index corresponding to each trajectory point;

[0022] Based on the H3 geographic index corresponding to each trajectory point, the grid path of the device under multiple preset grid levels is obtained.

[0023] Optionally, obtaining the grid path of the device under multiple preset grid levels based on the H3 geographic index corresponding to each trajectory point includes:

[0024] Adjacent trajectory points with the same H3 geographic index on the trajectory data are aggregated;

[0025] Based on the H3 geographic index of the aggregated trajectory points, obtain the grid path of the device under multiple preset grid levels.

[0026] Secondly, embodiments of this application also provide a path query device, the device comprising:

[0027] A region filling unit is used to obtain the grid filling result of a target region, wherein the grid filling result includes filling grids under multiple grid levels;

[0028] The path query unit is used to query a pre-built path database in descending order of grid level to obtain target grid paths that share grid nodes with the filling grid. The path database includes multiple device paths, and each device path includes multiple grid paths under a preset grid level.

[0029] The path determination unit is used to obtain the device path passing through the target area based on the target grid path.

[0030] Optionally, the plurality of preset grid levels include multiple levels between a preset highest grid level and a preset lowest grid level. The path query unit is used to determine whether the highest fillable grid level is higher than the preset highest grid level before querying the pre-built path database in descending order of grid levels; if it is higher, the path database is queried with the preset highest grid level as the first grid level; if it is not higher, the path database is queried with the highest fillable grid level as the first grid level.

[0031] Thirdly, embodiments of this application also provide an electronic device, including:

[0032] Processor; and

[0033] A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform a path lookup method.

[0034] Fourthly, embodiments of this application also provide a computer-readable storage medium that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to execute a path query method.

[0035] The above-mentioned technical solutions adopted in this application embodiment can achieve the following beneficial effects: This application embodiment pre-constructs a path database, which includes device paths under multiple preset grid levels. When starting a path query, the filled grids of multiple grid levels corresponding to the target area are first obtained. Then, the path database is queried in descending order of grid level to obtain the target grid path that shares a common grid node with the filled grid. Thus, the device path passing through the target area can be obtained through the target grid path. This application embodiment transforms the calculation of determining whether a point is inside a polygon into a query of common grid nodes, greatly reducing algorithm complexity. The device path passing through the target area can be quickly determined through database query operations, significantly saving computational resources. Attached Figure Description

[0036] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0037] Figure 1 This is a schematic diagram of an Earth grid shown in an embodiment of this application;

[0038] Figure 2 This is a flowchart illustrating a path query method in an embodiment of this application;

[0039] Figure 3 This is a schematic diagram of the grid path shown in the embodiments of this application;

[0040] Figure 4 This is a schematic diagram of the interaction process of the path query system shown in the embodiments of this application;

[0041] Figure 5 This is a schematic diagram illustrating the target grid path query process in an embodiment of this application;

[0042] Figure 6 This is a schematic diagram of the structure of a path query device shown in an embodiment of this application;

[0043] Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0045] Before introducing the embodiments of this application, a brief introduction to the current H3 mesh system will be given to facilitate the subsequent understanding of the various embodiments of this application.

[0046] The H3 grid system is a hexagonal hierarchical indexed grid system, such as Figure 1 As shown, it approximates the Earth as an icosahedron, with hexagons arranged in the same pattern on each face of this spherical dodecahedron. The H3 grid system has a spatial index granularity of 16 grid levels as shown in Table 1:

[0047] Grid hierarchy Side length of a hexagon (kilometers) Grid hierarchy Side length of a hexagon (kilometers) 0 1107.712591 8 0.461354684 1 418.6760055 9 0.174375668 2 158.2446558 10 0.065907807 3 59.81085794 11 0.024910561 4 22.6063794 12 0.009415526 5 8.544408276 13 0.003559893 6 3.229482772 14 0.001348575 7 1.220629759 15 0.000509713

[0048] Table 1

[0049] As shown in Table 1, the granularity is finest at the lowest grid level (i.e., layer 15), with an average side length of 0.509713 meters per grid cell. The granularity is coarsest at the highest grid level (i.e., layer 0), with an average side length of 1107.712591 kilometers per grid cell. Figure 1 As shown, each parent grid corresponds to 7 child grids, and the H3 geographic index occupies a maximum of 63 bits. Its structure is shown in Table 2.

[0050]

[0051] Table 2

[0052] As can be seen from Table 2, for grids with higher grid levels (such as level 0, level 1, level 2, etc.), many of the later positions are unnecessary. Directly performing path queries based on the H3 geographic index will consume a lot of resources and affect query efficiency.

[0053] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0054] This application provides a method for determining whether a point lies within a polygon. This method can be applied to various scenarios. For example, in a geographic information system (GIS), a region can be defined using polygons to represent roads, buildings, parks, etc. When it's necessary to locate certain targets, such as whether a car has passed through a certain road or is located within a certain park, this application can be used for quick querying. Alternatively, when a region is flooded by heavy rain, the rain-covered area can be represented by polygons. This application can then quickly determine which roads are not yet covered by rain and are safe.

[0055] The execution entity of the path query method provided in this application embodiment can be a computing device, server, or cloud platform, etc.; the execution entity of this application embodiment can also be software or hardware. Please refer to... Figure 2 , Figure 2 Taking a server as the executing entity as an example, this application provides a path query method according to its embodiments. Figure 2 As shown, a path query method provided in this application embodiment may include the following steps S210 to S230:

[0056] Step S210: Obtain the grid filling result of the target area, wherein the grid filling result includes the filling grids under multiple grid levels.

[0057] This application aims to improve the efficiency of path query by obtaining the filled grid of the target area at multiple grid levels. The target area refers to the geographical area of ​​interest, which can be a street, supermarket, community, island, etc. In practical applications, those skilled in the art can select the corresponding target area according to business needs.

[0058] like Figure 1 As shown, the number of grids at higher grid levels is much lower than that at lower grid levels. This allows for faster database queries by following the order of grid levels from highest to lowest.

[0059] Multiple grid levels include several levels from the highest fillable grid level to the preset lowest grid level. The highest fillable grid level refers to the grid level corresponding to the largest regular hexagon that can be successfully filled within the target area; that is, the grid level corresponding to the largest inscribed regular hexagon in the target area is the highest grid level corresponding to the target area. Assuming the largest fillable regular hexagon in the target area is the Lth grid level (L is a positive integer less than 15), and the preset lowest grid level is the 15th grid level, this application obtains the filled grids for the Lth grid level, the (L+1)th grid level, ..., the 15th grid level. The filled grid for each grid level can include one or more hexagonal grids.

[0060] Step S220: Query the pre-built path database in descending order of grid level to obtain the target grid path that shares a common grid node with the filling grid. The path database includes multiple device paths, and each device path includes multiple grid paths under a preset grid level.

[0061] This application pre-constructs a path database for devices with planned paths. The device paths in the path database can be understood as planned paths or assigned paths for the devices. The device types in this application are related to the business scenario and include, but are not limited to, vehicles, ships, drones, and robots.

[0062] The path database includes multiple device paths, each represented using a grid path. For example... Figure 3 As shown, to improve path query efficiency, when constructing grid paths, multiple grid levels from the preset highest grid level to the preset lowest grid level are also constructed. The preset highest and lowest grid levels can be reasonably set according to the application scenario and application requirements. For example, the preset highest grid level can be level 10 or 11, and the preset lowest grid level can be level 14 or 15.

[0063] In this way, when querying the database, you can start by querying the grid paths at the same grid level as the highest fillable grid level. If the grid paths at the same grid level do not share any grid nodes with the fillable grid, then you can query the grid paths at the next grid level and the fillable grid to see if they share any grid nodes, until you obtain the target grid path.

[0064] Step S230: Obtain the device path passing through the target area based on the target mesh path.

[0065] like Figure 2 As illustrated by the path query method, this embodiment pre-constructs a path database. The device paths in the database include grid paths under multiple preset grid levels. When starting a path query, the filled grids of multiple grid levels corresponding to the target area are first obtained. Then, the path database is queried in descending order of grid level to obtain the target grid paths that share common grid nodes with the filled grids. Thus, the device paths passing through the target area can be obtained through the target grid paths. This embodiment transforms the calculation of determining whether a point is within a polygon into a query of common grid nodes, greatly reducing algorithm complexity. Device paths passing through the target area can be quickly determined through database queries, significantly saving computational resources.

[0066] As mentioned above, the mesh filling result of the target device includes filled meshes at multiple levels from the highest fillable mesh level to the preset lowest mesh level. The device paths in the path database include mesh paths at multiple levels from the preset highest mesh level to the preset lowest mesh level. In some embodiments of this application, before querying the pre-built path database in descending order of mesh level, the method further includes:

[0067] Determine whether the highest fillable grid level is higher than the preset highest grid level;

[0068] If it is higher, then the path database is queried with the preset highest grid level as the first grid level;

[0069] If it is not higher, then the path database is queried with the highest fillable grid level as the first grid level.

[0070] Before querying the path database, this embodiment should first determine the relationship between the highest fillable grid level corresponding to the target area and the preset highest grid level corresponding to the device path. Based on the relationship between the two, the first grid level for database query is determined to avoid invalid queries and improve query efficiency.

[0071] In some possible implementations of this embodiment, the highest fillable grid level of the target region can be obtained through the following steps:

[0072] Obtain the location of the boundary points of the target area;

[0073] The target area is filled with grids based on the boundary point positions of the target area and the grid filling query method of the H3 grid system, and the filling results of the target area at each grid level are obtained. The filling results include filling success information or filling failure information at that grid level.

[0074] The highest fillable grid level is obtained based on the filling results of each grid level.

[0075] Assuming the target area is a quadrilateral, the coordinates of its four vertices are input into the H3 mesh system's mesh fill query method `h3.polyfillAddress()`. This method queries the fill results for each mesh level. If a hexagonal mesh at a certain level can fill the target area, the method provides a fill success message and the index value of each filled mesh. If a hexagonal mesh at a certain level cannot fill the target area, the method provides a fill failure message. This allows for quick determination of the highest mesh level at which the target area can be successfully filled.

[0076] This application embodiment illustrates an implementation method for obtaining the highest grid level of a fillable grid. In other embodiments, the highest grid level of a fillable grid can also be obtained based on the relationship between the side lengths of the largest inscribed regular hexagon of the target region and the regular hexagons of each grid level.

[0077] In some embodiments of this application, such as Figure 4 As shown, the path database includes a cache database and a persistent database. The cache database is, for example, a Redis database, and the persistent database is, for example, a MySQL database.

[0078] Accordingly, step S120 above, which queries a pre-built path database in descending order of grid level to obtain target grid paths that share grid nodes with the filled grid, includes:

[0079] The cache database is queried in descending order of grid hierarchy.

[0080] If the target grid path does not exist in the cache database, the persistent database is queried in descending order of grid level.

[0081] This embodiment first queries the cache database. If the target grid path does not exist in the cache database, it then queries the persistent database. This reduces the frequency of read operations with the persistent database and improves the path query efficiency to some extent.

[0082] In practical applications, the cache database should be updated regularly. For example, an expiration time should be set for device paths in the cache database, and the expired device paths should be deleted from the cache database when the expiration time is reached. When the target mesh path is obtained from the persistent database, the device path of the target mesh path can be saved to the cache database.

[0083] To comprehensively understand the path query method of this application's embodiments, the following will be combined with... Figure 4 and Figure 5 Let's take vehicle allocation as an example to illustrate.

[0084] Assume a vehicle management platform manages all registered service vehicles, including vehicles such as patrol cars, sweepers, and garbage trucks. Each service vehicle has a pre-assigned route. When allocating service vehicles on the vehicle management platform, it needs to query the service vehicle's route and allocate vehicles appropriately based on the query results.

[0085] like Figure 4The aforementioned method allows for the assignment of driving routes to each service vehicle via the client. During the vehicle registration phase, the server obtains the driving route of each service vehicle through the client. Based on the trajectory data of the driving route, the server can construct the grid path of each service vehicle at grid levels 10 to 14 and write the grid path of each service vehicle into a MySQL database for storage.

[0086] Assuming the target area is street A to be cleaned, when street A needs to be cleaned, the filled grid of street A should be obtained, and the Redis database should be queried based on the filled grid. If the target grid path is not found, the MySQL database should be queried, and the service vehicles of the target grid path found should be assigned to street A to be cleaned.

[0087] Assuming the highest grid level corresponding to street A to be cleaned is grid level 12, a filling grid is constructed for each grid level from grid level 12 to 14. Each grid level's filling grid may include one or more hexagonal grids. When multiple hexagonal grids are included, they can be combined according to certain rules, such as H3 geographic indexing rules, or according to the distribution of the hexagonal grids, such as in a clockwise direction. Alternatively, they can be combined according to a tree structure. This application does not limit the combination method of multiple filling grids.

[0088] like Figure 5 As shown, first, the grid path database for the 12th grid level of the street to be cleaned is searched based on the 12th grid level of the filled grid. If a filled grid and a certain grid path share a common grid node, then the sweeper corresponding to that grid path is the target sweeper. Otherwise, the database for the 13th grid level of the street to be cleaned is searched based on the 13th grid level of the filled grid. If no grid path sharing a common grid node with the filled grid is found, the database for the 14th grid level of the street to be cleaned is searched based on the 14th grid level of the filled grid. If no grid path sharing a common grid node with the filled grid is found at this point, then there is currently no unassigned sweeper.

[0089] In some embodiments of this application, the path database can be constructed through the following steps:

[0090] Acquire the device's trajectory data and the H3 geographic index corresponding to each trajectory point;

[0091] Based on the H3 geographic index corresponding to each trajectory point, the grid path of the device under multiple preset grid levels is obtained.

[0092] like Figure 4As shown, the server obtains the trajectory data of the device through the client. The device can be a vehicle, ship, drone, robot, etc. The trajectory data can be obtained through the device's positioning system. The corresponding H3 geographic index is obtained based on the latitude and longitude information of the trajectory point. The H3 geographic index has a data structure as shown in Table 2. The grid level and the corresponding base grid of the trajectory point can be obtained through the H3 geographic index. Thus, the grid path of the device under multiple preset grid levels can be obtained based on the H3 geographic index corresponding to each trajectory point.

[0093] In some possible implementations of this embodiment, the grid path of the device under multiple preset grid levels is obtained based on the H3 geographic index corresponding to each trajectory point, including:

[0094] Adjacent trajectory points with the same H3 geographic index on the trajectory data are aggregated;

[0095] Based on the H3 geographic index of the aggregated trajectory points, obtain the grid path of the device under multiple preset grid levels.

[0096] For example, such as Figure 3 As shown, assuming all trajectory points correspond to the 15th grid level, adjacent trajectory points with the same base grid index value are aggregated. Each aggregated trajectory point corresponds to a base grid, and the grid path at the 15th grid level can be obtained from the aggregated trajectory point sequence. Then, the parent grid corresponding to each grid node in the 15th grid level grid path is obtained, and adjacent parent grids with the same index value are aggregated. Based on the aggregation result, the grid path at the 14th grid level can be obtained, and so on, to obtain the grid paths at higher grid levels.

[0097] This application embodiment also provides a path query device 600, such as... Figure 6 The diagram shows a schematic representation of a path query device according to an embodiment of this application. The path query device 600 includes: a region filling unit 610, a path query unit 620, and a path determination unit 630, wherein:

[0098] The region filling unit 610 is used to obtain the grid filling result of the target region, the grid filling result including the filling grid under multiple grid levels;

[0099] The path query unit 620 is used to query a pre-built path database in descending order of grid level to obtain target grid paths that share grid nodes with the filling grid. The path database includes multiple device paths, and each device path includes multiple grid paths under a preset grid level.

[0100] The path determination unit 630 is used to obtain the device path passing through the target area based on the target grid path.

[0101] In one embodiment of this application, the plurality of preset grid levels includes a plurality of levels between a preset highest grid level and a preset lowest grid level. The plurality of grid levels includes a plurality of levels between a fillable highest grid level and a preset lowest grid level. The path query unit 620 is configured to determine whether the fillable highest grid level is higher than the preset highest grid level before querying the pre-built path database in descending order of grid levels; if it is higher, the path database is queried with the preset highest grid level as the first grid level; if it is not higher, the path database is queried with the fillable highest grid level as the first grid level.

[0102] In one embodiment of this application, the region filling unit 610 is used to obtain the highest fillable grid level of the target region through the following steps:

[0103] Obtain the boundary point positions of the target area; perform grid filling on the target area based on the boundary point positions and the grid filling query method provided by the H3 grid system, and obtain the filling result of the target area at each grid level, the filling result including filling success information or filling failure information of the grid level; obtain the highest fillable grid level based on the filling result of each grid level.

[0104] In one embodiment of this application, the path database includes a cache database and a persistent database. The path query unit 620 is used to query the cache database in descending order of grid level. If the target grid path does not exist in the cache database, the persistent database is queried in descending order of grid level.

[0105] In one embodiment of this application, the path query device 600 further includes an initialization unit;

[0106] An initialization unit is used to build the path database through the following steps:

[0107] Acquire the device's trajectory data and the H3 geographic index corresponding to each trajectory point; based on the H3 geographic index corresponding to each trajectory point, obtain the grid path of the device under multiple preset grid levels.

[0108] In one embodiment of this application, the initialization unit is further configured to aggregate adjacent trajectory points with the same H3 geographic index on the trajectory data; and obtain the grid path of the device under multiple preset grid levels based on the H3 geographic index of the aggregated trajectory points.

[0109] It is understood that the above-mentioned path query device can implement each step of the path query method provided in the foregoing embodiments. The relevant explanations of the path query method are applicable to the path query device and will not be repeated here.

[0110] Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Please refer to it. Figure 7 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.

[0111] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0112] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.

[0113] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming a trace fusion device at the logical level. The processor executes the program stored in memory and specifically performs the following operations:

[0114] Obtain the grid filling result of the target area, the grid filling result including the filling grids under multiple grid levels;

[0115] The pre-built path database is queried in descending order of grid level to obtain the target grid path that shares a common grid node with the filling grid. The path database includes multiple device paths, and each device path includes multiple grid paths under a preset grid level.

[0116] The device path passing through the target area is obtained based on the target mesh path.

[0117] The above is as stated in this application. Figure 1 The path query device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads the information from the memory and, in conjunction with its hardware, completes the steps of the path lookup method described above.

[0118] The electronic device can also perform Figure 1 The method executed by the path query device, and the implementation of the path query device in... Figure 1 The functions of the embodiments shown are not described in detail here.

[0119] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform... Figure 1 The method executed by the path query device in the illustrated embodiment specifically performs the following operations:

[0120] Obtain the grid filling result of the target area, the grid filling result including the filling grids under multiple grid levels;

[0121] The pre-built path database is queried in descending order of grid level to obtain the target grid path that shares a common grid node with the filling grid. The path database includes multiple device paths, and each device path includes multiple grid paths under a preset grid level.

[0122] The device path passing through the target area is obtained based on the target mesh path.

[0123] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0124] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0125] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0126] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0127] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0128] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0129] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0130] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0131] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0132] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the scope of the claims of this application.

Claims

1. A path query method, characterized in that, The method includes: Obtain the grid filling result of the target area, the grid filling result including the filling grids under multiple grid levels; The pre-built path database is queried in descending order of grid level to obtain the target grid path that shares a common grid node with the filling grid. The path database includes multiple device paths, and each device path includes multiple grid paths under a preset grid level. The device path passing through the target area is obtained based on the target grid path; The multiple grid levels include multiple levels from the highest grid level that can be filled to the preset lowest grid level. The highest grid level that can be filled refers to the grid level that can successfully fill the largest inscribed regular hexagon within the target area. The number of grids at higher grid levels is lower than the number of grids at lower grid levels. The step of querying a pre-built path database in descending order of grid level to obtain target grid paths that share common grid nodes with the filled grid includes: Starting from the highest fillable grid level, query the path database for grid paths at the same grid level; If the grid path at the same grid level does not share a common grid node with the fill grid at the highest fillable grid level, then the query is performed in descending order to check whether the fill grid at the next grid level shares a common grid node with the grid path at the same grid level, until the target grid path is obtained.

2. The path query method as described in claim 1, characterized in that, The multiple preset grid levels include multiple levels from the preset highest grid level to the preset lowest grid level. Before querying the pre-built path database in descending order of grid level, the method further includes: Determine whether the highest fillable grid level is higher than the preset highest grid level; If it is higher, then the path database is queried with the preset highest grid level as the first grid level; If it is not higher, then the path database is queried with the highest fillable grid level as the first grid level.

3. The path query method as described in claim 2, characterized in that, The highest fillable grid level of the target region is obtained through the following steps: Obtain the location of the boundary points of the target area; The target area is filled with grids based on the boundary point locations of the target area and the grid filling query method provided by the H3 grid system, and the filling results of the target area at each grid level are obtained. The filling results include filling success information or filling failure information at that grid level. The highest fillable grid level is obtained based on the filling results of each grid level.

4. The path query method as described in claim 1, characterized in that, The path database includes a cache database and a persistent database. The step of querying the pre-built path database in descending order of grid level to obtain target grid paths that share grid points with the filled grid includes: The cache database is queried in descending order of grid hierarchy. If the target grid path does not exist in the cache database, the persistent database is queried in descending order of grid level.

5. The path query method as described in claim 1, characterized in that, Build the path database using the following steps: Acquire the device's trajectory data and the H3 geographic index corresponding to each trajectory point; Based on the H3 geographic index corresponding to each trajectory point, the grid path of the device under multiple preset grid levels is obtained.

6. The path query method as described in claim 5, characterized in that, The step of obtaining the grid path of the device under multiple preset grid levels based on the H3 geographic index corresponding to each trajectory point includes: Adjacent trajectory points with the same H3 geographic index on the trajectory data are aggregated; Based on the H3 geographic index of the aggregated trajectory points, obtain the grid path of the device under multiple preset grid levels.

7. A path query device, characterized in that, The device includes: A region filling unit is used to obtain the grid filling result of a target region, wherein the grid filling result includes filling grids under multiple grid levels; The path query unit is used to query a pre-built path database in descending order of grid level to obtain target grid paths that share grid nodes with the filling grid. The path database includes multiple device paths, and each device path includes multiple grid paths under a preset grid level. A path determination unit is used to obtain a device path passing through the target area based on the target grid path; The multiple grid levels include multiple levels from the highest grid level that can be filled to the preset lowest grid level. The highest grid level that can be filled refers to the grid level that can successfully fill the largest inscribed regular hexagon within the target area. The number of grids at higher grid levels is lower than the number of grids at lower grid levels. The step of querying a pre-built path database in descending order of grid level to obtain target grid paths that share common grid nodes with the filled grid includes: Starting from the highest fillable grid level, query the path database for grid paths at the same grid level; If the grid path at the same grid level does not share a common grid node with the fill grid at the highest fillable grid level, then the query is performed in descending order to check whether the fill grid at the next grid level shares a common grid node with the grid path at the same grid level, until the target grid path is obtained.

8. The path query device as described in claim 7, characterized in that, The multiple preset grid levels include multiple levels between the preset highest grid level and the preset lowest grid level. The path query unit is used to determine whether the highest fillable grid level is higher than the preset highest grid level before querying the pre-built path database in descending order of grid levels. If it is higher, then the path database is queried with the preset highest grid level as the first grid level; If it is not higher, then the path database is queried with the highest fillable grid level as the first grid level.

9. An electronic device, comprising: processor; as well as A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the path lookup method as described in any one of claims 1 to 6.

10. A computer-readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of applications, cause the electronic device to perform the path lookup method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Network path planning method and device, electronic equipment and storage medium

    CN115329023A

  • Road network generation

    US20160092621A1