Spatial entity positioning method and apparatus, storage medium, and electronic device

By constructing a geographic relationship map and using a multi-path merging method, the problem of time-consuming, labor-intensive, and error-prone spatial entity positioning based on orientation relationship description is solved, achieving automated, efficient, and accurate positioning of spatial entities.

CN116610768BActive Publication Date: 2026-05-19JINGDONG CITY BEIJING DIGITS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JINGDONG CITY BEIJING DIGITS TECH CO LTD
Filing Date
2023-06-09
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing technologies lack automated methods for spatial entity localization based on orientation relationships, resulting in time-consuming, labor-intensive, and error-prone processes.

Method used

By constructing a geographic relationship graph, based on the pre-constructed geographic relationship graph, the initial matching spatial entities corresponding to the relationship predicates are queried, and the final matching spatial entities are determined through multi-way merging, thereby achieving automated positioning of spatial entities.

Benefits of technology

It improves the efficiency and accuracy of spatial entity positioning, realizes the automation of spatial entity positioning, saves time and effort compared with manual positioning, and improves the accuracy of positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116610768B_ABST
    Figure CN116610768B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of data processing, in particular to a spatial entity positioning method, a spatial entity positioning device, a storage medium and an electronic device. The spatial entity positioning method comprises: obtaining a plurality of input relationship predicates; querying initial matching spatial entities corresponding to each of the relationship predicates based on a pre-constructed geographical relationship graph; performing multi-path merging on the initial matching spatial entities corresponding to each of the relationship predicates to obtain common spatial entities, and positioning a final matching spatial entity based on the common spatial entities. The spatial entity positioning method provided by the present disclosure can improve the efficiency and accuracy of spatial entity positioning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, specifically to a spatial entity positioning method, a spatial entity positioning device, a storage medium, and an electronic device. Background Technology

[0002] With the digital development of the surveying and mapping industry and the arrival of the big data era, massive amounts of geographic data have been generated, including spatial entities such as points of interest, roads, and buildings. This has led to a wealth of upper-level applications, such as map service providers using urban geographic data to provide navigation services.

[0003] Spatial entity localization based on directional relationship descriptions is a common query method. Given a directional description, it retrieves the spatial entity corresponding to that description. Spatial entity localization has wide applications; users can use fuzzy searches based on directional descriptions to find corresponding spatial entities, such as searching for shopping malls based on road relationships or determining navigation locations based on neighborhood locations.

[0004] However, there is currently no automated method for spatial entity localization based on orientation description. It is mainly done manually, which is time-consuming, labor-intensive, and prone to errors.

[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] The purpose of this disclosure is to provide a spatial entity positioning method, spatial entity positioning device, storage medium, and electronic device, aiming to solve the problems of time-consuming, labor-intensive, and error-prone spatial entity positioning.

[0007] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.

[0008] According to one aspect of the present disclosure, a spatial entity localization method is provided, comprising: acquiring multiple input relation predicates; querying initial matching spatial entities corresponding to each relation predicate based on a pre-constructed geographic relation map; performing multi-path merging on the initial matching spatial entities corresponding to each relation predicate to obtain a common spatial entity, and locating the final matching spatial entity based on the common spatial entity.

[0009] According to some embodiments of this disclosure, based on the foregoing scheme, the method further includes: pre-constructing the geographic relationship map, including: obtaining a set of spatial entities and a distance threshold; constructing points in the geographic relationship map using the spatial entities in the set of spatial entities; and constructing an edge between two points corresponding to two spatial entities in the geographic relationship map when the distance value between two spatial entities in the set of spatial entities does not exceed the distance threshold.

[0010] According to some embodiments of this disclosure, based on the foregoing scheme, constructing the edge between two points corresponding to two spatial entities in the geographic relationship map includes: determining the starting spatial entity and the ending spatial entity among the two spatial entities, and configuring the spatial orientation of the ending spatial entity relative to the starting spatial entity; and configuring the distance value between the two spatial entities.

[0011] According to some embodiments of this disclosure, based on the foregoing scheme, the relation predicate includes the spatial orientation of the final matched spatial entity relative to the input spatial entity; the step of querying the initial matched spatial entity corresponding to each relation predicate based on a pre-constructed geographic relation map includes: for a relation predicate, querying the initial matched spatial entity in the geographic relation map that matches the spatial orientation of the input spatial entity; traversing all the relation predicates to obtain the initial matched spatial entity corresponding to each relation predicate.

