[go: up one dir, main page]

CN116303519A - A route query method, device, electronic equipment, and storage medium - Google Patents

A route query method, device, electronic equipment, and storage medium Download PDF

Info

Publication number
CN116303519A
CN116303519A CN202310300399.4A CN202310300399A CN116303519A CN 116303519 A CN116303519 A CN 116303519A CN 202310300399 A CN202310300399 A CN 202310300399A CN 116303519 A CN116303519 A CN 116303519A
Authority
CN
China
Prior art keywords
grid
path
level
database
filling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310300399.4A
Other languages
Chinese (zh)
Inventor
张跃
贺伟伟
郑旭
刘胜平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhidao Network Technology Beijing Co Ltd
Original Assignee
Zhidao Network Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhidao Network Technology Beijing Co Ltd filed Critical Zhidao Network Technology Beijing Co Ltd
Priority to CN202310300399.4A priority Critical patent/CN116303519A/en
Publication of CN116303519A publication Critical patent/CN116303519A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Remote Sensing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

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 under a plurality of grid levels; inquiring a pre-constructed path database according to the sequence from high to low of a grid level, and acquiring a target grid path with grid nodes common to the filling grid, wherein the path database comprises a plurality of equipment paths, and each equipment path comprises a plurality of grid paths under a preset grid level; and obtaining a device path passing through the target area according to the target grid path. According to the technical scheme, the complexity of judging and calculating the points in the polygon can be reduced, and the path query is rapidly realized.

Description

一种路径查询方法、装置和电子设备、存储介质A route query method, device, electronic equipment, and storage medium

技术领域technical field

本申请涉及数据处理技术领域,尤其涉及一种路径查询方法、装置和电子设备、存储介质。The present application relates to the technical field of data processing, and in particular to a path query method, device, electronic equipment, and storage medium.

背景技术Background technique

目前,在基于位置服务的研究中,常常涉及到点在多边形内的判定计算,现有方法主要是通过向量积方法、射线方法和面积方法等。向量积方法,就是从测试点向多边形的每个顶点分别连线,由此形成的多个向量,若这多个向量成的夹角和等于360°,则测试点在多边形内,否则在多边形外。射线方法,就是从测试点发出一条射线,统计它与多边形的边的相交次数,如果相交次数为偶数,则测试点在多边形外;否则,在多边形内。面积方法,就是测试点向多边形的每个顶点分别连线形成多个三角形,若所有三角形的面积和等于多边形的面积,则测试点在多边形内,否则在多边形外。At present, in the research of location-based services, it often involves the determination and calculation of a point within a polygon. The existing methods mainly use the vector product method, ray method and area method. The vector product method is to connect lines from the test point to each vertex of the polygon, and form multiple vectors. If the sum of the angles formed by these multiple vectors is equal to 360°, the test point is in the polygon, otherwise it is in the polygon. outside. The ray method is to send a ray from the test point and count the number of intersections it has with the sides of the polygon. If the number of intersections is even, the test point is outside the polygon; otherwise, it is inside the polygon. The area method is to connect the test point to each vertex of the polygon to form multiple triangles. If the area of all triangles is equal to the area of the polygon, the test point is inside the polygon, otherwise it is outside the polygon.

现有技术的上述计算方法或者具有较高的时间复杂度、空间复杂度或具有较高的算法复杂度,对计算资源的占用率都比较高,且耗时长。The above-mentioned calculation methods in the prior art either have high time complexity, space complexity or high algorithm complexity, occupy a relatively high rate of calculation resources, and take a long time.

发明内容Contents of the invention

基于现有技术中存在的上述问题,本申请实施例提供了一种路径查询方法、装置和电子设备、存储介质,以降低点在多边形内的判定计算的复杂度,快速实现路径查询。Based on the above-mentioned problems in the prior art, the embodiments of the present application provide a path query method, device, electronic equipment, and storage medium to reduce the complexity of calculation for determining whether a point is within a polygon, and quickly implement path query.

本申请实施例采用下述技术方案:The embodiment of the application adopts the following technical solutions:

第一方面,本申请实施例提供一种路径查询方法,所述方法包括:In the first aspect, the embodiment of the present application provides a path query method, the method comprising:

获取目标区域的网格填充结果,所述网格填充结果包括多个网格层级下的填充网格;Obtaining a grid filling result of the target area, where the grid filling result includes filling grids under multiple grid levels;

按照网格层级从高到低顺序查询预先构建的路径数据库,获取与所述填充网格存在共同网格节点的目标网格路径,所述路径数据库包括多个设备路径,每个设备路径包括多个预设网格层级下的网格路径;Query the pre-built path database according to the order of the grid level from high to low, and obtain the target grid path that has a common grid node with the filled grid. The path database includes multiple equipment paths, and each equipment path includes multiple Grid paths under preset grid levels;

根据所述目标网格路径获得经过所述目标区域的设备路径。A device path passing through the target area is obtained according to the target grid path.

可选地,所述多个预设网格层级包括预设最高网格层级至预设最低网格层级之间的多个层级,所述多个网格层级包括可填充最高网格层级至预设最低网格层级之间的多个层级,在按照网格层级从高到低顺序查询预先构建的路径数据库之前,所述方法还包括:Optionally, the plurality of preset grid levels include a plurality of levels between the preset highest grid level to the preset lowest grid level, and the plurality of grid levels include the highest grid level that can be filled to the preset Assuming multiple levels between the lowest grid level, before querying the pre-built path database according to the order of the grid level from high to low, the method further includes:

确定所述可填充最高网格层级是否高于所述预设最高网格层级;determining whether the highest fillable grid level is higher than the preset highest grid level;

若高于,则以所述预设最高网格层级为首个网格层级查询所述路径数据库;若不高于,则以所述可填充最高网格层级为首个网格层级查询所述路径数据库。If it is higher, the path database is queried with the preset highest grid level as the first grid level; if not higher, the path database is queried with the highest fillable grid level as the first grid level .

可选地,通过下述步骤获取所述目标区域的可填充最高网格层级:Optionally, the highest fillable grid level of the target area is obtained through the following steps:

获取目标区域的边界点位置;Obtain the boundary point position of the target area;

根据所述目标区域的边界点位置和H3网格系统提供的网格填充查询方法对所述目标区域进行网格填充,获得所述目标区域在每一网格层级的填充结果,所述填充结果包括该网格层级的填充成功信息或填充失败信息;Perform grid filling on the target area according to the position of the boundary point of the target area 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 Include the filling success information or filling failure information of the grid level;

根据每一网格层级的填充结果获取所述可填充最高网格层级。The highest fillable grid level is obtained according to the filling result of each grid level.

可选地,所述路径数据库包括缓存数据库和持久化数据库,所述按照网格层级从高到低顺序查询预先构建的路径数据库,获取与所述填充网格存在共同网格点的目标网格路径,包括:Optionally, the path database includes a cache database and a persistent database, and the pre-built path database is queried according to the order of the grid level from high to low to obtain a target grid that has a common grid point with the filled grid path, including:

