Method, device, computer device and storage medium for determining spatial relationships

JP7639162B2Active Publication Date: 2025-03-04JINGDONG CITY BEIJING DIGITS TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
JP2023556947
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-03-16
Filing Date
2022-02-09
Publication Date
2025-03-04
Estimated Expiration
2042-02-09

AI Technical Summary

Benefits of technology

【0010】 本開示によって提供される空間関係の決定方法、装置、コンピュータ装置及び記憶媒体は、以下の有益な効果を有する。まず空間関係計算要求を取得し、計算要求に多角形領域及び報告ポイントセットが含まれ、その後に個々の地理的グリッドと多角形領域との間の位置関係に基づいて、多角形領域に対応する複数の第1の符号化値を決定し、さらに各地理的グリッドと報告ポイントセットのうちの個々の報告ポイントとの間の位置関係に基づいて、報告ポイントセットに対応する複数の第2の符号化値、及び各第2の符号化値にそれぞれ対応する報告ポイントグループを決定して、複数の第1の符号化値及び複数の第2の符号化をそれぞれソートしてマッチングさせて、各第1の符号化値にそれぞれマッチングする第2の符号化値を決定し、さらに各第1の符号化値にそれぞれマッチングする第2の符号化値に対応する報告ポイントグループに基づいて、多角形領域と報告ポイントセットのうちの個々の報告ポイントとの間の関係を決定することができる。これにより、各空間オブジェクトのそれぞれに対応する符号化値リストに基づいて、空間オブジェクト間の関係を迅速に決定することにより、データ処理の時間の複雑さと計算の複雑さを低減し、リソースオーバーヘッドを大幅に低減し、効率を向上させた。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007639162000001
    Figure 0007639162000001
  • Figure 0007639162000002
    Figure 0007639162000002
  • Figure 0007639162000003
    Figure 0007639162000003
Patent Text Reader

Abstract

The present disclosure provides a method, an apparatus, a computer device and a storage medium for determining a spatial relationship, the method including: obtaining a spatial relationship calculation request, the calculation request including a polygonal region and a reporting point set; determining a plurality of first coding values ​​corresponding to the polygonal region based on a positional relationship between each geographical grid and the polygonal region, where each geographical grid corresponds to one coding value; determining a plurality of second coding values ​​corresponding to the reporting point set and a reporting point group corresponding to each second coding value based on a positional relationship between each geographical grid and each reporting point of the reporting point set; sorting and matching the plurality of first coding values ​​and the plurality of second coding values ​​to determine a second coding value corresponding to each first coding value; and determining a relationship between the polygonal region and each reporting point of the reporting point set based on the reporting point group corresponding to the second coding value corresponding to each first coding value.
Need to check novelty before this filing date? Find Prior Art

Description

Priority information

[0001] This application is based on a Chinese patent application with Chinese patent application number "202110280378.1" and filing date on March 16, 2021, and claims priority to the Chinese patent application, the entire contents of which are hereby incorporated by reference into this application. [Technical field]

[0002] The present disclosure relates to the field of computer technology, and in particular to a method, apparatus, computer device, and storage medium for determining spatial relationships. [Background technology]

[0003] With the popularity of global positioning systems and mobile Internet devices, the application scenarios of spatial data relationships are becoming more and more widespread. For example, finding the nearest subway station, determining the location of the nearest bus stop in a residential area, and statistics on the number of people in a polygonal area. If it is only a single location query, we can find the most recent optimal solution based on personal experience. However, determining spatial relationships for large amounts of data takes a lot of time and reduces efficiency. Summary of the Invention

[0004] The present disclosure aims to solve at least one of the technical problems of the related art to some extent.

[0005] An embodiment of a first aspect of the present disclosure provides a method for determining a spatial relationship, the method including: obtaining a spatial relationship calculation request, the calculation request including a polygonal area and a reporting point set; determining a plurality of first coded values ​​corresponding to the polygonal area based on a positional relationship between each geographical grid and the polygonal area, where each geographical grid corresponds to one coded value; determining a plurality of second coded values ​​corresponding to the reporting point set and a reporting point group corresponding to each of the second coded values ​​based on a positional relationship between each of the geographical grids and each of the reporting points in the reporting point set; sorting and matching the plurality of first coded values ​​and the plurality of second coded values ​​to determine second coded values ​​matching each of the first coded values; and determining a relationship between the polygonal area and each of the reporting points in the reporting point set based on the reporting point group corresponding to the second coded value matching each of the first coded values.

[0006] An embodiment of a second aspect of the present disclosure provides a spatial relationship determination device, the device including: an acquisition module for acquiring a spatial relationship calculation request, the calculation request including a polygonal region and a reporting point set; a first determination module for determining a plurality of first coding values ​​corresponding to the polygonal region based on a positional relationship between each geographical grid and the polygonal region, the first determination module being configured to determine each of the first coding values ​​corresponding to the polygonal region; a second determination module for determining a plurality of second coding values ​​corresponding to the reporting point set and a reporting point group corresponding to each of the second coding values ​​based on a positional relationship between each of the geographical grids and each of the reporting points in the reporting point set; a matching module for sorting and matching the plurality of first coding values ​​and the plurality of second coding values, respectively, to determine a second coding value that matches each of the first coding values; and a third determination module for determining a relationship between the polygonal region and each of the reporting points in the reporting point set based on a reporting point group corresponding to the second coding value that matches each of the first coding values.

[0007] An embodiment of a third aspect of the present disclosure provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and operable on the processor, the processor, when executing the program, realizing the method for determining spatial relationships provided by the embodiment of the first aspect of the present disclosure.

[0008] An embodiment of a fourth aspect of the present disclosure provides a non-transitory computer-readable storage medium including a computer program, which, when executed by a processor, implements the method for determining spatial relationships provided by the embodiment of the first aspect of the present disclosure.

[0009] An embodiment of the fifth aspect of the present disclosure is a computer program M The computer program ToThe instructions, when executed by a processor, perform a method for determining a spatial relationship presented by an embodiment of the first aspect of the present disclosure.

