Entity Query Method Based on Knowledge Graph, Related Devices and Readable Storage Media

By introducing entity position information and natural language understanding models into the knowledge graph, the problem of processing position query conditions is solved, and the precise query of query statements containing position query conditions is realized.

CN114491067BActive Publication Date: 2025-08-01UNIV OF SCI & TECH OF CHINA +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210065498.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-20
Publication Date
2025-08-01
Estimated Expiration
2042-01-20

AI Technical Summary

Technical Problem

The existing knowledge graph cannot process query statements containing position query conditions, such as "What functions do the buttons below the central control?", and it is impossible to accurately query the relevant entities.

Method used

Build a knowledge graph containing entity position information, determine the query entity and position query conditions, use the natural language understanding model to determine the entity query results from the knowledge graph, and use the coordinate system and preset thresholds to process the position query conditions.

Benefits of technology

It realizes the effective processing of query statements containing position query conditions, and improves the query accuracy and accuracy of knowledge graphs in position query.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114491067B_ABST
    Figure CN114491067B_ABST
Patent Text Reader

Abstract

The present application discloses an entity query method, related devices and readable storage media based on a knowledge graph. In this solution, for a certain field, a knowledge graph of this field is pre-constructed. The knowledge graph includes multiple entity information, and each entity information includes an entity and the location information of the entity. The location information of the entity is used to indicate the location of the entity in a preset space; after obtaining a query statement in this field, a query entity and a location query condition are determined from the query statement. Based on the query entity and the location query condition, an entity query result corresponding to the query statement can be determined from the knowledge graph of this field. By adopting this solution, it is possible to process a query statement containing a location query condition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of knowledge graph technology, and more specifically, to an entity query method based on knowledge graph, related equipment and readable storage medium. Background Art

[0002] A knowledge graph is essentially a flattened semantic network that describes the relationships between entities and between concepts within a domain. In some domains (such as automotive, aircraft, and weapons), a knowledge graph is often constructed to process user queries and provide knowledge query services. In some cases, a user's query may include location query conditions. For example, in the automotive field, a user may ask, "What are the functions of the buttons below the center console?" or "What is the button between the driver's seat and the passenger seat?" "Below" and "between" are location query conditions.

[0003] However, the current domain knowledge graph cannot process queries that include location queries. For example, if a user's query is "What are the functions of the buttons below the center console?", the current automotive knowledge graph cannot find the exact buttons below the center console.

[0004] Therefore, how to process a query statement containing a location query condition has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention

[0005] In view of the above problems, this application proposes a knowledge graph-based entity query method, related equipment, and readable storage medium. The specific solution is as follows:

[0006] A knowledge graph-based entity query method, the method comprising:

[0007] Obtain a query statement and a knowledge graph corresponding to the query statement, wherein the knowledge graph includes a plurality of entity information, each entity information includes an entity and location information of the entity, and the location information of the entity is used to indicate the location of the entity in a preset space;

[0008] Determining a query entity and a location query condition from the query statement;

[0009] Based on the query entity and location query conditions, an entity query result corresponding to the query statement is determined from the knowledge graph.

[0010] Optionally, a method for determining the location information of the entity includes:

[0011] Determining a coordinate system of the preset space;

[0012] Determine the center point of the entity and / or the coordinates of at least one fixed-point position of the entity in the coordinate system;

[0013] Determine the center point of the entity and / or the coordinates of at least one fixed-point position of the entity in the coordinate system as the position information of the entity.

[0014] Optionally, determining the query entity and the position query condition from the query statement includes:

[0015] Input the query statement into a natural language understanding model, and the natural language understanding model outputs the query entity and the position query condition. The natural language understanding model is trained with training query statements as training samples and the query entity and the position query condition labeled by the training query statements as sample labels.

[0016] Optionally, when there is only one query entity and the position query condition is the first position query condition, determining the entity query result corresponding to the query statement from the knowledge graph based on the query entity and the position query condition includes:

[0017] Determine the position information of the query entity from the knowledge graph;

[0018] Determine the first preset threshold corresponding to the first position query condition;

[0019] Based on the position information of the query entity and the first preset threshold, determine the entity query result corresponding to the query statement from the knowledge graph.

[0020] Optionally, when there are multiple query entities and the position query condition is the second position query condition, determining the entity query result corresponding to the query statement from the knowledge graph based on the query entity and the position query condition includes:

[0021] Determine the position information of each query entity from the knowledge graph;

[0022] Based on the position information of each query entity and the second position query condition, determine the position interval to be queried;

[0023] Based on the entities within the position interval to be queried, determine the entity query result corresponding to the query statement.

[0024] Optionally, determining the entity query result corresponding to the query statement based on the entities within the position interval to be queried includes:

[0025] For each of the query entities, determine the planar position information of the query entity based on the position information of the query entity;

[0026] For each entity within the to-be-query position range, determine the planar position information of the entity based on the position information of the entity;

[0027] Based on the planar position information of each of the query entities and the planar position information of each entity within the to-be-query position range, determine the entity query result corresponding to the query statement from each entity within the to-be-query position range.

[0028] Optionally, the determining the entity query result corresponding to the query statement from each entity within the to-be-query position range based on the planar position information of each of the query entities and the planar position information of each entity within the to-be-query position range includes:

[0029] Determine whether each of the query entities is in the same plane based on the planar position information of each of the query entities;

[0030] When each of the query entities is in the same plane, determine the entities within the to-be-query position range that are in the same plane as each of the query entities as the entity query result corresponding to the query statement;

[0031] When each of the query entities is not in the same plane, obtain a preset hyperplane and a second preset threshold corresponding to the second position query condition; based on the planar position information of each of the query entities, the planar position information of each entity within the to-be-query position range, the preset hyperplane, and the second preset threshold corresponding to the second position query condition, determine the entity query result corresponding to the query statement from each entity within the to-be-query position range.

[0032] An entity query device based on a knowledge graph, the device includes:

[0033] An acquisition unit, configured to acquire a query statement and a knowledge graph corresponding to the query statement, where the knowledge graph includes a plurality of entity information, and each entity information includes an entity and the position information of the entity, and the position information of the entity is used to indicate the position of the entity in a preset space;

[0034] A determination unit, configured to determine a query entity and a position query condition from the query statement;

[0035] A query unit, configured to determine an entity query result corresponding to the query statement from the knowledge graph based on the query entity and the position query condition.

[0036] Optionally, the device further includes: a position information determination unit for an entity, configured to:

[0037] Determine the coordinate system of the preset space;

[0038] Determine the center point of the entity, and / or the coordinates of at least one fixed point position of the entity in the coordinate system;

[0039] Determine the center point of the entity, and / or the coordinates of at least one fixed point position of the entity in the coordinate system as the position information of the entity.

[0040] Optionally, the determination unit is specifically configured to:

[0041] Input the query statement into a natural language understanding model, which outputs a query entity and a location query condition. The natural language understanding model is trained with training query statements as training samples and the query entity and location query condition labeled by the training query statements as sample labels.

[0042] Optionally, when there is only one query entity and the location query condition is a first location query condition, the query unit includes:

[0043] A first position information determination unit, configured to determine the position information of the query entity from the knowledge graph;

[0044] A first preset threshold determination unit, configured to determine a first preset threshold corresponding to the first location query condition;

[0045] A first query unit, configured to determine an entity query result corresponding to the query statement from the knowledge graph based on the position information of the query entity and the first preset threshold.

[0046] Optionally, when there are multiple query entities and the location query condition is a second location query condition, the query unit includes:

[0047] A second position information determination unit, configured to determine the position information of each query entity from the knowledge graph;

[0048] A to-be-query location interval determination unit, configured to determine a to-be-query location interval based on the position information of each query entity and the second location query condition;

[0049] A second query unit, configured to determine an entity query result corresponding to the query statement based on the entities within the to-be-query location interval.