[0012] According to some embodiments of this disclosure, based on the foregoing scheme, the step of querying the initial matching spatial entity in the geographic relationship graph that matches the spatial orientation of the input spatial entity includes: querying the geographic relationship graph for edges that include the input spatial entity; for an edge, if the input spatial entity is the starting spatial entity and the spatial orientation corresponding to the edge matches the spatial orientation, taking the other spatial entity in the edge besides the input spatial entity as the initial matching spatial entity; or if the input spatial entity is the ending spatial entity and the spatial orientation corresponding to the edge matches the reverse direction of the spatial orientation, taking the other spatial entity in the edge besides the input spatial entity as the initial matching spatial entity; traversing all edges to obtain the initial matching spatial entity corresponding to the relation predicate.

[0013] According to some embodiments of this disclosure, based on the foregoing scheme, the step of locating the final matching spatial entity based on the shared spatial entity includes: for a shared spatial entity, calculating the sum of distance values ​​between the shared spatial entity and the input spatial entities in each of the relational predicates; and taking the shared spatial entity corresponding to the minimum value of the sum of distance values ​​as the final matching spatial entity.

[0014] According to some embodiments of this disclosure, based on the foregoing scheme, the step of performing multi-way merging of the initial matching space entities corresponding to each of the relation predicates to obtain a common space entity includes: performing single-way sorting on the initial matching space entities corresponding to each of the relation predicates to obtain a sequence of initial matching space entities corresponding to each of the relation predicates; and performing multi-way merging on the sequence of initial matching space entities to obtain the common space entity.

[0015] According to a second aspect of the present disclosure, a spatial entity positioning device is provided, characterized in that it includes: an acquisition module for acquiring multiple input relational predicates; a single-path module for querying the initial matching spatial entities corresponding to each relational predicate based on a pre-constructed geographic relation map; and a multi-path module for performing multi-path merging on the initial matching spatial entities corresponding to each relational predicate to obtain a common spatial entity, and locating the final matching spatial entity based on the common spatial entity.

[0016] According to a third aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the spatial entity positioning method as described in the above embodiments.

[0017] According to a fourth aspect of the present disclosure, an electronic device is provided, characterized in that it includes: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the spatial entity positioning method as described in the above embodiments.

[0018] The exemplary embodiments disclosed herein may have some or all of the following beneficial effects:

[0019] In some embodiments of this disclosure, the technical solutions can, on the one hand, support automatic querying of the final matching spatial entity based on the relational predicates after inputting multiple relational predicates, thereby automating the spatial entity positioning and improving the efficiency of spatial entity positioning, saving time and effort compared to manual positioning; on the other hand, a method is provided that performs single-path processing by querying the initial matching spatial entities corresponding to each relational predicate, and then performs multi-path merging based on the initial matching spatial entities corresponding to each relational predicate to determine the final matching spatial entity, which can improve the accuracy of spatial entity positioning.

[0020] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:

[0022] Figure 1 This illustration schematically depicts a spatial entity in an exemplary embodiment of the present disclosure;

[0023] Figure 2 This schematic diagram illustrates a vector orientation in an exemplary embodiment of the present disclosure;

[0024] Figure 3 This illustration schematically shows a calculation diagram of point-line orientation based on a perpendicular line in an exemplary embodiment of the present disclosure;

[0025] Figure 4 This illustration shows a schematic diagram of the calculation of the orientation of different types of spatial entities in an exemplary embodiment of this disclosure;

[0026] Figure 5 The schematic diagram illustrates a flow chart of a spatial entity positioning method according to an exemplary embodiment of the present disclosure;

[0027] Figure 6 The illustration schematically shows a flowchart of a method for constructing a geographic relationship map in an exemplary embodiment of the present disclosure;

[0028] Figure 7 This illustration schematically depicts a single-point construction of a geographic relationship map in an exemplary embodiment of this disclosure;

[0029] Figure 8 This illustration schematically depicts a partial geographic relationship map in an exemplary embodiment of the present disclosure;

[0030] Figure 9 The illustration shows a flowchart of a method for querying a final matching spatial entity in an exemplary embodiment of the present disclosure;

[0031] Figure 10 This schematically illustrates a system framework diagram for querying a final matching spatial entity in an exemplary embodiment of this disclosure;

[0032] Figure 11 This schematic diagram illustrates the composition of a spatial entity positioning device according to an exemplary embodiment of the present disclosure;

[0033] Figure 12 This schematic diagram illustrates a computer-readable storage medium according to an exemplary embodiment of the present disclosure;

[0034] Figure 13 The schematic diagram illustrates the structure of a computer system of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation

[0035] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art.

[0036] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0037] The block diagrams shown in the attached figures are merely functional space entities and do not necessarily correspond to physically independent spatial entities. That is, these functional space entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0038] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0039] Before introducing the spatial entity positioning method proposed in this disclosure, some basic concepts and definitions are given first.

[0040] ① Spatial Entity

[0041] Spatial entities are mainly divided into three categories: points, lines, and polygons.