[0010] The spatial relationship determination method, device, computer device, and storage medium provided by the present disclosure have the following beneficial effects: First, a spatial relationship calculation request is obtained, and the calculation request includes a polygonal region and a report point set; then, based on the positional relationship between each geographical grid and the polygonal region, a plurality of first coding values ​​corresponding to the polygonal region are determined; further, based on the positional relationship between each geographical grid and each report point in the report point set, a plurality of second coding values ​​corresponding to the report point set and a report point group corresponding to each second coding value are determined; and, based on the positional relationship between each geographical grid and each report point in the report point set, the plurality of first coding values ​​and the plurality of second coding values ​​are sorted and matched, respectively, to determine a second coding value that matches each first coding value; and further, based on the report point group corresponding to the second coding value that matches each first coding value, the relationship between the polygonal region and each report point in the report point set can be determined. This reduces the time complexity and calculation complexity of data processing, greatly reduces resource overhead, and improves efficiency by quickly determining the relationship between spatial objects based on the coding value list corresponding to each spatial object.

[0011] Additional features and advantages of the present application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the disclosure. [Brief description of the drawings]

[0012] The above and / or additional aspects and advantages of the present disclosure will become more apparent and easier to understand from the following detailed description of the embodiments taken in conjunction with the drawings. [Figure 1] 1 is a schematic flowchart of a method for determining a spatial relationship provided by an embodiment of the present disclosure; [Diagram 2]4 is a schematic flowchart of a method for determining a spatial relationship provided by another embodiment of the present disclosure; [Diagram 3] 1 is a schematic diagram of a first encoding list and a second encoding list provided by an embodiment of the present disclosure. FIG. [Figure 4] FIG. 1 is a schematic configuration diagram of a spatial relationship determination device provided by an embodiment of the present disclosure. [Diagram 5] FIG. 2 is a schematic configuration diagram of a spatial relationship determining apparatus provided according to another embodiment of the present disclosure; [Figure 6] FIG. 1 is a block diagram of an exemplary computing device adapted to implement embodiments of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0013] Hereinafter, the embodiments of the present disclosure will be described in detail, and examples of the embodiments are illustrated in the accompanying drawings, in which the same or similar reference numerals throughout the drawings indicate the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are illustrative and are intended to explain the present disclosure, and are not to be understood as limitations on the present disclosure.

[0014] Hereinafter, a spatial relationship determining method, an apparatus, a computer device, and a storage medium according to embodiments of the present disclosure will be described with reference to the accompanying drawings.

[0015] FIG. 1 is a schematic flow chart of a method for determining a spatial relationship provided by an embodiment of the present disclosure.

[0016] In the embodiments of the present disclosure, the spatial relationship determination method is described as being configured in a spatial relationship determination device, and the spatial relationship determination device can be applied to any computer device so that the computer device can perform the spatial relationship determination function.

[0017] The computing device may be a personal computer (abbreviated as PC), a cloud device, a mobile device, etc., and the mobile device may be a hardware device equipped with various operating systems, touch screens and / or displays, such as, for example, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, an in-vehicle device, etc.

[0018] As shown in FIG. 1, the method for determining a spatial relationship may include the following steps 101 to 105.

[0019] Step 101, obtain a spatial relationship calculation request, the calculation request including a polygon area and a report point set.

[0020] The spatial relationship may be a containment relationship, or a nearest neighbor relationship, etc. This disclosure is not limited thereto.

[0021] Also, a spatial relationship calculation request may include one polygonal area or may include multiple polygonal areas. A spatial relationship calculation request may include one reporting point set or may include multiple reporting point sets.

[0022] Alternatively, the spatial relationship calculation request may further include a target spatial relationship, such as determining whether the polygon region contains the report point, or determining the closest report point to the polygon region.

[0023] Step 102: determine a plurality of first coding values ​​corresponding to the polygonal region based on the positional relationship between each geographic grid and the polygonal region, where each geographic grid corresponds to one coding value respectively.

[0024] The encoded value may be an encoded value generated using any encoding method based on latitude and longitude information corresponding to a geographic grid, and may take various forms, such as an encoded value generated by encoding using a hash algorithm that is a geographic hash value.

[0025] Additionally, the location relationship between the geographic grid and the polygonal area may vary, such as the geographic grid being completely within the polygonal area, the geographic grid being partially within the polygonal area, or the geographic grid not being within the polygonal area.

[0026] Furthermore, when the positional relationship between the geographic grid and the polygonal area is different, the situation of the first coded value corresponding to the polygonal area may also be different.

[0027] In this disclosure, any function that calculates an encoded value corresponding to an object may be used to determine the first encoded values ​​corresponding to the polygonal region.

[0028] Also, for each known coding function, only coding values ​​corresponding to geographic grids that lie completely within the polygonal domain can be calculated, i.e., if any geographic grid lies completely within the polygonal domain, then the first calculated coding value corresponding to the polygonal domain includes the coding value corresponding to the geographic grid.

[0029] Alternatively, if any geographic grid is not within the polygonal region, the first coded value calculated and corresponding to the polygonal region does not include any coded value corresponding to the any geographic grid.

[0030] In the present disclosure, in order to ensure that the first coding value corresponding to the finally obtained polygonal area is sufficiently comprehensive and complete, the polygonal area can first be expanded, so that the multiple first coding values ​​corresponding to the finally obtained polygonal area also include coding values ​​corresponding to geographical grids only a portion of which is within the polygonal area.

[0031] Optionally, for any geographic grid having a portion within the polygonal area, when the polygonal area is expanded, eight geographic grids adjacent to the given geographic grid may be merged so that the eight geographic grids adjacent to the given geographic grid are completely located within the expanded polygonal area.

[0032] Alternatively, for any geographic grid having a portion within the polygonal region, the individual vertices of the geographic grid can be determined first, and when expanding the polygonal region, the polygonal region can be extended by extending outward a fixed distance along each vertex that is not within the polygonal region.

[0033] It should be noted that the above examples are merely illustrative and do not limit the polygonal region extension of the embodiments of the present disclosure.