[0050] Optionally, the second query unit includes:

[0051] The first plane position information determination unit is configured to determine the plane position information of each query entity based on the position information of the query entity.

[0052] The second plane position information determination unit is configured to determine the plane position information of each entity within the to-be-query position interval based on the position information of the entity.

[0053] The query subunit is configured to determine an entity query result corresponding to the query statement from each entity within the to-be-query position interval based on the plane position information of each query entity and the plane position information of each entity within the to-be-query position interval.

[0054] Optionally, the query subunit includes:

[0055] The judgment unit is configured to determine whether each query entity is in the same plane based on the plane position information of each query entity.

[0056] The first query subunit is configured to, when each query entity is in the same plane, determine the entities within the to-be-query position interval that are in the same plane as each query entity as the entity query result corresponding to the query statement.

[0057] The second query subunit is configured to, when each query entity is not in the same plane, obtain a preset hyperplane and a second preset threshold corresponding to the second position query condition; and determine an entity query result corresponding to the query statement from each entity within the to-be-query position interval based on the plane position information of each query entity, the plane position information of each entity within the to-be-query position interval, the preset hyperplane, and the second preset threshold corresponding to the second position query condition.

[0058] An entity query device based on a knowledge graph includes a memory and a processor;

[0059] The memory is configured to store a program;

[0060] The processor is configured to execute the program to implement each step of the entity query method based on a knowledge graph as described above.

[0061] A readable storage medium stores a computer program, and when the computer program is executed by a processor, each step of the entity query method based on a knowledge graph as described above is implemented.

[0062] With the above technical solution, the present application discloses a method for entity query based on a knowledge graph, related devices, and a readable storage medium. In this solution, for a certain field, a knowledge graph of this field is pre-constructed. The knowledge graph includes multiple entity information, and each entity information includes an entity and the location information of the entity. The location information of the entity is used to indicate the location of the entity in a preset space; after obtaining a query statement in this field, a query entity and a location query condition are determined from the query statement, and based on the query entity and the location query condition, an entity query result corresponding to the query statement can be determined from the knowledge graph of this field. By adopting this solution, it is possible to process a query statement containing a location query condition. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present application. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0064] Figure 1 is a flowchart of the method for entity query based on a knowledge graph disclosed in an embodiment of the present application;

[0065] Figure 2 is a flowchart of a method for determining an entity query result corresponding to the query statement from the knowledge graph based on the query entity and the location query condition disclosed in an embodiment of the present application;

[0066] Figure 3 is another flowchart of a method for determining an entity query result corresponding to the query statement from the knowledge graph based on the query entity and the location query condition disclosed in an embodiment of the present application;

[0067] Figure 4 is a flowchart of a method for determining an entity query result corresponding to the query statement based on the entities within the to-be-query location range disclosed in an embodiment of the present application;

[0068] Figure 5 is a schematic structural diagram of an entity query device based on a knowledge graph disclosed in an embodiment of the present application;

[0069] Figure 6 is a hardware structural block diagram of an entity query device based on a knowledge graph disclosed in an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0070] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0071] Next, the entity query method based on the knowledge graph provided by the present application will be introduced through the following embodiments.

[0072] Refer to Figure 1 , Figure 1 which is a schematic flowchart of the entity query method based on the knowledge graph disclosed in the embodiments of the present application. The method may include the following steps:

[0073] Step S101: Obtain a query statement and a knowledge graph corresponding to the query statement. The knowledge graph includes multiple entity information, and each entity information includes an entity and the location information of the entity. The location information of the entity is used to indicate the location of the entity in a preset space.

[0074] For some fields, the entities involved in their knowledge graphs do not have location information. For example, in the field of poetry, each poetry entity only needs to clarify its attributes such as the verses, author, and dynasty it contains, and there is no location information. For specific fields, such as the automotive field, the aircraft field, the weapon field, etc., their component entities all have location relationships, and the user's query statement may also contain location query conditions. Therefore, in the present application, for these specific fields, a knowledge graph can be pre-constructed. The knowledge graph includes multiple entity information, and each entity information includes an entity and the location information of the entity. The location information of the entity is used to indicate the location of the entity in a preset space.