[0042] Figure 1 This diagram schematically illustrates a spatial entity according to an exemplary embodiment of the present disclosure. (Reference) Figure 1As shown, spatial entities 1 and 2 represent points, spatial entities 3, 4, 5, and 6 represent lines, and spatial entities 7, 8, and 9 represent surfaces. The following spatial entities are represented by lowercase 's', and sets of spatial entities are represented by uppercase 'S'.

[0043] ② Entity Orientation

[0044] Given two spatial entities s1 and s2, the orientation of s2 relative to s1 can be calculated, which is called the spatial orientation. Its value is an enumeration of East (E), South (S), West (W), and North (N).

[0045] The spatial orientation is calculated as follows: First, represent lines and surfaces using their centroids, thus abstracting all spatial entities as points; then calculate the relative orientations of s1 and s2. The following spatial orientations are represented by the lowercase letter 'o', for example, o... 12 The spatial orientation of spatial entity s2 relative to s1.

[0046] Figure 2 This schematic diagram illustrates a vector orientation in an exemplary embodiment of the present disclosure, with reference to... Figure 2 As shown, the space is divided into four subspaces by two straight lines at a 45-degree angle to the horizontal and vertical axes, and named according to the rule of north at the top, south at the bottom, west on the left, and east on the right. For example, the directional vector v in the figure falls in the "west" region on the left.

[0047] The relative orientations of s1 and s2 are calculated as follows: Assume that spatial entities s1 and s2 have been represented by their centroids, i.e., s1 =<x1,y1> and s2 =<x2,y2> Then calculate the orientation vector v of the two spatial entities. 12 =<x2-x1,y2-y1> Finally, let vector v 12 The name of the subspace to which it falls can be its location.

[0048] It is worth noting that there are two exceptions: if the spatial entities are a point and a line, or a surface and a line, then first calculate the centroid of the point or surface to the orthocenter of the line, and then calculate the vector orientation of the centroid and orthocenter of the point or surface as the orientation of the two spatial entities.

[0049] Figure 3 This illustration schematically demonstrates a calculation of point and line orientation based on perpendicular lines in an exemplary embodiment of this disclosure. The orientation calculation for points and lines is based on perpendicular lines, primarily because urban roads are generally long, and using the centroid for calculation would easily yield unintuitive results. (Reference) Figure 3 As shown, if the spatial orientation of a point and a line is calculated using the centroid, the result is that the point is to the west of the line. However, in reality, we tend to think that the point is to the south of the line, which is the orientation of the point in space perpendicular to the line.

[0050] Figure 4 This schematic diagram illustrates the calculation of the orientation of different types of spatial entities in an exemplary embodiment of this disclosure. For example... Figure 4 As shown, there are a total of 9 cases for different types of spatial entity combinations, where a hollow circle represents the centroid of a line or surface, and a right angle symbol represents a perpendicular line.

[0051] ③ Spatial distance (Distance)

[0052] Given two spatial entities s1 and s2, their distance is defined as follows: the distance between two spatial entities is equal to the Euclidean distance between their two nearest points, where d e (p,q) represents the Euclidean distance between points p and q.

[0053]

[0054] ④ Relative predicate

[0055] A relational predicate describes the location of a spatial entity and is represented by the lowercase letter p. It is formally represented as p = (s, o), which represents the spatial location o of the spatial entity s.

[0056] Based on the above conceptual definitions, the technical problem of entity locating can be described as: given a set of geospatial entities S = <s1,s2,…,s n >, where n is the number of spatial entities, and given the set of relational predicates P = <p1,p2,…,p m > where m is the number of relational predicates, and the query returns the final matching spatial entity s corresponding to the set of relational predicates P. p .

[0057] Currently, there is no automated method for spatial entity localization based on orientation relationships; it mainly relies on manual queries, which are time-consuming, labor-intensive, and prone to errors. Therefore, this disclosure presents a spatial entity localization method designed and implemented to automate spatial entity localization and improve spatial entity matching efficiency.

[0058] The implementation details of the technical solutions of the embodiments of this disclosure are described in detail below.

[0059] Figure 5 This schematic diagram illustrates a flow chart of a spatial entity positioning method according to an exemplary embodiment of the present disclosure. Figure 5 As shown, the spatial entity localization method includes steps S1 to S3:

[0060] Step S1: Obtain the multiple relational predicates input;

[0061] Step S2: Based on the pre-constructed geographic relationship map, query the initial matching spatial entities corresponding to each of the relationship predicates;

[0062] Step S3: Perform multi-way merging on the initial matching space entities corresponding to each relation predicate to obtain a common space entity, and locate the final matching space entity based on the common space entity.

[0063] In some embodiments of this disclosure, the technical solutions can, on the one hand, support automatic querying of the final matching spatial entity based on the relational predicates after inputting multiple relational predicates, thereby automating the spatial entity positioning and improving the efficiency of spatial entity positioning, saving time and effort compared to manual positioning; on the other hand, a method is provided that performs single-path processing by querying the initial matching spatial entities corresponding to each relational predicate, and then performs multi-path merging based on the initial matching spatial entities corresponding to each relational predicate to determine the final matching spatial entity, which can improve the accuracy of spatial entity positioning.