按照网格层级从高到低顺序查询所述缓存数据库;Querying the cache database according to the order of the grid level from high to low;

若所述缓存数据库中不存在所述目标网格路径,则按照网格层级从高到低顺序查询所述持久化数据库。If the target grid path does not exist in the cache database, query the persistent database in descending order of grid levels.

可选地,通过下述步骤构建路径数据库:Optionally, build the route database through the following steps:

获取设备的轨迹数据以及每个轨迹点对应的H3地理索引;Obtain the track data of the device and the H3 geographic index corresponding to each track point;

根据每个轨迹点对应的H3地理索引,获取所述设备在多个预设网格层级下的网格路径。According to the H3 geographic index corresponding to each track point, the grid path of the device under multiple preset grid levels is obtained.

可选地,所述根据每个轨迹点对应的H3地理索引,获取所述设备在多个预设网格层级下的网格路径,包括:Optionally, the obtaining grid paths of the device under multiple preset grid levels according to the H3 geographic index corresponding to each track point includes:

对所述轨迹数据上具有相同H3地理索引的相邻轨迹点进行汇集;Collecting adjacent track points with the same H3 geographic index on the track data;

根据汇集后的轨迹点的H3地理索引,获取设备在多个预设网格层级下的网格路径。According to the H3 geographic index of the collected track points, the grid path of the device under multiple preset grid levels is obtained.

第二方面,本申请实施例还提供一种路径查询装置,所述装置包括:In the second aspect, the embodiment of the present application also provides a path query device, the device includes:

区域填充单元,用于获取目标区域的网格填充结果,所述网格填充结果包括多个网格层级下的填充网格;an area filling unit, configured to obtain a grid filling result of the target area, the grid filling result including filling grids under multiple grid levels;

路径查询单元,用于按照网格层级从高到低顺序查询预先构建的路径数据库,获取与所述填充网格存在共同网格节点的目标网格路径,所述路径数据库包括多个设备路径,每个设备路径包括多个预设网格层级下的网格路径;a path query unit, configured to query a pre-built path database according to the order of the grid level from high to low, and obtain a target grid path that has a common grid node with the filled grid, the path database includes a plurality of device paths, Each device path includes grid paths under multiple preset grid levels;

路径确定单元,用于根据所述目标网格路径获得经过所述目标区域的设备路径。A route determining unit, configured to obtain a device route passing through the target area according to the target grid route.

可选地,所述多个预设网格层级包括预设最高网格层级至预设最低网格层级之间的多个层级,路径查询单元,用于在按照网格层级从高到低顺序查询预先构建的路径数据库之前,确定所述可填充最高网格层级是否高于所述预设最高网格层级;若高于,则以所述预设最高网格层级为首个网格层级查询所述路径数据库;若不高于,则以所述可填充最高网格层级为首个网格层级查询所述路径数据库。Optionally, the plurality of preset grid levels include a plurality of levels between the preset highest grid level and the preset lowest grid level, and the path query unit is used to perform a sequence of grid levels from high to low. Before querying the pre-built route database, determine whether the highest grid level that can be filled is higher than the preset highest grid level; if higher, use the preset highest grid level as the first grid level query If it is not higher than the path database, query the path database with the highest grid level that can be filled as the first grid level.

第三方面,本申请实施例还提供一种电子设备,包括:In a third aspect, the embodiment of the present application further provides an electronic device, including:

处理器;以及processor; and

被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行路径查询方法。A memory arranged to store computer-executable instructions which, when executed, cause the processor to perform a path-finding method.

第四方面,本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储一个或多个程序,所述一个或多个程序当被包括多个应用程序的电子设备执行时,使得所述电子设备执行路径查询方法。In a fourth aspect, the embodiment of the present application further provides a computer-readable storage medium, the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by an electronic device including multiple application programs , causing the electronic device to execute the path query method.

本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:本申请实施例预先构建路径数据库,路径数据库中的设备路径包括多个预设网格层级下的网格路径,在开始路径查询时,先获取目标区域对应的多个网格层级的填充网格,然后按照网格层级从高到低顺序查询路径数据库,得到与填充网格存在共同网格节点的目标网格路径,由此可以通过目标网格路径获得经过目标区域的设备路径。本申请实施例将点在多边形内的判断计算转化为共同网格节点的查询,极大的降低了算法复杂度,通过数据库查询操作就能够快速确定出经过目标区域的设备路径,显著节省了计算资源。The above-mentioned at least one technical solution adopted by the embodiment of the present application can achieve the following beneficial effects: the embodiment of the present application pre-builds a path database, and the device paths in the path database include grid paths under a plurality of preset grid levels. When , the filling grids of multiple grid levels corresponding to the target area are obtained first, and then the path database is queried according to the order of the grid levels from high to low, and the target grid path with the same grid node as the filling grid is obtained. The device path through the target area can be obtained through the target grid path. The embodiment of the present application converts the judgment calculation of the point within the polygon into the query of the common grid node, which greatly reduces the complexity of the algorithm, and the device path passing through the target area can be quickly determined through the database query operation, which significantly saves calculation resource.

附图说明Description of drawings

此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the application and constitute a part of the application. The schematic embodiments and descriptions of the application are used to explain the application and do not constitute an improper limitation to the application. In the attached picture:

图1为本申请实施例中示出的一种地球网格示意图;Fig. 1 is a schematic diagram of a kind of earth grid shown in the embodiment of the present application;

图2为本申请实施例中示出的一种路径查询方法流程图;FIG. 2 is a flow chart of a path query method shown in the embodiment of the present application;

图3为本申请实施例中示出的网格路径示意图;FIG. 3 is a schematic diagram of a grid path shown in an embodiment of the present application;

图4为本申请实施例中示出的路径查询系统的交互过程示意图;FIG. 4 is a schematic diagram of the interactive process of the path query system shown in the embodiment of the present application;

图5为本申请实施例中示出的目标网格路径查询过程示意图;FIG. 5 is a schematic diagram of the target grid path query process shown in the embodiment of the present application;

图6为本申请实施例中示出的一种路径查询装置的结构示意图;FIG. 6 is a schematic structural diagram of a route query device shown in an embodiment of the present application;

图7为本申请实施例中一种电子设备的结构示意图。FIG. 7 is a schematic structural diagram of an electronic device in an embodiment of the present application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and corresponding drawings. Apparently, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

在介绍本申请实施例之前,先对目前的H3网格系统进行简单介绍,使得后续便于理解本申请各个实施例。Before introducing the embodiments of the present application, a brief introduction to the current H3 grid system is given to facilitate the understanding of various embodiments of the present application.