[0075] The preset space may be the space where the entity is located. Taking the automotive field as an example, the preset space may be the entire vehicle space or a specific space inside the vehicle. The present application does not make any limitations in this regard.

[0076] For different fields, the location information of an entity can be represented in different forms, such as coordinates, longitude and latitude, etc. This application does not make any limitations in this regard. As an implementable manner, the method for determining the location information of the entity may include: determining the coordinate system of the preset space; determining the center point of the entity and / or the coordinates of at least one fixed-point position of the entity in the coordinate system; and determining the center point of the entity and / or the coordinates of at least one fixed-point position of the entity in the coordinate system as the location information of the entity. For example, in the automotive field, the preset space is the entire vehicle space, and its coordinate system can be a three-dimensional coordinate system with a certain point on the vehicle as the origin. For the central control, which is generally rectangular, its center point or its four vertices can be selected as the vertex positions.

[0077] In this application, the query statement can be in a specific field, such as the automotive field, the aircraft field, the weapon field, etc. The query statement includes a query entity and a location query condition. For example, if the query statement is "What are the functions of the buttons under the central control?", the query entity is "central control" and the location query condition is "under". The query statement can be in the form of natural language, such as text, voice, etc. This application does not make any limitations in this regard.

[0078] Step S102: Determine the query entity and the location query condition from the query statement.

[0079] In this application, semantic understanding processing can be performed on the query statement to determine the query entity and the location query condition. As an implementable manner, training query statements can be used as training samples, and the query entities and location query conditions labeled by the training query statements can be used as sample labels to train a natural language understanding model. Inputting the query statement into this natural language understanding model, the natural language understanding model can output the query entity and the location query condition.

[0080] Step S103: Based on the query entity and the location query condition, determine the entity query result corresponding to the query statement from the knowledge graph.

[0081] In this application, after determining the query entity and the location query condition, among the entities in the knowledge graph other than the query entity, an entity whose location relationship with the query entity satisfies the location query condition can be determined as the entity query result corresponding to the query statement. The specific implementation manner will be described in detail in the following embodiments and will not be elaborated here.

[0082] In this embodiment, a method for entity query based on a knowledge graph is disclosed. In this method, for a certain domain, a knowledge graph of this domain is pre-constructed. The knowledge graph includes multiple entity information, and each entity information includes an entity and the location information of this entity. The location information of the entity is used to indicate the position of the entity in a preset space. After obtaining a query statement in this domain, a query entity and a location query condition are determined from the query statement. Based on the query entity and the location query condition, an entity query result corresponding to the query statement can be determined from the knowledge graph of this domain. By using this method, it is possible to process a query statement containing a location query condition.

[0083] In another embodiment of this application, an implementation manner of step S103 for determining an entity query result corresponding to the query statement from the knowledge graph based on the query entity and the location query condition is described. This implementation manner is applicable to the scenario where there is only one query entity and the location query condition is the first location query condition.

[0084] Refer to Figure 2 , Figure 2 is a schematic flowchart of a method for determining an entity query result corresponding to the query statement from the knowledge graph based on the query entity and the location query condition disclosed in the embodiment of this application. This method may include the following steps:

[0085] Step S201: Determine the location information of the query entity from the knowledge graph.

[0086] In this application, the entity information of the query entity can be retrieved from the knowledge graph, and its location information can be obtained from its entity information.

[0087] Step S202: Determine the first preset threshold corresponding to the first location query condition.

[0088] In this application, for different location query conditions, different preset thresholds can be preset. For example, when the location query condition is "nearby", its corresponding preset threshold is S, indicating that the distance between the entity in the entity query result and the query entity needs to be no more than S to meet the location query condition "nearby".