[0064] The following will describe in more detail the steps of the spatial entity positioning method in this example embodiment, with reference to the accompanying drawings and embodiments.

[0065] In step S1, multiple relational predicates are obtained from the input.

[0066] Specifically, as defined in definition ④ above, the relational predicate, p = (s, o), includes the final matching space entity s. p The spatial orientation o relative to the input spatial entity s.

[0067] Multiple relational predicates can be user-defined and input, serving as the basis for spatial entity queries. These multiple relational predicates can be denoted as the relational predicate set P = ... <p1,p2,…,p m >, where m is the number of relational predicates, and the purpose is to...

[0068] It should be noted that multiple relational predicates are required when locating spatial entities. If there is only one relational predicate, the query result will be the spatial entity that is closest to the input spatial entity in that spatial orientation, and spatial entity location will not be required.

[0069] In step S2, based on the pre-constructed geographic relationship map, the initial matching spatial entities corresponding to each of the relationship predicates are queried.

[0070] In the process of locating spatial entities, a pre-constructed geographic relationship map is required. Specifically, the process of constructing the geographic relationship map includes: obtaining a set of geographic spatial entities and a distance threshold; constructing points in the geographic relationship map using the spatial entities in the set of geographic spatial entities; and constructing an edge between corresponding points of the two spatial entities in the geographic relationship map when the distance between two spatial entities in the set of geographic spatial entities does not exceed the distance threshold.

[0071] Specifically, a given set of geospatial entities S can be obtained. <s1,s2,…,s n > where n is the number of spatial entities, and a given distance threshold ε is obtained to construct a geographic relationship map G = <V g E g >. Among them, V g E represents a set of points, i.e., a set of spatial entities. g This represents the edge set, which is the spatial orientation relationship and distance between each pair of spatial entities. During the construction process, for each spatial entity s, we first query its neighboring nodes within a specified distance threshold ε, then calculate the pairwise relative orientations and construct the edges.

[0072] When constructing an edge, the process includes: determining the starting and ending spatial entities of the two spatial entities, and configuring the spatial orientation of the ending spatial entity relative to the starting spatial entity; and configuring the distance value between the two spatial entities. That is, the edge parameter is represented as e = (s... i ,s j ,o ij ,d ij ), where o ij For s j Compared to s i Spatial orientation relationship, d ij For s i and s j The distance between them.

[0073] It is worth noting that the spatial orientation of each pair of different entities was calculated only once, therefore the value of each edge in the graph is e = (s i ,s j ,o ij ,d ij This contains two pieces of information, namely s j Compared to s i The orientation is o ij s i Compared to s j The orientation is o ijThe opposite direction of o (hereinafter, -o represents the opposite direction of o) is used for the following reasons: 1) to reduce unnecessary calculations and accelerate graph construction; 2) to reduce redundant edges and simplify the graph structure. Since the spatial orientation relationship is symmetrical, knowing one side allows inference of the other, so this does not affect accuracy. Furthermore, R-tree indexes can be used to speed up the query for the nearest neighbor set within the ε-distance range of a spatial entity s, thus avoiding the need to traverse all entities for calculation and judgment, further accelerating graph construction.

[0074] Figure 6 This illustration schematically depicts a flowchart of a method for constructing a geographic relationship map according to an exemplary embodiment of this disclosure. Figure 6 As shown, the process of constructing a geographic relationship map is as follows:

[0075] Step S601, read in the set of geospatial entities S = <s1,s2,…,s n > and distance threshold ε;

[0076] Step S602, initialize the geographic relationship map G = <V g E g >, where V g ← <s1,s2,…,s n >, which means treating spatial entities as nodes, and "←" means assigning a value;

[0077] Step S603, let i = 1, start constructing the edges E of the geographic relationship graph. g ;

[0078] Step S604: Determine if i ≤ n-1. If yes, proceed to step S605; otherwise, proceed to step S612.

[0079] Step S605, let j = i + 1;

[0080] Step S606: Determine if j ≤ n. If yes, proceed to step S607; otherwise, proceed to step S611.

[0081] Step S607, calculate s i and s j Euclidean distance d ij and spatial orientation ij ;

[0082] Step S608, determine d ij If ≤ε, then execute step S609, then execute step S610; otherwise, execute step S610 directly.

[0083] Step S609, construct edge e = (s i ,s j ,o ij ,dij ), and add a geographical relationship map, i.e., E g ←E g ∪{e};

[0084] Step S610: Let j ← j + 1; After step S610 is completed, return to step S606.

[0085] Step S611: Let i ← i+1; After step S611 is completed, return to execute step S604.