H3网格系统是一种六边形分层索引网格系统,如图1所示,其将地球近似为一个二十面体,在这个球形十二面体的每个面上都有相同排列方式的六边形。H3网格系统具有如表1所示的16个网格层级的空间索引粒度:The H3 grid system is a hexagonal hierarchical index grid system, as shown in Figure 1, which approximates the earth as an icosahedron, and each face of the spherical dodecahedron has the same arrangement of hexagon. The H3 grid system has a spatial index granularity of 16 grid levels as shown in Table 1:

网格层级grid level 六边形边长(千米)Hexagon side length (km) 网格层级grid level 六边形边长(千米)Hexagon side length (km) 00 1107.7125911107.712591 88 0.4613546840.461354684 11 418.6760055418.6760055 99 0.1743756680.174375668 22 158.2446558158.2446558 1010 0.0659078070.065907807 33 59.8108579459.81085794 1111 0.0249105610.024910561 44 22.606379422.6063794 1212 0.0094155260.009415526 55 8.5444082768.544408276 1313 0.0035598930.003559893 66 3.2294827723.229482772 1414 0.0013485750.001348575 77 1.2206297591.220629759 1515 0.0005097130.000509713

表1Table 1

从表1可知,在最低网格层级(即第15层)的粒度最细,平均每个网格的平均边长为0.509713米,在最高网格层次(即第0层)的粒度最粗,平均每个网格的平均边长为1107.712591千米。如图1所示,每个父亲网格对应7个子网格,H3地理索引最多占63个比特位,其结构如表2所示:It can be seen from Table 1 that the granularity at the lowest grid level (that is, the 15th layer) is the finest, and the average side length of each grid is 0.509713 meters, and the granularity at the highest grid level (that is, the 0th layer) is the coarsest. The average side length of each grid is 1107.712591 km. As shown in Figure 1, each parent grid corresponds to 7 sub-grids, and the H3 geographic index occupies a maximum of 63 bits. Its structure is shown in Table 2:

Figure BDA0004144969900000051
Figure BDA0004144969900000051

表2Table 2

从表2中可以看出,对于网格层级较高(如第0层,第1层,第2层等)的网格,后面很多位是不需要的,直接基于H3地理索引进行路径查询会占用较多资源,影响查询效率。It can be seen from Table 2 that for grids with higher grid levels (such as layer 0, layer 1, layer 2, etc.), many bits behind are unnecessary, and path query directly based on the H3 geographic index will It takes up more resources and affects query efficiency.

以下结合附图,详细说明本申请各实施例提供的技术方案。The technical solutions provided by various embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.

本申请提供的是一种点在多边形内的判定计算的方法,能够用于诸多场景,例如,在地理信息系统中,对于一个区域的道路、楼房、公园等以多边形方式进行区域限定,当需要对某些目标进行定位时,如某辆汽车是否经过某条道路,或位于某个公园内等时,则可以使用本申请进行快速查询。或者当暴雨浸漫一个区域时,雨水覆盖的区域可用多边形表达,则使用本申请可快速知道哪些道路还没有被雨水覆盖、是安全的。This application provides a method for determining and calculating a point within a polygon, which can be used in many scenarios. For example, in a geographic information system, the area is limited by polygons for roads, buildings, parks, etc. in an area. When locating certain targets, such as whether a certain car passes a certain road, or is located in a certain park, etc., this application can be used for quick query. Or when the rainstorm floods an area, the area covered by rainwater can be expressed by polygons, and then using this application can quickly know which roads are not covered by rainwater and are safe.

本申请实施例提供的路径查询方法的执行主体可以是计算设备、服务器或者云平台等等;其中本申请实施例的执行主体也可以是软件或硬件。请参考图2,图2以执行主体为服务器为例,对本申请实施例提供的一种路径查询方法进行介绍。如图2所示,本申请实施例提供的一种路径查询方法可以包括以下步骤S210至步骤S230:The execution subject of the path query method provided by the embodiment of the present application may be a computing device, server, or cloud platform; the execution subject of the embodiment of the present application may also be software or hardware. Please refer to FIG. 2 . FIG. 2 introduces a path query method provided in the embodiment of the present application by taking the execution subject as a server as an example. As shown in Figure 2, a route query method provided in the embodiment of the present application may include the following steps S210 to S230:

步骤S210,获取目标区域的网格填充结果,所述网格填充结果包括多个网格层级下的填充网格。Step S210, acquiring a grid filling result of the target area, the grid filling result including filling grids under multiple grid levels.

本申请为提高路径查询效率,获取目标区域在多个网格层级下的填充网格,目标区域是指感兴趣的地理区域,可以为街道、超市、社区、岛屿等,在实际应用中,本领域技术人员可以根据业务需求选择相应的目标区域。In order to improve the route query efficiency, this application obtains the filled grids of the target area at multiple grid levels. The target area refers to the geographical area of interest, which can be streets, supermarkets, communities, islands, etc. In practical applications, this application Field technicians can select the corresponding target area according to business needs.

如图1所示,高网格层级下的网格数量远远低于低网格层级下的网格数量,这样在进行数据库查询时,可以按照网格层级从高到低的查询顺序进行快速查询。As shown in Figure 1, the number of grids at the high grid level is much lower than that at the low grid level, so that when performing database queries, the grid level can be quickly searched in the order of the grid level from high to low. Inquire.

多个网格层级包括可填充最高网格层级至预设最低网格层级之间的多个层级,其中,可填充最高网格层级是指能成功填充到目标区域内的最大正六边形所对应的网格层级,即目标区域的最大内接正六边形对应的网格层级即为目标区域对应的最高网格层级。假设目标区域可填充的最大正六边形为第L(L是小于15的正整数)网格层级,预设最低网格层级为第15网格层级,那么本申请获取第L网格层级、第L+1网格层级…,第15网格层级的填充网格,每一网格层级的填充网格可以包括一个或多个六边形网格。The multiple grid levels include multiple levels between the highest fillable grid level and the preset lowest grid level, where the highest fillable grid level refers to the largest regular hexagon that can be successfully filled into the target area The grid level of 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 that the largest regular hexagon that can be filled in the target area is the Lth (L is a positive integer less than 15) grid level, and the preset minimum grid level is the 15th grid level, then this application obtains the Lth grid level, the L+1 grid level . . . , the filling grid of the 15th grid level, the filling grid of each grid level may include one or more hexagonal grids.

步骤S220,按照网格层级从高到低顺序查询预先构建的路径数据库,获取与所述填充网格存在共同网格节点的目标网格路径,所述路径数据库包括多个设备路径,每个设备路径包括多个预设网格层级下的网格路径。Step S220, query the pre-built path database according to the order of the grid level from high to low, and obtain the target grid path that has a common grid node with the filled grid. The path database includes multiple device paths, and each device The paths include grid paths under multiple preset grid levels.

本申请事先为具有规划路径的设备构建路径数据库,路径数据库中的设备路径可以理解为设备的规划路径或设备的分配路径等。本申请中的设备类型与业务场景相关,包括但不限于车辆、船舶、无人机、机器人等。This application builds a route database for devices with planned routes in advance, and the device routes in the route database can be understood as planned routes of devices or distribution routes of devices. The device types in this application are related to business scenarios, including but not limited to vehicles, ships, drones, robots, etc.