[0089] Step S203: Based on the location information of the query entity and the first preset threshold, determine an entity query result corresponding to the query statement from the knowledge graph.

[0090] As an implementable manner, the distance between each entity in the knowledge graph except the query entity and the query entity can be determined, the distances are compared with the first preset threshold, and among the other entities in the knowledge graph except the query entity, the entities whose distances from the query entity do not exceed the first preset threshold are determined as the entity query results corresponding to the query statement.

[0091] In another embodiment of the present application, another implementation manner of step S103 for determining the entity query result corresponding to the query statement from the knowledge graph based on the query entity and the location query condition is described. This implementation manner is applicable to the scenario where there are multiple query entities and the location query condition is the second location query condition.

[0092] Refer to Figure 3 , Figure 3 FIG. is another flow schematic diagram of the method for determining the entity query result corresponding to the query statement from the knowledge graph based on the query entity and the location query condition disclosed in the embodiments of the present application. The method may include the following steps:

[0093] Step S301: Determine the location information of each query entity from the knowledge graph.

[0094] In the present application, the entity information of each query entity can be retrieved from the knowledge graph, and its location information can be obtained from the entity information.

[0095] Step S302: Determine the location interval to be queried based on the location information of each query entity and the second location query condition.

[0096] As an implementable manner, the location interval to be queried is a specific space in the preset space. For example, assuming that there are two query entities, namely A and B, and the second location query condition is "between", then the location interval to be queried is the space between the location of A and the location of B.

[0097] For ease of understanding, assume that the coordinates of the query entities are I a (X a , Y a , Z a ), I b (X b , Y b , Z b ), and the second location query condition is "between", then the location interval to be queried can be an interval formed by the following function:

[0098] (1) The function that the X-axis needs to satisfy

[0099] X <= X a +|Xa -X b |, if X a <X b

[0100] X<=X b +|X a -X b |, if X a >X b

[0101] (2) Conditions that the Y-axis needs to meet

[0102] Y<=Y a +|Y a -Y b |, if Y a <Y b

[0103] Y<=Y b +|Y a -Y b |, if Y a >Y b

[0104] (3) Conditions that the Z axis needs to meet

[0105] Z<=Z a +|Z a -Z b |, if Z a <Z b

[0106] Z<=Z b +|Z a -Z b |, if Z a >Z b

[0107] Step S303: determining an entity query result corresponding to the query statement based on the entities within the location interval to be queried.

[0108] In another embodiment of the present application, an implementation method of determining an entity query result corresponding to the query statement based on the entities within the query location interval in step S303 is described. This implementation method may include: determining all entities within the query location interval as the entity query result corresponding to the query statement.

[0109] However, the entities within the to-be-query location interval often include invalid entities, resulting in a low accuracy of the final entity query result. To solve this problem, in another embodiment of the present application, another implementation manner of step S303 for determining the entity query result corresponding to the query statement based on the entities within the to-be-query location interval is described.

[0110] Referring to Figure 4 , Figure 4 is a schematic flowchart of a method for determining an entity query result corresponding to a query statement based on entities within the to-be-query location interval disclosed in an embodiment of the present application. The method may include the following steps:

[0111] Step S401: For each of the query entities, determine the planar position information of the query entity based on the position information of the query entity.

[0112] A query entity is often not a point but a region. For example, a central control screen is often a rectangular region. Therefore, in the present application, for each of the query entities, the planar position information of the query entity is determined based on the position information of the query entity. As an implementable manner, the planar position information of the query entity may be a function expression of a plane determined based on the position information of the query entity. For example, it may be a coordinate representation composed of the coordinates of at least one fixed-point position of the query entity.

[0113] Step S402: For each entity within the to-be-query location interval, determine the planar position information of the entity based on the position information of the entity.