[0034] Step 103: determine a plurality of second encoding values ​​corresponding to the reporting point set and a reporting point group respectively corresponding to each second encoding value based on a positional relationship between each geographic grid and each individual reporting point of the reporting point set.

[0035] The positional relationship between the geographic grid and a reporting point in the set of reporting points may be such that the geographic grid includes the reporting point or the geographic grid does not include the reporting point.

[0036] Correspondingly, if the reporting points are in a geographic grid, it can be determined that the second coding value corresponding to the reporting point set includes a coding value corresponding to the geographic grid, and if the reporting points are not in a geographic grid, it can be determined that the second coding value corresponding to the reporting point set does not include a coding value corresponding to the geographic grid.

[0037] It should be noted that if a reporting point is on the boundary of a geographic grid, then the reporting point is also determined to be on the geographic grid, and thus it can be determined that the second encoding value corresponding to the reporting point set includes an encoding value corresponding to the geographic grid.

[0038] Also, a reporting point group may include one reporting point or may include multiple reporting points.

[0039] For example, if a coding value corresponding to a geographic grid A is WX1 and reporting points a, b, c, d, and e are all within the geographic grid A, it can be determined that one second coding value corresponding to a reporting point set is WX1, and the reporting point group corresponding to the second coding value WX1 can include reporting points a, b, c, d, e, etc.

[0040] It should be noted that the above examples are merely illustrative and do not limit the geographic grids and their corresponding coding values, the second coding values ​​corresponding to the reporting point sets, and the reporting point groups each corresponding to the second coding values ​​of the embodiments of the present disclosure.

[0041] Step 104: sorting and matching the plurality of first encoded values ​​and the plurality of second encoded values, respectively, to determine a second encoded value that matches each first encoded value, respectively.

[0042] Sorting may be in various ways, such as largest to smallest, smallest to largest, etc.

[0043] For example, each of the first encoded values ​​can be sorted in ascending order, and each of the second encoded values ​​can be sorted, and then the smallest first encoded value and the smallest second encoded value that were previously sorted can be compared.

[0044] For example, by sorting in ascending order, the sorted individual first encoded values ​​are obtained as N1, N2, and N3, and the sorted individual second encoded values ​​are obtained as M1, M2, and M3. Then, the relationship between the smallest first encoded value and the smallest second encoded value can be compared first. If N1 is smaller than M1 and both M2 and M3 are larger than M1, it is possible to determine that there is no second encoded value in M1, M2, and M3 that is the same as the first encoded value N1 without needing to continuously compare the relationship between N1 and M2 and M3, thereby reducing the complexity of data processing and improving efficiency.

[0045] Alternatively, the relationship between the smallest first encoded value and the smallest second encoded value can be compared first, and if N1 is greater than M1, the relationship between N1 and M2 can be continuously compared. If N1 is less than M2, it is clear that N1 is also less than M3, and thus it can be determined that there is no second encoded value in M1, M2, and M3 that is the same as the first encoded value N1 without the need for continuous comparison.

[0046] When N1 and M2 are the same, that is, N1 and M2 satisfy the matching condition, after the matching of N1 is completed, the second coded value matching N2 can be continuously found. Although N2 is larger than N1, N1 is the same as M2, so it can be obtained that N2 is larger than M2. Therefore, when determining the second coded value matching N2, the comparison can start from M3, which can effectively shorten the matching time.

[0047] As can be seen from the above description, when the number of first encoded values ​​and second encoded values ​​is large, each matching process of the first encoded values ​​and the second encoded values ​​can be performed in the above process, thereby effectively shortening the matching time and improving the processing efficiency.

[0048] Note that the above examples are merely illustrative and do not limit the first encoded value, the second encoded value, and the matching relationship between the two in the embodiments of the present disclosure.

[0049] Step 105: determining a relationship between the polygon area and each of the reporting points in the reporting point set based on the reporting point groups corresponding to the second coding values ​​that respectively match each of the first coding values.

[0050] The relationship between the polygon region and the individual reporting points of the reporting point set may vary, for example it may be a containment relationship, a non-containment relationship, a nearest neighbor relationship, etc.

[0051] If the second coded value matches the first coded value, it indicates that the two correspond to the same map grid, and the reporting point group corresponding to each of the second coded values ​​is also the reporting point group corresponding to the first coded value, and it can be determined that the first coded value is one of a plurality of first coded values ​​corresponding to a polygonal region, and the polygonal region includes the reporting point group corresponding to the first coded value.

[0052] For example, a first coded value is WY1, a matching second coded value is also WY1, and the report point groups corresponding to the second coded values ​​are report points a, b, and c. Correspondingly, the report point groups corresponding to the first coded value are also report points a, b, and c. It can be determined that the first coded value corresponding to the polygonal region includes WY1, and thus the polygonal region also includes report points a, b, and c corresponding to WY1.

[0053] Correspondingly, if the second coding value and the first coding value do not satisfy the matching condition, each reporting point group corresponding to the second coding value has no corresponding relationship with the first coding value, and no corresponding relationship with the polygon area, so that it can be determined that these reporting point groups are not included in the polygon area.

[0054] It should be noted that the above examples are merely illustrative and do not limit the relationship between polygonal regions and individual reporting points in a reporting point set in the embodiments of the present disclosure.

[0055] In an embodiment of the present disclosure, a spatial relationship calculation request is first obtained, and the calculation request includes a polygon area and a report point set. Then, based on the positional relationship between each geographic grid and the polygon area, a plurality of first coding values ​​corresponding to the polygon area are determined, and based on the positional relationship between each geographic grid and each report point in the report point set, a plurality of second coding values ​​corresponding to the report point set and a report point group corresponding to each second coding value are determined, and the plurality of first coding values ​​and the plurality of second coding values ​​are respectively sorted and matched to determine a second coding value corresponding to each first coding value, and based on the report point group corresponding to the second coding value corresponding to each first coding value, a relationship between the polygon area and each report point in the report point set can be determined. This reduces the time complexity and calculation complexity of data processing, greatly reduces resource overhead, and improves efficiency by quickly determining the relationship between spatial objects based on the coding value list corresponding to each of the individual spatial objects.