其中,路径数据库包括多个设备路径,每个设备路径采用网格路径进行表示。如图3所示,为提高路径查询效率,在构建网格路径时,同样构建从预设最高网格层级至预设最低网格层级的多个网格层级下的网格路径。预设最高网格层级和预设最低网格层级可以根据应用场景和应用需求合理设置,例如预设最高网格层级为第10级或第11级,预设最低网格层级为第14级或第15级。Wherein, the path database includes multiple device paths, and each device path is represented by a grid path. As shown in FIG. 3 , in order to improve the route query efficiency, when constructing the grid path, the grid paths under multiple grid levels from the preset highest grid level to the preset lowest grid level are also constructed. The preset highest grid level and the preset lowest grid level can be reasonably set according to the application scenario and application requirements, for example, the preset highest grid level is level 10 or 11, and the preset lowest grid level is level 14 or Level 15.

这样在查询数据库时,可以从可填充最高网格层级开始查询数据库中同等网格层级下的网格路径,若同等网格层级下的网格路径与填充网格不存在共同网格节点,则按照查询顺序查询下一网格层级下的网格路径和填充网格是否存在共同网格节点,直至获得目标网格路径。In this way, when querying the database, the grid path at the same grid level in the database can be queried from the highest grid level that can be filled. If there is no common grid node between the grid path at the same grid level and the filled grid, then Query whether there is a common grid node between the grid path and the filling grid under the next grid level according to the query order, until the target grid path is obtained.

步骤S230,根据所述目标网格路径获得经过所述目标区域的设备路径。Step S230, obtaining a device path passing through the target area according to the target grid path.

如图2所示的路径查询方法可知,本实施例预先构建路径数据库,路径数据库中的设备路径包括多个预设网格层级下的网格路径,在开始路径查询时,先获取目标区域对应的多个网格层级的填充网格,然后按照网格层级从高到低顺序查询路径数据库,得到与填充网格存在共同网格节点的目标网格路径,由此可以通过目标网格路径获得经过目标区域的设备路径。本实施例将点在多边形内的判断计算转化为共同网格节点的查询,极大的降低了算法复杂度,通过数据库查询操作就能够快速确定出经过目标区域的设备路径,显著节省了计算资源。From the path query method shown in Figure 2, it can be seen that this embodiment pre-builds a path database, and the device paths in the path database include grid paths under multiple preset grid levels. When starting the path query, first obtain the corresponding The filled grids of multiple grid levels, and then query the path database according to the order of the grid levels from high to low, and obtain the target grid path with the same grid node as the filled grid, so that it can be obtained through the target grid path The device path through the target zone. This embodiment converts the judgment calculation of the point within the polygon into the query of the common grid node, which greatly reduces the complexity of the algorithm, and can quickly determine the device path passing through the target area through the database query operation, which significantly saves computing resources. .

如前所述,目标设备的网格填充结果包括从可填充最高网格层级至预设最低网格层级之间的多个层级下的填充网格,路径数据库中的设备路径包括从预设最高网格层级至预设最低网格层级的多个层级下的网格路径,在本申请的一些实施例中,在按照网格层级从高到低顺序查询预先构建的路径数据库之前,所述方法还包括:As mentioned above, the grid filling result of the target device includes filling grids at multiple levels from the highest grid level that can be filled to the preset lowest grid level, and the device paths in the path database include The grid paths under multiple levels from the grid level to the preset lowest grid level. In some embodiments of the present application, before querying the pre-built path database according to the order of the grid level from high to low, the method Also includes:

确定所述可填充最高网格层级是否高于所述预设最高网格层级;determining whether the highest fillable grid level is higher than the preset highest grid level;

若高于,则以所述预设最高网格层级为首个网格层级查询所述路径数据库;If higher, querying the route database with the preset highest grid level as the first grid level;

若不高于,则以所述可填充最高网格层级为首个网格层级查询所述路径数据库。If not, query the path database with the highest fillable grid level as the first grid level.

本实施例在查询路径数据库之前,应先判断目标区域对应的可填充最高网格层级与设备路径对应的预设最高网格层级的关系,根据两者的关系,确定数据库查询的首个网格层级,避免无效查询,提高查询效率。In this embodiment, before querying the path database, the relationship between the highest fillable grid level corresponding to the target area and the preset highest grid level corresponding to the device path should be judged first, and the first grid for database query should be determined according to the relationship between the two Hierarchy to avoid invalid queries and improve query efficiency.

在本实施例的一些可实现方案中,可以通过下述步骤获取所述目标区域的可填充最高网格层级:In some implementable solutions of this embodiment, the highest fillable grid level of the target area may be obtained through the following steps:

获取目标区域的边界点位置;Obtain the boundary point position of the target area;

根据所述目标区域的边界点位置和H3网格系统的网格填充查询方法对所述目标区域进行网格填充,获得所述目标区域在每一网格层级的填充结果,所述填充结果包括该网格层级的填充成功信息或填充失败信息;Carry out grid filling on the target area according to the position of the boundary point of the target area and the grid filling query method of the H3 grid system, and obtain the filling result of the target area at each grid level, and the filling result includes Filling success information or filling failure information of the grid level;

根据每一网格层级的填充结果获取所述可填充最高网格层级。The highest fillable grid level is obtained according to the filling result of each grid level.

假设目标区域为四边形,则将四边形的四个顶点坐标输入到H3网格系统的网格填充查询方法h3.polyfillAddress(),通过该方法可以查询每一网格层级的填充结果,若某一网格层级的六边形网格能够填充到目标区域内,则该方法给出填充成功信息及每个填充网格的索引值。若某一网格层级的六边形网格不能够填充到目标区域内,则该方法给出填充失败信息。如此可以快速确定目标区域能够被成功填充的最高网格层级。Assuming that the target area is a quadrilateral, input the coordinates of the four vertices of the quadrilateral into the grid filling query method h3.polyfillAddress() of the H3 grid system. Through this method, the filling result of each grid level can be queried. If the hexagonal grid at the grid level can be filled into the target area, then this method gives the filling success information and the index value of each filled grid. If the hexagonal grid of a certain grid level cannot be filled into the target area, the method will give a filling failure message. This quickly determines the highest mesh level at which the target area can be successfully filled.

本申请实施例在此示出了一种获取可填充网格的最高网格层级的实现方法,在其他实施例中,也可以基于目标区域的最大内接正六边形与各网格层级的正六边形的边长关系,得到可填充最高网格层级。The embodiment of the present application shows an implementation method of obtaining the highest grid level of the grid that can be filled. In other embodiments, it can also be based on the largest inscribed regular hexagon of the target area and the regular hexagon of each grid level. The side length relationship of the polygon is obtained to obtain the highest grid level that can be filled.