[0114] Each entity within the to-be-query location interval is often not a point but a region. Therefore, in the present application, for each entity within the to-be-query location interval, the planar position information of the entity is determined based on the position information of the entity. As an implementable manner, the planar position information of each entity within the to-be-query location interval may be a function expression of a plane determined based on the position information of each entity within the to-be-query location interval. For example, it may be a coordinate representation composed of the coordinates of at least one fixed-point position of each entity within the to-be-query location interval.

[0115] It should be noted that for the convenience of calculation, preferably, the planar position information of each entity within the to-be-query location interval and the planar position information of the query entity need to be represented in the same form. If the planar position information of each entity within the to-be-query location interval and the planar position information of the query entity are represented in different forms, their forms need to be unified before subsequent processing.

[0116] Step S403: Based on the planar position information of each of the query entities and the planar position information of each entity within the to-be-query position interval, determine the entity query result corresponding to the query statement from each entity within the to-be-query position interval.

[0117] As an implementable manner, the determining the entity query result corresponding to the query statement from each entity within the to-be-query position interval based on the planar position information of each of the query entities and the planar position information of each entity within the to-be-query position interval may include the following steps:

[0118] Step S501: Based on the planar position information of each of the query entities, determine whether each of the query entities is in the same plane.

[0119] In this application, the planar position information of each of the query entities can be compared to determine whether each of the query entities is in the same plane. Different representation forms of the planar position information correspond to different comparison methods, and this application does not make any limitations in this regard.

[0120] Step S502: When each of the query entities is in the same plane, determine the entities within the to-be-query position interval that are in the same plane as each of the query entities as the entity query result corresponding to the query statement.

[0121] Step S503: When each of the query entities is not in the same plane, obtain a preset hyperplane and a second preset threshold corresponding to the second position query condition; based on the planar position information of each of the query entities, the planar position information of each entity within the to-be-query position interval, the preset hyperplane, and the second preset threshold corresponding to the second position query condition, determine the entity query result corresponding to the query statement from each entity within the to-be-query position interval.

[0122] In this application, the hyperplane can be a plane composed of points with the same distance from the planar positions of different query entities.

[0123] As an implementable manner, for each entity within the to-be-query position interval, the distance between the plane of the entity and the preset hyperplane can be determined; compare each distance with the second preset threshold, and determine the entities whose distances do not exceed the second preset threshold as the entity query result corresponding to the query statement.

[0124] Next, the entity query device based on the knowledge graph disclosed in the embodiments of this application will be described. The entity query device based on the knowledge graph described below can be mutually referred to with the entity query method described above.

[0125] Refer toFigure 5 , Figure 5 This is a schematic structural diagram of an entity query device based on a knowledge graph disclosed in an embodiment of the present application. As Figure 5 shown, the entity query device based on the knowledge graph may include:

[0126] An acquisition unit 11, configured to acquire a query statement and a knowledge graph corresponding to the query statement, where the knowledge graph includes a plurality of entity information, and each entity information includes an entity and the position information of the entity, and the position information of the entity is used to indicate the position of the entity in a preset space;

[0127] A determination unit 12, configured to determine a query entity and a position query condition from the query statement;

[0128] A query unit 13, configured to determine an entity query result corresponding to the query statement from the knowledge graph based on the query entity and the position query condition.

[0129] As an implementable manner, the device further includes: a position information determination unit of the entity, and the position information determination unit of the entity is configured to:

[0130] Determine the coordinate system of the preset space;

[0131] Determine the center point of the entity, and / or the coordinates of at least one fixed point position of the entity in the coordinate system;

[0132] Determine the center point of the entity, and / or the coordinates of at least one fixed point position of the entity in the coordinate system as the position information of the entity.

[0133] As an implementable manner, the determination unit is specifically configured to:

[0134] Input the query statement into a natural language understanding model, and the natural language understanding model outputs a query entity and a position query condition. The natural language understanding model is trained with training query statements as training samples and query entities and position query conditions annotated by the training query statements as sample labels.

[0135] As an implementable manner, when there is only one query entity and the position query condition is a first position query condition, the query unit includes:

[0136] A first position information determination unit, configured to determine the position information of the query entity from the knowledge graph;