[0056] In some embodiments, the relationship between the spatial objects can be quickly determined based on the list of encoded values ​​that each of the individual spatial objects corresponds to. Furthermore, there may be various cases when sorting and matching the first encoded values ​​and the second encoded values, and the above process will be further described below in conjunction with steps 201-209 of FIG. 2.

[0057] Step 201, obtain a spatial relationship calculation request, the calculation request including a polygon area and a report point set.

[0058] Step 202, determining the type of each reporting point in the set of reporting points.

[0059] Step 203 determines the size of the geographic grid based on the type of reporting points.

[0060] The type of the report point can be determined based on how it is generated, for example, the report point can be generated by human positioning and its type can be a first type, or the report point can be generated by bus stop positioning and its type can be a second type, etc.

[0061] It should be noted that for different types of reporting points, the corresponding geographic grid sizes may be different, and different geographic grid sizes may correspond to different accuracy ranges.

[0062] For example, when a reporting point is of the first type and the containment relationship is calculated by calculating the case where the reporting point is included in the polygon area, the size of the geographic grid can be divided into smaller areas, thereby making the relationship between the determined polygon area and the reporting point more accurate.

[0063] Or, the reporting point is of the second type, and the nearest neighbor relationship is calculated by calculating the nearest reporting point to the polygon area, and the size of the geographic grid can be partitioned relatively large to meet the needs of the business.

[0064] For example, when the reporting point is of the first type, it is necessary to calculate the number of people contained in the residential polygon area, and the size of the geographic grid can be divided into smaller areas. Usually, the boundary range of the residential polygon area is larger than 5m*5m, the precision corresponding to the 8-bit coding value is 38.2m*19m, and the precision range corresponding to the 9-bit coding value is 4.8m*4.8m, where the 9-bit coding value can be selected to make the number of people contained in the determined residential polygon area more accurate.

[0065] Or, if the reporting point is of the second type, when determining the location of the nearest bus stop near the residential area, the approximate distance between each residential area and the location of the bus stop can be estimated, which may be 2 km, for example, in which case a 6-bit encoding value can be selected, and the corresponding accuracy of the 6-bit encoding value is 1.2 km*609.4 m.

[0066] It should be noted that the above examples are merely illustrative and are not intended to limit the determination of the types of reporting points and the size of the geographic grid in the embodiments of the present disclosure.

[0067] Step 204, in response to some or all of the area of ​​the arbitrary geographic grid being located within the polygonal area, determines an encoding value corresponding to the arbitrary geographic grid as a first encoding value corresponding to the polygonal area.

[0068] For any geographic grid whose part lies within a polygonal area, the polygonal area can first be expanded so that a first coding value corresponding to the polygonal area includes a coding value corresponding to the arbitrary geographic grid.

[0069] In an embodiment of the present disclosure, the first coding value corresponding to the polygonal area may include coding values ​​corresponding to any geographic grid of some or all of the area located in the polygonal area, thereby making the finally obtained first coding value corresponding to the polygonal area sufficiently comprehensive and complete.

[0070] Step 205: Determine a plurality of second encoding values ​​corresponding to the reporting point set and a reporting point group corresponding to each second encoding value based on a positional relationship between each geographic grid and each individual reporting point of the reporting point set.

[0071] Step 206: sorting the plurality of first encoded values ​​and the plurality of second encoded values ​​according to a preset rule to obtain a sorted first encoded list and a sorted second encoded list, respectively.

[0072] The preset rule may be ascending order, descending order, or some other rule.

[0073] For example, the individual first encoded values ​​can be sorted from smallest to largest to obtain a sorted first encoded list, and accordingly, the individual second encoded values ​​can be sorted from smallest to largest to obtain a sorted second encoded list.

[0074] Alternatively, the individual first encoded values ​​can be sorted in descending order to obtain a sorted first encoded list, and correspondingly, the individual second encoded values ​​can be sorted in descending order to obtain a sorted second encoded list.

[0075] It should be noted that the above examples are merely illustrative and do not limit the acquisition of sorted first encoded lists, second encoded lists, etc. in the embodiments of the present disclosure.

[0076] Step 207, in response to the first first encoded value in the first encoded list being smaller than the first second encoded value in the second encoded list and the preset rule being in ascending order, sequentially traversing each first encoded value after the first first encoded value in the first encoded list until obtaining a first encoded value that is the same as the first second encoded value in the second encoded list.

[0077] For example, in the schematic diagram of the first encoding list and the second encoding list shown in Figure 3, both the first encoding value and the second encoding value are sorted in ascending order. The individual first encoding values ​​in the first encoding list are N1, N2, N3, N4, and N5 in order, and the individual second encoding values ​​in the second encoding list are M1, M2, M3, M4, and M5 in order. If N1 is smaller than M1, the relationship between N2 and M1 can be continuously compared, and if N2 is smaller than M1, the relationship between N3 and M1 can be continuously compared, and if N3 is equal to M1, it can be determined that N3 is the first encoding value that is the same as M1.

[0078] It should be noted that the above examples are merely illustrative and do not limit the first encoded value, the second encoded value, and the like in the embodiments of the present disclosure.

[0079] In some embodiments, the i-th first encoded value in the first encoded list is the same as the j-th second encoded value in the second encoded list, where i and j are positive integers, and the i+1-th first encoded value in the first encoded list is matched with each second encoded value located after the j-th second encoded value in the second encoded list to obtain a second encoded value that matches the i+1-th first encoded value.

[0080] For example, in the schematic diagram shown in FIG. 3, when N2 and M3 are the same, N3 is greater than N2, and obviously N3 is also greater than M3, M2, and M1, so the relationship between N3 and M4 can be directly compared, which eliminates the need to sequentially compare N3 with M3, M2, and M1, thereby reducing the complexity of data processing, reducing computing resources, and greatly improving efficiency.

[0081] Then, if N3 is smaller than M4, the relationship between N3 and M5 can be continuously compared, and if N3 is the same as M5, it can be determined that the second encoded value matching N3 is M5.