在本申请的一些实施例中,如图4所示,路径数据库包括缓存数据库和持久化数据库,缓存数据库例如为Redis数据库,持久化数据库例如为Mysql数据库等。In some embodiments of the present application, as shown in FIG. 4 , 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.

相应的,上述步骤S120,按照网格层级从高到低顺序查询预先构建的路径数据库,获取与所述填充网格存在共同网格节点的目标网格路径,包括:Correspondingly, in the above step S120, query the pre-built path database according to the order of the grid level from high to low, and obtain the target grid path that has a common grid node with the filled grid, including:

按照网格层级从高到低顺序查询所述缓存数据库;Querying the cache database according to the order of the grid level from high to low;

若所述缓存数据库中不存在所述目标网格路径,则按照网格层级从高到低顺序查询所述持久化数据库。If the target grid path does not exist in the cache database, query the persistent database in descending order of grid levels.

本实施例先查询缓存数据库,在缓存数据库中不存在目标网格路径时,再查询持久化数据库,能够降低与持久化数据库的读操作频率,在一定程度上提高路径查询效率。In this embodiment, the cache database is queried first, and then the persistent database is queried when there is no target grid path in the cache database, which can reduce the frequency of read operations with the persistent database and improve path query efficiency to a certain extent.

在实际应用中,还应定期更新缓存数据库,例如为缓存数据库中的设备路径设置过期时间,在达到过期时间时,从缓存数据库中删除过期的设备路径。当从持久化数据库中获得目标网格路径时,可以将目标网格路径的设备路径保存到缓存数据库中。In practical applications, the cache database should also be updated regularly, for example, an expiration time is set for the device path in the cache database, and when the expiration time is reached, the expired device path is deleted from the cache database. When the target grid path is obtained from the persistent database, the device path of the target grid path may be saved in the cache database.

为遍历理解本申请实施例的路径查询方法,下面结合图4和图5,以车辆分配为例进行说明。In order to comprehensively understand the route query method of the embodiment of the present application, the vehicle allocation is taken as an example for illustration below in conjunction with FIG. 4 and FIG. 5 .

假设车辆管理平台管理所有注册的服务车辆,服务车辆例如包括巡逻车、清扫车、垃圾回收车等车辆。每个服务车辆具有事先分配的行驶路线,在车辆管理平台进行服务车辆分配时,需要对服务车辆的行驶路径进行查询,基于查询结果合理分配车辆。It is assumed that the vehicle management platform manages all registered service vehicles, such as patrol cars, sweepers, garbage collection vehicles and other vehicles. Each service vehicle has a pre-assigned driving route. When allocating service vehicles on the vehicle management platform, it is necessary to query the driving route of the service vehicle, and allocate vehicles reasonably based on the query results.

如图4所述,可以通过客户端为每个服务车辆分配行驶路径,在车辆注册阶段,服务器通过客户端获取每个服务车辆的行驶路径,根据行驶路径的轨迹数据能够构建出每个服务车辆在第10~14网格层级下的网格路径,并将每个服务车辆的网格路径写入到Mysql数据库进行保存。As shown in Figure 4, each service vehicle can be assigned a driving route through the client. In the vehicle registration stage, the server obtains the driving route of each service vehicle through the client, and can construct each service vehicle according to the trajectory data of the driving route. The grid path under the 10th to 14th grid level, and the grid path of each service vehicle is written into the Mysql database for storage.

假设目标区域为待清扫街道A,如此,当需要对待清扫街道A进行清扫时,应获取待清扫街道A的填充网格,根据填充网格查询Redis数据库,若没有查询到目标网格路径,则查询Mysql数据库,将查询到的目标网格路径的服务车辆分配到待清扫街道A进行清扫。Suppose the target area is the street A to be cleaned. In this way, when the street A to be cleaned needs to be cleaned, the filled grid of the street A to be cleaned should be obtained, and the Redis database can be queried according to the filled grid. If the target grid path is not found, then Query the Mysql database, and assign the service vehicles of the queried target grid path to the street A to be cleaned for cleaning.

假设待清扫街道A对应的最高网格层级为第12网格层级,则构建出从第12~14网格层级下每一网格层级的填充网格,每一网格层级的填充网格可以包括一个或多个六边形网格,当包括多个六边形网格时,可以按照一定规则将多个六边形网格组合,例如根据H3地理索引规则,或者根据六边形网格的分布状态进行组合,例如按照顺时针方向组合。当然,也可以按照树形结构进行组合。本申请实施例不限定多个填充网格的组合方式。Assuming that the highest grid level corresponding to the street A to be cleaned is the 12th grid level, the filling grids of each grid level under the 12th to 14th grid levels are constructed, and the filling grids of each grid level can be Contains one or more hexagonal grids. When multiple hexagonal grids are included, multiple hexagonal grids can be combined according to certain rules, such as according to H3 geographic index rules, or according to hexagonal grids Combination of the distribution state, for example, in a clockwise direction. Of course, it can also be combined in a tree structure. The embodiment of the present application does not limit the combination manner of multiple filling grids.

如图5所示,先根据待清扫街道A的第12网格层级的填充网格查询路径数据库中第12网格层级的网格路径,若查询到填充网格与某个网格路径存在共同网格节点,则该网格路径对应的清扫车为目标清扫车。否则,再根据待清扫街道A的第13网格层级的填充网格查询路径数据库中第13网格层级的网格路径,若没有查询到与填充网格存在共同网格节点的网格路径,则继续根据待清扫街道A的第14网格层级的填充网格查询路径数据库中第14网格层级的网格路径,若此时仍然没有查询到与填充网格存在共同网格节点的网格路径,则当前不存在未分配的清扫车。As shown in Figure 5, first query the grid path of the 12th grid level in the path database according to the filling grid of the 12th grid level of the street A to be cleaned. grid node, the sweeper corresponding to the grid path is the target sweeper. Otherwise, query the grid path of the 13th grid level in the path database according to the filling grid of the 13th grid level of the street A to be cleaned, if there is no grid path with a common grid node with the filling grid, Then continue to query the grid path of the 14th grid level in the route database according to the filling grid of the 14th grid level of the street A to be cleaned, if there is still no grid with the same grid node as the filling grid at this time path, there is currently no unassigned sweeper.

在本申请的一些实施例中,可以通过下述步骤构建路径数据库:In some embodiments of the present application, the route database may be constructed through the following steps:

获取设备的轨迹数据以及每个轨迹点对应的H3地理索引;Obtain the track data of the device and the H3 geographic index corresponding to each track point;

根据每个轨迹点对应的H3地理索引,获取所述设备在多个预设网格层级下的网格路径。According to the H3 geographic index corresponding to each track point, the grid path of the device under multiple preset grid levels is obtained.