[0137] A first preset threshold determination unit, configured to determine a first preset threshold corresponding to the first position query condition;

[0138] A first query unit, configured to determine an entity query result corresponding to the query statement from the knowledge graph based on the location information of the query entity and the first preset threshold.

[0139] As an implementable manner, when there are multiple query entities and the location query condition is a second location query condition, the query unit includes:

[0140] A second location information determination unit, configured to determine the location information of each query entity from the knowledge graph;

[0141] A to-be-query location interval determination unit, configured to determine a to-be-query location interval based on the location information of each query entity and the second location query condition;

[0142] A second query unit, configured to determine an entity query result corresponding to the query statement based on the entities within the to-be-query location interval.

[0143] As an implementable manner, the second query unit includes:

[0144] A first plane location information determination unit, configured to determine the plane location information of each query entity based on the location information of the query entity;

[0145] A second plane location information determination unit, configured to determine the plane location information of each entity within the to-be-query location interval based on the location information of the entity;

[0146] A query subunit, configured to determine an entity query result corresponding to the query statement from the entities within the to-be-query location interval based on the plane location information of each query entity and the plane location information of each entity within the to-be-query location interval.

[0147] As an implementable manner, the query subunit includes:

[0148] A judgment unit, configured to determine whether each query entity is in the same plane based on the plane location information of each query entity;

[0149] A first query subunit, configured to, when each query entity is in the same plane, determine the entities within the to-be-query location interval that are in the same plane as each query entity as the entity query result corresponding to the query statement;

[0150] A second query subunit, configured to obtain a preset hyperplane and a second preset threshold corresponding to the second position query condition when the query entities are not in the same plane; and determine an entity query result corresponding to the query statement from each entity within the to-be-query position range based on the plane position information of each query entity, the plane position information of each entity within the to-be-query position range, the preset hyperplane, and the second preset threshold corresponding to the second position query condition.

[0151] Refer to Figure 6 , Figure 6 which is a hardware structure block diagram of an entity query device based on a knowledge graph provided by an embodiment of the present application. Refer to Figure 6 , the hardware structure of the entity query device based on the knowledge graph may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4;

[0152] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 complete communication with each other through the communication bus 4;

[0153] The processor 1 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;

[0154] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0155] Wherein, the memory stores a program, and the processor can call the program stored in the memory, and the program is used for:

[0156] Obtain a query statement and a knowledge graph corresponding to the query statement, where the knowledge graph includes multiple entity information, and each entity information includes an entity and the position information of the entity, and the position information of the entity is used to indicate the position of the entity in a preset space;

[0157] Determine a query entity and a position query condition from the query statement;

[0158] Based on the query entity and the position query condition, determine an entity query result corresponding to the query statement from the knowledge graph.

[0159] Optionally, the refined functions and extended functions of the program may refer to the above description.

[0160] An embodiment of the present application further provides a readable storage medium, which can store a program suitable for a processor to execute, and the program is used for:

[0161] Obtain a query statement and a knowledge graph corresponding to the query statement. The knowledge graph includes a plurality of entity information, and each entity information includes an entity and the location information of the entity. The location information of the entity is used to indicate the location of the entity in a preset space;

[0162] Determine a query entity and a location query condition from the query statement;

[0163] Based on the query entity and the location query condition, determine an entity query result corresponding to the query statement from the knowledge graph.

[0164] Optionally, the refinement function and the extension function of the program can refer to the above description.

[0165] Finally, it should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.

[0166] The various embodiments in this specification are described in a progressive manner, and the key points of each embodiment are the differences from other embodiments. The same and similar parts among the various embodiments can be referred to each other.