[0082] Note that the above examples are merely illustrative and do not limit the first encoded value, the second encoded value, and the matching relationship between the two in the embodiments of the present disclosure.

[0083] Step 208: In response to the first first encoded value in the first encoded list being smaller than the first second encoded value in the second encoded list and the preset rule being in ascending order, sequentially traverse each first encoded value located after the first first encoded value in the first encoded list until the i-th first encoded value in the first encoded list is larger than the first second encoded value in the second encoded list, and determine that the first encoded list does not include a first encoded value that matches the first second encoded value in the second encoded list.

[0084] For example, in the schematic diagram shown in FIG. 3, when N1 is smaller than M1, N2 can be continuously compared with M1, and when N2 is smaller than M1, N3 can be continuously compared with M1. When N3 is larger than M1, each first coding value in the first coding list is sorted in ascending order, so obviously N4 and N5 are also larger than M1. Furthermore, there is no need to compare M1 with N4 and N5 respectively, and it can be determined that the first coding list does not include the first coding value that is the same as M1, thereby reducing the process of data processing, reducing the complexity of data processing, and improving the efficiency of data processing.

[0085] Note that the above examples are merely illustrative and do not limit the first encoding values ​​in the first encoding list, the second encoding values ​​in the second encoding list, and matching relationships in the embodiments of the present disclosure.

[0086] Step 209 determines relationships between the polygon area and individual reporting points in the reporting point set based on the reporting point groups corresponding to the second coding values ​​that respectively match each of the first coding values.

[0087] A reporting point group corresponding to each first encoded value may be determined in advance based on a reporting point group corresponding to a second encoded value that matches each first encoded value.

[0088] It should be noted that when the second coded value matches the first coded value, the reporting point group corresponding to each of the second coded values ​​is also the reporting point group corresponding to the first coded value.

[0089] Also, depending on different target spatial relationships, the relationship between the polygonal area to be determined and the individual reporting points of the reporting point set may be different.

[0090] For example, in response to the target spatial relationship being a containment relationship, overlapping reporting points are removed and merged from the individual reporting point groups to generate a set of reporting points contained within the polygonal region.

[0091] For each reporting point located on a geographic grid boundary, it may also be counted in multiple geographic grids, which may result in the same reporting point being included in different reporting point groups, so that duplicate reporting points in each reporting point group can be removed first. For example, if both reporting point group 1 and reporting point group 2 include the same reporting point a, it can be chosen to keep reporting point a in reporting point group 1 and remove reporting point a in reporting point group 2.

[0092] In addition, the polygonal region corresponds to a plurality of first coded values, and the reporting point groups corresponding to each of the first coded values ​​are part of the reporting point set corresponding to the polygonal region. After the reporting point groups corresponding to each of the first coded values ​​are determined, first, duplicated reporting points in the reporting point groups corresponding to each of the first coded values ​​are removed, and then individual reporting points in each of the reporting point groups are merged to obtain a reporting point set included in the polygonal region.

[0093] For example, a polygon region includes three first encoding values, and the report point groups corresponding to each of the first encoding values ​​are report point group 1, report point group 2, and report point group 3. If both report point group 1 and report point group 2 include the same report point a, a in report point group 1 can be kept and report point a in report point group 2 can be removed, and then individual report points in report point group 1, report point group 2, and report point group 3 can be merged, and the merged result is a report point set included in the polygon region.

[0094] It should be noted that the above examples are merely illustrative and are not intended to limit the set of reporting points included in the polygonal regions of the embodiments of the present disclosure.

[0095] Alternatively, in response to the target spatial relationship being a nearest neighbor relationship, a distance between each geographical mesh grid and each reporting point of the corresponding reporting point group is determined, and then a reporting point having a closest distance to the polygonal area is determined based on the distance between each geographical mesh grid and each reporting point of the corresponding reporting point group.

[0096] For example, if the target spatial relationship is a nearest neighbor relationship and the reporting points of the reporting point group corresponding to the geographic grid 1 are a1, b1, and c1, the distances between the geographic grid 1 and the reporting points a1, b1, and c1 can be determined first. If the reporting points of the reporting point group corresponding to the geographic grid 2 are a2, b2, and c2, the distances between the geographic grid 1 and the reporting points a2, b2, and c2 can be determined first, and then the individual distance values ​​can be sorted, and the reporting point with the smallest distance value is the reporting point with the closest distance to the polygon area.

[0097] It should be noted that the above examples are merely illustrative and do not limit the determination of the closest reporting point to the polygon region in the embodiments of the present disclosure.

[0098] In the embodiment of the present disclosure, a spatial relationship calculation request is first obtained, and then the size of the geographic grid can be determined based on the type of the reporting point, and then the corresponding first and second coding values ​​can be determined based on the positional relationship between each geographic grid and the polygonal area, and the positional relationship between the geographic grid and the reporting point in the reporting point set, and then each first and second coding values ​​can be sorted according to a preset rule to obtain a sorted first coding list and a sorted second coding list, and then sequentially traversed to further determine the matching relationship between each first coding value in the first coding list and each second coding value in the second coding list, and further determine the relationship between the polygonal area and each reporting point in the reporting point set. This reduces the time complexity and calculation complexity of data processing, greatly reduces resource overhead, and improves efficiency by quickly determining the relationship between spatial objects based on the coding value list corresponding to each individual spatial object.

[0099] In some embodiments, the present disclosure further provides an apparatus for determining a spatial relationship.

[0100] FIG. 4 is a schematic block diagram of a spatial relationship determining apparatus provided according to an embodiment of the present disclosure.

[0101] As shown in FIG. 4, the spatial relationship determining apparatus 100 may include an obtaining module 110, a first determining module 120, a second determining module 130, a matching module 140, and a third determining module 150.

[0102] The acquisition module 110 acquires a spatial relationship calculation request, the calculation request including a polygon area and a report point set.

[0103] The first determination module 120 determines a plurality of first encoding values ​​corresponding to the polygonal region based on a positional relationship between each geographic grid and the polygonal region, where each geographic grid corresponds to one encoding value.