如图4所示,服务器通过客户端获取设备的轨迹数据,设备例如为车辆、船舶、无人机、机器人等,可以通过设备的定位系统获取轨迹数据,根据轨迹点的经纬度信息得到相应H3地理索引,H3地理索引具有如表2形式的数据结构,通过H3地理索引可以得到轨迹点对应的网格层级和对应的基网格,由此可以根据每个轨迹点对应的H3地理索引,获取设备在多个预设网格层级下的网格路径。As shown in Figure 4, the server obtains the trajectory data of the device through the client. The device is such as a vehicle, ship, drone, robot, etc. The trajectory data can be obtained through the positioning system of the device, and the corresponding H3 geographic location can be obtained according to the latitude and longitude information of the trajectory point. Index, the H3 geographic index has a data structure in the form of Table 2. Through the H3 geographic index, the grid level corresponding to the track point and the corresponding base grid can be obtained, so that the device can be obtained according to the H3 geographic index corresponding to each track point. Grid paths at multiple preset grid levels.

在本实施例的一些可能实现方案中,根据每个轨迹点对应的H3地理索引,获取所述设备在多个预设网格层级下的网格路径,包括:In some possible implementations of this embodiment, according to the H3 geographic index corresponding to each track point, the grid path of the device under multiple preset grid levels is obtained, including:

对所述轨迹数据上具有相同H3地理索引的相邻轨迹点进行汇集;Collecting adjacent track points with the same H3 geographic index on the track data;

根据汇集后的轨迹点的H3地理索引,获取设备在多个预设网格层级下的网格路径。According to the H3 geographic index of the collected track points, the grid path of the device under multiple preset grid levels is obtained.

举例来说,如图3所示,假设所有轨迹点对应的网格层级均为第15网格层级,对轨迹数据上具有相同基网格的索引值的相邻轨迹点进行汇集,这样汇集后的每个轨迹点对应一个基网格,根据汇集后的轨迹点序列即可得到第15网格层级的网格路径。再获取第15网格层级的网格路径中每个网格节点对应的父亲网格,将具有相同索引值的相邻父亲网格进行汇聚,根据汇集结果能够获得第14网格层级的网格路径,依此可以得到更高网格层级的网格路径。For example, as shown in Figure 3, assuming that the grid level corresponding to all trajectory points is the 15th grid level, the adjacent trajectory points with the same index value of the base grid on the trajectory data are collected, so that after the aggregation Each trajectory point of corresponds to a base grid, and the grid path of the 15th grid level can be obtained according to the collected trajectory point sequence. Then obtain the parent grid corresponding to each grid node in the grid path of the 15th grid level, gather the adjacent parent grids with the same index value, and obtain the grid of the 14th grid level according to the aggregation result The path, and the grid path of a higher grid level can be obtained according to this.

本申请实施例还提供了一种路径查询装置600,如图6所示,提供了本申请实施例中一种路径查询装置的结构示意图,所述路径查询装置600包括:区域填充单元610、路径查询单元620和路径确定单元630,其中:The embodiment of the present application also provides a path query device 600. As shown in FIG. 6, a schematic structural diagram of a path query device in the embodiment of the present application is provided. The query unit 620 and the path determination unit 630, wherein:

区域填充单元610,用于获取目标区域的网格填充结果,所述网格填充结果包括多个网格层级下的填充网格;An area filling unit 610, configured to obtain a grid filling result of the target area, the grid filling result including filling grids under multiple grid levels;

路径查询单元620,用于按照网格层级从高到低顺序查询预先构建的路径数据库,获取与所述填充网格存在共同网格节点的目标网格路径,所述路径数据库包括多个设备路径,每个设备路径包括多个预设网格层级下的网格路径;The path query unit 620 is configured to query the pre-built path database according to the order of the grid level from high to low, and obtain a target grid path that has a common grid node with the filled grid, and the path database includes multiple device paths , each device path includes grid paths under multiple preset grid levels;

路径确定单元630,用于根据所述目标网格路径获得经过所述目标区域的设备路径。A path determination unit 630, configured to obtain a device path passing through the target area according to the target grid path.

在本申请的一个实施例中,所所述多个预设网格层级包括预设最高网格层级至预设最低网格层级之间的多个层级,所述多个网格层级包括可填充最高网格层级至预设最低网格层级之间的多个层级,路径查询单元620,用于在按照网格层级从高到低顺序查询预先构建的路径数据库之前,确定所述可填充最高网格层级是否高于所述预设最高网格层级;若高于,则以所述预设最高网格层级为首个网格层级查询所述路径数据库;若不高于,则以所述可填充最高网格层级为首个网格层级查询所述路径数据库。In one embodiment of the present application, the plurality of preset grid levels include a plurality of levels between the preset highest grid level and the preset lowest grid level, and the plurality of grid levels include fillable For multiple levels between the highest grid level and the preset lowest grid level, the path query unit 620 is used to determine the highest grid level that can be filled before querying the pre-built path database according to the grid level from high to low. Whether the grid level is higher than the preset highest grid level; if higher, then use the preset highest grid level as the first grid level to query the path database; if not higher, use the fillable The highest grid level is the first grid level to query the route database.

在本申请的一个实施例中,区域填充单元610,用于通过下述步骤获取所述目标区域的可填充最高网格层级:In one embodiment of the present application, the area filling unit 610 is configured to obtain the highest fillable grid level of the target area through the following steps:

获取目标区域的边界点位置;根据所述目标区域的边界点位置和H3网格系统提供的网格填充查询方法对所述目标区域进行网格填充,获得所述目标区域在每一网格层级的填充结果,所述填充结果包括该网格层级的填充成功信息或填充失败信息;根据每一网格层级的填充结果获取所述可填充最高网格层级。Obtain the position of the boundary point of the target area; perform grid filling on the target area according to the position of the boundary point of the target area and the grid filling query method provided by the H3 grid system, and obtain the grid level of the target area at each grid level The filling result of the grid level includes the filling success information or filling failure information of the grid level; the highest grid level that can be filled is obtained according to the filling result of each grid level.

在本申请的一个实施例中,所述路径数据库包括缓存数据库和持久化数据库,路径查询单元620,用于按照网格层级从高到低顺序查询所述缓存数据库;若所述缓存数据库中不存在所述目标网格路径,则按照网格层级从高到低顺序查询所述持久化数据库。In one embodiment of the present application, the path database includes a cache database and a persistent database, and the path query unit 620 is configured to query the cache database in descending order of the grid level; if there is no If the target grid path exists, the persistent database is queried in order of grid levels from high to low.

在本申请的一个实施例中,路径查询装置600还包括初始化单元;In an embodiment of the present application, the path query device 600 further includes an initialization unit;

初始化单元,用于通过下述步骤构建路径数据库:The initialization unit is used to build the path database through the following steps:

获取设备的轨迹数据以及每个轨迹点对应的H3地理索引;根据每个轨迹点对应的H3地理索引,获取所述设备在多个预设网格层级下的网格路径。Obtain the track data of the device and the H3 geographic index corresponding to each track point; obtain the grid path of the device under multiple preset grid levels according to the H3 geographic index corresponding to each track point.