[0086] Step S612, return the geographic relationship map G= <V g E g >

[0087] Figure 7 This illustration schematically depicts a single-point construction of a geographic relationship map according to an exemplary embodiment of this disclosure. (Reference) Figure 7 As shown, for entity 1, first query its nearest neighbors to get entity 3, entity 5 and entity 7, then calculate the relative position of entity 1 and them respectively and add them to the map.

[0088] Figure 8 This diagram schematically illustrates a partial geographic relationship map in an exemplary embodiment of this disclosure. The same operation is performed on all nodes, and the final result is as follows. Figure 8 As shown, the black dots represent spatial entities, and note that only some edges are shown here.

[0089] In a geographic relationship map, points represent spatial entities, and edges represent the relative orientation between two entities. Therefore, the data structure of the map implicitly stores the pre-calculated relative orientations between pairs of spatial entities. This allows for quick and direct retrieval of neighboring entities in a specified orientation for a given entity without the need for further global calculations, greatly improving query efficiency. This is a typical "space-for-time" strategy.

[0090] It should be noted that the main reasons for setting the distance threshold ε are as follows: 1) In practice, the spatial entities corresponding to relational predicates in spatial positioning are often adjacent, which can improve the accuracy; 2) By limiting the distance between two nodes to form an edge, the number of edges in the graph is greatly reduced, thereby achieving the purpose of pruning, reducing the physical space of graph storage, and also speeding up subsequent queries.

[0091] Once the geographic relationship map is constructed, step S2 can be executed to query the initial matching spatial entities corresponding to each of the pre-constructed geographic relationship maps. Specifically, this includes: for a given relationship predicate, querying the geographic relationship map for the initial matching spatial entities that match the spatial orientation of the input spatial entity; and traversing all the relationship predicates to obtain the initial matching spatial entities corresponding to each relationship predicate.