[0104] A second determination module 130 determines a plurality of second encoding values ​​corresponding to the reporting point set and a reporting point group corresponding to each of the second encoding values ​​based on a positional relationship between each of the geographic grids and individual reporting points of the reporting point set.

[0105] A matching module 140 sorts and matches the plurality of first encoded values ​​and the plurality of second encoded values, respectively, to determine a second encoded value that matches each of the first encoded values, respectively.

[0106] A third determination module 150 determines a relationship between the polygon area and each of the reporting points in the reporting point set based on a reporting point group corresponding to a second encoding value that matches each of the first encoding values.

[0107] The functions and implementation principles of the above modules in the embodiments of the present disclosure can be referred to in the embodiments of the above methods, and the description is omitted here.

[0108] The spatial relationship determination device of the embodiment of the present disclosure can first obtain a spatial relationship calculation request, the calculation request includes a polygonal region and a report point set, and then determine a plurality of first coding values ​​corresponding to the polygonal region based on the positional relationship between each geographical grid and the polygonal region, and further determine a plurality of second coding values ​​corresponding to the report point set and a report point group corresponding to each second coding value based on the positional relationship between each geographical grid and each report point of the report point set, and sort and match the plurality of first coding values ​​and the plurality of second codings, respectively, to determine a second coding value matching each of the first coding values, and further determine a relationship between the polygonal region and each report point of the report point set based on the report point group corresponding to the second coding value matching each of the first coding values. This reduces the time complexity and calculation complexity of data processing by quickly determining the relationship between the spatial objects based on the coding value list corresponding to each of the individual spatial objects, greatly reducing resource overhead and improving efficiency.

[0109] Further, in an embodiment of the present disclosure, referring to FIG. 5, based on the embodiment shown in FIG. 4, the above-mentioned apparatus 100 may further include a fourth determination module 160 for determining a type of each reporting point in the reporting point set, and a fifth determination module 170 for determining a size of the geographical grid based on the type of the reporting point.

[0110] In some embodiments, the first determination module 120 specifically determines a first coding value corresponding to any geographic grid as one first coding value corresponding to the polygonal area in response to some or all of the area of ​​the any geographic grid being located within the polygonal area.

[0111] In some embodiments, the matching module 140 sorts the plurality of first encoded values ​​and the plurality of second encoded values, respectively, according to a specific preset rule to obtain sorted first encoded lists and second encoded lists, and in response to a first first encoded value in the first encoded list being smaller than a first second encoded value in the second encoded list, the preset rule being in ascending order, sequentially traverses each first encoded value after a first first encoded value in the first encoded list until obtaining a first encoded value that is the same as a first second encoded value in the second encoded list.

[0112] In some embodiments, the matching module 140 further, specifically in response to a first first encoded value in the first encoded list being smaller than a first second encoded value in the second encoded list and the preset rule being in ascending order, sequentially traverses each first encoded value located after the first first encoded value in the first encoded list until an i-th first encoded value in the first encoded list is greater than a first second encoded value in the second encoded list, and determines that the first encoded list does not include a first encoded value that matches the first second encoded value in the second encoded list.

[0113] In some embodiments, the i-th first encoded value in the first encoded list is the same as the j-th second encoded value in the second encoded list, where i and j are each positive integers, and the matching module 140 further specifically matches the i+1-th first encoded value in the first encoded list with each second encoded value located after the j-th second encoded value in the second encoded list to obtain a second encoded value that matches the i+1-th first encoded value.

[0114] In some embodiments, the calculation request further includes a target spatial relationship, and the third determination module 150 determines a reporting point group corresponding to each of the first encoding values ​​based specifically on a reporting point group corresponding to a second encoding value that matches each of the first encoding values, and in response to the target spatial relationship being an inclusion relationship, removes and merges overlapping reporting points from each of the reporting point groups to generate a reporting point set included in the polygonal area.

[0115] In some embodiments, the third determination module 150, more specifically, in response to the target spatial relationship being a nearest neighbor relationship, determines a distance between each of the geographical mesh grids and each reporting point of the corresponding reporting point group, and determines a reporting point that is closest to the polygonal area based on a first distance between each of the geographical mesh grids and each reporting point of the corresponding reporting point group.

[0116] The functions and specific implementation principles of each of the above modules in the embodiments of the present disclosure may refer to the embodiments of the above methods, and the description will be omitted here.

[0117] The spatial relationship determination device of the embodiment of the present disclosure can first obtain a spatial relationship calculation request, and then determine the size of a geographical grid based on the type of a reporting point, and then determine corresponding first and second coding values ​​based on the positional relationship between each geographical grid and a polygonal region and the positional relationship between the geographical grid and a reporting point in the reporting point set, and then sort each first and second coding values ​​according to a preset rule to obtain a sorted first coding list and a second coding list, and then sequentially traverse to further determine a matching relationship between each first coding value in the first coding list and each second coding value in the second coding list, and further determine the relationship between the polygonal region and each reporting point in the reporting point set. This reduces the time complexity and calculation complexity of data processing, greatly reduces resource overhead, and improves efficiency by quickly determining the relationship between spatial objects based on the coding value list corresponding to each of the individual spatial objects.

[0118] In some embodiments, the present disclosure further provides a computer apparatus, comprising a memory, a processor, and a computer program stored in the memory and operable on the processor, the processor, when executing the program, implementing the method of determining spatial relationships provided by the embodiments described in the present disclosure.

[0119] In some embodiments, the present disclosure further provides a non-transitory computer-readable storage medium including a computer program, which, when executed by a processor, implements the spatial relationship determination method provided by the above-described examples of the present disclosure.

[0120] In some embodiments, the present disclosure further comprises a computer program product. M Present and computer program To The instructions, when executed by a processor, perform the method of determining spatial relationships presented by the embodiments described in this disclosure.

[0121] FIG. 6 is a block diagram of an exemplary computing device adapted to implement embodiments of the present disclosure. The computing device 12 shown in FIG. 6 is merely an example and should not limit in any way the functionality and scope of use of embodiments of the present disclosure.

[0122] 6, computing device 12 is depicted as a general-purpose computing device. Components of computing device 12 may include, but are not limited to, one or more processors or processing units 16, a system memory 28, and a bus 18 that connects different system components (including the system memory 228 and the processing units 16).

[0123] Bus 18 represents one or more of several classes of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics accelerator port, a processor, or a local bus using any of a number of bus structures, including, but not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0124] Computing device 12 typically includes a number of computer system readable media, which may be any available media that can be accessed by computing device 12 and includes volatile media, nonvolatile media, removable media, and non-removable media.

[0125] The memory 28 may comprise a computer system readable medium in the form of a volatile memory such as a Random Access Memory (RAM) 30 and / or a cache memory 32. The computer device 12 may further comprise other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may read from and write to a non-removable, non-volatile magnetic medium (not shown in FIG. 6, but commonly referred to as a "hard disk drive"). Although not shown in FIG. 6, a disk drive may be provided for reading and writing a removable, non-volatile disk (e.g., a "floppy disk"), and an optical disk drive may be provided for reading and writing a removable, non-volatile disk (e.g., a Compact Disc Read Only Memory (CD-ROM), a Digital Video Disc Read Only Memory (DVD-ROM), or other optical media). In these cases, each drive may be connected to the bus 18 via one or more data media interfaces. The memory 28 may include at least one program product comprising a set (eg, at least one) of program modules configured to perform the functions of each embodiment of the present disclosure.

[0126] A program / utility 40 comprising a set (at least one) of program modules 42 may be stored, for example, in memory 28, where such program modules 42 include, but are not limited to, an operating system, one or more applications, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment. The program modules 42 typically perform the functions and / or methods of the embodiments described in this disclosure.

[0127] Computing device 12 may communicate with one or more external devices 14 (e.g., a keyboard, a pointing device, a display 24, etc.) and with one or more devices that allow a user to interact with computing device 12 and / or any devices that allow computing device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communications may occur via an input / output (I / O) interface 22. Computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 20. As shown, network adapter 20 communicates with other modules of computer device 12 via a bus 18. Although not shown, it should be understood that other hardware and / or software modules may be used in combination with computer device 12, including, but not limited to, microcode, device drives, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.

[0128] The processing unit 16 executes programs stored in the system memory 28 to perform various functional applications and data processing, such as the methods described in the above embodiments.

[0129] In the technical solution of the present disclosure, a spatial relationship calculation request is first obtained, and the calculation request includes a polygonal region and a report point set. Then, based on the positional relationship between each geographical grid and the polygonal region, a plurality of first coding values ​​corresponding to the polygonal region are determined, and based on the positional relationship between each geographical grid and each report point in the report point set, a plurality of second coding values ​​corresponding to the report point set and a report point group corresponding to each second coding value are determined, and the plurality of first coding values ​​and the plurality of second codings are respectively sorted and matched to determine a second coding value corresponding to each first coding value, and based on the report point group corresponding to the second coding value corresponding to each first coding value, the relationship between the polygonal region and each report point in the report point set can be determined. This reduces the time complexity and calculation complexity of data processing by quickly determining the relationship between spatial objects based on the coding value list corresponding to each individual spatial object, greatly reducing resource overhead and improving efficiency.

[0130] In the present description, a description that refers to terms such as "one embodiment," "several embodiments," "examples," "specific examples," or "several examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In the present description, general descriptions of the above terms do not necessarily refer to the same embodiment or example. In addition, the specific features, structures, materials, or characteristics described may be combined in an appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art may combine or combine different embodiments or examples described in the present description, and features of different embodiments or examples, as long as they do not conflict with each other.

[0131] Additionally, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance and the number of technical features depicted. Thus, a feature qualified as "first" or "second" may explicitly or implicitly include at least one of the feature. In the description of this disclosure, "plurality" means at least two, e.g., two, three, etc., unless otherwise specifically and explicitly limited.

[0132] Any process or method description depicted in a flowchart or otherwise herein may be understood to represent one or more executable instructions, modules, fragments, or portions thereof, including steps for implementing a custom logical function or process, and it will be understood by those skilled in the art of the embodiments of the present disclosure that the scope of the preferred embodiments of the present disclosure includes additional implementations that may be outside the order shown or discussed, including performing functions essentially simultaneously or in reverse order according to the associated functionality.

