An Unmanned Aerial Vehicle Airspace Grid Fusion Method, Electronic Device and Storage Medium
By obtaining the list of latitude and longitude points of the intersection of two Geohash grids and the midpoint list of edges to be judged, accurately determine whether the grid edges overlap, the problem of edge overlap judgment in drone airspace grid fusion is solved, and the accuracy of the fusion result is improved.
Patent Information
- Application Number
- CN202411889388.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2044-12-20
AI Technical Summary
In the process of drone airspace grid fusion, how to accurately determine whether grid edges overlap has become a technical problem that needs to be solved urgently.
By obtaining the list of latitude and longitude points JW of the intersection of two Geohash grids RD and RE, determine the midpoint list YD of the edge to be judged, and traverse YD. If the midpoint is in RD and RE at the same time, the corresponding edges are fused with RD and RE.
It is achieved to accurately determine whether two Geohash grids can be fused, thereby improving the accuracy of the fusion result.
Smart Images

Figure CN119642802B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle (UAV) airspace grid fusion, and particularly to a UAV airspace grid fusion method, an electronic device, and a storage medium. Background Art
[0002] In the field of UAVs, real-time map support is required during UAV flight. To facilitate the management of flyable airspace and controlled airspace, the flyable airspace and controlled airspace are usually rasterized, that is, the areas corresponding to the flyable airspace and controlled airspace on the map are divided into several grids. However, since the map interface needs to be rendered during the presentation process of the system website, and after rasterizing the map interface, the number of grids is large. Rendering each grid one by one will result in high computational complexity and low rendering efficiency. Therefore, a method of fusing adjacent grids is adopted to reduce the number of grids, thereby improving the rendering efficiency. However, during the grid fusion process, how to accurately determine whether the edges of the grids coincide has become a technical problem to be solved urgently. Summary of the Invention
[0003] For the above technical problems, the technical solution adopted by the present invention is as follows:
[0004] According to the first aspect of the present application, a UAV airspace grid fusion method is provided. The method includes the following steps:
[0005] T100, obtain a first Geohash grid RD and a second Geohash grid RE; where there is an edge intersection between RD and RE.
[0006] T200, obtain each longitude and latitude point of the intersection part of RD and RE to obtain a longitude and latitude point list JW=(JW 1 , JW 2 , …, JW u , …, JW v ), u = 1, 2, …, v; where JW u is the u-th longitude and latitude point of the intersection part of RD and RE, and v is the number of longitude and latitude points of the intersection part of RD and RE; each longitude and latitude point in JW is distributed in a clockwise direction in sequence on RD or RE according to the arrangement order.
[0007] T300, if V>1, then according to JW, determine the edges to be judged corresponding to two adjacent longitude and latitude points in JW to obtain a list of edges to be judged PD=(PD 1 , PD 2 , …, PD z , …, PD v-1 , PD’), z = 1, 2, …, v - 1; where PD z is to use JWz and JW z+1 The edge to be judged formed by connecting; PD’ is formed by connecting JW v and JW 1 The edge to be judged formed by connecting.
[0008] T400, obtain the midpoint of each edge to be judged in PD to obtain the midpoint list YD=(YD 1 , YD 2 , …, YD z , …, YD v-1 , YD’); where YD z is the midpoint of PD z , and YD’ is the midpoint of PD’.
[0009] T500, traverse YD, if YD z is simultaneously within RD and RE, then fuse PD z with RD and RE; if YD’ is simultaneously within RD and RE, then fuse YD’ with RD and RE.
[0010] According to another aspect of the present application, there is also provided a non-transitory computer-readable storage medium, in which at least one instruction or at least one program segment is stored, and at least one instruction or at least one program segment is loaded and executed by a processor to implement the above-mentioned UAV airspace grid fusion method.
[0011] According to another aspect of the present application, there is also provided an electronic device, including a processor and the above-mentioned non-transitory computer-readable storage medium.
[0012] The present invention has at least the following beneficial effects:
[0013] The UAV airspace grid fusion method of the present invention obtains the first Geohash grid RD and the second Geohash grid RE; obtains each longitude and latitude point of the intersection part of RD and RE to obtain the longitude and latitude point list JW; if V>1, then according to JW, determine the edges to be judged corresponding to two adjacent longitude and latitude points in JW to obtain the edge to be judged list PD; obtain the midpoint of each edge to be judged in PD to obtain the midpoint list YD corresponding to PD; traverse YD, if YD z is simultaneously within RD and RE, then fuse PD z with RD and RE; if YD’ is simultaneously within RD and RE, then fuse YD’ with RD and RE; thereby accurately judging whether two Geohash grids can be fused, so that the fusion result is more accurate. Description of the Drawings
[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0015] Figure 1 It is a flowchart of the UAV airspace grid fusion method provided by the embodiments of the present invention. Specific embodiments
[0016] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.
[0017] It should be noted that based on this disclosure, those skilled in the art should understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement the device and / or practice the method. In addition, this device and / or practice this method can be implemented using other structures and / or functions in addition to one or more of the aspects described herein.
[0018] The following will refer to Figure 1 the flowchart of the UAV airspace grid fusion method shown in the figure to introduce a UAV airspace grid fusion method.
[0019] The UAV airspace grid fusion method may include the following steps:
[0020] T100, obtain the first Geohash grid RD and the second Geohash grid RE; wherein, there is an edge intersection between RD and RE.
[0021] In this embodiment, the first Geohash grid RD and the second Geohash grid RE can be any two different Geohash grids with edge intersections.
[0022] Further, step T100 may include the following steps:
[0023] T110, obtain the first initial Geohash grid and the second initial Geohash grid.
[0024] The first initial Geohash grid can be any Geohash grid, and the second initial Geohash grid can be any Geohash grid other than the first initial Geohash grid; the first initial Geohash grid can be a regular rectangular Geohash grid; it can also be an irregular Geohash grid, that is, a Geohash grid that has been merged.
[0025] T120, use a preset algorithm to determine whether there is an intersecting edge between the first initial Geohash grid and the second initial Geohash grid.
[0026] In this embodiment, the preset algorithm includes the intersects algorithm of the Polygon class of polygon objects in geometry.
[0027] In this embodiment, to determine whether there is an edge intersection between two polygons, the intersects method of the Polygon class of polygon objects in geometry can be used to judge the graphic space; this method uses the principles of computer graphics to calculate whether there is an intersection between the boundaries and internal regions of the two polygons, so as to determine whether they intersect; it should be noted that through this method, only whether two polygons intersect can be judged, and it is impossible to determine whether there is an edge coincidence.
[0028] T200, obtain each longitude and latitude point of the intersection of RD and RE to obtain a list of longitude and latitude points JW = (JW 1 , JW 2 , …, JW u , …, JW v ), u = 1, 2, …, v; where JW u is the u-th longitude and latitude point of the intersection of RD and RE, and v is the number of longitude and latitude points of the intersection of RD and RE; each longitude and latitude point in JW is distributed in a clockwise direction in sequence on RD or RE according to the arrangement order.
[0029] In this embodiment, the number of longitude and latitude points of the intersection of RD and RE is not fixed. If v = 1, it means that there is only one vertex intersection between RD and RE, and the two cannot be merged. Therefore, it is determined that RD and RE are non-fusible Geohash grids.
[0030] T300, if V > 1, then according to JW, determine the edges to be judged corresponding to two adjacent longitude and latitude points in JW to obtain a list of edges to be judged PD = (PD 1 , PD 2 , …, PD z , …, PD v-1 , PD’), z = 1, 2, …, v - 1; where PD z is to use JWz and JW z+1 The edge to be judged formed by connecting; PD’ is formed by connecting JW v and JW 1 The edge to be judged formed by connecting.
[0031] In this embodiment, if V>1, it means that there is more than one intersection point between RD and RE. However, it is necessary to further judge whether the edges to be judged between two adjacent intersection points in the clockwise direction can be merged.
[0032] T400, obtain the midpoint of each edge to be judged in PD to obtain the corresponding midpoint list YD=(YD 1 , YD 2 , …, YD z , …, YD v-1 , YD’); where YD z is the midpoint of PD z , and YD’ is the midpoint of PD’.
[0033] In this embodiment, according to the longitude and latitude coordinates of the two endpoints of each edge to be judged in PD, the coordinates of the midpoint of each edge to be judged in PD can be obtained.
[0034] T500, traverse YD. If YD z is simultaneously inside RD and RE, then fuse PD z with RD and RE; if YD’ is simultaneously inside RD and RE, then fuse YD’ with RD and RE.
[0035] In this embodiment, if YD z is simultaneously inside RD and RE, PD z belongs to RD and also belongs to RE. Therefore, it can be determined that PD z is the edge to be judged where RD and RE coincide;
[0036] Furthermore, fusing PD z with RD and RE includes: using the union() algorithm of the Polygon class to fuse PD z with RD and RE; it should be noted that those skilled in the art can use the existing union() algorithm of the Polygon class to fuse PD z with RD and RE according to actual needs, which will not be elaborated here.
[0037] Optionally, if YD z is simultaneously inside RD and RE, PD z can also be directly deleted to achieve the effect of fusing PD z with RD and RE.
[0038] Further, the first Geohash grid RD and the second Geohash grid RE correspond to airspaces with the same attributes; for example, both are flyable airspaces or controlled airspaces.
[0039] In this embodiment, the first Geohash grid RD and the second Geohash grid RE are obtained; each longitude and latitude point of the intersection part of RD and RE is obtained to obtain a list JW of longitude and latitude points; if V > 1, then according to JW, the edges to be judged corresponding to two adjacent longitude and latitude points in JW are determined to obtain a list PD of edges to be judged; the midpoint of each edge to be judged in PD is obtained to obtain a corresponding list YD of midpoints; traverse YD, if YD z is simultaneously within RD and RE, then PD z is fused with RD and RE; if YD' is simultaneously within RD and RE, then YD' is fused with RD and RE; thus, it can be accurately judged whether two Geohash grids can be fused.
[0040] In an exemplary embodiment, the Geohash grid in the above embodiment can be generated by the following method:
[0041] S100, obtain the maximum longitude LON max and minimum longitude LON min of the area MT corresponding to the target airspace on the map, max maximum latitude LAT min and minimum latitude LAT
[0042] In this embodiment, the target airspace can be a flyable airspace, that is, an airspace where drones can fly, and the target airspace can also be a controlled airspace, that is, an airspace where drones are prohibited from flying; after the target airspace is projected onto a two-dimensional plane map, the maximum longitude, minimum longitude, maximum latitude, and minimum latitude corresponding to the target area can be obtained.
[0043] S200, generate a rectangular frame QT of the area corresponding to the target airspace on the map according to LON max , LON min , LAT max and LAT min .
[0044] Further, step S200 may include the following steps:
[0045] S210, generate a first vertex DQ max =(LON min , LAT max and LAT min according to LON 1 =(LON min , LAT min)、Second vertex DQ 2 =(LON min , LAT max ), third vertex DQ 3 =(LON max , LAT max ) and fourth vertex DQ 4 =(LON max , LAT min ).
[0046] S220, connect DQ 1 , DQ 2 , DQ 3 and DQ 4 in sequence to generate QT.
[0047] Through the above steps, the rectangular frame QT corresponding to the target airspace in the map area can be obtained.
[0048] In this embodiment, QT can also be the corresponding Minimum Bounding Rectangle (MBR); since Geohash grids are all rectangular grids, therefore, setting the rectangular frame QT can make the subsequent grid division calculation more convenient; it should be noted that those skilled in the art can use the existing minimum bounding rectangle generation method to generate QT according to actual needs, which will not be elaborated here.
[0049] S300, obtain the boundary coordinates corresponding to QT to obtain the boundary coordinate list A=(A 1 , A 2 , …, A i , …, A n ), i = 1, 2, …, n; where A i is the i-th boundary coordinate corresponding to QT, and n is the number of boundary coordinates corresponding to QT.
[0050] In this embodiment, QT includes four sides, and several evenly distributed boundary points can be set on each side, and each boundary point corresponds to coordinates, that is, boundary coordinates; the boundary coordinates include the longitude and latitude of the corresponding boundary point.
[0051] S400, determine the target-level Geohash grid from a preset number of levels of Geohash grids according to LON max , LON min , LAT max and LAT min ; where, the smaller the level of the Geohash grid, the larger the corresponding range.
[0052] In this embodiment, several Geohash grids of different levels are preset; the ranges corresponding to Geohash grids of different levels are also different; for example, Geohash grids of levels 1-7 are preset; as the level increases, the range of the corresponding Geohash grid decreases.
[0053] Further, LA r / LA r+1 = f(r); LB r / LB r+1 = f(r), r = 1, 2,..., AZ; where LA r is the side length in the vertical direction of the Geohash grid at the r-th level, and LB r is the side length in the horizontal direction of the Geohash grid at the r-th level; f(r) is a preset proportionality coefficient, and f(r) is an integer.
[0054] It can be understood that since in this embodiment, the ratio of the side lengths corresponding to adjacent-level Geohash grids can be the same or different, therefore, in this embodiment, f(r) does not refer to a specific function or function result value, but refers to a possible value that may vary with the specific value of r. For example, when r = 1, f(r) = 3; when r = 2, f(r) = 4; when r = 3, f(r) = 3.
[0055] Further, step S400 may include the following steps:
[0056] S410, obtain the distance JL max between LON min and LON LON as well as the distance JL max between LAT min and LAT LAT .
[0057] S420, obtain the side length in the horizontal direction and the side length in the vertical direction of each preset Geohash grid to obtain a side length group list BC = (BC 1 , BC 2 ,..., BC r ,..., BC AZ ); where BC r is the side length group corresponding to the Geohash grid at the r-th level; BC r = (BC r,1 , BC r,2 ); BC r,1 is the side length in the horizontal direction of the Geohash grid at the r-th level, and BC r,2 is the side length in the vertical direction of the Geohash grid at the r-th level.
[0058] S430, traverse BC. If BC y,1 <JL LON and BC y,2 <JL LAT ; meanwhile, BC y-1,1 ≥JL LON or BC y-1,2 ≥JL LAT ; y = 2, 3, …, AZ; then determine the y-level Geohash grid as the target-level Geohash grid.
[0059] In this embodiment, through the above method, the smallest-level Geohash grid that meets the requirements can be determined, so that a larger-range Geohash grid can be used for partitioning at the beginning of grid partitioning, thereby improving the partitioning efficiency.
[0060] S500, use the target-level Geohash grid to partition QT to obtain the initial target-level Geohash grid list B = (B 1 , B 2 , …, B j , …, B m ), j = 1, 2, …, m; where B j is the j-th initial target-level Geohash grid obtained by partitioning QT using the target-level Geohash grid, and m is the number of initial target-level Geohash grids obtained by partitioning QT using the target-level Geohash grid; each target-level Geohash grid overlaps with the area corresponding to the target airspace on the map.
[0061] In this embodiment, when using the target-level Geohash grid to partition QT, a vertex of QT, such as the upper left vertex, can be determined as the reference point, and then the upper left vertex of the target-level Geohash grid is made to coincide with the reference point to generate the first initial target-level Geohash grid, and finally, adjacent initial target-level Geohash grids are generated successively adjacent to each side of the first initial target-level Geohash grid.
[0062] S600, traverse B. If part of the boundary of MT is located within B j , then determine B j as the intermediate target-level Geohash grid to obtain the intermediate target-level Geohash grid list C = (C 1 , C 2 , …, C p , …, C q ), p = 1, 2, …, q; where C pThe p-th intermediate target level Geohash grid determined, where q is the number of intermediate target level Geohash grids determined.
[0063] It can be understood that the initially generated target level Geohash grids in step S500 completely cover QT and may even exceed the range of QT; however, MT is an irregular figure, so there may be initially generated target level Geohash grids outside MT, and these grids need to be deleted.
[0064] S700, use Geohash grids with a level higher than the target level to divide C p to obtain the gridded airspace corresponding to the target airspace.
[0065] In this embodiment, the intermediate target level Geohash grids obtained by the above division have too low precision at the boundary of MT, so it is necessary to further refine the intermediate target level Geohash grids at the boundary of MT.
[0066] Furthermore, step S700 may include the following steps:
[0067] S710, obtain the target level NE, the preset value NY = 1, and obtain the intermediate grid CU = C p .
[0068] In this embodiment, for the specific level corresponding to the determined target level Geohash grid, for example, if the target level Geohash grid is a 5-level Geohash grid, then NE = 5.
[0069] S720, use the (NE + NY)-th level Geohash grid to divide CU; where each (NE + NY)-th level Geohash grid overlaps with C p to some extent.
[0070] In this embodiment, the range corresponding to a Geohash grid with a larger level is smaller, so by continuing to divide CU with a Geohash grid with a larger level, the division precision at the boundary can be further improved.
[0071] S730, traverse each (NE + NY)-th level Geohash grid. If there is a (NE + NY)-th level Geohash grid that contains part of the boundary of MT, then obtain CU = the (NE + NY)-th level Geohash grid.
[0072] S740, if NY < AZ, then obtain NY = NY + 1; enter S720; otherwise, enter step S750; where AZ is the maximum level of the Geohash grid.
[0073] S750, screen Geohash grids of all levels to obtain the gridded airspace corresponding to the target airspace.
[0074] Further, step S750 may include the following steps:
[0075] S751, traverse Geohash grids of each level, delete the Geohash grids that do not overlap with the MT, to obtain the gridded airspace corresponding to the target airspace.
[0076] In this embodiment, through the above steps, the Geohash grids at the boundary of the MT are the Geohash grids of the maximum level, so that the division accuracy at the boundary of the MT is relatively high.
[0077] The method for generating the gridded airspace of the UAV in this embodiment generates a rectangular frame QT of the area corresponding to the target airspace on the map according to the maximum longitude, minimum longitude, maximum latitude, and minimum latitude of the area MT corresponding to the target airspace on the map; obtains the boundary coordinates corresponding to the QT to obtain a boundary coordinate list A; determines the target-level Geohash grid from a preset number of levels of Geohash grids according to the maximum longitude, minimum longitude, maximum latitude, and minimum latitude; uses the target-level Geohash grid to divide the QT, and then uses Geohash grids of levels higher than the target level to divide C p to obtain the gridded airspace corresponding to the target airspace; thus dividing the flyable airspace and the controlled airspace into relatively regular airspaces to increase the convenience of managing the flyable airspace or the controlled airspace.
[0078] Further, in the process of gridding the irregular flyable airspace or controlled airspace, Geohash grids with a higher level, that is, a smaller range, are used for division at the boundary of the irregular flyable airspace or controlled airspace, so that the division accuracy at the boundary is relatively high, and the shape of the gridded area is more consistent with the shape of the corresponding actual area.
[0079] In an exemplary embodiment, after gridding the target airspace by the above method, the number of generated Geohash grids is relatively large. Then, when rendering the Geohash grids later, each grid needs to be rendered one by one, resulting in a relatively long rendering time; to improve the rendering efficiency, the following method is provided:
[0080] Q100, obtain the level JH of the Geohash grid of the maximum level corresponding to the target gridded airspace max and the level JH of the Geohash grid of the minimum level min .
[0081] In this embodiment, the target gridded airspace corresponds to Geohash grids of different levels on the map. For example, it corresponds to Geohash grids of levels 1-7, and the level JH of the Geohash grid with the largest level can be obtained. max and the level JH of the Geohash grid with the smallest level min .
[0082] Q200. According to JH max and JH min , determine the initial level JH' of Geohash grid merging.
[0083] Furthermore, where is a preset ceiling function.
[0084] In this embodiment, for example, JH max = 7, JH min = 2, then JH' = 5; that is, start merging from the 5th-level Geohash grid.
[0085] It can be understood that the larger the level of the grid, the more the number. To avoid too long calculation time, find an intermediate level. For example, start from the 5th level, classify the grids with a level greater than or equal to the 5th level into the 5th-level grid, and then merge those grids with overlapping sides; since this method is used, there is no need to traverse all grids in full, thus, the efficiency of grid merging can be greatly improved.
[0086] Q300. Obtain the Geohash strings of each JH'-level Geohash grid corresponding to the target gridded airspace to obtain a Geohash string list GH = (GH 1 , GH 2 , …, GH a , …, GH b ), where a = 1, 2, …, b; among them, GH a is the Geohash string of the a-th JH'-level Geohash grid corresponding to the target gridded airspace, and b is the number of JH'-level Geohash grids corresponding to the target gridded airspace.
[0087] In this embodiment, each Geohash grid corresponds to a Geohash string, and the Geohash strings of each JH'-level Geohash grid can be obtained;
[0088] Furthermore, the number of digits of the Geohash string of the Geohash grid is equal to the level of the corresponding Geohash grid; for example, the number of digits of the Geohash string of the 5th-level Geohash grid is 5.
[0089] Q400. According to GH, obtain the Geohash grids to be merged within the Geohash grid corresponding to each Geohash string in GH, so as to obtain the list set SH of Geohash grids to be merged corresponding to GH = (SH 1 , SH 2 , …, SH a , …, SH b ); where SH a is the list of Geohash grids to be merged corresponding to GH a ; SH a = (SH a,1 , SH a,2 , …, SH a,c , …, SH a,g(a) ), c = 1, 2, …, g(a); where SH a,c is the a-th Geohash grid to be merged within the Geohash grid corresponding to GH a , and g(a) is the number of Geohash grids to be merged within the Geohash grid corresponding to GH a .
[0090] In this embodiment, the Geohash grids with a smaller level contain the Geohash grids with a larger level; for example, the Geohash grids of level 5 contain the Geohash grids of level 6 or 7; the first 5-bit strings of the Geohash strings of the Geohash grids of level 5 are the same as those of the Geohash strings of the Geohash grids of level 6 or 7 they contain.
[0091] Q500. Merge the Geohash grids with overlapping edges in SH a .
[0092] Furthermore, step Q500 may include the following steps:
[0093] Q510. Obtain each side of each Geohash grid to be merged in SH a to obtain the first list of edges to be merged KA = (KA 1 , KA 2 , …, KA d , …, KA e ), d = 1, 2, …, e; where KA d is the d-th edge obtained by obtaining each side of each Geohash grid to be merged in SH a , and e is the number of edges obtained by obtaining each side of each Geohash grid to be merged in SH a .
[0094] Q520, traverse KA. If KA d completely coincides with any edge to be merged in KA, then delete KA d and the edge that coincides with KA d from it.
[0095] In this embodiment, when the edges of two Geohash grids with the same level coincide, they completely coincide. Then, the coincident edge can be deleted on the map in the target gridded airspace, so as to achieve the effect of grid merging.
[0096] Q530, if KA d partially coincides with any edge to be merged in KA, then delete the overlapping partial edges.
[0097] In this embodiment, the lengths of the edges of two Geohash grids with different levels are different. Therefore, when the edges of two Geohash grids with different levels coincide, they partially coincide. At this time, the overlapping partial edges can be deleted on the map in the target gridded airspace, so as to achieve the effect of grid merging.
[0098] Q600, merge the remaining Geohash grids from JH' level to JH min level Geohash grids to obtain the multi-level grids corresponding to the target gridded airspace.
[0099] Further, step Q600 may include the following steps:
[0100] Q610, obtain the second preset value NU = 1 and the intermediate level RA = JH'.
[0101] Q620, obtain each edge of each RA-level Geohash grid to obtain the second list of edges to be merged KB corresponding to the RA-level Geohash grid.
[0102] Q630, traverse KB. If any two edges to be merged in KB completely coincide, then delete the two completely coincident edges to be merged.
[0103] Q640, if any two edges to be merged in KB partially coincide, then delete the overlapping partial edges.
[0104] Q650, if NU < JH', then obtain NU = NU + 1; obtain RA = RA - 1; enter Q620.
[0105] In this embodiment, through the above method, from the Geohash grid of JH' level to JH minGeohash grids at different levels are merged step by step, with the highest level being level 1. Since the displayed map is an irregular area and the displayed area is different each time, layering is performed according to the displayed area, and finally, unified rendering is carried out at the highest level, level 1. When the tiles cannot be merged, independent rendering of the tiles is performed, thereby improving the rendering efficiency.
[0106] In this embodiment, a Map collection can be used to store data. For example, the range of a 5-level grid is represented by a five-digit string generated by Geohash encoding, which serves as the key of the Map collection. Then, the flyable airspace grid data within the grid range serves as the value of the Map collection, and the merged data is stored in the same way.
[0107] After preprocessing the grid data, it can be merged from level 5 to level 1 step by step. For example, when merging the grid from level 5 to level 4, the Geohash encoding of the level 4 grid serves as the key of the Map collection, and the flyable airspace grid merged from level 5 to level 4 serves as the value. And so on. Through a while loop, when merging to the maximum range of level 1, a complete flyable airspace tile that cannot be merged anymore is obtained.
[0108] In this embodiment, obtain the level JH of the Geohash grid with the maximum level corresponding to the target rasterized airspace max and the level JH of the Geohash grid with the minimum level min ; According to JH max and JH min , determine the initial level JH' of Geohash grid merging; obtain the Geohash strings of each Geohash grid at level JH' corresponding to the target rasterized airspace to obtain a Geohash string list GH; according to GH, obtain the Geohash grids to be merged within each Geohash grid corresponding to each Geohash string in GH to obtain a set SH of lists of Geohash grids to be merged corresponding to GH; merge the Geohash grids with overlapping edges in SH a ; Merge the remaining Geohash grids from level JH' to level JH min level Geohash grids to obtain a multi-level grid corresponding to the target rasterized airspace; thereby greatly reducing the number of Geohash grids and making the rendering efficiency of Geohash grids higher in the later stage.
[0109] In an exemplary embodiment, when a drone is flying, it requires real-time map support. When searching for a specific coordinate point in the map system, in the prior art, a traversal method is usually adopted, that is, the longitude and latitude corresponding to a specific coordinate point are matched with all the longitudes and latitudes stored in the database. However, a large amount of longitude and latitude data is usually stored in the database. Therefore, searching for a specific coordinate point in the map system through the above traversal method takes a long time, resulting in low efficiency in finding the specific coordinate point. Based on the Geohash grid generated in the above embodiment, the following method is provided to improve the efficiency of finding a specific coordinate point:
[0110] H100, obtain the coordinate YQ of the position to be judged; wherein, YQ includes the longitude and latitude of the position to be judged.
[0111] In this embodiment, the position to be judged is any position, and the position to be judged corresponds to longitude and latitude, and the longitude and latitude of the position to be judged can be obtained to obtain YQ.
[0112] H200, according to YQ, determine the third-level preset area TQ where the position to be judged is located.
[0113] In this embodiment, the third-level preset area can be a district or a county; after obtaining YQ, the province, city, district or county where the position to be judged is located can be determined through YQ.
[0114] Further, step H200 may include the following steps:
[0115] H210, obtain the ray ZX with YQ as the endpoint YQ and the number of first intersections with the boundary of each first-level preset area.
[0116] In this embodiment, the first-level preset area can be a province.
[0117] H220, determine the target first-level preset area as the first-level preset area corresponding to the number of first intersections being 1; wherein, each first-level preset area includes several second-level preset areas.
[0118] In this embodiment, if the number of first intersections is 1, it means that YQ is inside the corresponding first-level preset area. Therefore, the first-level preset area corresponding to the number of first intersections being 1 is determined as the target first-level preset area to further determine a smaller area.
[0119] H230, obtain the number of second intersections of ZX YQ with each second-level preset area within the target first-level preset area.
[0120] In this embodiment, the second-level preset area can be a city.
[0121] H240, determine the target second-level preset area by identifying the second-level preset area corresponding to the second intersection point count of 1; each second-level preset area includes several third-level preset areas.
[0122] In this embodiment, the third-level preset area can be a district or a county.
[0123] H250, obtain ZX YQ and the third intersection point count for each third-level preset area within the target second-level preset area.
[0124] H260, determine the third-level preset area corresponding to the third intersection point count of 1 as TQ.
[0125] In this embodiment, if YQ is within a certain preset area, then the number of intersection points of the ray with YQ as the endpoint and this preset area must be 1; while the number of intersection points of the ray with YQ as the endpoint and other third-level preset areas is greater than 1; through the above steps, the province, city, and district or county where the position to be judged is located can be determined; during subsequent judgment, the calculation amount can be greatly reduced and the judgment efficiency can be improved.
[0126] Furthermore, the range of the first-level preset area is larger than that of the second-level preset area, and the range of the second-level preset area is larger than that of the third-level preset area.
[0127] H300, convert YQ into the corresponding Geohash grid string GH YQ ;; where GH YQ includes several characters.
[0128] In this embodiment, converting YQ into the corresponding Geohash grid string GH YQ , the conversion process is divided into three steps:
[0129] The first step is to convert the longitude and latitude corresponding to YQ into binary. For example, the longitude and latitude coordinates of YQ are (114.3528769, 22.5467932), and the range of latitude is (-90, 90), with the mid-value being 0. For the latitude 22.5467932, it is in the interval (0, 90), so a 1 is obtained; the mid-value of the interval (0, 90) is 45 degrees, and the latitude 22.5467932 is less than 45, so a 0 is obtained. Calculating in this way successively, the binary representation of the latitude can be obtained, as shown in Table 1:
[0130] Table 1
[0131] Latitude range Interval range 0 Interval range 1 Belonging interval 1 (-90,90) (-90,0) (0,90) 1 2 (0,90) (0,45) (45,90) 0 3 (0,45) (0,22.5) (22.5,45) 1 4 (22.5,45) (22.5,33.75) (33.75,45) 0 5 (22.5,33.75) (22.5,28.125) (28.125,33.75) 0 6 (22.5,28.125) (22.5,25.3125) (25.3125,28.125) 0 7 (22.5,25.3125) (22.5,23.90625) (23.90625,25.3125) 0 8 (22.5,23.90625) (22.5,23.203125) (23.203125,23.90625) 0 9 (22.5,23.203125) (22.5,22.851563) (22.851563,23.203125) 0 10 (22.5,22.851563) (22.5,22.675781) (22.675781,22.851563) 0
[0132] Finally, the binary representation of the latitude is obtained as 1010000000. Similarly, the binary code of the longitude can be obtained as 1101000101.
[0133] Step 2: Merge. The sequence corresponding to the odd positions is the longitude sequence, and the sequence corresponding to the even positions is the latitude sequence. The merged value is 11100 11000 00001 00010;
[0134] Step 3: Encode according to Base32, convert 5 binary digits into one base32 code; obtain that YQ is converted into the corresponding Geohash grid string GH YQ which is ws12.
[0135] H400, obtain each preset Geohash grid index corresponding to TQ to get the Geohash grid index list SY = (SY 1 , SY 2 , …, SY α , …, SY β ), where α = 1, 2, …, β; among them, SY α is the α-th Geohash grid index corresponding to TQ, and β is the number of Geohash grid indexes corresponding to TQ; SY α = (LQ α , SY α,1 , SY α,2 , …, SY α,η , …, SY α,y(α) ), where η = 1, 2, …, y(α); SY α,η is the Geohash grid string corresponding to the η-th maximum-level Geohash grid within the α-th Geohash grid index corresponding to TQ, and y(α) is the number of Geohash grid strings within the α-th Geohash grid index corresponding to TQ; LQ α is the first γ-bit string of SY α,η ; SY α,η corresponds to the preset flyable airspace.
[0136] In this embodiment, each third-level preset area corresponds to a preset Geohash grid index, and the Geohash grid index may include Geohash grid information of the corresponding flyable airspace or Geohash grid information of the controlled airspace; in this embodiment, the Geohash grid index includes Geohash grid information of the flyable airspace.
[0137] Further, SY can be generated through the following steps:
[0138] H410, obtain the Geohash grid string corresponding to each maximum-level Geohash grid within TQ.
[0139] H420. Divide the Geohash grid strings with the same first γ - bit strings into the same Geohash grid index to obtain SY.
[0140] In this embodiment, the Geohash grids corresponding to the Geohash grid strings included in the Geohash grid index are all the Geohash grids at the maximum level, that is, the Geohash grids with the smallest range before merging. Through the above steps, numerous Geohash grids in TQ can be mapped to a smaller number of Geohash grid indexes, which can greatly improve the query efficiency during subsequent queries.
[0141] H500. If GH YQ matches any Geohash grid string in any Geohash grid index in SY, it is determined that the position to be judged is in the preset flyable airspace; otherwise, it is determined that the position to be judged is not in the preset flyable airspace.
[0142] Further, step H500 may include the following steps:
[0143] H510. Obtain the first γ - bit string YQ YQ of GH γ .
[0144] H520. Traverse SY. If LQ α = YQ γ , then enter H530; otherwise, it is determined that the position to be judged is not in the preset flyable airspace.
[0145] In this embodiment, γ can be equal to 5. When γ = 5, it means that the Geohash grids with a level higher than 5 in each 5 - level Geohash grid in TQ are divided into the same Geohash grid index. Therefore, it can be determined which Geohash grid index the position to be judged corresponds to by judging whether LQ α is the same as YQ γ .
[0146] In this embodiment, if LQ α ≠ YQ γ , it means that the position to be judged is not in the preset flyable airspace.
[0147] H530. Traverse SY α . If any Geohash grid string in SY α is the same as GH YQ , it is determined that the position to be judged is in the preset flyable airspace; otherwise, it is determined that the position to be judged is not in the preset flyable airspace.
[0148] In this embodiment, after determining the Geohash grid index corresponding to the position to be judged, it is only necessary to traverse within this Geohash grid index. Therefore, the query method in this embodiment can greatly improve the query efficiency.
[0149] Further, after step H500, the method may further include the following steps:
[0150] H600, if the position to be judged is not within the preset flight-permissible airspace, generate a preset alarm prompt.
[0151] In this embodiment, if the position to be judged is not within the preset flight-permissible airspace, it means that the position to be judged may be within the preset controlled airspace. At this time, an alarm prompt is sent to the user.
[0152] In this embodiment, obtain the coordinate YQ of the position to be judged; according to YQ, determine the third-level preset area TQ where the position to be judged is located; convert YQ into the corresponding Geohash grid string GH YQ ; obtain each preset Geohash grid index corresponding to TQ to obtain a Geohash grid index list SY; if GH YQ matches any Geohash grid string within any Geohash grid index in SY, it is determined that the position to be judged is within the preset flight-permissible airspace; otherwise, it is determined that the position to be judged is not within the preset flight-permissible airspace; when querying the position to be judged, first determine the district or county where the position to be judged is located, then determine the specific corresponding Geohash grid index from several Geohash grid indexes corresponding to this district or county. Finally, it is only necessary to traverse within the determined Geohash grid index to determine whether the position to be judged is located within the preset flight-permissible airspace, thereby greatly improving the query efficiency of the position to be judged.
[0153] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that these steps must be executed in this specific order, or that all the steps shown must be executed to achieve the desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution, etc.
[0154] An embodiment of the present invention also provides a non-transitory computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one segment of a program related to implementing a method in the method embodiment. The at least one instruction or the at least one segment of the program is loaded and executed by the processor to implement the method provided in the above embodiment.
[0155] The program product may employ any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the readable storage medium (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0156] The computer readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which the readable program code is carried. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The readable signal medium may also be any readable medium other than the readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device.
[0157] The program code contained on the readable medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0158] The program code for performing the operations of this application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's device, executed as a stand-alone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0159] Embodiments of the present invention also provide an electronic device, including a processor and the foregoing non-transitory computer readable storage medium.
[0160] The electronic device is merely an example and should not impose any limitation on the functions and scope of use of the embodiments of this application.
[0161] The electronic device is presented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: at least one of the above-mentioned processors, at least one of the above-mentioned memories, and a bus connecting different system components (including the memory and the processor).
[0162] Among them, the memory stores program code, and the program code can be executed by the processor, so that the processor executes the steps in various embodiments described in this specification.
[0163] The memory may include a readable medium in the form of volatile memory, such as random access memory (RAM) and / or cache memory, and may further include read-only memory (ROM).
[0164] The memory may also include a program / utility with a set (at least one) of program modules. Such program modules include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. The implementation of a network environment may be included in each or some combination of these examples.
[0165] The bus may represent one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any bus structure in a variety of bus structures.
[0166] The electronic device can also communicate with one or more external devices (such as a keyboard, a pointing device, a Bluetooth device, etc.), can also communicate with one or more devices that enable a user to interact with the electronic device, and / or communicate with any device that enables the electronic device to communicate with one or more other computing devices (such as a router, a modem, etc.). Such communication can be carried out through an input / output (I / O) interface. And, the electronic device can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter. The network adapter communicates with other modules of the electronic device through the bus. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0167] Through the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein can be implemented by software or by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (such as a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
[0168] An embodiment of the present invention also provides a computer program product, which includes program code. When the program product runs on an electronic device, the program code is used to cause the electronic device to execute the steps in the methods according to various exemplary embodiments of the present invention described above in this specification.
[0169] Although some specific embodiments of the present invention have been described in detail by way of examples, those skilled in the art should understand that the above examples are only for the purpose of illustration and not for the purpose of limiting the scope of the present invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the present invention.
Claims
1. A method for fusion of UAV airspace grids, characterized in that: The method comprises the following steps: T100, obtaining a first Geohash grid RD and a second Geohash grid RE; wherein RD and RE have edges intersecting; T200, obtain each longitude and latitude point of the intersection of RD and RE to obtain a longitude and latitude point list JW = (JW1, JW2, ..., JW u , …, JW v ), u=1, 2, …, v; where JW u is the u-th longitude and latitude point of the intersection of RD and RE, v is the number of longitude and latitude points of the intersection of RD and RE; each longitude and latitude point in JW is distributed in a clockwise direction on RD or RE according to the arrangement order; T300, if v>1, then according to JW, determine the edges to be determined corresponding to the two adjacent longitude and latitude points in JW to obtain a list of edges to be determined PD = (PD1, PD2, ..., PD z ,…,PD v-1 , PD'), z = 1, 2, ..., v-1; where PD z To JW z and JW z+1 The edge to be judged formed by the connection; PD' is the edge of JW v The edge to be judged formed by connecting with JW1; T400, obtain the midpoint of each edge to be judged in PD to obtain the midpoint list YD corresponding to PD = (YD1, YD2, ..., YD z , …, YD v-1 , YD'); where YD z For PD z The midpoint of YD' is the midpoint of PD'; T500, traverse YD, if YD z If it is in RD and RE at the same time, PD z Fuse with RD and RE; if YD' is in both RD and RE, fuse YD' with RD and RE.
2. The method for fusion of UAV airspace grids according to claim 1, characterized in that: After step T200 and before step T300, the method further includes the following steps: T210, if v=1, it is determined that RD and RE are Geohash grids that cannot be merged.
3. The method for fusion of UAV airspace grid according to claim 1, characterized in that: Step T100 includes the following steps: T110, obtaining a first initial Geohash grid and a second initial Geohash grid; T120: Use a preset algorithm to determine whether the first initial Geohash grid and the second initial Geohash grid have an intersecting edge.
4. The method for fusion of UAV airspace grids according to claim 3, characterized in that: The preset algorithms include the intersects algorithm of the polygon object Polygon class in geometry.
5. The method for fusion of UAV airspace grid according to claim 1, characterized in that: The PD z The fusion with RD and RE includes: using the union() algorithm of the Polygon class to combine PD z Fusion with RD and RE.
6. The method for fusion of UAV airspace grids according to claim 1, characterized in that: The first Geohash grid RD and the second Geohash grid RE correspond to airspaces of the same attributes.
7. The method for fusion of UAV airspace grids according to claim 6, characterized in that: Airspace with the same attributes is flyable airspace or controlled airspace.
8. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the storage medium, characterized in that: The at least one instruction or the at least one program is loaded and executed by the processor to implement the drone airspace grid fusion method as described in any one of claims 1-7.
9. An electronic device, characterized in that: Includes a processor and the non-transitory computer-readable storage medium of claim 8.
Citation Information
Patent Citations
System and method for additional recording of historical data in airworthiness field
CN113642557A
Grid processing method and device for overlapped grids
CN118171605A