Method for judging position coordinates in airspace suitable for unmanned aerial vehicle to fly
By using the Geohash grid index list in the drone's flight-friendly airspace to determine whether the position to be judged is in the preset flight-friendly airspace, the problem of low efficiency in finding coordinate points in the prior art is solved, and more efficient position judgment is achieved.
Patent Information
- Application Number
- CN202411889392.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-20
AI Technical Summary
The prior art when a drone is flying, it searches for specific coordinate points by traversing a large amount of longitude and latitude data in the map system, resulting in low search efficiency.
A method of determining position coordinates in the airspace suitable for airplanes by obtaining the coordinates of the position to be judged, determining the third-level preset area where it is located, and converting the coordinates into a Geohash grid string. Then obtain the corresponding Geohash grid index list and determine whether the position to be judged is in the preset flying airspace.
By first determining the district or county of the position to be judged, and then traversing from the corresponding Geohash grid index, the efficiency of position coordinate judgment is significantly improved.
Smart Images

Figure CN119807320A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of position coordinate judgment in suitable flying airspace, and in particular to a method for position coordinate judgment in 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, a traversal method is usually used in the prior art, that is, the longitude and latitude corresponding to a specific coordinate point are matched with all the longitudes and latitudes stored in a database; however, a large amount of longitude and latitude data is usually stored in the database. Therefore, it takes a long time to search for a specific coordinate point from a map system through the above traversal method, resulting in low efficiency in searching for specific coordinate points. 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 an airspace suitable for flying, the method comprising the following steps:
[0005] H100, obtain the coordinates YQ of the position to be determined; wherein YQ includes the longitude and latitude of the position to be determined.
[0006] H200, according to YQ, determine the third level preset area TQ where the position to be determined is located.
[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 η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 flying 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 in the suitable airspace for unmanned aerial vehicles 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 according to YQ; converts YQ into the corresponding Geohash grid character 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 determined is in the preset suitable airspace; otherwise, it is determined that the position to be determined is not in the preset suitable airspace; when querying the position to be determined, first determine the district or county where the position to be determined is located, and then determine the specific corresponding Geohash grid index from several Geohash grid indexes corresponding to the district or county, and finally, only need to traverse in the determined Geohash grid index to determine whether the position to be determined is in the preset suitable airspace, thereby greatly improving the query efficiency of the position to be determined. 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 A flow chart of a method for determining position coordinates in a suitable flying airspace for a UAV provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0014] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work are within the scope of protection of the present invention.
[0015] It should be noted that, based on the present disclosure, those skilled in the art should understand that an 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 a device 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 this device and / or practice this 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, and a method for determining the position coordinates of a UAV in an airspace suitable for flying is introduced.
[0017] The method for determining the position coordinates of the unmanned aerial vehicle in the suitable flying airspace may include the following steps:
[0018] H100, obtain the coordinates YQ of the position to be determined; wherein 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, according to YQ, determine the third level preset area TQ where the position to be determined is located.
[0021] In this embodiment, the third-level preset area can be a district or a 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] Further, 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, determining 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 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 the range of the second-level preset area, and the range of the second-level preset area is larger than the range 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 a 1 is obtained; the middle value of the interval (0, 90) is 45 degrees, and the latitude 22.5467932 is less than 45, so a 0 is obtained. By calculating in sequence, the binary representation of the latitude can be obtained, 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 according to Base32 and convert the 5 binary bits into a base32 code; 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 η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 flying 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, obtain 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] Further, 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 position to be judged is not in the preset suitable flying 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 the 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 in the preset suitable flying 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; according to 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 determined is in the preset suitable airspace; otherwise, it is determined that the position to be determined is not in the preset suitable airspace; when querying the position to be determined, first determine the district or county where the position to be determined is located, and then determine the specific corresponding Geohash grid index from several Geohash grid indexes corresponding to the district or county, and finally, only need to traverse in the determined Geohash grid index to determine whether the position to be determined is in the preset suitable airspace, thereby greatly improving the query efficiency of the position to be determined.
[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 flying 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.
[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] Further, 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 )、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 , connecting DQ1 , DQ2 , DQ3 , and DQ4 in sequence 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 (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 technical personnel in this field can use the existing minimum bounding rectangle generation method to generate QT according to actual needs, which will not be repeated 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; where, 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 the Geohash grid, the larger the corresponding range.
[0073] In this embodiment, several different levels of Geohash grids are preset; the ranges corresponding to Geohash grids of different levels are also different; for example, there are 1-7 levels of Geohash grids preset; as the level increases, the range of the corresponding Geohash grid decreases.
[0074] Furthermore, L.A. r / LA r+1 =f(r);LB r / LB r+1 =f(r), r=1, 2, ..., AZ; where LA r is the length of the vertical side 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] Further, step S400 may include the following steps:
[0077] S410, Get LONmax and LON min The distance between LON and LAT max and LAT min The distance between 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 which, BC r is the edge length group corresponding to the r-th level Geohash grid; BC r =(BC r,1 , B.C. r,2 );BC r,1 is the horizontal length of the r-th level Geohash grid, BC r,2 is the length of the vertical side of the r-th level Geohash grid.
[0079] S430, traverse BC, if BC y,1 <JL LON And BC y,2 <JL LAT Meanwhile, B.C. 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 when the grid division starts, the Geohash grid can be divided into a larger range, 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, QT is divided using a target-level Geohash grid. A vertex of QT, such as the upper left vertex, can be determined as a reference point. The upper left vertex of the target-level Geohash grid is then 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 boundary of MT 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 exceed the range of QT; however, MT is an irregular shape, so there may be initial target level Geohash grids outside MT, which need to be deleted.
[0085] S700, use a Geohash grid with a level greater than the target level for C p Divide it to obtain the gridded airspace corresponding to 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, it is necessary to further refine the intermediate target level Geohash grid at the boundary of MT.
[0087] Further, step S700 may include the following steps:
[0088] S710, obtaining the target level NE, the preset value NY=1, and the intermediate grid CU=C p .
[0089] In this embodiment, the specific level corresponding to the above determined target level Geohash grid, for example, the target level Geohash grid is a level 5 Geohash grid, then NE=5.
[0090] S720: Use 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 through 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 that includes 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] S750, screening all levels of Geohash grids to obtain a gridded airspace corresponding to the target airspace.
[0095] Further, step S750 may include the following steps:
[0096] S751, traverse each level of Geohash grids, and 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 Geohash grid of the maximum level, so that the division accuracy at the MT boundary is higher.
[0098] The method for generating gridded airspace of a drone in this embodiment generates a rectangular frame QT of the target airspace corresponding to the area MT 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 divide the suitable flyable airspace and the controlled airspace into more regular airspace to increase the convenience of managing the suitable flyable 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 Geohash grid of a higher level, i.e., a smaller range, 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 by the above method, a large number of Geohash grids are generated. Then, when the Geohash grids are rendered later, they need to be rendered one by one, which results in a long rendering time. In order to improve the 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 Geohash grids of levels 1-7; the level JH of the maximum level Geohash grid can be obtained. 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] Furthermore, 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 is understandable that the larger the level of the grid, the greater the number. To avoid too long calculation time, find an intermediate level, for example, level 5 as the starting point, classify all grids with levels greater than or equal to level 5 into the level 5 grid, and then merge these grids with overlapping edges; due to the use of this method, there is no need to traverse all grids in full, thereby 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 Geohash grid of level 5 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 SH 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 , S.H. 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 level 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 level 7 it contains.
[0112] Q500, SH a The Geohash grids with overlapping edges are merged.
[0113] Further, 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 edge of each Geohash grid to be merged, and e is the SH 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 are completely overlapped; then, the overlapped 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 are partially overlapped. 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] Further, step Q600 may include the following steps:
[0121] Q610, obtain 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 KB, if any two edges to be merged in KB completely overlap, the two completely overlapping edges to be merged are deleted.
[0124] Q640: If any two edges to be merged in 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 level by level, with the highest level being level 1. Since the displayed map is an irregular area and the displayed area is different each time, 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-bit string generated by Geohash encoding as the key of the Map set, and then the 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] The preprocessed 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 suitable airspace grid merged from level 5 to level 4 as the value; and so on, through the while loop, when the maximum range is merged to level 1, a complete suitable 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 the 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 grids to be merged in the Geohash grids corresponding to each Geohash string in GH to obtain a list set SH of Geohash grids to be merged corresponding to GH; set SH a The Geohash grids with overlapping edges in the JH are merged; the remaining JH' level Geohash grids are merged to JH min The Geohash grids of different levels are merged to obtain the multi-level grids corresponding to the target gridded airspace; thereby the number of Geohash grids is greatly reduced, making the rendering efficiency of the later Geohash grids higher.
[0130] In an exemplary embodiment, in the above embodiment, in 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, obtaining 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 with intersecting edges.
[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 may be any Geohash grid, and the second initial Geohash grid may be any Geohash grid except the first initial Geohash grid; the first initial Geohash grid may be a regular rectangular Geohash grid; or 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 make 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 overlap in edges.
[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 at the intersection of RD and RE, v is the number of longitude and latitude points at 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 of the intersection of RD and RE 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 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.
[0142] In this embodiment, if V>1, it means that there is more than one intersection point between RD and RE, but the edges to be determined between two clockwise adjacent intersection points 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'); where YD z For PD z 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 acquired 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 both RD and RE, 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 The fusion with RD and RE includes: 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 fusion 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 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 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 Merge with RD and RE; if YD' is in RD and RE at the same time, merge YD' with RD and RE; thus accurately determine whether the two Geohash grids can be merged.
[0151] 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 the steps must be performed in this specific order, or that all the 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, etc.
[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 use 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 device, or any combination of the above. More specific examples (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 of the above.
[0154] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit 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, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0156] Program code for performing the operations of the present application may 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 may 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 may 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 may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0157] An embodiment of the present invention further provides an electronic device, comprising a processor and the aforementioned non-transitory computer-readable storage medium.
[0158] The electronic device is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0159] 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: the at least one processor mentioned above, the at least one memory mentioned above, 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 executes the steps in 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.), may communicate with one or more devices that enable a user to interact with the electronic device, and / or may communicate with any device (e.g., routers, modems, etc.) that enables the electronic device to communicate with one or more other computing devices. Such communication may be performed through 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) through a network adapter. The network adapter communicates with other modules of the electronic device through a bus. It should be understood that, although not shown in the figure, 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, etc.
[0165] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation 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, including 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 implementation of the present disclosure.
[0166] An embodiment of the present invention further provides a computer program product, which includes 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 example, it should be understood by those skilled in the art that the above examples are only for illustration, not for limiting 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 drone in an airspace suitable for flying, characterized in that: The method comprises the following steps: H100, obtaining coordinates YQ of the position to be determined; wherein YQ includes the longitude and latitude of the position to be determined; H200, according to 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(α) ), eta = 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 flying airspace; 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.
2. The method for determining the position coordinates of a drone in a suitable flying airspace according to claim 1, characterized in that: 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 determined is not in the preset suitable 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.
3. The method for determining the position coordinates of a drone in a suitable flying airspace according to claim 1, characterized in that: 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 intersections with each third-level preset area within the target second-level preset area; H260, determine the third level preset area corresponding to the third intersection number 1 as TQ.
4. The method for determining the position coordinates of a drone in a suitable flying airspace according to claim 3, 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.
5. The method for determining the position coordinates of a drone in a suitable flying airspace according to claim 1, characterized in that: 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.
6. The method for determining the position coordinates of a drone in an airspace suitable for flying according to claim 1, characterized in that: γ=5.
7. The method for determining the position coordinates of a drone in an airspace suitable for flying according to claim 1, characterized in that: After step H500, the method further comprises the following steps: H600: If the position to be determined is not in the preset suitable flying 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