[0133] Any logic and / or steps described in a flow chart or otherwise herein may be considered, for example, as a sequencing sequence of executable instructions to realize a logical function, and may be specifically implemented in any computer-readable medium for use with or in conjunction with an instruction execution system, apparatus, or device (e.g., a computer-based system, a system with a processor, or other system capable of fetching and executing instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" may be any device that can contain a program that can store, communicate, propagate, or transmit, for use with or in conjunction with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include an electrical connection with one or more wires (electronic devices), a portable computer disk box (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable editable read-only memory (EPROM or flash memory), a fiber optic device, and a portable optical disk read-only memory (CD-ROM). The computer readable medium may also be paper or other suitable medium on which the program may be printed and then electronically obtained by, for example, optically scanning the paper or other medium and then editing, interpreting, or processing in any other suitable manner as necessary, and storing the program in a computer memory.

[0134] Each part of the present disclosure can be realized by hardware, software, firmware, or a combination thereof. In the above embodiment, a plurality of steps or methods can be realized by software or firmware stored in a memory and executed by an appropriate instruction execution system. For example, when realized by hardware, as in the case of another embodiment, it can be realized by any one of techniques known to those skilled in the art, a discrete logic circuit having logic gate circuits for implementing a logical function for a data signal, an application specific integrated circuit having an appropriate combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc., or a combination thereof.

[0135] It can be understood by those skilled in the art that all or part of the steps involved in realizing the methods of the above embodiments can be completed by instructing relevant hardware by a program, and the program may be stored in a computer-readable storage medium, and the program, when executed, includes one or a combination of the steps of the method embodiments.

[0136] In addition, each functional unit of each embodiment of the present disclosure may be integrated into one processing module, each unit may exist physically separately, or two or more units may be integrated into one module. The integrated module may be realized in the form of hardware or in the form of a software functional module. When the integrated module is realized in the form of a software functional module and sold or used as an independent product, it may be stored in a computer-readable storage medium.

[0137] The above-mentioned storage medium may be a read-only memory, a magnetic disk, an optical disk, etc. Although the embodiments of the present disclosure have been shown and described above, it should be noted that the embodiments of the present application are illustrative and should not be understood as limitations on the present disclosure, and those skilled in the art may change, modify, substitute, and change the embodiments of the present application within the scope of the present disclosure.

Claims

1. obtaining a spatial relation calculation request, the spatial relation calculation request including a polygon area and a reporting point set; determining a plurality of first coding values ​​corresponding to the polygonal region based on a positional relationship between each geographic grid and the polygonal region, each geographic grid corresponding to one coding value; determining a plurality of second coded values ​​corresponding to the set of reporting points and a reporting point group corresponding to each of the second coded values ​​based on a positional relationship between each of the geographic grids and each of the individual reporting points of the set of reporting points; sorting and matching the plurality of first encoded values ​​and the plurality of second encoded values ​​to determine a matching second encoded value for each of the first encoded values; determining a relationship between the polygon area and each of the reporting points of the set of reporting points based on a reporting point group corresponding to a second coding value that matches each of the first coding values; 2. A method for determining a spatial relationship, the method being performed by a spatial relationship determination device, comprising:

2. prior to determining a plurality of first coded values ​​corresponding to the polygonal area based on a positional relationship between the respective geographic grids and the polygonal area; determining a type of each of the reporting points in the set of reporting points; determining a size of the geographic grid based on the type of reporting points; The method of claim 1 , comprising:

3. determining a plurality of first coded values ​​corresponding to the polygonal area based on a positional relationship between the respective geographic grids and the polygonal area, 2. The method of claim 1, further comprising the step of: in response to some or all of an area of ​​a given geographic grid being located within the polygonal area, determining a first coded value corresponding to the given geographic grid as one first coded value corresponding to the polygonal area.

4. A step of sorting and matching the plurality of first encoded values ​​and the plurality of second encoded values ​​to determine second encoded values ​​that match each of the first encoded values, sorting the plurality of first encoded values ​​and the plurality of second encoded values ​​according to a preset rule to obtain a sorted first encoded list and a sorted second encoded list, respectively; a first first encoded value in the first encoded list being smaller than a first second encoded value in the second encoded list, in response to the preset rule being ascending order, sequentially traversing each first encoded value after the first first encoded value in the first encoded list until obtaining a first encoded value that is the same as the first second encoded value in the second encoded list; The method of claim 1 , comprising:

5. After obtaining the sorted first and second encoded lists, 5. The method of claim 4, further comprising: in response to a first first coded value in the first coded list being smaller than a first second coded value in the second coded list and the preset rule being in ascending order, sequentially traversing each first coded value located after the first first coded value in the first coded list until an i-th first coded value in the first coded list is greater than a first second coded value in the second coded list, and determining that the first coded list does not include a first coded value that matches a first second coded value in the second coded list.

6. an i-th first encoded value in the first encoded list is equal to a j-th second encoded value in the second encoded list, where i and j are each positive integers; 5. The method of claim 4, further comprising: matching an i+1-th first coded value in the first coded list with each second coded value located after the j-th second coded value in the second coded list to obtain a second coded value that matches the i+1-th first coded value.

7. The spatial relationship calculation request further includes a target spatial relationship, and the step of determining a relationship between the polygon area and each of the reporting points of the reporting point set based on a reporting point group corresponding to a second coding value that matches each of the first coding values, respectively, comprises: determining a reporting point group corresponding to each of the first coded values ​​based on a reporting point group corresponding to a second coded value matching each of the first coded values; in response to the target spatial relationship being a containment relationship, removing and merging overlapping reporting points from individual reporting point groups to generate a reporting point set that is contained within the polygonal region; The method of claim 1 , comprising:

8. After determining a reporting point group corresponding to each of the first encoded values, determining a distance between each of the geographic grids and each of the reporting points of the respective corresponding reporting point groups in response to the target spatial relationship being a nearest neighbor relationship; determining a reporting point that is closest to the polygonal area based on a first distance between each of the geographic grids and each of the reporting points in the corresponding reporting point group; 8. The method of claim 7, comprising:

9. an acquisition module for acquiring a spatial relationship calculation request, the spatial relationship calculation request including a polygon area and a reporting point set; a first determination module for determining a plurality of first coding values ​​corresponding to the polygonal region based on a positional relationship between each geographic grid and the polygonal region, where each geographic grid corresponds to one coding value; a second determination module that determines a plurality of second coding values ​​corresponding to the reporting point set and a reporting point group corresponding to each of the second coding values ​​based on a positional relationship between each of the geographic grids and each of the reporting points in the reporting point set; a matching module that sorts and matches each of the plurality of first encoded values ​​and the plurality of second encoded values ​​to determine a matching second encoded value for each of the first encoded values; a third determination module that determines a relationship between the polygon area and each of the reporting points in the set of reporting points based on a reporting point group corresponding to a second coding value that matches each of the first coding values; An apparatus for determining a spatial relationship comprising:

10. A computer apparatus comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer apparatus implementing the method for determining spatial relationships according to any one of claims 1 to 8 when the processor executes the computer program.

11. A computer readable storage medium containing a computer program, which, when executed by a processor, implements the method for determining spatial relations according to any one of claims 1 to 8.

12. A computer program which, when executed by a processor, implements the method for determining spatial relations according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Tracking method by hierarchical mesh

    JP1983063874A

  • Coincident data detector, receiving device, coincident data detecting method, and coincident data detecting program

    JP2008197719A

  • Control program, information processing method, and information processing apparatus

    JP2016014532A

  • Method and device for determining target position

    JP2016152044A

  • System, method, and program for generating mesh statistics using data associated with positional information

    JP2020166739A