在本申请的一个实施例中,初始化单元,还用于对所述轨迹数据上具有相同H3地理索引的相邻轨迹点进行汇集;根据汇集后的轨迹点的H3地理索引,获取设备在多个预设网格层级下的网格路径。In one embodiment of the present application, the initialization unit is also used to collect adjacent track points with the same H3 geographic index on the track data; The grid path under the default grid hierarchy.

能够理解,上述路径查询装置,能够实现前述实施例中提供的路径查询方法的各个步骤,关于路径查询方法的相关阐释均适用于路径查询装置,此处不再赘述。It can be understood that the above-mentioned route query device can implement each step of the route query method provided in the foregoing embodiments, and relevant explanations about the route query method are applicable to the route query device, and will not be repeated here.

图7是本申请的一个实施例电子设备的结构示意图。请参考图7,在硬件层面,该电子设备包括处理器,可选地还包括内部总线、网络接口、存储器。其中,存储器可能包含内存,例如高速随机存取存储器(Random-Access Memory,RAM),也可能还包括非易失性存储器(non-volatile memory),例如至少1个磁盘存储器等。当然,该电子设备还可能包括其他业务所需要的硬件。Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Please refer to FIG. 7 , at the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. Wherein, the memory may include a memory, such as a high-speed random-access memory (Random-Access Memory, RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. Of course, the electronic device may also include hardware required by other services.

处理器、网络接口和存储器可以通过内部总线相互连接,该内部总线可以是ISA(Industry Standard Architecture,工业标准体系结构)总线、PCI(PeripheralComponent Interconnect,外设部件互连标准)总线或EISA(Extended Industry StandardArchitecture,扩展工业标准结构)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图7中仅用一个双向箭头表示,但并不表示仅有一根总线或一种类型的总线。The processor, the network interface and the memory can be connected to each other through an internal bus, which can be an ISA (Industry Standard Architecture, industry standard architecture) bus, a PCI (Peripheral Component Interconnect, peripheral component interconnection standard) bus or an EISA (Extended Industry StandardArchitecture, extended industry standard architecture) bus, etc. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one double-headed arrow is used in FIG. 7 , but it does not mean that there is only one bus or one type of bus.

存储器,用于存放程序。具体地,程序可以包括程序代码,所述程序代码包括计算机操作指令。存储器可以包括内存和非易失性存储器,并向处理器提供指令和数据。Memory for storing programs. Specifically, the program may include program code, and the program code includes computer operation instructions. Storage, which can include internal memory and nonvolatile storage, provides instructions and data to the processor.

处理器从非易失性存储器中读取对应的计算机程序到内存中然后运行,在逻辑层面上形成轨迹融合装置。处理器,执行存储器所存放的程序,并具体用于执行以下操作:The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a trajectory fusion device on a logical level. The processor executes the program stored in the memory, and is specifically used to perform the following operations:

获取目标区域的网格填充结果,所述网格填充结果包括多个网格层级下的填充网格;Obtaining a grid filling result of the target area, where the grid filling result includes filling grids under multiple grid levels;

按照网格层级从高到低顺序查询预先构建的路径数据库,获取与所述填充网格存在共同网格节点的目标网格路径,所述路径数据库包括多个设备路径,每个设备路径包括多个预设网格层级下的网格路径;Query the pre-built path database according to the order of the grid level from high to low, and obtain the target grid path that has a common grid node with the filled grid. The path database includes multiple equipment paths, and each equipment path includes multiple Grid paths under preset grid levels;

根据所述目标网格路径获得经过所述目标区域的设备路径。A device path passing through the target area is obtained according to the target grid path.

上述如本申请图1所示实施例揭示的路径查询装置执行的方法可以应用于处理器中,或者由处理器实现。处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital SignalProcessor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述路径查询方法的步骤。The above-mentioned method performed by the path query device disclosed in the embodiment shown in FIG. 1 of the present application may be applied to a processor or implemented by the processor. A processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. Above-mentioned processor can be general-purpose processor, comprises central processing unit (Central Processing Unit, CPU), network processor (Network Processor, NP) etc.; It can also be digital signal processor (Digital Signal Processor, DSP), ASIC (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Various methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above path query method in combination with its hardware.

该电子设备还可执行图1中路径查询装置执行的方法,并实现路径查询装置在图1所示实施例的功能,本申请实施例在此不再赘述。The electronic device can also execute the method performed by the route query device in FIG. 1, and realize the functions of the route query device in the embodiment shown in FIG. 1, which will not be repeated in this embodiment of the present application.

本申请实施例还提出了一种计算机可读存储介质,该计算机可读存储介质存储一个或多个程序,该一个或多个程序包括指令,该指令当被包括多个应用程序的电子设备执行时,能够使该电子设备执行图1所示实施例中路径查询装置执行的方法,并具体执行以下操作:The embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores one or more programs, and the one or more programs include instructions, and when the instructions are executed by an electronic device including a plurality of application programs , the electronic device can be made to execute the method performed by the path query device in the embodiment shown in Figure 1, and specifically perform the following operations:

获取目标区域的网格填充结果,所述网格填充结果包括多个网格层级下的填充网格;Obtaining a grid filling result of the target area, where the grid filling result includes filling grids under multiple grid levels;

按照网格层级从高到低顺序查询预先构建的路径数据库,获取与所述填充网格存在共同网格节点的目标网格路径,所述路径数据库包括多个设备路径,每个设备路径包括多个预设网格层级下的网格路径;Query the pre-built path database according to the order of the grid level from high to low, and obtain the target grid path that has a common grid node with the filled grid. The path database includes multiple equipment paths, and each equipment path includes multiple Grid paths under preset grid levels;

根据所述目标网格路径获得经过所述目标区域的设备路径。A device path passing through the target area is obtained according to the target grid path.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, systems, or computer program products. Accordingly, the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may 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.) having computer-usable program code embodied therein.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present 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 should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.

在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.

内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent storage in computer readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read only memory (ROM) or flash RAM. Memory is an example of computer readable media.

计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information. Information may be computer readable instructions, data structures, modules of a program, 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 technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.

还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes Other elements not expressly listed, or elements inherent in the process, method, commodity, or apparatus are also included. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems or computer program products. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may 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.) having computer-usable program code embodied therein.

以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The above descriptions are only examples of the present application, and are not intended to limit the present application. For those skilled in the art, various modifications and changes may occur in this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims (10)

