A method for determining the position coordinates of unmanned aerial vehicles in suitable flight airspace
Through the Geohash grid index method, the problem of low efficiency in position coordinate search of drones in flight-friendly airspace is solved, and fast and accurate position judgment is achieved.
Patent Information
- Application Number
- CN202411889392.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2044-12-20
AI Technical Summary
In the prior art, when searching for specific coordinate points, drones traverse a large amount of longitude and latitude data in the database, resulting in low search efficiency.
Using the Geohash grid index method, first determine the third-level preset area where the position to be judged is located, convert it into a Geohash grid string, and obtain the corresponding Geohash grid index list, and determine whether the position is in the appropriate airspace by matching the Geohash grid string.
This greatly improves the efficiency of position coordinate query, reduces the amount of calculation, and improves the query speed.
Smart Images

Figure CN119807320B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of position coordinate judgment in a suitable flying airspace, and in particular to a method for judging position coordinates in a suitable flying airspace. Background Art
[0002] In the field of drones, real-time map support is required when drones fly. When searching for a specific coordinate point from a map system, the existing technology usually adopts a traversal method, that is, matching the longitude and latitude corresponding to the specific coordinate point with all the longitudes and latitudes stored in the database; however, the database usually stores a large amount of longitude and latitude data. Therefore, searching for a specific coordinate point from the map system through the above traversal method is time-consuming, resulting in low efficiency in finding the specific coordinate point. Summary of the Invention
[0003] In view of the above technical problems, the technical solution adopted by the present invention is:
[0004] The present application provides a method for determining the position coordinates of a drone in a suitable flight airspace, the method comprising the following steps:
[0005] H100, obtain the coordinates YQ of the position to be determined; where YQ includes the longitude and latitude of the position to be determined.
[0006] H200: Determine the third level preset area TQ where the position to be determined is located based on YQ.
[0007] H300, convert YQ to the corresponding Geohash grid string GH YQ Among them, GH YQ Includes several characters.
[0008] H400, obtain each preset Geohash grid index corresponding to TQ to obtain a Geohash grid index list SY=(SY1, SY2, ..., SY α ,…,SY β ), α=1, 2,...,β; among them, SY α is the αth Geohash grid index corresponding to TQ, β is the number of Geohash grid indexes corresponding to TQ; SY α =(LQ α , SY α,1 , SY α,2 ,…,SY α,η ,…,SY α,y(α) ), eta = 1, 2,..., y(α); SY α,ηis the Geohash grid string corresponding to the nth maximum level Geohash grid in the αth Geohash grid index corresponding to TQ, y(α) is the number of Geohash grid strings in the αth Geohash grid index corresponding to TQ; LQ α SY α,η The first γ bits of the string; SY α,η Corresponding to the preset suitable flight airspace.
[0009] H500, if GH YQ If it matches any Geohash grid string in any Geohash grid index in SY, it is determined that the position to be determined is in the preset suitable airspace; otherwise, it is determined that the position to be determined is not in the preset suitable airspace.
[0010] The present invention has at least the following beneficial effects:
[0011] The method for determining the position coordinates of a drone in a suitable airspace of the present invention obtains the coordinates YQ of the position to be determined; determines the third-level preset area TQ where the position to be determined is located based on YQ; converts YQ into the corresponding Geohash grid string GH YQ ; Get each preset Geohash grid index corresponding to TQ to obtain the Geohash grid index list SY; if GH YQ If it 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 suitable airspace; otherwise, it is determined that the position to be judged is not in the preset suitable airspace; when querying the position to be judged, first determine the district or county where the position to be judged is located, and then determine the specific corresponding Geohash grid index from several Geohash grid indexes corresponding to the district or county. Finally, it only needs to traverse in one of the determined Geohash grid indexes to determine whether the position to be judged is in the preset suitable airspace, thereby greatly improving the query efficiency of the position to be judged. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0013] Figure 1 This is a flow chart of a method for determining the position coordinates of a UAV in a suitable flying airspace provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0014] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.
[0015] It should be noted that, based on this disclosure, those skilled in the art will appreciate that an aspect described herein can be implemented independently of any other aspect, and that two or more of these aspects can be combined in various ways. For example, any number of the aspects described herein can be used to implement an apparatus and / or practice a method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement such an apparatus and / or practice such a method.
[0016] The following will refer to Figure 1 The flowchart of the method for determining the position coordinates of a UAV in an airspace suitable for flying is shown, which introduces a method for determining the position coordinates of a UAV in an airspace suitable for flying.
[0017] The method for determining the position coordinates of a UAV in a suitable flying airspace may include the following steps:
[0018] H100, obtain the coordinates YQ of the position to be determined; where YQ includes the longitude and latitude of the position to be determined.
[0019] In this embodiment, the position to be determined is an arbitrary position, and the position to be determined corresponds to longitude and latitude. The longitude and latitude of the position to be determined can be obtained to obtain YQ.
[0020] H200: Determine the third level preset area TQ where the position to be determined is located based on YQ.
[0021] In this embodiment, the third-level preset area can be a district or county; after obtaining the YQ, the province, city, district or county where the location to be determined is located can be determined by the YQ.
[0022] Furthermore, step H200 may include the following steps:
[0023] H210, get the ray ZX with YQ as the endpoint YQ The number of first intersections with the boundary of each first-level preset area.
[0024] In this embodiment, the first-level preset area may be a province.
[0025] H220, determine a first-level preset area corresponding to an odd number of first intersections as a target first-level preset area; wherein each first-level preset area includes a plurality of second-level preset areas.
[0026] In this embodiment, if the number of first intersections is an odd number, it means that YQ is inside the corresponding first-level preset area. Therefore, the first-level preset area corresponding to the first intersection number of 1 is determined as the target first-level preset area to further determine a smaller area.
[0027] H230, Get ZX YQ The number of second intersections with each second-level preset area within the target first-level preset area.
[0028] In this embodiment, the second-level preset area may be a city.
[0029] H240, determine the second-level preset area corresponding to the second intersection number of 1 as the target second-level preset area; wherein each second-level preset area includes a plurality of third-level preset areas.
[0030] In this embodiment, the third-level preset area may be a district or a county.
[0031] H250, Get ZX YQ The number of third intersections with each third-level preset area within the target second-level preset area.
[0032] H260: Determine the third level preset area corresponding to the third intersection number 1 as TQ.
[0033] In this embodiment, if YQ is within a preset area, then the number of intersections between the ray with YQ as the endpoint and the preset area must be 1; and the number of intersections between the ray with YQ as the endpoint and other third-level preset areas is greater than 1; through the above steps, the province, city, district or county where the position to be judged is located can be determined; in subsequent judgments, the amount of calculation can be greatly reduced and the judgment efficiency can be improved.
[0034] 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.
[0035] H300, convert YQ to the corresponding Geohash grid string GH YQ ; ; Among them, GH YQ Includes several characters.
[0036] In this embodiment, YQ is replaced with the corresponding Geohash grid string GH YQ The conversion process is divided into three steps:
[0037] 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 latitude range is (-90, 90), with the middle value being 0. For the latitude 22.5467932, it is in the interval (0, 90), so it is a 1. The middle value of the interval (0, 90) is 45 degrees, and the latitude 22.5467932 is less than 45, so it is a 0. Continuing the calculation, we can get the binary representation of the latitude, as shown in Table 1:
[0038] Table 1
[0039] Latitude range Interval range 0 Interval range 1 Belong to the 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
[0040] Finally, the binary representation of latitude is 1010000000. Similarly, the binary encoding of longitude is 1101000101.
[0041] The second step is merging. The sequence corresponding to the odd bits is the longitude sequence, and the sequence corresponding to the even bits is the latitude sequence. The merged value is 11100 11000 00001 00010.
[0042] The third step is to encode the 5 binary bits into a base32 code according to Base32; the obtained YQ is converted into the corresponding Geohash grid string GH YQ For ws12.
[0043] H400, obtain each preset Geohash grid index corresponding to TQ to obtain a Geohash grid index list SY=(SY1, SY2, ..., SY α ,…,SY β ), α=1, 2,...,β; among them, SY α is the αth Geohash grid index corresponding to TQ, β is the number of Geohash grid indexes corresponding to TQ; SY α =(LQ α , SY α,1 , SY α,2 ,…,SY α,η ,…,SY α,y(α) ), eta = 1, 2,..., y(α); SY α,η is the Geohash grid string corresponding to the nth maximum level Geohash grid in the αth Geohash grid index corresponding to TQ, y(α) is the number of Geohash grid strings in the αth Geohash grid index corresponding to TQ; LQ α SY α,η The first γ bits of the string; SY α,ηCorresponding to the preset suitable flight airspace.
[0044] In this embodiment, each third-level preset area corresponds to a preset Geohash grid index, and the Geohash grid index may include the corresponding Geohash grid information of the suitable airspace or the Geohash grid information of the controlled airspace; in this embodiment, the Geohash grid index includes the Geohash grid information of the suitable airspace.
[0045] Furthermore, SY can be generated by the following steps:
[0046] H410, obtains the Geohash grid string corresponding to each maximum level Geohash grid in TQ.
[0047] H420, divide the Geohash grid strings with the same first γ bits into the same Geohash grid index to obtain SY.
[0048] In this embodiment, the Geohash grids corresponding to the Geohash grid strings contained in the Geohash grid index are all maximum-level Geohash grids, that is, the Geohash grids with the smallest range before merging; through the above steps, the numerous Geohash grids in the TQ can be mapped to a smaller number of Geohash grid indexes, which can greatly improve the query efficiency in subsequent queries.
[0049] H500, if GH YQ If it matches any Geohash grid string in any Geohash grid index in SY, it is determined that the position to be determined is in the preset suitable airspace; otherwise, it is determined that the position to be determined is not in the preset suitable airspace.
[0050] Furthermore, step H500 may include the following steps:
[0051] H510, get GH YQ The first γ bits of the string YQ γ .
[0052] H520, traverse SY, if LQ α =YQ γ , then enter H530; otherwise, it is determined that the position to be judged is not in the preset suitable airspace.
[0053] 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, by judging LQ α With YQ γWhether they are the same is used to determine which Geohash grid index the position to be determined corresponds to.
[0054] In this embodiment, if LQ α ≠YQ γ , indicating that the location to be determined is not in the preset suitable flight airspace.
[0055] H530, traverse SY α , if SY α Any Geohash grid string with GH YQ If the two conditions are the same, it is determined that the position to be determined is in the preset suitable airspace; otherwise, it is determined that the position to be determined is not in the preset suitable airspace.
[0056] In this embodiment, after determining the Geohash grid index corresponding to the position to be determined, it is only necessary to traverse within this Geohash grid index. Therefore, the query method in this embodiment can greatly improve the query efficiency.
[0057] Furthermore, after step H500, the method may further include the following steps:
[0058] H600: If the position to be determined is not within the preset suitable airspace, a preset alarm prompt will be generated.
[0059] In this embodiment, if the position to be determined is not in the preset suitable airspace, it means that the position to be determined may be in the preset controlled airspace. At this time, an alarm prompt is issued to the user.
[0060] In this embodiment, the coordinates YQ of the position to be determined are obtained; based on YQ, the third level preset area TQ where the position to be determined is located is determined; YQ is converted into the corresponding Geohash grid string GH YQ ; Get each preset Geohash grid index corresponding to TQ to obtain the Geohash grid index list SY; if GH YQ If it 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 suitable airspace; otherwise, it is determined that the position to be judged is not in the preset suitable airspace; when querying the position to be judged, first determine the district or county where the position to be judged is located, and then determine the specific corresponding Geohash grid index from several Geohash grid indexes corresponding to the district or county. Finally, it only needs to traverse in one of the determined Geohash grid indexes to determine whether the position to be judged is in the preset suitable airspace, thereby greatly improving the query efficiency of the position to be judged.
[0061] In an exemplary embodiment, the Geohash grid in the above embodiment can be generated by the following method:
[0062] S100, obtaining the maximum longitude LON of the area MT corresponding to the target airspace on the map max , minimum longitude LON min , maximum latitude LAT max and minimum latitude LAT min .
[0063] In this embodiment, the target airspace can be a suitable airspace, that is, an airspace where drones can fly, or the target airspace can 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.
[0064] S200, according to LON max 、LON min , LAT max and LAT min , generate a rectangular box QT corresponding to the target airspace on the map.
[0065] Furthermore, step S200 may include the following steps:
[0066] S210, according to LON max 、LON min , LAT max and LAT min , generate the first vertex DQ1=(LON min , LAT min ), the second vertex DQ2 = (LON min , LAT max ), the third vertex DQ3 = (LON max , LAT max ) and the fourth vertex DQ4=(LON max , LAT min ).
[0067] S220 , sequentially connect DQ1 , DQ2 , DQ3 , and DQ4 to generate QT.
[0068] Through the above steps, the rectangular box QT of the target airspace corresponding to the area on the map can be obtained.
[0069] In this embodiment, QT can also be the corresponding minimum bounding rectangle (MBR). Since Geohash grids are all rectangular grids, 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.
[0070] S300, obtaining the boundary coordinates corresponding to QT to obtain a boundary coordinate list A=(A1, A2, ..., A i ,…,A n ), i=1, 2,...,n; among them, A i is the i-th boundary coordinate corresponding to QT, and n is the number of boundary coordinates corresponding to QT.
[0071] In this embodiment, QT includes four edges, and a number of evenly distributed boundary points can be set on each edge. Each boundary point has corresponding coordinates, namely boundary coordinates; the boundary coordinates include the longitude and latitude of the corresponding boundary point.
[0072] S400, according to LON max 、LON min , LAT max and LAT min , determine the target level Geohash grid from several preset levels of Geohash grids; wherein, the smaller the level of Geohash grid, the larger the corresponding range.
[0073] In this embodiment, several different levels of Geohash grids are preset; different levels of Geohash grids correspond to different ranges; for example, there are 1-7 levels of Geohash grids preset; as the level increases, the range of the corresponding Geohash grid decreases.
[0074] Further, LA r / LA r+1 =f(r);LB r / LB r+1 =f(r), r=1, 2, ..., AZ; where LA r is the vertical length of the r-th level Geohash grid, LB r is the horizontal side length of the r-th level Geohash grid; f(r) is the preset scale factor, and f(r) is an integer.
[0075] It can be understood that, since in this embodiment, the ratio of the side lengths corresponding to adjacent levels of Geohash grids can be the same or different, in this embodiment, f(r) does not refer to a specific function or function result value, but refers to a possible value that varies 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.
[0076] Furthermore, step S400 may include the following steps:
[0077] S410, obtain LONmax and LON min The distance between JL LON and LAT max and LAT min The distance between JL LAT .
[0078] S420, obtaining the horizontal and vertical side lengths of each preset Geohash grid to obtain a side length group list BC=(BC1, BC2, ..., BC r ,…,BC AZ );Among them, BC r is the edge length group corresponding to the r-th level Geohash grid; BC r =(BC r,1 , BC r,2 );BC r,1 is the horizontal side length of the r-th level Geohash grid, BC r,2 is the vertical side length of the r-th level Geohash grid.
[0079] 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 the y-th level Geohash grid is determined as the target level Geohash grid.
[0080] In this embodiment, the minimum level Geohash grid that meets the requirements can be determined by the above method, so that the grid division can be performed with a larger range of Geohash grids at the beginning, thereby improving the efficiency of the division.
[0081] S500, using the target level Geohash grid to divide QT to obtain an initial target level Geohash grid list B = (B1, B2, ..., B j ,…,B m ), j = 1, 2, ..., m; where B j is the jth initial target-level Geohash grid obtained by dividing QT using the target-level Geohash grid, and m is the number of initial target-level Geohash grids obtained by dividing QT using the target-level Geohash grid; each target-level Geohash grid overlaps with the corresponding area of the target airspace on the map.
[0082] In this embodiment, the target-level Geohash grid is used to divide QT. A vertex of QT, such as the upper-left vertex, can be determined as a reference point. Then, the upper-left vertex of the target-level Geohash grid is overlapped with the reference point to generate the first initial target-level Geohash grid. Finally, adjacent initial target-level Geohash grids are generated in sequence along each edge of the first initial target-level Geohash grid.
[0083] S600, traverse B, if part of the MT boundary is located in B j If B j Determine as the intermediate target level Geohash grid to obtain the intermediate target level Geohash grid list C = (C1, C2, ..., C p ,…,C q ), p=1, 2, ..., q; where C p is the pth intermediate target level Geohash grid determined, and q is the number of intermediate target level Geohash grids determined.
[0084] It is understandable that the initial target level Geohash grid generated in step S500 completely covers QT and may even exceed the range of QT; however, MT is an irregular shape, so there may be initial target level Geohash grids outside of MT, which need to be deleted.
[0085] S700, use a Geohash grid with a level greater than the target level for C p Divide the gridded airspace to obtain the target airspace.
[0086] In this embodiment, the intermediate target level Geohash grid obtained by the above steps has too low precision at the boundary of MT. Therefore, the intermediate target level Geohash grid at the boundary of MT needs to be further refined.
[0087] Furthermore, step S700 may include the following steps:
[0088] S710, obtain target level NE, preset value NY=1 and obtain intermediate grid CU=C p .
[0089] In this embodiment, the target level Geohash grid determined above corresponds to a specific level. For example, if the target level Geohash grid is a level 5 Geohash grid, then NE=5.
[0090] S720, using the NE+NY level Geohash grid to divide the CU; wherein each NE+NY level Geohash grid is connected to the C p There is overlap.
[0091] In this embodiment, the range corresponding to the larger-level Geohash grid is smaller. Therefore, continuing to divide the CU by using the larger-level Geohash grid can further improve the division accuracy at the boundary.
[0092] S730 , traverse each NE+NY level Geohash grid, and if there is a NE+NY level Geohash grid containing part of the boundary of MT, obtain CU=NE+NY level Geohash grid.
[0093] S740, if NY<AZ, obtain NY=NY+1; go to S720; otherwise, go to step S750; wherein AZ is the maximum level of the Geohash grid.
[0094] At S750 , all levels of Geohash grids are screened to obtain a gridded airspace corresponding to the target airspace.
[0095] Furthermore, step S750 may include the following steps:
[0096] S751, traverse each level of Geohash grids, delete the Geohash grids that do not overlap with the MT, to obtain the gridded airspace corresponding to the target airspace.
[0097] In this embodiment, through the above steps, the Geohash grid at the MT boundary is a maximum-level Geohash grid, thereby achieving higher division accuracy at the MT boundary.
[0098] The method for generating gridded airspace of a UAV in this embodiment generates a rectangular frame QT 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 QT to obtain a boundary coordinate list A; determines a target level Geohash grid from a plurality of preset levels of Geohash grids according to the maximum longitude, minimum longitude, maximum latitude and minimum latitude; divides QT using the target level Geohash grid, and then divides C using the Geohash grid of a level greater than the target level. p Divide it to obtain the gridded airspace corresponding to the target airspace; thereby dividing the suitable airspace and the controlled airspace into more regular airspace to increase the convenience of managing the suitable airspace or the controlled airspace.
[0099] Furthermore, in the process of gridding irregular flyable airspace or controlled airspace, the boundaries of the irregular flyable airspace or controlled airspace are divided using a higher-level, i.e., smaller-range Geohash grid, so that the division accuracy at the boundaries is higher and the shape of the gridded area is more consistent with the shape of the corresponding actual area.
[0100] In an exemplary embodiment, after the target airspace is gridded using the above method, a large number of Geohash grids are generated. Therefore, when rendering the Geohash grids later, they need to be rendered one by one, resulting in a long rendering time. To improve rendering efficiency, the following method is provided:
[0101] Q100, obtain the maximum level of Geohash grid corresponding to the target gridded airspace JH max and the minimum level Geohash grid level JH min .
[0102] In this embodiment, the target gridded airspace corresponds to different levels of Geohash grids on the map, for example, corresponding to levels 1-7 of Geohash grids; the level JH that can obtain the maximum level of Geohash grid max and the minimum level Geohash grid level JH min .
[0103] Q200, according to JH max and JH min , determines the initial level JH' of Geohash grid merging.
[0104] Further, in, is the default ceiling function.
[0105] In this embodiment, for example, JH max =7, JH min =2, then JH'=5; that is, the merging starts from the 5th level Geohash grid.
[0106] It can be understood that the larger the level of the grid, the greater the number. In order to avoid too long calculation time, find an intermediate level, for example, level 5 as the starting point, and classify all grids with levels greater than or equal to level 5 into the level 5 grid. Then merge these grids with overlapping edges. Due to the use of this method, there is no need to traverse all grids in full, thus greatly improving the efficiency of grid merging.
[0107] Q300, obtain the Geohash string of each JH' level Geohash grid corresponding to the target gridded airspace to obtain a Geohash string list GH = (GH1, GH2, ..., GH a ,…,GH b ), a=1, 2, ..., b; where GH a is the Geohash string of the ath 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.
[0108] In this embodiment, each Geohash grid corresponds to a Geohash string, and the Geohash string of each JH' level Geohash grid can be obtained;
[0109] 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 a level 5 Geohash grid is 5.
[0110] Q400, according to GH, obtain the Geohash grids to be merged in the Geohash grids corresponding to each Geohash string in GH, so as to obtain the Geohash grid list set to be merged corresponding to GH = (SH1, SH2, ..., SH a ,…,SH b );Among them, SH a For GH a The corresponding Geohash grid list to be merged; SH a =(SH a,1 , SH a,2 ,…,SH a,c ,…,SH a,g(a) ), c=1, 2, …, g(a); where SH a,c For GH a The ath Geohash grid to be merged in the corresponding Geohash grid, g(a) is GH a The number of Geohash grids to be merged within the corresponding Geohash grid.
[0111] In this embodiment, a Geohash grid of a smaller level contains a Geohash grid of a larger level; for example, a Geohash grid of level 5 contains a Geohash grid of level 6 or 7; the Geohash string of the Geohash grid of level 5 is the same as the first 5 characters of the Geohash string of level 6 or 7 it contains.
[0112] Q500, SH a The Geohash grids with overlapping edges are merged.
[0113] Furthermore, step Q500 may include the following steps:
[0114] Q510, get SH a Each edge of each Geohash grid to be merged in the first to-be-merged edge list KA = (KA1, KA2, ..., KA d ,…,KA e ), d=1, 2,...,e; among them, KA d To obtain SH a The dth edge is obtained from each side of each Geohash grid to be merged, and e is the dth edge obtained from each side of each Geohash grid to be merged. a The number of edges obtained for each edge of each Geohash grid to be merged.
[0115] Q520, traverse KA, if KA d If it completely overlaps with any edge to be merged in KA, then KA d And with KA d Delete overlapping edges.
[0116] In this embodiment, when the edges of two Geohash grids of the same level overlap, they completely overlap; then, the overlapping edges can be deleted on the map in the target gridded airspace, thereby achieving the effect of grid merging.
[0117] Q530, if KA d If it partially overlaps with any edge to be merged in KA, the overlapping edge will be deleted.
[0118] In this embodiment, the lengths of the edges of two Geohash grids of different levels are different. Therefore, when the edges of two Geohash grids of different levels overlap, they overlap partially. At this time, the overlapping edges can be deleted on the map of the target gridded airspace, thereby achieving the effect of grid merging.
[0119] Q600, for the remaining JH' level Geohash grid to JH min The Geohash grids at different levels are merged to obtain the multi-level grids corresponding to the target gridded airspace.
[0120] Furthermore, step Q600 may include the following steps:
[0121] Q610, obtaining the second preset value NU=1 and the intermediate level RA=JH'.
[0122] Q620, obtain each edge of each RA-level Geohash grid to obtain a second to-be-merged edge list KB corresponding to the RA-level Geohash grid.
[0123] Q630, traverse the KB. If any two edges to be merged in the KB completely overlap, the two completely overlapping edges to be merged are deleted.
[0124] Q640: If any two edges to be merged in the KB partially overlap, the overlapping edges are deleted.
[0125] Q650, if NU<JH', obtain NU=NU+1; obtain RA=RA-1; enter Q620.
[0126] In this embodiment, the above method is used to transform the Geohash grid from the JH' level to the JH min The Geohash grids of different levels are merged step by step, with the highest level being level 1. Since the displayed map is an irregular area and the area displayed each time is different, it is layered according to the displayed area and finally rendered uniformly in the highest layer, layer 1. When tiles cannot be merged, they are rendered independently, thereby improving rendering efficiency.
[0127] In this embodiment, a Map set can be used to store data. For example, a 5-level grid range is represented by a five-digit string generated by Geohash encoding as the key of the Map set, and then the flight-suitable airspace grid data within the grid range is used as the value of the Map set. The merged data is stored in the same way.
[0128] After preprocessing, the grid data can be merged from level 5 to level 1 step by step. For example, when merging grids from level 5 to level 4, the Map collection uses the Geohash code of the level 4 grid as the key and the airspace grid merged from level 5 to level 4 as the value. Similarly, through the while loop, when the merging reaches the maximum range of level 1, a complete airspace tile that cannot be merged any further is obtained.
[0129] In this embodiment, the level JH of the maximum level Geohash grid corresponding to the target gridded airspace is obtained. max and the minimum level Geohash grid level JH min According to JH max and JH min, determine the initial level JH' of Geohash grid merging; obtain the Geohash string of each JH' level Geohash grid corresponding to the target gridded airspace to obtain a Geohash string list GH; according to GH, obtain the Geohash grid to be merged in the Geohash grid corresponding to each Geohash string in GH to obtain the Geohash grid list set SH to be merged corresponding to GH; a The Geohash grids with overlapping edges are merged; the remaining JH' level Geohash grids are merged to JH min The multi-level Geohash grids are merged to obtain the multi-level grids corresponding to the target gridded airspace; thereby greatly reducing the number of Geohash grids and making the rendering efficiency of the later Geohash grids higher.
[0130] In an exemplary embodiment, in the above embodiment, during the process of merging meshes, how to accurately determine whether the edges of the meshes overlap is related to whether the operation of merging the meshes is correct. Based on this, the following method for determining whether the edges of the meshes overlap is provided, and the method includes the following steps:
[0131] T100: Obtain a first Geohash grid RD and a second Geohash grid RE; wherein RD and RE have edges intersecting.
[0132] In this embodiment, the first Geohash grid RD and the second Geohash grid RE may be any two different Geohash grids having edges intersecting with each other.
[0133] Furthermore, step T100 may include the following steps:
[0134] T110, obtaining a first initial Geohash grid and a second initial Geohash grid.
[0135] The first initial Geohash grid can be any Geohash grid, and the second initial Geohash grid can be any Geohash grid except the first initial Geohash grid; the first initial Geohash grid can be a regular rectangular Geohash grid; or it can be an irregular Geohash grid, that is, a merged Geohash grid.
[0136] T120: Use a preset algorithm to determine whether the first initial Geohash grid and the second initial Geohash grid have an intersecting edge.
[0137] In this embodiment, the preset algorithm includes the intersects algorithm of the polygon object Polygon class in geometry.
[0138] In this embodiment, to determine whether two polygons have intersecting edges, the intersects method of the polygon object Polygon class in geometry can be used to perform a judgment in the graphic space; this method uses the principles of computer graphics to calculate whether the boundaries and internal areas of the two polygons intersect, thereby determining whether they intersect; it should be noted that this method can only determine whether two polygons intersect, and cannot determine whether there is any edge overlap.
[0139] 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 in the intersection of RD and RE, v is the number of longitude and latitude points in 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.
[0140] In this embodiment, the number of longitude and latitude points where RD and RE intersect is not fixed. If v=1, it means that RD and RE intersect at only one vertex, and the two cannot be merged. Therefore, RD and RE are determined to be non-mergeable Geohash grids.
[0141] 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 the edge list 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.
[0142] In this embodiment, if V>1, it means that there is more than one intersection point between RD and RE. However, the edges to be determined between two clockwise adjacent intersection points still need to be further determined whether they can be merged.
[0143] 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'); among them, YD z For PD z The midpoint of YD' is the midpoint of PD'.
[0144] In this embodiment, the coordinates of the midpoint of each to-be-determined edge in the PD can be obtained according to the longitude and latitude coordinates of the two end points of each to-be-determined edge in the PD.
[0145] 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.
[0146] In this embodiment, if YD z In RD and RE at the same time, PD z It belongs to RD and RE at the same time, so PD can be determined. z The edge to be judged where RD and RE overlap;
[0147] Furthermore, PD z Fusion with RD and RE involves: using the union() algorithm of the Polygon class to combine PD z It should be noted that those skilled in the art can use the existing union() algorithm of the Polygon class to merge PD according to actual needs. z The integration with RD and RE is not described here.
[0148] Optional, if YD z At the same time, in RD and RE, you can also directly z Delete to achieve the PD z The effect of fusion with RD and RE.
[0149] Furthermore, 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.
[0150] In this implementation, the first Geohash grid RD and the second Geohash grid RE are obtained; each longitude and latitude point of the intersection of RD and RE is obtained to obtain a longitude and latitude point list JW; if V>1, then according to JW, the edges to be determined corresponding to the two adjacent longitude and latitude points in JW are determined to obtain a list of edges to be determined PD; the midpoint of each edge to be determined in PD is obtained to obtain a list of midpoints YD corresponding to PD; YD is traversed, and if YD z If it is in RD and RE at the same time, PD z Fuse it with RD and RE; if YD' is in both RD and RE, fuse YD' with RD and RE; thus accurately judging whether the two Geohash grids can be fused.
[0151] Furthermore, although the steps of the method of the present disclosure are described in a particular order in the accompanying drawings, this does not require or imply that the steps must be performed in this particular order, or that all steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0152] 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 program related to implementing a method in a method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiment.
[0153] The program product may be implemented in any combination of one or more readable media. The readable medium 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, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with 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 thereof.
[0154] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0155] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0156] The program code for performing the operations of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user 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 can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0157] An embodiment of the present invention further provides an electronic device including a processor and the aforementioned non-transitory computer-readable storage medium.
[0158] The electronic device is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0159] The electronic device is implemented as a general-purpose computing device. Components of the electronic device may include, but are not limited to, the aforementioned at least one processor, the aforementioned at least one memory, and a bus connecting different system components (including the memory and the processor).
[0160] The memory stores program codes, which can be executed by the processor, so that the processor performs the steps of various embodiments described in this specification.
[0161] The memory may include readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory, and may further include read-only memory (ROM).
[0162] The memory may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0163] The bus may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.
[0164] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter. The network adapter communicates with other modules of the electronic device via a bus. It should be understood that, although not shown in the figures, other hardware and / or software modules may be used in conjunction 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.
[0165] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution 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 (which can be 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 (which can be 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.
[0166] An embodiment of the present invention further provides a computer program product comprising program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the method according to various exemplary embodiments of the present invention described above in this specification.
[0167] Although some specific embodiments of the present invention have been described in detail by way of examples, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It should also be understood by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention.
Claims
1. A method for determining the position coordinates of a UAV in a suitable flying airspace, characterized in that: The method comprises the following steps: H100, obtain the coordinates YQ of the location to be determined; where YQ includes the longitude and latitude of the location to be determined; H200, based on YQ, determine the third level preset area TQ where the position to be determined is located; H300, convert YQ to the corresponding Geohash grid string GH YQ Among them, GH YQ Includes several characters; H400, obtain each preset Geohash grid index corresponding to TQ to obtain a Geohash grid index list SY = (SY1, SY2, ..., SY α ,…,SY β ), α=1, 2,...,β; among them, SY α is the αth Geohash grid index corresponding to TQ, β is the number of Geohash grid indexes corresponding to TQ; SY α =(LQ α , SY α,1 , SY α,2 ,…,SY α,η ,…,SY α,y(α) ), η=1, 2,…, y (α); SY α,η is the Geohash grid string corresponding to the ηth maximum level Geohash grid in the αth Geohash grid index corresponding to TQ, y(α) is the number of Geohash grid strings in the αth Geohash grid index corresponding to TQ; LQ α SY α,η The first γ bits of the string; SY α,η Corresponding to the preset suitable flight airspace; H500, if GH YQ If the match is with any Geohash grid string in any Geohash grid index in SY, it is determined that the position to be determined is in the preset suitable airspace; otherwise, it is determined that the position to be determined is not in the preset suitable airspace; Step H500 includes the following steps: H510, get GH YQ The first γ bits of the string YQ γ ; H520, traverse SY, if LQ α =YQ γ , then enter H530; otherwise, it is determined that the position to be judged is not in the preset suitable flight airspace; H530, traverse SY α , if SY α Any Geohash grid string with GH YQ If the two conditions are the same, it is determined that the position to be determined is in the preset suitable airspace; otherwise, it is determined that the position to be determined is not in the preset suitable airspace; Step H200 includes the following steps: H210, get the ray ZX with YQ as the endpoint YQ the number of first intersections with the boundary of each first-level preset area; H220, determining the first-level preset area corresponding to the first intersection number of 1 as the target first-level preset area; wherein each first-level preset area includes a plurality of second-level preset areas; H230, Get ZX YQ the number of second intersections with each second-level preset area within the target first-level preset area; H240, determining the second-level preset area corresponding to the second intersection number of 1 as the target second-level preset area; wherein each second-level preset area includes a plurality of third-level preset areas; H250, Get ZX YQ The number of third intersection points with each third-level preset area within the target second-level preset area; H260, determining the third level preset area corresponding to the third intersection number 1 as TQ; SY is generated by the following steps: H410, obtain the Geohash grid string corresponding to each maximum level Geohash grid in TQ; H420, divide the Geohash grid strings with the same first γ bits into the same Geohash grid index to obtain SY.
2. The method for determining the position coordinates of a UAV in a suitable flying airspace according to claim 1, characterized in that: 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.
3. The method for determining the position coordinates of a UAV in a suitable flying airspace according to claim 1, characterized in that: γ=5.
4. The method for determining the position coordinates of a UAV in a suitable flying airspace according to claim 1, wherein: After step H500, the method further includes the following steps: H600: If the position to be determined is not within the preset suitable airspace, a preset alarm prompt will be generated.
Citation Information
Patent Citations
Method and system for judging whether aircraft is in safe airspace
CN117576952A
Identifying an object in an area of interest
US20240087463A1