[0092] It should be noted that for each relational predicate p i =(s i ,o i The first step is single-path processing, where each path can be queried based on the constructed geographic relationship map G to obtain the initial set S of matching spatial entities. i Then, each relation predicate is traversed to obtain the initial matching space entity corresponding to each relation predicate.

[0093] In one embodiment of this disclosure, querying the geographic relationship map for the initial matching spatial entity that matches the spatial orientation of the input spatial entity includes:

[0094] Step 1. Query the edges in the geographic relationship map that include the input spatial entity;

[0095] Specifically, first initialize the empty result set S. i Since the geographic relationship graph includes edges consisting of two spatial entities, it is possible to query all entities including S in the geographic relationship graph G. i The set of edges E i .

[0096] Step 2. For an edge, determine whether the other spatial entity in the edge besides the input spatial entity is the initial matching spatial entity.

[0097] Specifically, when the input spatial entity is the starting spatial entity and the spatial orientation corresponding to the edge matches the spatial orientation, the other spatial entity in the edge besides the input spatial entity is taken as the initial matching spatial entity.

[0098] For E i Each edge in the array is e = (s1, s2, o) 12 ,d 12 This is because the atlas only stores the orientation of s2 relative to s1. 12 Therefore, there are two cases here, if s i If the starting point is s1, then determine whether the orientation of the edge matches the predicate, i.e., o. 12 =o i If s iIf the endpoint is s2, then determine whether the opposite direction of that edge matches the predicate, i.e., -o. 12 =o i If the condition is met, add it to the result set S. i .

[0099] Step 3. Traverse all edges to obtain the initial matching space entity corresponding to the relation predicate.

[0100] By performing step 2 above on each side, the initial matching space entity corresponding to the relational predicate can be obtained. (See reference) Figure 7 Given the geographical relationship shown, with relational predicate p = (s3, south), we can see that south of s3 are s8, s5, s4 and s2, which are all the initial matching spatial entities corresponding to relational predicate p.

[0101] In step S3, the initial matching space entities corresponding to each relation predicate are merged in multiple ways to obtain a common space entity, and the final matching space entity is located based on the common space entity.

[0102] Specifically, for the query result set {S1,S2,…,S} of all relational predicates m The final spatial entity result s is obtained based on the idea of ​​multi-way merging. p The rule is: find the shared space entity that appears in all relational predicate result sets with the smallest distance value.

[0103] In step S3, the common space entities are first determined. Since the aforementioned method has already obtained the initial matching space entity set {S1, S2, ..., S...} consisting of the initial matching space entities corresponding to each relation predicate,... m Therefore, elements that appear in all initial matching spatial entity sets can be considered as common spatial entities, resulting in a common spatial entity set S. c ,Right now

[0104] After determining the shared space entity, the final matching space entity can be determined. The specific process is as follows: For a shared space entity, calculate the sum of distance values ​​between the shared space entity and the input space entities in each relational predicate; take the shared space entity corresponding to the minimum value of the sum of distance values ​​as the final matching space entity.

[0105] The final matched spatial entity is the common spatial entity set S. c The entity corresponding to the minimum distance value among all input space entities is identified. Therefore, the common space entity set S is traversed. cFor each shared spatial entity, calculate the distance value between it and the input spatial entities in all relational predicates, add the distance values ​​to obtain the sum of the distance values, and then select the shared spatial entity with the minimum sum of distance values ​​as the final matching spatial entity.

[0106] For example, for Figure 8 Given the geographic relations shown, and the set of geographic relation predicates P = {p1 = (s3, South), p2 = (s7, East)}, the initial matching spatial entity set corresponding to p1 is S1 = {s2, s4, s5, s8}, and the initial matching spatial entity set corresponding to p2 is S2 = {s5, s6, s8, s9}. Find the set of elements S common to S1 and S2. c ={s5,s8}.

[0107] Then, the sum of the distances from s5 to s3 and s7, and the sum of the distances from s8 to s3 and s7 are calculated separately. The result shows that the sum of the distances corresponding to s8 is the smallest, therefore the final spatial entity result is s. p =s8.

[0108] In one embodiment of this disclosure, the specific process of determining the common space entity may further include: performing single-way sorting on the initial matching space entities corresponding to each of the relation predicates to obtain a sequence of initial matching space entities corresponding to each of the relation predicates; and performing multi-way merging based on the sequences of initial matching space entities to obtain the common space entity.

[0109] Specifically, to speed up multi-way merge queries, the initial matching space entity set S corresponding to the relational predicates processed in a single-way process can be processed first. i Elements in the array are ordered according to distance value d ij The entities are sorted, and then the common entities and subsequent spatial entity matching are determined based on the sorting results.

[0110] As in the example above, for Figure 8 The geographical relationships shown are used to perform single-path sorting on p1 and p2 respectively, resulting in S1 = {s8, s5, s4, s2} and S2 = {s5, s8, s6, s9}; then, the set of elements S common to S1 and S2 is found. c ={s8,s5}. Then, based on S... c ={s8,s5} positioning, the final spatial entity result is s p =s8.

[0111] The core idea of ​​this algorithm is based on the two-pointer concept: maintaining a pointer in both S1 and S2, moving the pointers sequentially, and using the sorted nature of S1 and S2 for boundary checks. This can be easily extended to multiple pointers when multiple relational predicates exist.

[0112] Figure 9 This illustration schematically depicts a flowchart of a method for querying ultimately matching spatial entities according to an exemplary embodiment of this disclosure. (Reference) Figure 9 As shown, the specific method for querying the final matching spatial entity is as follows:

[0113] Step S901, input the set of geographic relation predicates P = {p1, ..., p m} and relational graph G = <V g E g >;

[0114] Step S902: Let i = 1 and initialize the multi-way query result set.

[0115] Step S903: Determine if i ≤ m. If yes, proceed to step S904; otherwise, proceed to step S908.

[0116] Step S904, for p i =(s i ,o i Initialize the single-way query result set.

[0117] Step S905: Query the relation graph G for the expression s. i The set of edges E with origin and destination i ;

[0118] Step S906, If s 1= s i ^o 12 =o i or s 2= s i ^-o 12 =o i Then let S i ←S i ∪{s2};

[0119] Step S907, Single-path sorting: Sort S i Press and s i Sort by distance, let S p ←S p ∪{S i}, and let i ← i+1;

[0120] Step S908: Query the common entity set S of all predicate results. c ,Right now

[0121] Step S909, Multi-way merging: In S cThe final spatial entity result s is the one with the smallest sum of distances to the entities corresponding to each predicate. p ;

[0122] Step S910: Return the final spatial entity result s corresponding to the relational predicate set P. p .

[0123] Figure 10 This schematically illustrates a system framework diagram for querying ultimately matching spatial entities in an exemplary embodiment of this disclosure. For example... Figure 10 As shown, it is divided into two main parts: geographic relationship map construction and spatial entity query.

[0124] The first part involves preprocessing the raw spatial entity data, constructing a geographic relationship map for each spatial entity within a given range, and establishing relevant indexes to speed up queries.

[0125] The second part involves parsing and querying the geographic relation predicates input by the user, specifically: 1. specifying the set of geographic relation predicates; 2. obtaining the geographic relation map for each predicate; and 3. querying the geographic relation predicates based on single-path and multi-path queries to return spatial entity results. The main idea is to first extract the corresponding spatial entity and directional features for each relation predicate, then query the geographic relation map to find the entity and its adjacent entities at the specified directional location, sorting them by distance. Finally, the query results for each relation predicate are merged, sorted, and the final result is returned.

[0126] Based on the aforementioned method, this disclosure provides a spatial entity localization algorithm and its framework based on geographic relationship graphs. By constructing a geographic relationship graph, the algorithm pre-stores the pairwise relative directional relationships between spatial entities. At the same time, it effectively prunes the graph through distance range constraints. Then, based on the geographic relationship graph and the idea of ​​single-path processing and multi-path merging, it infers and returns the spatial entities corresponding to the set of spatial relationship predicates. It can automatically and accurately infer the spatial entities corresponding to the set of relationship predicates and has good query efficiency.

[0127] On the other hand, a geographic relationship graph data structure based on spatial orientation is proposed. By designing points and edges, the spatial orientation between pre-calculated entities is stored to support subsequent queries. At the same time, the edges are pruned by distance range constraints to construct a geographic relationship graph for spatial entity positioning, which can further improve the query efficiency of entities.

[0128] Figure 11 This schematic diagram illustrates the composition of a spatial entity positioning device according to an exemplary embodiment of the present disclosure, such as... Figure 11 As shown, the spatial entity positioning device 1100 may include an acquisition module 1101, a single-channel module 1102, and a multi-channel module 1103. Wherein:

[0129] The acquisition module 1101 is used to acquire multiple relational predicates as input;

[0130] The single-path module 1102 is used to query the initial matching spatial entities corresponding to each of the aforementioned relation predicates based on a pre-constructed geographic relation map;

[0131] The multi-path module 1103 is used to merge the initial matching space entities corresponding to each of the relation predicates to obtain a common space entity, and to locate the final matching space entity based on the common space entity.

[0132] According to an exemplary embodiment of the present disclosure, the spatial entity positioning device 1100 may further include a map module for pre-constructing the geographic relationship map, including: acquiring a set of spatial entities and a distance threshold; constructing points in the geographic relationship map using the spatial entities in the set of spatial entities; and constructing an edge between two corresponding points of two spatial entities in the geographic relationship map when the distance value between two spatial entities in the set of spatial entities does not exceed the distance threshold.

[0133] According to an exemplary embodiment of this disclosure, the atlas module is further configured to determine the starting spatial entity and the ending spatial entity among the two spatial entities, and configure the spatial orientation of the ending spatial entity relative to the starting spatial entity; and configure the distance value between the two spatial entities.

[0134] According to an exemplary embodiment of this disclosure, the relation predicate includes the spatial orientation of the final matched spatial entity relative to the input spatial entity; the single-path module 1102 is further configured to, for a relation predicate, query the geographic relation map for the initial matched spatial entity that matches the spatial orientation of the input spatial entity; and traverse all the relation predicates to obtain the initial matched spatial entity corresponding to each relation predicate.

[0135] According to an exemplary embodiment of this disclosure, the single-path module 1102 is further configured to query edges including the input spatial entity in the geographic relationship graph; for an edge, when the input spatial entity is the starting spatial entity and the spatial orientation corresponding to the edge matches the spatial orientation, the other spatial entity in the edge besides the input spatial entity is used as the initial matching spatial entity; or when the input spatial entity is the ending spatial entity and the spatial orientation corresponding to the edge matches the reverse direction of the spatial orientation, the other spatial entity in the edge besides the input spatial entity is used as the initial matching spatial entity; traversing all edges to obtain the initial matching spatial entity corresponding to the relation predicate.

[0136] According to an exemplary embodiment of this disclosure, the multiplexing module 1103 is configured to, for a shared spatial entity, calculate the sum of distance values ​​between the shared spatial entity and the input spatial entities in each of the relational predicates; and take the shared spatial entity corresponding to the minimum value of the sum of distance values ​​as the final matched spatial entity.

[0137] According to an exemplary embodiment of this disclosure, the multiplexing module 1103 is further configured to traverse each of the relational predicates, sort them based on the distance values ​​between the initial matching space entities and the input space entities in the relational predicates, and obtain the initial matching space entity sequence corresponding to each of the relational predicates; and perform a common space entity query according to each of the initial matching space entity sequences to obtain the common space entity.

[0138] The specific details of each module in the aforementioned spatial entity positioning device 1100 have been described in detail in the corresponding spatial entity positioning method, so they will not be repeated here.

[0139] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0140] In an exemplary embodiment of this disclosure, a storage medium capable of implementing the above-described method is also provided. Figure 12 This schematic diagram illustrates a computer-readable storage medium according to an exemplary embodiment of the present disclosure, such as... Figure 12 As shown, a program product 1200 for implementing the above-described method according to an embodiment of the present disclosure is described. This product may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a mobile phone. However, the program product of the present disclosure is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0141] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided. Figure 13 The schematic diagram illustrates the structure of a computer system of an electronic device according to an exemplary embodiment of the present disclosure.

[0142] It should be noted that, Figure 13The computer system 1300 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0143] like Figure 13 As shown, the computer system 1300 includes a Central Processing Unit (CPU) 1301, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 1302 or programs loaded from Storage Unit 1308 into Random Access Memory (RAM) 1303. The RAM 1303 also stores various programs and data required for system operation. The CPU 1301, ROM 1302, and RAM 1303 are interconnected via a bus 1304. An Input / Output (I / O) interface 1305 is also connected to the bus 1304.

[0144] The following components are connected to I / O interface 1305: an input section 1306 including a keyboard, mouse, etc.; an output section 1307 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1308 including a hard disk, etc.; and a communication section 1309 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to I / O interface 1305 as needed. Removable media 1311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1310 as needed so that computer programs read from them can be installed into storage section 1308 as needed.

[0145] In particular, according to embodiments of this disclosure, the processes described below with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1309, and / or installed from removable medium 1311. When the computer program is executed by central processing unit (CPU) 1301, it performs various functions defined in the system of this disclosure.

[0146] It should be noted that the computer-readable medium shown in the embodiments of this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0147] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0148] The units described in the embodiments of this disclosure can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the unit itself.

[0149] In another aspect, this disclosure also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to perform the methods described in the above embodiments.

[0150] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0151] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiments of this disclosure.

[0152] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein.

[0153] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for locating spatial entities, characterized in that, include: Obtain multiple relational predicates from the input; the relational predicates include the spatial orientation of the final matched spatial entity relative to the input spatial entity; For a given relation predicate, query the pre-constructed geographic relation map for an initial matching spatial entity that matches the spatial orientation of the input spatial entity; Traverse all the relation predicates to obtain the initial matching space entity corresponding to each relation predicate; The initial matching space entities corresponding to each of the relation predicates are merged in multiple ways to obtain a common space entity, and the final matching space entity is located based on the common space entity.

2. The spatial entity positioning method according to claim 1, characterized in that, The method further includes: pre-constructing the geographic relationship map, wherein pre-constructing the geographic relationship map includes: Obtain the spatial entity set and distance threshold; Points in the geographic relationship map are constructed from the spatial entities in the set of spatial entities; and When the distance between two spatial entities in the set of spatial entities does not exceed the distance threshold, an edge is constructed between the two points corresponding to the two spatial entities in the geographic relationship map.

3. The spatial entity positioning method according to claim 2, characterized in that, The construction of the edge between two points corresponding to two spatial entities in the geographic relationship graph includes: Determine the starting spatial entity and the ending spatial entity among the two spatial entities, and configure the spatial orientation of the ending spatial entity relative to the starting spatial entity; and Configure the distance value between the two spatial entities.

4. The spatial entity positioning method according to claim 1, characterized in that, The step of querying the pre-constructed geographic relationship map for an initial matching spatial entity that matches the spatial orientation of the input spatial entity includes: Query the edges in the geographic relationship graph that include the input spatial entity; For an edge, if the input spatial entity is the starting spatial entity and the spatial orientation corresponding to the edge matches the spatial orientation, then the other spatial entity in the edge besides the input spatial entity is taken as the initial matching spatial entity; or When the input spatial entity is the endpoint spatial entity and the spatial orientation corresponding to the edge matches the reverse direction of the spatial orientation, the other spatial entity in the edge besides the input spatial entity is taken as the initial matching spatial entity. Traverse all edges to obtain the initial matching space entity corresponding to the relation predicate.

5. The spatial entity positioning method according to claim 1, characterized in that, The step of locating the final matching spatial entity based on the shared spatial entity includes: For a shared spatial entity, calculate the sum of distance values ​​between the shared spatial entity and the input spatial entities in each of the relational predicates; The shared spatial entity corresponding to the minimum sum of the distance values ​​is taken as the final matched spatial entity.

6. The spatial entity positioning method according to claim 1, characterized in that, The step of performing multi-way merging of the initial matching space entities corresponding to each of the aforementioned relational predicates to obtain a common space entity includes: The initial matching space entities corresponding to each of the relation predicates are sorted in a single path to obtain the sequence of initial matching space entities corresponding to each of the relation predicates. The common spatial entity is obtained by multi-way merging based on each of the initial matching spatial entity sequences.

7. A spatial entity positioning device, characterized in that, include: The acquisition module is used to acquire multiple input relation predicates; the relation predicates include the spatial orientation of the final matched spatial entity relative to the input spatial entity; A single-path module is used to query, for a given relation predicate, an initial matching spatial entity that matches the spatial orientation of the input spatial entity in a pre-constructed geographic relation map; and to traverse all the relation predicates to obtain the initial matching spatial entity corresponding to each relation predicate. The multi-path module is used to merge the initial matching space entities corresponding to each of the relation predicates to obtain a common space entity, and to locate the final matching space entity based on the common space entity.

8. A computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the spatial entity positioning method as described in any one of claims 1 to 6.

9. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the spatial entity positioning method as described in any one of claims 1 to 6.