1. A method of path query, the method comprising:
acquiring a grid filling result of a target area, wherein the grid filling result comprises filling grids under a plurality of grid levels;
inquiring a pre-constructed path database according to the sequence from high to low of a grid level, and acquiring a target grid path with grid nodes common to the filling grid, wherein the path database comprises a plurality of equipment paths, and each equipment path comprises a plurality of grid paths under a preset grid level;
and obtaining a device path passing through the target area according to the target grid path.
2. The path query method of claim 1, wherein the plurality of preset mesh levels includes a plurality of levels between a preset highest mesh level and a preset lowest mesh level, the plurality of mesh levels including a plurality of levels between a fillable highest mesh level and a preset lowest mesh level, the method further comprising, prior to querying a pre-built path database in a mesh level order from high to low:
determining whether the fillable highest grid level is higher than the preset highest grid level;
if the path database is higher than the preset highest grid level, querying the path database by taking the preset highest grid level as a first grid level;
and if the path database is not higher than the first grid level, querying the path database by taking the fillable highest grid level as the first grid level.
3. The path query method of claim 2, wherein the fillable highest grid level of the target area is obtained by:
acquiring the boundary point position of a target area;
grid filling is carried out on the target area according to the boundary point positions of the target area and a grid filling query method provided by an H3 grid system, so that filling results of the target area in each grid level are obtained, and the filling results comprise filling success information or filling failure information of the grid level;
and acquiring the fillable highest grid level according to the filling result of each grid level.
4. The path query method as claimed in claim 1, wherein the path database comprises a cache database and a persistence database, the querying the path database constructed in advance in order of a grid level from high to low, obtaining a target grid path having a common grid point with the filling grid, comprising:
querying the cache database from high to low according to a grid level;
and if the target grid path does not exist in the cache database, querying the persistence database according to a grid level from high to low.
5. The path query method as claimed in claim 1, wherein the path database is constructed by:
acquiring track data of equipment and H3 geographic indexes corresponding to each track point;
and acquiring grid paths of the equipment under a plurality of preset grid levels according to the H3 geographic index corresponding to each track point.
6. The path query method as claimed in claim 5, wherein said obtaining the mesh path of the device under a plurality of preset mesh levels according to the H3 geographic index corresponding to each track point comprises:
collecting adjacent track points with the same H3 geographic index on the track data;
and acquiring grid paths of the equipment under a plurality of preset grid levels according to the H3 geographic indexes of the collected track points.
7. A path query device, the device comprising:
the regional filling unit is used for acquiring a grid filling result of the target region, wherein the grid filling result comprises filling grids under a plurality of grid levels;
the path query unit is used for sequentially querying a pre-constructed path database from high to low according to a grid level, and acquiring a target grid path with grid nodes common to the filling grid, wherein the path database comprises a plurality of equipment paths, and each equipment path comprises a plurality of grid paths under a preset grid level;
and the path determining unit is used for obtaining the equipment path passing through the target area according to the target grid path.
8. The path query device according to claim 7, wherein said plurality of preset mesh levels includes a plurality of levels between a preset highest mesh level and a preset lowest mesh level, a path query unit for determining whether said fillable highest mesh level is higher than said preset highest mesh level before querying a pre-built path database in order of mesh levels from high to low; if the path database is higher than the preset highest grid level, querying the path database by taking the preset highest grid level as a first grid level; and if the path database is not higher than the first grid level, querying the path database by taking the fillable highest grid level as the first grid level.
9. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions which, when executed, cause the processor to perform the path query method of any of claims 1 to 6.
10. A computer readable storage medium storing one or more programs, which when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform the path query method of any of claims 1-6.
CN202310300399.4A 2023-03-24 2023-03-24 A route query method, device, electronic equipment, and storage medium Pending CN116303519A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310300399.4A CN116303519A (en) 2023-03-24 2023-03-24 A route query method, device, electronic equipment, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310300399.4A CN116303519A (en) 2023-03-24 2023-03-24 A route query method, device, electronic equipment, and storage medium

Publications (1)

Publication Number Publication Date
CN116303519A true CN116303519A (en) 2023-06-23

Family

ID=86837677

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310300399.4A Pending CN116303519A (en) 2023-03-24 2023-03-24 A route query method, device, electronic equipment, and storage medium

Country Status (1)

Country Link
CN (1) CN116303519A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160092621A1 (en) * 2014-09-30 2016-03-31 International Business Machines Corporation Road network generation
CN109506669A (en) * 2018-12-28 2019-03-22 斑马网络技术有限公司 Dynamic path planning method, device, system and storage medium
CN111125155A (en) * 2018-10-31 2020-05-08 北京国双科技有限公司 Data query method and device based on access path, storage medium and processor
CN114485611A (en) * 2021-12-28 2022-05-13 中科星图股份有限公司 Three-dimensional space shortest path planning method and device based on Beidou grid code
CN115329023A (en) * 2022-08-15 2022-11-11 北斗伏羲中科数码合肥有限公司 Network path planning method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160092621A1 (en) * 2014-09-30 2016-03-31 International Business Machines Corporation Road network generation
CN111125155A (en) * 2018-10-31 2020-05-08 北京国双科技有限公司 Data query method and device based on access path, storage medium and processor
CN109506669A (en) * 2018-12-28 2019-03-22 斑马网络技术有限公司 Dynamic path planning method, device, system and storage medium
CN114485611A (en) * 2021-12-28 2022-05-13 中科星图股份有限公司 Three-dimensional space shortest path planning method and device based on Beidou grid code
CN115329023A (en) * 2022-08-15 2022-11-11 北斗伏羲中科数码合肥有限公司 Network path planning method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108981739A (en) Path planning method, device, server and storage medium
US20140078143A1 (en) Apparatus and method for scheduling of ray tracing
WO2015078238A1 (en) Dispatching map matching tasks by cluster server in internet of vehicles
CN111445472A (en) Laser point cloud ground segmentation method and device, computing equipment and storage medium
CN107615787A (en) The management of Moving Objects
JP2015521767A5 (en)
CN113497670B (en) Map data acquisition method, device and system
CN108732556A (en) A kind of mobile lidar emulation mode based on geometry intersection operation
CN109885046B (en) A mobile robot positioning acceleration method based on particle filter
CN116303519A (en) A route query method, device, electronic equipment, and storage medium
CN109598925B (en) Taxi gathering alarm method, terminal equipment and storage medium
CN111767295B (en) Map data processing method, device, computing equipment and medium
CN113902200A (en) Path matching method, device and equipment and computer readable storage medium
CN118133572A (en) Method and device for rapidly calculating traffic noise map, electronic equipment and medium
CN117312396B (en) Lane positioning method and device, electronic equipment and readable storage medium
CN118443030A (en) Navigation method, device, equipment and medium based on topological hierarchical semantic map
CN108613681A (en) Path planning distributed computing method based on iterative calculation under big data environment
CN116198544A (en) Digital twin data processing method and device
CN116167235A (en) Road network model generation method, device and equipment
CN111507493B (en) Object and span matching method, device and system
CN110674843B (en) Method and system for generating parking lot entity
WO2023116567A1 (en) Data coding method and apparatus, data decoding method and apparatus, and device
CN116127656A (en) Bus stop information determining method and device, network equipment and storage medium
CN112667605A (en) Construction method and device of urban information multilevel grid for industry application
CN114739386A (en) A method, device, device and medium for map data processing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination