A query method and system
By constructing a topological relationship graph and a geographic grid, the relationships between entities are indirectly calculated, which solves the problems of complex and costly entity relationship calculation in existing technologies. It enables flexible and efficient entity relationship querying, reduces construction and query costs, and improves performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
- Filing Date
- 2023-08-24
- Publication Date
- 2026-06-26
AI Technical Summary
When the number of entities is large and the types are diverse, existing technologies suffer from complex, inflexible, and costly calculations of relationships between entities, and rely on spatiotemporal search engines, resulting in poor inference performance and high construction costs.
By constructing a topological relationship graph and utilizing geographic grids and the topological relationship graph, the relationships between entities can be indirectly calculated, reducing the amount of direct calculation, improving query efficiency, avoiding pre-construction and on-demand calculation, reducing costs, and not relying on a spatiotemporal search engine.
It enables flexible and efficient entity relationship calculation, reduces construction and query costs, improves performance, and is not limited by the performance of spatiotemporal search engines.
Smart Images

Figure CN117171414B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer technology, and in particular to a query method and system. Background Technology
[0002] An entity can refer to things in the real world, such as people, places, and companies. Entities have relationships, which can be used to express the connections between different entities, such as the friendship between Zhang San and Li Si, or the distance relationship between a person and a merchant.
[0003] The calculation of relationships between entities has a wide range of applications. For example, by calculating the distance relationship between merchant entities and user entities, merchants can understand the surrounding foot traffic and make better business decisions. Similarly, by calculating the social relationships between user entities, social platforms can help expand their business. However, when there are many types and a large number of entities, the calculation of relationships between entities often becomes particularly complex.
[0004] Therefore, this specification provides a query method and system to better solve the problem of calculating relationships between entities. Summary of the Invention
[0005] One embodiment of this specification provides a query method, which includes: obtaining a query task; the query task includes querying a target entity whose distance from a reference entity in a first entity meets a preset condition, the target entity belonging to a second entity; obtaining a topological relationship graph based on the query task; wherein the graph nodes of the topological relationship graph include first-type nodes corresponding to the first entity, second-type nodes corresponding to the second entity, and reference nodes corresponding to a reference position, and the edges include a first edge and a second edge; the first edge reflects the positional relationship between the first entity and the reference position; the second edge reflects the positional relationship between the second entity and the reference position; and determining the target entity based on the topological relationship graph and the preset condition.
[0006] One embodiment of this specification provides a query system, which includes: a query task acquisition module for acquiring query tasks; the query task includes querying a target entity whose distance from a reference entity in a first entity meets a preset condition, the target entity belonging to a second entity; a topology graph acquisition module for acquiring a topology graph based on the query task; wherein the graph nodes of the topology graph include first-type nodes corresponding to the first entity, second-type nodes corresponding to the second entity, and reference nodes corresponding to a reference position, and the edges include a first edge and a second edge; the first edge reflects the positional relationship between the first entity and the reference position; the second edge reflects the positional relationship between the second entity and the reference position; and a target entity determination module for determining the target entity based on the topology graph and the preset conditions.
[0007] One embodiment of this specification provides a graph construction method, which includes: obtaining a first entity and a second entity; determining reference positions corresponding to the first entity and the second entity respectively based on a preset algorithm; using the first entity, the second entity, and the reference positions as graph nodes; wherein the first entity corresponds to a first type of node, the second entity corresponds to a second type of node, and the reference position corresponds to a reference node; establishing a first edge between the first entity and the reference position, establishing a second edge between the second entity and the reference position, and determining a topological graph; wherein the first edge reflects the positional relationship between the first entity and the reference position, and the second edge reflects the positional relationship between the second entity and the reference position.
[0008] One embodiment of this specification provides a graph construction system, the system comprising: an entity acquisition module for acquiring a first entity and a second entity; a reference position acquisition module for determining reference positions corresponding to the first entity and the second entity respectively based on a preset algorithm; a first graph construction module for using the first entity, the second entity, and the reference positions as graph nodes; wherein the first entity corresponds to a first type of node, the second entity corresponds to a second type of node, and the reference position corresponds to a reference node; and a second graph construction module for establishing a first edge between the first entity and the reference position, and establishing a second edge between the second entity and the reference position to determine a topological graph; wherein the first edge reflects the positional relationship between the first entity and the reference position, and the second edge reflects the positional relationship between the second entity and the reference position.
[0009] One embodiment of this specification provides an apparatus including a processor for performing a graph query method as described in any of the above embodiments.
[0010] One embodiment of this specification provides an apparatus including a processor for performing a map construction method as described in any of the above embodiments. Attached Figure Description
[0011] This specification will be further described by way of exemplary embodiments, which will be described in detail with reference to the accompanying drawings. These embodiments are not limiting; in these embodiments, the same reference numerals denote the same structures, wherein:
[0012] Figure 1 These are exemplary schematic diagrams illustrating application scenarios of the query system according to some embodiments of this specification;
[0013] Figure 2 These are exemplary schematic diagrams illustrating the query method according to some embodiments of this specification;
[0014] Figure 3 This is an exemplary schematic diagram illustrating the determination of a target entity according to some embodiments of this specification;
[0015] Figure 4 These are exemplary schematic diagrams illustrating diffusion processes according to some embodiments of this specification;
[0016] Figure 5 These are exemplary schematic diagrams illustrating a map construction method according to some embodiments of this specification;
[0017] Figure 6 This is an exemplary block diagram of a query system according to some embodiments of this specification.
[0018] Figure 7 This is an exemplary block diagram of a map construction system according to some embodiments of this specification;
[0019] Figure 8 These are exemplary schematic diagrams showing the position of the same object at different points in time according to some embodiments of this specification;
[0020] Figure 9 These are exemplary schematic diagrams showing entities and reference locations according to some embodiments of this specification. Detailed Implementation
[0021] To more clearly illustrate the technical solutions of the embodiments in this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some examples or embodiments of this specification. For those skilled in the art, these drawings can be applied to other similar scenarios without creative effort. Unless obvious from the context or otherwise specified, the same reference numerals in the drawings represent the same structures or operations.
[0022] It should be understood that the terms “system,” “device,” “unit,” and / or “module” used herein are one way to distinguish different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.
[0023] As indicated in this specification and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" do not specifically refer to the singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of expressly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.
[0024] Flowcharts are used in this specification to illustrate the operations performed by the system according to embodiments of this specification. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.
[0025] The technical solutions disclosed in the embodiments of this specification can be used to calculate the distance relationship between entities. For example, it can be used to calculate the distance relationship between another entity that is adjacent to a certain entity. For instance, suppose the two types of entities are merchants and people. Merchants have geographical locations, and people have trajectory information. The requirement is to calculate the pedestrian flow within a 500-meter radius of the merchants.
[0026] A knowledge graph is a structured semantic knowledge base used to describe objects and their relationships in the physical world in symbolic form. Its basic unit can be represented by an "entity-relationship-entity" triple, with entities connected by relations (or edges) to form a network-like knowledge structure. Knowledge graphs can be used to better compute entity relationships; for example, spatiotemporal rule-based reasoning capabilities based on knowledge graphs can be used to compute entity relationships.
[0027] Spatiotemporal rule reasoning is a crucial capability in knowledge graph reasoning, with wide applications in planning, Geographic Information Systems (GIS), advanced navigation for autonomous robots, and natural language understanding. In practical spatiotemporal business applications, spatiotemporal topological relationships are commonly used. In the application of related technologies, the construction of spatiotemporal topological relationships often requires preprocessing using a spatiotemporal search engine before importing it into the knowledge graph. This approach poses a significant challenge to business flexibility, especially when there are a large number of spatiotemporal entities, as the cost of constructing topological relationships between these entities is very high.
[0028] The methods for calculating entity relationships in related technologies can be broadly divided into the following two categories, such as the problem of calculating the foot traffic around a merchant.
[0029] The first type of solution involves pre-construction based on a spatiotemporal search engine. The idea behind this approach is to pre-build the topological relationships between merchants and people into edges during the knowledge graph (also known as a topological relationship graph) construction process, which are then used during inference. The process is as follows: 1. During merchant data construction, the geographical location of the merchants is imported into the spatiotemporal search engine to build a merchant spatiotemporal index. 2. During person trajectory data construction, merchants within a 500-meter radius are obtained through the merchant spatiotemporal index, and relationships are built between people and merchants, indicating that a person has appeared around a merchant. 3. During inference, using the edge relationships built in the second stage, all people appearing around a merchant can be obtained, thus calculating the pedestrian traffic near the merchant. This method has the following disadvantages: 1. Inflexibility: When requirements change, data needs to be re-imported. For example, if the requirement changes to calculating pedestrian traffic within a one-kilometer radius of a merchant, the edge relationships need to be reconstructed. 2. High cost: In the above example, there are only two spatiotemporal entities, requiring only one relationship to be built. If there are a large number of spatiotemporal entities, a large number of spatiotemporal indexes and spatiotemporal relationship chains need to be built. 3. It is highly dependent and requires the support of a spatiotemporal search engine.
[0030] The second approach integrates a spatiotemporal search engine during the inference process. The core idea of this approach is to avoid preprocessing during the construction phase. During computation, the entities requiring spatiotemporal inference are identified based on needs, and spatiotemporal indexes are built as needed. During inference execution, topological relationships are directly retrieved through these indexes. The process is as follows: 1. Data is directly imported during the knowledge graph data construction process without additional processing. 2. During inference, if the business requirement is to search for people within a 500-meter radius of a merchant, the merchant data is imported into the spatiotemporal search engine. 3. During inference, topological relationships are converted into queries to the spatiotemporal search engine. This approach has the following drawbacks: 1. Poor performance: A large number of spatiotemporal search engine queries occur during inference, making it difficult to guarantee inference performance. 2. Heavy dependency: It requires the support of a spatiotemporal search engine.
[0031] To address at least some of the problems mentioned above, this specification proposes some improvement methods to achieve more efficient inference computation.
[0032] Figure 1 This is an exemplary schematic diagram illustrating an application scenario of a query system based on some embodiments of this specification.
[0033] like Figure 1As shown, the application scenario 100 of the query system may include a first entity 110, a second entity 120, and a processing device 140. The query system can be used to query other entities related to a given entity. This relatedness may include location-based relationships, distance-based relationships, motion trajectory-based relationships, etc. For example, it can query a target entity in a second entity 120 whose distance from a reference entity in the first entity 110 meets a preset condition. Another example is querying a target entity in a second entity whose motion trajectory intersects or overlaps with that of a reference entity in the first entity.
[0034] The first entity 110 and the second entity 120 can be generalizations of things in the real world. The first entity 110 and the second entity 120 can be generalizations of people, cars, merchants, buildings, and other items in the physical world. In some embodiments, the entity types of the first entity 110 and the second entity 120 can be the same or different. For example, the first entity 110 can be a merchant entity, and the second entity 120 can be a user entity. Another example is that the first entity 110 can be a merchant entity, and the second entity 120 can be a competing merchant entity, etc.
[0035] In some embodiments, the first entity 110 and the second entity 120 have time attributes and location attributes. The time attribute can be associated with the location attribute. For example, the time attribute can refer to time information, such as a specific point in time or a time period, while the location attribute can refer to the actual physical location of the first entity 110 and the second entity 120, such as latitude and longitude coordinates. In some embodiments, the location of the first entity 110 and the second entity 120 can be represented by points, lines, or areas formed by location coordinates.
[0036] Processing device 140 refers to a device that can provide computing services. Processing device 140 can be used to process data and / or information related to a query to perform one or more functions described in this specification. For example, processing device 140 can obtain topological relationships 130 between entities. In some embodiments, processing device 140 can obtain target entities whose distance from a baseline entity in first entity 110 meets preset conditions based on a query task. The target entity may be a part of second entity 120. For example, a second entity located within the area of first entity 110 can be the target entity. In some embodiments, processing device 140 may be local or remote; for example, processing device 140 may be implemented on a cloud platform. In some embodiments, processing device 140 may be a server.
[0037] Figure 2 This is an exemplary schematic diagram illustrating a query method according to some embodiments of this specification. In some embodiments, Figure 2 The method shown can be performed by a processing device (e.g., processing device 140).
[0038] The processing device can acquire query task 202. In some embodiments, the processing device can perform this step through query task acquisition module 610.
[0039] A query task can refer to finding entity data that meets the conditions given by the user. For example, a query task can include querying target entities whose distance from the baseline entity in the first entity meets preset conditions. Specifically, a query could be to query users whose distance from the first merchant is less than 5km, or to query competing merchants whose distance from the first merchant is less than 3km, etc.
[0040] The first and second entities can be abstract generalizations of things in the physical world. For example, the first and second entities can be merchants, regions, buildings, or people in the physical world. The first entity can be a collective term for a group of entities. This group of entities can be of a single type, such as a user type entity, or it can include multiple types of entities, such as user entities, vehicle entities, building entities, etc. The range of entity types in this group of entities can be defined in various ways, such as according to requirements, etc., and this specification does not limit it in this way.
[0041] A base entity refers to one or more entities among the first entities specified in a query task. For example, taking merchants as an example, the base entity can be one or more merchants among the merchant entities specified in the query task. For instance, the merchant type entities can include first merchant, second merchant, third merchant, fourth merchant, etc., and the base entity can be first merchant, or first merchant and second merchant, etc. Another example is that the first entity can be a geographical region, and the base entity can be a building or a merchant within that geographical region, or a location within it, etc. This specification does not limit the entity types of the first entity and the base entity.
[0042] A target entity can refer to a subset of entities within a second entity whose distance from the baseline entity of the first entity meets a preset condition. The target entity belongs to the second entity. For example, the first entity is a merchant entity, the baseline entity is the second merchant within the merchant entity, the second entity is a user entity, and the target entity can be a user entity whose distance from the second merchant in the first entity meets a preset condition.
[0043] In some embodiments, the determination of the target entity varies depending on the query task. For example, when the query task is to query the target entity in a second entity that intersects or overlaps with the movement trajectory of a reference entity in the first entity within a preset time period, the first entity can be a vehicle entity, the reference entity is the first vehicle in the vehicle entity, the vehicle's position changes over time, and time is the time attribute of the vehicle entity. If the first entity is a user entity, by querying which user entities' movement trajectories overlap with the first vehicle's movement trajectory within the preset time period, it can be determined which users may have ridden in the first vehicle.
[0044] In some embodiments, the first entity and the second entity can be of different entity types. For example, when querying the surrounding pedestrian traffic of a merchant entity, the first entity can be a merchant entity, and the second entity can be a user entity.
[0045] In some embodiments, the first entity and the second entity can be of the same type. For example, when querying competing merchants around a certain merchant, the first entity is a merchant entity, and the second entity can also be a merchant entity.
[0046] Preset conditions can be constraints imposed when executing a query task. Preset conditions can be used to filter out entities that do not meet the user's query requirements.
[0047] In some embodiments, the preset condition may include the distance to a reference entity in the first entity being less than a preset value. The preset value may be 1km, 3km, 5km, etc. In some embodiments, the preset condition may also include a time condition. For example, a query task may be to query a second entity whose distance to a reference entity in the first entity is less than 3km within the past 7 days. In this case, the preset condition may include both "within the past 7 days" and "distance less than 3km". In some embodiments, the preset condition may also include other conditions, such as querying male users. This specification does not specifically limit the preset condition.
[0048] In some embodiments, at least a portion of the first entity and the second entity may represent the time-dependent location of an actual object. For example, at least a portion may be the location of an object (which could be a user) within the second entity at different times. For instance, if the object is located at position A at a first time point, position B at a second time point, and position C at a third time point, then the object's positions at different time points can form a trajectory A—B—C. Although the time attributes (time points) of each location are different, these locations all point to the same object within the second entity. In some embodiments, at least a portion of the first entity and the second entity may also simply represent the location of an actual object, which may not be time-dependent. For example, for a merchant-type entity, its store location is typically fixed, and its location coordinates do not change over time. In this case, the location of the merchant entity in the first entity and the second entity is not time-dependent.
[0049] See Figure 8 , Figure 8 This is an exemplary schematic diagram illustrating the positions of the same object at different points in time according to some embodiments of this specification. A pentagram represents a second entity, and objects 810 and 830 represent different objects within that second entity. A triangle represents a first entity, and objects 820 and 840 represent different objects within that first entity. The letters in the diagram indicate the positions of objects within each entity at different points in time. For example, A, B, and C can indicate that object 810 is at position A at the first point in time, position B at the second point in time, and position C at the third point in time. D can indicate that object 830 is at position D at one or more points in time (multiple points in time at the same position indicate that its position has not changed). Similarly, E can indicate that object 820 is at position E at one or more points in time, and F can indicate that object 840 is at position F at one or more points in time.
[0050] In some embodiments, at least a portion of the first entity and the second entity may be related to the query task. For example, if the query task is to query which second entities are within a 3km radius of object 820, then based on the relationship between the positions of each object of the second entity and the 3km radius around object 820, it can be determined that when object 810 is at position B at the second time point, it is exactly within a 3km radius of object 820, while object 830 is not within a 3km radius of object 820.
[0051] In some embodiments, the processing device may obtain a query task by acquiring user input. The query task may also be obtained by the processing device by reading from a storage device, a database, or other means.
[0052] The processing device can obtain a topology graph 204 based on the query task. In some embodiments, the processing device can perform this step through the topology graph acquisition module 620.
[0053] A topological graph is a knowledge graph used to represent the topological relationships between entities. In some embodiments, the graph nodes of a topological graph may include a first type of node corresponding to a first entity, a second type of node corresponding to a second entity, and a reference node corresponding to a reference position. The edges of a topological graph may include a first edge and a second edge.
[0054] The first type of node refers to the node corresponding to the first entity. For example, if the first entity is a merchant type entity, then the first type of node can be a node with the "merchant" attribute.
[0055] The second type of node refers to the node corresponding to the second entity. For example, if the second entity is a user type entity, then the second type of node can be a node with the "user" attribute.
[0056] A reference location is a position that serves as a reference. For example, regarding the physical location of an entity, the reference location could be another location adjacent to that entity's physical location, which can be used to help determine the entity's spatial position in the physical world. In some embodiments, the reference location can be a point or region of location related to the physical location of the entity corresponding to the first type of node and / or the second type of node. For example, the reference location can be a reference object in the physical world. In some embodiments, the reference object can be a geographic grid obtained by dividing an actual area of the physical world. See also Figure 9 , Figure 9 This is an exemplary schematic diagram illustrating entities and reference locations according to some embodiments of this specification. 910 and 920 represent objects corresponding to the second entity; for example, 930 is an object in the first entity. A reference location can be a region or grid point within the grid in the diagram, such as the intersection of grid lines indicated by the arrow. A geographic grid refers to a progressively finer division of the Earth's surface, approximating the Earth's surface using a polygonal grid of a certain size to reproduce the Earth's surface. It can integrate geospatial positioning and the description of geographic features, and control the error range within the grid cells. In some embodiments, the geographic grid can be a latitude and longitude grid, for example, a grid obtained by dividing the Earth's surface using latitude and longitude.
[0057] A reference node is a graph node in the topology graph corresponding to a reference location. In some embodiments, the attribute characteristics of a reference node may include the location information of the reference location in the physical world, such as grid location coordinates.
[0058] The first edge is the edge between the first entity and the reference position. The first edge reflects the positional relationship between the first entity and the reference position. For example, it could represent the actual position of the first entity within the range of the reference position, or the distance between the actual position of the first entity and the reference point corresponding to the reference position. The two nodes of the first edge can be a first-type node and the reference node corresponding to the reference position, respectively; the edge relationship reflects the positional relationship between the first entity and the reference position.
[0059] The second edge can be the edge between the second entity and the reference position. The second edge reflects the positional relationship between the second entity and the reference position. For example, the actual position of the second entity may be within the range of the reference position. The two nodes of the second edge can be a second-type node and the reference node corresponding to the reference position, respectively; the edge relationship reflects the positional relationship between the second entity and the reference position.
[0060] In some embodiments, the topology diagram can be pre-constructed and stored in a database or storage device based on the correspondence between various entities and their corresponding reference locations. The processing device can obtain the topology diagram by reading from the database or storage device based on query conditions. For example, the processing device can determine the entity information to be queried based on the query conditions and obtain the corresponding topology diagram based on the entity information.
[0061] In some embodiments, the processing device may also obtain corresponding entity information based on query conditions and construct a topology graph in real time based on the entity information.
[0062] For instructions on constructing topological graphs, please refer to [link / reference]. Figure 5 The description.
[0063] In this embodiment, by obtaining a topology graph, the topological relationships between entities can be obtained without directly calculating them. Instead, the relationships between entities and reference positions can be derived from the graph, and the topological relationships between entities can be indirectly obtained based on these relationships. The relationships between entities and reference positions can be pre-calculated and determined, thereby effectively reducing computational load and improving query efficiency during the query phase.
[0064] The processing device can determine the target entity 206 based on the topology diagram and the preset conditions. In some embodiments, the processing device can perform this step through the target entity determination module 630.
[0065] A target entity refers to an entity that satisfies a user's query task. In some embodiments, the target entity is a second entity. The target entity can be an entity in the second entity that satisfies the user's query task. For example, if the query task is to find the target entity whose distance from the baseline entity in the first entity meets a preset condition, the target entity is the entity in the second entity whose distance from the baseline entity in the first entity meets the preset condition.
[0066] In some embodiments, the processing device can determine the target entity based on preset conditions and edge relationships in a topological graph. For example, the processing device can obtain candidate entities based on edge relationships in a topological graph, and then determine the target entity based on the candidate entities and preset conditions. For example, the processing device can determine the candidate entities whose distance from the reference entity in the first entity satisfies the preset condition as the target entity.
[0067] For more information on identifying target entities, please refer to [link / reference]. Figure 3 A detailed description.
[0068] In some embodiments of this specification, during the execution of a user query task, the target entity can be quickly queried by obtaining a topological relationship graph. Furthermore, the construction of the topological relationship graph does not require pre-construction of the topological relationships between spatiotemporal entities, solving the problem of construction flexibility and eliminating the need to reconstruct data according to user needs; it is low-cost, computes on demand, and does not require topological relationship calculation and construction when spatiotemporal inference calculations are not performed; it offers high performance, as it does not rely on a spatiotemporal search engine and is not limited by the performance of the spatiotemporal search engine.
[0069] It should also be noted that the query method disclosed in the embodiments of this specification can be the smallest execution unit of the query task. If more entities need to be queried, it can be split into calculations between pairs of entities.
[0070] Figure 3 This is an exemplary schematic diagram illustrating the determination of a target entity according to some embodiments of this specification.
[0071] The processing device can perform diffusion processing based on the reference entity 302 to determine the associated reference position 304.
[0072] Entity 302 can be a specific entity within the first entity. In this embodiment, taking the actual location of the reference entity 302 corresponding to a certain area as an example, the reference entity 302 could be a building, a merchant's shop, etc. Figure 4 As shown, the area corresponding to the reference entity 302 can be an irregular polygon. In some embodiments, the reference entity can also be represented by points.
[0073] An associated reference position refers to a reference position that is related to the reference position corresponding to the reference entity and preset conditions. For example, an associated reference position could be a reference position adjacent to the reference position corresponding to the reference entity. The determination of the associated reference position is related to the preset conditions; for example, the proximity distance between the associated reference position and the reference position corresponding to the reference entity can be determined based on the preset conditions.
[0074] Diffusion processing refers to expanding the range of the reference location corresponding to a base entity. For example, if the area of the reference location corresponding to the base entity itself is 100 square meters, diffusion processing can expand 100 square meters to 1000 square meters. Another example is expanding the location point corresponding to the reference location into a location region.
[0075] In some embodiments, the processing device may perform diffusion processing based on the regional features of the reference entity, or the processing device may perform diffusion processing based on the attribute features of the reference position corresponding to the reference entity, and determine the associated reference position based on the result of the diffusion processing.
[0076] For more information on determining the associated reference location, please refer to [link to relevant documentation]. Figure 4 Related descriptions.
[0077] The processing device can obtain the associated node corresponding to the associated reference position, establish an edge between the reference node corresponding to the reference entity and the associated node, and update the topology graph 306.
[0078] The associated node corresponding to the associated reference position can be a graph node corresponding to that associated reference position in the topology graph. In some embodiments, the associated node can be an existing node in the topology graph (e.g., in the topology graph before the update, as shown in 306, the associated node can be a node represented by a black solid rectangle), or it can be a node not present in the topology graph (not shown). For example, assuming that there is also a corresponding relationship between the associated reference position and other entities besides the first entity, such as the reference position of other entities being the same as the reference position corresponding to the associated node, then an edge relationship between the other entity and the associated reference position may already exist in the topology graph. In this case, the graph node corresponding to the associated reference position is the reference node corresponding to the reference position of the other entity. The processing device can directly use this reference node as the associated node corresponding to the associated reference position. In some embodiments, when there is no associated node corresponding to the associated reference position in the topology graph, a new graph node can be added to the topology graph as the associated node.
[0079] In some embodiments, establishing an edge can be done between a base node corresponding to a base entity and an associated node. The edge relationship represents the correspondence between the reference position corresponding to the base entity and the associated reference position corresponding to the associated node (e.g., distance relationship, location attribution relationship, etc.). The edge relationship can be used to reflect the positional relationship between the associated reference position corresponding to the associated node and the reference position corresponding to the base entity. For example, it can represent the distance between the reference position corresponding to the base entity and the associated reference position corresponding to the associated node. Or, the reference position corresponding to the associated reference position may be a reference point, and the reference position corresponding to the base entity may be a reference region. The position of the reference point may be located within the reference region.
[0080] Updating a topology graph can refer to updating the graph nodes and / or edges. For example, adding edges between associated nodes and entity nodes in the topology graph. For instance, 308 represents the updated topology graph, where associated nodes are represented by solid black rectangles. In the updated topology graph, two dashed lines have been added, representing two new edges that reflect the relationship between the associated nodes and their corresponding entities.
[0081] The processing device can obtain candidate entities 310 based on the updated topology graph 308.
[0082] A candidate entity is an entity that may satisfy the preset conditions. A candidate entity belongs to the second entity, or it can be understood as at least a portion of the second entities that may satisfy the preset conditions.
[0083] In some embodiments, the processing device may, based on the reference node, obtain the second type of second-degree neighbor nodes of the reference node from the updated topology graph; and determine the second entity corresponding to the second type of second-degree neighbor nodes as the candidate entity.
[0084] A first-degree neighbor is any node that is directly adjacent to the base node, and there is an edge between them. A second-degree neighbor is any node that is directly adjacent to one of the base node's first-degree neighbors, and there is an edge between them. For example, suppose the base node in the updated topology graph 308 is node A, its first-degree neighbor is node B, there is an edge A—B between A and B, and node C is a first-degree neighbor of B, and there is an edge B—C between B and C.
[0085] A second-degree neighbor of type II refers to a node of type II among the second-degree neighbors of the base node. Continuing with the example above, we can determine that node B is the second-degree neighbor of node A, and node C is the first-degree neighbor of node B. Therefore, based on the edge relationships A-B and B-C, we can determine that node C is the second-degree neighbor of node A. Furthermore, if node C corresponds to the second entity, then node C is a second-degree neighbor of type II. If node C corresponds to the first entity (or another entity), then node C is not a second-degree neighbor of type II.
[0086] In some embodiments, the processing device can obtain the second-degree neighbor second-type nodes of the base node based on a graph database. For example, the processing device can obtain the second-degree neighbor second-type nodes of the base node from the graph database using Neo4j, Networkx 2.0, or similar methods. Since the second-type nodes to be obtained have close neighbor relationships with the base node, the second-degree neighbor second-type nodes can be obtained quickly even when the number of nodes is large, thereby improving query efficiency.
[0087] The processing device can select the candidate entity whose distance from the reference entity meets the preset condition as the target entity 312.
[0088] In some embodiments, the processing device can calculate the distance between each candidate entity and the reference entity in the first entity. For example, a distance calculation algorithm can be used to calculate the distance based on the location information (such as latitude and longitude coordinates) of the candidate entity and the location information (such as latitude and longitude coordinates or a point in the region, such as the center point) of the reference entity. The calculation result is then compared with preset conditions, and the candidate entity that meets the preset conditions is selected as the target entity. The distance calculation algorithm can be any existing algorithm, such as an inverse cosine calculation algorithm or a road-based driving distance calculation algorithm, and this specification does not limit it.
[0089] In some embodiments, the target entity may be a subset of the candidate entities, or all of them.
[0090] In some embodiments of this specification, geographic grids are introduced into the topological relationship calculation of knowledge graphs. By establishing the relationship between entities and geographic grids, it is not necessary to calculate complex spatiotemporal relationships between entities. Spatiotemporal topological calculations are completed by indirectly obtaining the topological relationships between spatiotemporal entities. The calculation process is flexible, low-cost, and has high computational performance.
[0091] Figure 4 This is an exemplary schematic diagram of a diffusion process according to some embodiments of this specification.
[0092] In some embodiments, the processing device may perform proportional diffusion of the regional features of the reference entity based on the preset conditions; and determine multiple associated reference positions based on the result of the proportional diffusion.
[0093] Regional features can refer to features related to the location region of a reference entity. For example, such as... Figure 4As shown in 402, the location region of the reference entity is a polygonal region in 402. The region features can include the area and location coordinates of the reference entity. The location coordinates can include multiple coordinates (for example, the location coordinates can include the location coordinates of each vertex of the polygon, the midpoint coordinates of each edge, and certain coordinate points within the region, such as the location points indicated by the location identifiers in 402). The lines connecting the location coordinates of multiple vertices enclose the area of the region. In some embodiments, the region features can also include a reference location corresponding to the reference entity. The reference location can correspond to a geographic grid. For example, the location region of the reference entity of the first entity can correspond to multiple geographic grids. 1-16 in 402 are the geographic grid identifiers of the corresponding reference locations. The reference locations corresponding to the reference entity include grids 3, 6, 7, 8, 10, 11, and 12.
[0094] Proportional diffusion refers to expanding the area corresponding to a reference entity outwards, with the area of the expanded region being proportional to the area of the area before diffusion. In some embodiments, the length of the diffusion can be determined based on preset conditions. For example, if the preset condition is that the distance between entities is less than 3km, then the length of the diffusion can be expanding outwards by 3km along each edge of the area corresponding to the reference entity in a direction perpendicular to the edge. Alternatively, it can be a circle with a radius of 3km drawn, centered at a point in the area corresponding to the reference entity (e.g., the location indicated by the location marker in 402 or 404). The area within this circle and between this circle and the area corresponding to the reference entity is the result of the diffusion, i.e., the diffusion area.
[0095] 404 shows the results of the two diffusion methods in the above example, where the diffusion region is the area between the solid-line polygon and the dashed-line polygon (or dashed-line circle), or the diffusion region is the area between the solid-line polygon and the dashed-line circle.
[0096] In some embodiments, the diffusion area after proportional diffusion can have a corresponding relationship with a geographic grid, and the reference location (geographic grid) corresponding to the diffusion area can be identified as the associated reference location.
[0097] For example, Figure 4 402 represents the correspondence between the baseline entity and the reference position before the scaled diffusion, and 404 represents the correspondence between the baseline entity and the reference position after the scaled diffusion. Based on the correspondence between the diffusion area and the reference position (grid), the associated reference positions can be determined as grid 5, grid 2, grid 4, grid 18, grid 9, grid 14 and grid 15.
[0098] In some embodiments, the processing device may perform distance diffusion on the reference position corresponding to the reference entity based on the attribute characteristics of the reference position and the preset conditions; and determine multiple associated reference positions based on the result of the distance diffusion.
[0099] The attribute characteristics of a reference location can refer to information related to the geographic grid corresponding to that reference location. For example, assuming a reference location corresponds to a grid, the attribute characteristics of the reference location can include grid edge length, distance from the grid center point to the edge line, etc.
[0100] Distance diffusion can refer to expanding a geographic grid outward by a certain number of grids based on the distance of the grid's edge. The number of grids to be diffused can be determined based on preset conditions and the attribute characteristics of the reference location. For example, assuming the edge length of the divided geographic grid is 3km, and the preset condition is that the distance to the reference entity is less than 3km, then the geographic grid of the reference location corresponding to the first entity can be diffused outward by one grid.
[0101] The diffusion area after the distance diffusion, that is, the diffusion geographic grid, can be identified as the associated reference location.
[0102] For example, 406 shows the correspondence between the region location and the reference location (geographic grid) before distance diffusion. At this time, the reference location corresponding to the base entity is grid 3, grid 6, grid 7, grid 8, grid 10, grid 11 and grid 12. 408 shows the distance diffusion after distance diffusion. The distance diffusion distance is the side length of one grid (3km). The associated reference location corresponding to the region after diffusion is grid 1, grid 5, grid 9, grid 13, grid 14, grid 15, grid 16, grid 17, grid 18, grid 19, grid 20, grid 4, grid 21, grid 22, grid 23, grid 24 and grid 25.
[0103] In this embodiment, by spreading the reference position, candidate entities that may meet the preset conditions in terms of distance from the reference entity of the first entity can be recalled based on the spread area, avoiding complex calculations of relationships between entities. By calculating the relationship between the entity and the reference position, the relationship between entities is indirectly obtained.
[0104] By comparing the two diffusion methods, it can be seen that proportional diffusion determines fewer associated reference positions than distance diffusion. When querying a target entity, fewer candidate entities are recalled based on the associated reference positions. That is, proportional diffusion can have higher recall accuracy than distance diffusion. Therefore, in some embodiments, proportional diffusion can be preferred.
[0105] Figure 5 These are exemplary schematic diagrams illustrating a map construction method according to some embodiments of this specification.
[0106] The processing device can acquire a first entity and a second entity. In some embodiments, this step can be performed by the entity acquisition module 710.
[0107] In some embodiments, the processing device may obtain a first entity and a second entity from a database and a storage device according to the knowledge graph construction requirements. For example, the first entity may be as follows: Figure 5 The polygon shown in 502, the second entity can be as follows Figure 5 The figure shows a pentagram as shown in Figure 502. Here, the polygon represents the location area corresponding to the first entity, and the pentagram represents a user's trajectory point, such as a location the user visited at a certain time. In some embodiments, the location corresponding to the first entity can also be a location point (not shown), and the user's trajectory can include multiple points, which can form a trajectory route (not shown).
[0108] The processing device can determine the reference positions corresponding to the first entity and the second entity respectively based on a preset algorithm. In some embodiments, this step can be performed by the reference position acquisition module 720.
[0109] The preset algorithm can be a spatial indexing algorithm, such as GeoHash. The spatial indexing algorithm can calculate the reference positions corresponding to the first and second entities, as shown in the geographic grid in Figure 502. The division of the geographic grid can be predetermined. For example, after calculation using the spatial indexing algorithm, the first entity can be determined to correspond to grids 6, 7, 10, and 11, and the second entity to correspond to grids 5, 11, and 13, as shown in Figure 504. It should be noted that the geographic grid division is not necessarily quadrilateral; it can also be triangular, hexagonal, irregular polygonal, etc. This manual does not limit the geographic grid division, as long as it achieves the corresponding functionality.
[0110] The processing device can use the first entity, the second entity, and the reference position as graph nodes. In some embodiments, this step can be performed by the first graph construction module 730.
[0111] Wherein, the first entity corresponds to a first type of node, the second entity corresponds to a second type of node, and the reference position corresponds to a reference node.
[0112] The processing device can establish a first edge between the first entity and the reference position, and a second edge between the second entity and the reference position, to determine a topological graph. In some embodiments, this step can be performed by a second graph construction module 740.
[0113] Wherein, the first side reflects the positional relationship between the first entity and the reference position, and the second side reflects the positional relationship between the second entity and the reference position.
[0114] The constructed topology graph can be shown in Figure 506, where triangles and pentagrams represent graph nodes corresponding to entities, such as the first type of node corresponding to the first entity and the second type of node corresponding to the second entity; rectangles represent reference nodes corresponding to reference positions. If the first entity and the second entity share a common reference position grid 11, then in the topology graph, the nodes corresponding to the first entity and the nodes corresponding to the second entity can establish edges with grid 11.
[0115] For more information on constructing topological graphs, please refer to [link / reference]. Figures 2 to 4 Related descriptions.
[0116] In this embodiment, the knowledge graph construction process does not require pre-constructing the topological relationships between entities, thus solving the problem of graph construction flexibility. Furthermore, it eliminates the need to reconstruct the graph based on user needs during application. For example, during knowledge graph construction, multiple edge relationships between entities and reference locations can be established simultaneously. During the inference application phase, the corresponding edge relationships between entities and reference locations can be queried from the graph as needed, without recalculating the topological relationships between entities and reference locations based on the query task.
[0117] Figure 6 This is an exemplary block diagram of a query system according to some embodiments of this specification. In some embodiments, the query system 600 may include a query task acquisition module 610, a topology graph acquisition module 620, and a target entity determination module 630.
[0118] The query task acquisition module 610 can be used to acquire query tasks; the query task includes querying a target entity whose distance from the baseline entity in the first entity meets a preset condition, and the target entity belongs to the second entity.
[0119] The topology graph acquisition module 620 can be used to acquire a topology graph based on the query task; wherein, the graph nodes of the topology graph include a first type of node corresponding to a first entity, a second type of node corresponding to a second entity, and a reference node corresponding to a reference position, and the edges include a first edge and a second edge; the first edge reflects the positional relationship between the first entity and the reference position; the second edge reflects the positional relationship between the second entity and the reference position.
[0120] The target entity determination module 630 can be used to determine the target entity based on the topology diagram and the preset conditions.
[0121] Figure 7This is an exemplary block diagram of a map construction system according to some embodiments of this specification. In some embodiments, the map construction system 700 may include an entity acquisition module 710, a reference position acquisition module 720, a first map construction module 730, and a second map construction module 740.
[0122] The entity acquisition module 710 can be used to acquire the first entity and the second entity.
[0123] The reference position acquisition module 720 can be used to determine the reference positions corresponding to the first entity and the second entity respectively based on a preset algorithm.
[0124] The first graph construction module 730 can be used to use the first entity, the second entity, and the reference position as graph nodes; wherein the first entity corresponds to a first type of node, the second entity corresponds to a second type of node, and the reference position corresponds to a reference node.
[0125] The second graph construction module 740 can be used to establish a first edge between the first entity and the reference position, and to establish a second edge between the second entity and the reference position to determine the topological relationship graph; wherein, the first edge reflects the positional relationship between the first entity and the reference position, and the second edge reflects the positional relationship between the second entity and the reference position.
[0126] about Figure 6 and Figure 7 For further explanation of the various modules of the system shown, please refer to [link / reference]. Figures 2 to 5 Related descriptions.
[0127] It should be understood that Figure 6 and Figure 7The systems and modules shown can be implemented in various ways. For example, in some embodiments, the systems and modules can be implemented by hardware, software, or a combination of both. The hardware portion can be implemented using dedicated logic; the software portion can be stored in memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated-design hardware. Those skilled in the art will understand that the methods and systems described above can be implemented using computer-executable instructions and / or included in processor control code, for example, on a carrier medium such as a disk, CD, or DVD-ROM, a programmable memory such as read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The systems and modules of this specification can be implemented not only by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field-programmable gate arrays, programmable logic devices, etc., but also by software, for example, executed by various types of processors, or by a combination of the aforementioned hardware circuits and software (e.g., firmware).
[0128] It should be noted that the above description of the query system and the map construction system, and their modules, is for convenience only and should not be construed as limiting this specification to the scope of the embodiments described. It is understood that those skilled in the art, after understanding the principles of the system, may arbitrarily combine the various modules or construct subsystems connected to other modules without departing from these principles. In some embodiments, Figure 6 The query task acquisition module 610, topology graph acquisition module 620, and target entity determination module 630 disclosed herein can be different modules within the same system, or a single module can implement the functions of two or more of the aforementioned modules. For example, the modules can share a single storage module, or each module can have its own dedicated storage module. Such variations are all within the scope of protection of this specification.
[0129] The basic concepts have been described above. Obviously, for those skilled in the art, the detailed disclosure above is merely illustrative and does not constitute a limitation of this specification. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements, and corrections to this specification. Such modifications, improvements, and corrections are suggested in this specification and therefore remain within the spirit and scope of the exemplary embodiments described herein.
[0130] Furthermore, this specification uses specific terms to describe embodiments thereof. For example, "an embodiment," "one embodiment," and / or "some embodiments" refer to a particular feature, structure, or characteristic associated with at least one embodiment of this specification. Therefore, it should be emphasized and noted that references to "an embodiment," "one embodiment," or "an alternative embodiment" in different locations throughout this specification do not necessarily refer to the same embodiment. Moreover, certain features, structures, or characteristics in one or more embodiments of this specification can be appropriately combined.
[0131] Furthermore, unless expressly stated in the claims, the order of processing elements and sequences, the use of numbers and letters, or other names described in this specification are not intended to limit the order of the processes and methods described herein. Although various examples have been discussed in the foregoing disclosure of some embodiments of the invention that are currently considered useful, it should be understood that such details are for illustrative purposes only, and the appended claims are not limited to the disclosed embodiments; rather, the claims are intended to cover all modifications and equivalent combinations that conform to the spirit and scope of the embodiments described herein. For example, while the system components described above can be implemented using hardware devices, they can also be implemented solely using software solutions, such as installing the described system on existing servers or mobile devices.
[0132] Similarly, it should be noted that, in order to simplify the description disclosed herein and thus aid in the understanding of one or more embodiments of the invention, the foregoing description of embodiments in this specification may sometimes combine multiple features into a single embodiment, drawing, or description thereof. However, this method of disclosure does not imply that the subject matter of this specification requires more features than those mentioned in the claims. In fact, the embodiments contain fewer features than all the features of a single embodiment disclosed above.
[0133] In some embodiments, numbers describing the quantity of components and attributes are used. It should be understood that such numbers used in the description of embodiments are modified in some examples with the terms "approximately," "approximately," or "generally." Unless otherwise stated, "approximately," "approximately," or "generally" indicates that the numbers are allowed to vary by ±20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximate values, which may be changed depending on the characteristics required by individual embodiments. In some embodiments, numerical parameters should take into account specified significant digits and employ a general method of digit reservation. Although the numerical ranges and parameters used to confirm their breadth of range in some embodiments of this specification are approximate values, in specific embodiments, such values are set as precisely as feasible.
[0134] For each patent, patent application, patent application publication, and other material, such as articles, books, specifications, publications, and documents, referenced in this specification, the entire contents of which are incorporated herein by reference. This excludes historical application documents that are inconsistent with or conflict with the content of this specification, as well as documents that limit the broadest scope of the claims in this specification (currently or subsequently appended to this specification). It should be noted that in the event of any inconsistency or conflict between the descriptions, definitions, and / or terminology used in the supplementary materials to this specification and the content of this specification, the descriptions, definitions, and / or terminology used in this specification shall prevail.
[0135] Finally, it should be understood that the embodiments described in this specification are merely illustrative of the principles of the embodiments described herein. Other variations may also fall within the scope of this specification. Therefore, alternative configurations of the embodiments described herein are intended to be illustrative rather than limiting, and should be considered consistent with the teachings of this specification. Accordingly, the embodiments described herein are not limited to those explicitly introduced and described herein.
Claims
1. A query method, the method comprising: Get the query task; The query task includes querying a target entity whose distance from a baseline entity in the first entity meets a preset condition, and the target entity belongs to the second entity; Based on the query task, a topological relationship graph is obtained; wherein, the graph nodes of the topological relationship graph include a first type of node corresponding to a first entity, a second type of node corresponding to a second entity, and a reference node corresponding to a reference position, and the edges include a first edge and a second edge; the first edge reflects the positional relationship between the first entity and the reference position; the second edge reflects the positional relationship between the second entity and the reference position; the first entity and the second entity correspond to merchants, regions, buildings, or people in the physical world; Determining the target entity based on the topological relationship diagram and the preset conditions includes: Based on the reference entity, a diffusion process is performed to determine the associated reference position; Obtain the associated node corresponding to the associated reference position, establish an edge between the reference node corresponding to the reference entity and the associated node, and update the topology graph; Based on the updated topology graph, candidate entities are obtained; the candidate entities belong to the second entity. The candidate entities whose distance from the benchmark entity meets the preset condition are selected as the target entities.
2. The method according to claim 1, wherein at least a portion of the first entity and the second entity represents the time-related position of the actual object.
3. The method according to claim 1, wherein diffusion processing is performed based on the reference entity to determine the associated reference position, comprising: Based on the preset conditions, the regional features of the reference entity are proportionally diffused; Based on the results of proportional diffusion, multiple associated reference locations were determined.
4. The method according to claim 1, wherein diffusion processing is performed based on the reference entity to determine the associated reference object, comprising: Based on the attribute characteristics of the reference position and the preset conditions, distance diffusion is performed on the reference position corresponding to the reference entity; Based on the distance diffusion results, multiple associated reference locations were determined.
5. The method according to claim 1, wherein obtaining candidate entities based on the updated topological relationship graph includes: Based on the baseline node, obtain the second-degree neighbor second-type node of the baseline node from the updated topology graph; The second entity corresponding to the second type of second-degree neighbor node is determined as the candidate entity.
6. A query system, the system comprising: The query task acquisition module is used to acquire query tasks; The query task includes querying target entities whose distance from a baseline entity in the first entity meets a preset condition, and the target entities belong to the second entity; the first entity and the second entity correspond to merchants, regions, buildings or people in the physical world. The topology graph acquisition module is used to acquire a topology graph based on the query task; wherein, the graph nodes of the topology graph include a first type of node corresponding to a first entity, a second type of node corresponding to a second entity, and a reference node corresponding to a reference position, and the edges include a first edge and a second edge; the first edge reflects the positional relationship between the first entity and the reference position; the second edge reflects the positional relationship between the second entity and the reference position; The target entity determination module is used to determine the target entity based on the topological relationship graph and the preset conditions, including: Based on the reference entity, a diffusion process is performed to determine the associated reference position; Obtain the associated node corresponding to the associated reference position, establish an edge between the reference node corresponding to the reference entity and the associated node, and update the topology graph; Based on the updated topology graph, candidate entities are obtained; the candidate entities belong to the second entity. The candidate entities whose distance from the benchmark entity meets the preset condition are selected as the target entities.
7. A map construction method, the method comprising: Obtain a first entity and a second entity; the first entity and the second entity correspond to merchants, regions, buildings, or people in the physical world. Based on a preset algorithm, the reference positions corresponding to the first entity and the second entity are determined respectively; The first entity, the second entity, and the reference position are used as graph nodes; wherein the first entity corresponds to a first type of node, the second entity corresponds to a second type of node, and the reference position corresponds to a reference node; A first edge is established between the first entity and the reference position, and a second edge is established between the second entity and the reference position to determine the topology diagram; wherein, the first edge reflects the positional relationship between the first entity and the reference position, and the second edge reflects the positional relationship between the second entity and the reference position; The topology graph is used to determine the target entity that satisfies the user's query task. The query task includes querying the target entity whose distance from the baseline entity in the first entity meets a preset condition. The target entity belongs to the second entity. The target entity that satisfies the user's query task includes: Based on the reference entity, a diffusion process is performed to determine the associated reference position; Obtain the associated node corresponding to the associated reference position, establish an edge between the reference node corresponding to the reference entity and the associated node, and update the topology graph; Based on the updated topology graph, candidate entities are obtained; the candidate entities belong to the second entity. The candidate entities whose distance from the benchmark entity meets the preset condition are selected as the target entities.
8. A map construction system, the system comprising: The entity acquisition module is used to acquire a first entity and a second entity; the first entity and the second entity correspond to merchants, regions, buildings or people in the physical world; The reference position acquisition module is used to determine the reference positions corresponding to the first entity and the second entity respectively based on a preset algorithm; The first graph construction module is used to construct graph nodes using the first entity, the second entity, and the reference position; wherein the first entity corresponds to a first type of node, the second entity corresponds to a second type of node, and the reference position corresponds to a reference node; The second graph construction module is used to establish a first edge between the first entity and the reference position, and to establish a second edge between the second entity and the reference position to determine the topological relationship graph; wherein, the first edge reflects the positional relationship between the first entity and the reference position, and the second edge reflects the positional relationship between the second entity and the reference position; The topology graph is used to determine the target entity that satisfies the user's query task. The query task includes querying the target entity whose distance from the baseline entity in the first entity meets a preset condition. The target entity belongs to the second entity. The target entity that satisfies the user's query task includes: Based on the reference entity, a diffusion process is performed to determine the associated reference position; Obtain the associated node corresponding to the associated reference position, establish an edge between the reference node corresponding to the reference entity and the associated node, and update the topology graph; Based on the updated topology graph, candidate entities are obtained; the candidate entities belong to the second entity. The candidate entities whose distance from the benchmark entity meets the preset condition are selected as the target entities.
9. A query apparatus, comprising a processor, the processor being configured to perform the query method as described in any one of claims 1-5.
10. A map construction apparatus, comprising a processor, the processor being configured to perform the map construction method as claimed in claim 7.