[0167] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An entity query method based on a knowledge graph, characterized in that, The method includes: Obtaining a query statement and a knowledge graph corresponding to the query statement, where the knowledge graph includes multiple entity information, and each entity information includes an entity and the position information of the entity, and the position information of the entity is used to indicate the position of the entity in a preset space; Determining a query entity and a position query condition from the query statement; When there are multiple query entities and the position query condition is a second position query condition, determining the position information of each query entity from the knowledge graph; Determining a to-be-query position interval based on the position information of each query entity and the second position query condition; For each query entity, determining the planar position information of the query entity based on the position information of the query entity; For each entity within the to-be-query position interval, determining the planar position information of the entity based on the position information of the entity; Determining whether each query entity is in the same plane based on the planar position information of each query entity; When each query entity is in the same plane, determining the entities within the to-be-query position interval that are in the same plane as each query entity as the entity query result corresponding to the query statement; When each query entity is not in the same plane, obtaining a preset hyperplane and a second preset threshold corresponding to the second position query condition; determining the entity query result corresponding to the query statement from each entity within the to-be-query position interval based on the planar position information of each query entity, the planar position information of each entity within the to-be-query position interval, the preset hyperplane, and the second preset threshold corresponding to the second position query condition.

2. The method according to claim 1, characterized in that, The determination method of the position information of the entity includes: Determining the coordinate system of the preset space; Determining the center point of the entity, and / or the coordinates of at least one fixed point position of the entity in the coordinate system; Determining the coordinates of the center point of the entity, and / or the coordinates of at least one fixed point position of the entity in the coordinate system as the position information of the entity.

3. The method according to claim 1 or 2, characterized in that, The determining the query entity and the position query condition from the query statement includes: Inputting the query statement into a natural language understanding model, and the natural language understanding model outputs a query entity and a position query condition, and the natural language understanding model is trained with training query statements as training samples and query entities and position query conditions labeled by the training query statements as sample labels.

4. The method according to claim 1 or 2, characterized in that, When there is only one query entity and the position query condition is a first position query condition, determining the position information of the query entity from the knowledge graph; Determining a first preset threshold corresponding to the first position query condition; Determining the entity query result corresponding to the query statement from the knowledge graph based on the position information of the query entity and the first preset threshold.

5. An entity query device based on a knowledge graph, characterized in that, The device includes: An acquisition unit, configured to acquire a query statement and a knowledge graph corresponding to the query statement, where the knowledge graph includes a plurality of entity information, and each entity information includes an entity and the position information of the entity, and the position information of the entity is used to indicate the position of the entity in a preset space; A determination unit, configured to determine a query entity and a position query condition from the query statement; A query unit, configured to determine an entity query result corresponding to the query statement from the knowledge graph based on the query entity and the position query condition; When there are multiple query entities and the position query condition is a second position query condition, the query unit includes: A second position information determination unit, configured to determine the position information of each query entity from the knowledge graph; A to-be-query position interval determination unit, configured to determine a to-be-query position interval based on the position information of each query entity and the second position query condition; A first plane position information determination unit, configured to, for each query entity, determine the plane position information of the query entity based on the position information of the query entity; A second plane position information determination unit, configured to, for each entity within the to-be-query position interval, determine the plane position information of the entity based on the position information of the entity; A judgment unit, configured to determine whether each query entity is in the same plane based on the plane position information of each query entity; A first query subunit, configured to, when each query entity is in the same plane, determine the entities within the to-be-query position interval that are in the same plane as each query entity as the entity query result corresponding to the query statement; A second query subunit, configured to, when each query entity is not in the same plane, acquire a preset hyperplane and a second preset threshold corresponding to the second position query condition; and determine the entity query result corresponding to the query statement from each entity within the to-be-query position interval based on the plane position information of each query entity, the plane position information of each entity within the to-be-query position interval, the preset hyperplane, and the second preset threshold corresponding to the second position query condition.

6. An entity query device based on a knowledge graph, characterized in that, Including a memory and a processor; The memory is configured to store a program; The processor is configured to execute the program to implement each step of the entity query method based on a knowledge graph according to any one of claims 1 to 4.

7. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, each step of the entity query method based on a knowledge graph according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Knowledge graph query statement generation method and device, equipment and storage medium

    CN112818092A