Knowledge graph storage and query method and device based on graph database

By building a central mapping registry and logical operation optimization query in the graph database, the problems of storage space waste and low query efficiency in knowledge graph storage and query are solved, efficient storage and query performance is achieved, and the smooth evolution and seamless integration of the business are supported.

CN120723947AActive Publication Date: 2025-09-30INSPUR SOFTWARE TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511195537.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2025-09-30
Estimated Expiration
2045-08-26

AI Technical Summary

Technical Problem

Existing technologies have problems with storage space waste and low query efficiency in knowledge graph storage and query. In particular, it is difficult to meet real-time requirements in large-scale concurrent retrieval and complex condition filtering, especially in the fields of financial anti-fraud.

Method used

A knowledge graph storage and query method based on a graph database is adopted. A unique attribute location identifier is assigned to each attribute by building a central mapping registry. The nodes of the graph database are used for attribute storage management. The query process is optimized through logical operations, including the logical union and difference calculation of storage unit indexes and attribute placeholder reference values, to achieve cross-dimensional multi-attribute combination queries.

Benefits of technology

It achieves a 90% compression rate of storage space, improves query speed and efficiency, supports efficient query of any tag/attribute combination, has the ability to adapt to business query patterns, solves the capacity limitation problem of existing technologies, and ensures smooth evolution and seamless integration of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120723947A_ABST
    Figure CN120723947A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge graph storage and query method and device based on a graph database, and relates to the technical field of artificial intelligence and graph databases. Comprising the steps of 1, collecting all attributes involved in a knowledge graph, and constructing a central mapping registry of global attributes of the knowledge graph in a graph database, 2, carrying out attribute storage management by utilizing nodes in the graph database, and 3, executing cross-dimension multi-attribute combined query retrieval, according to the central mapping registry, finding out an attribute positioning identifier of each target attribute, obtaining a storage unit index of each target attribute, if the storage unit indexes of all the target attributes are the same, carrying out storage unit internal retrieval, and if the storage unit indexes of the target attributes are different, carrying out cross-storage unit associated retrieval; according to the method, an efficient solution is provided for high-performance application of the large-scale knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention discloses a knowledge graph storage and query method and device based on a graph database, relating to the technical field of artificial intelligence and graph database technology. Background Art

[0002] Knowledge graphs are widely used in fields such as intelligent question-answering, recommendation systems, and risk analysis. As knowledge graphs expand in size, multi-label and multi-attribute management of nodes and relationships becomes a performance bottleneck. Existing practices typically use string arrays or multi-table structures to store labels and attributes, resulting in wasted storage space and inefficient queries. Performance issues are particularly prominent in large-scale concurrent searches and complex conditional filtering. For example, in areas with extremely stringent response time requirements, such as financial anti-fraud, a transaction must complete a complex combination judgment of hundreds of risk labels within tens of milliseconds. Existing methods, which involve multiple graph database queries or complex in-memory calculations, struggle to meet these real-time requirements. Summary of the Invention

[0003] In response to the problems of the prior art, the present invention provides a method and device for storing and querying a knowledge graph based on a graph database. The specific solution proposed by the present invention is: The present invention provides a knowledge graph storage and query method based on a graph database, comprising: Step 1: Collect all the attributes involved in the knowledge graph and build a central mapping registry of the global attributes of the knowledge graph in the graph database. The central mapping registry assigns a unique attribute location identifier to each attribute. The attribute location identifier includes a storage unit index and an attribute placeholder reference value. The storage unit index indicates which storage unit the attribute information is stored in, and the attribute placeholder reference value specifies the unique identity symbol of the attribute in the storage unit. Step 2: Use the nodes in the graph database to perform attribute storage management, wherein a composite attribute storage body is preset in each node of the graph database, and the composite attribute storage body includes at least one of the storage units. When a new attribute is assigned to an entity in the knowledge graph, the attribute location identifier corresponding to the newly added attribute is found according to the central mapping registry, and the information of the new attribute is stored according to the obtained storage unit index and attribute placeholder reference value. When removing attributes from entities in the knowledge graph, the attribute location identifier corresponding to the attribute is found according to the central mapping registry, and the attribute information is deleted based on the obtained storage unit index and attribute placeholder reference value. Step 3: Perform cross-dimensional multi-attribute combined query retrieval: Based on the query request of multiple target attributes, find the attribute location identifier of each target attribute according to the central mapping registry, and obtain the storage unit index of each target attribute. If the storage unit indexes of all target attributes are the same, perform an internal storage unit search; if the storage unit indexes of the target attributes are different, perform a cross-storage unit association search.

[0004] Furthermore, in step 1 of the knowledge graph storage and query method based on a graph database, attribute location identifiers are assigned to attributes through a central mapping registry, including: based on historical query logs, analyzing the co-occurrence frequency of different attributes being queried simultaneously, the co-occurrence frequency refers to the frequency with which attributes are queried in combination in the same search, and preferentially assigning attributes with higher co-occurrence frequencies to the same storage unit index.

[0005] Furthermore, in step 1 of the knowledge graph storage and query method based on a graph database, when a new attribute is introduced, it is registered through the central mapping registry, and an unoccupied binary bit is found from the last storage unit to identify the attribute location assigned to the new attribute. When all the occupiers of the storage unit are allocated, a new storage unit is enabled through the composite attribute storage body.

[0006] Furthermore, in step 2 of the graph database-based knowledge graph storage and query method, a new attribute is assigned to an entity of the knowledge graph, including: selecting a correct storage unit in the composite attribute storage body according to the obtained storage unit index, performing a logical union calculation on the attribute placeholder reference value of the new attribute and the value currently stored in the selected storage unit, and storing the calculated new value back into the storage unit. The logical union calculation refers to merging the two values ​​while ensuring that their respective independent placeholder information is not lost, thereby completing the information storage of the new attribute; Removing attributes from entities in the knowledge graph includes: selecting the correct storage unit in the composite attribute storage body according to the obtained storage unit index, performing a logical difference calculation on the attribute placeholder reference value of the attribute and the value currently stored in the selected storage unit, and storing the calculated new value back into the storage unit. The logical difference calculation refers to performing a logical intersection calculation on the inverse value of the attribute placeholder reference value of the attribute, eliminating the attribute placeholder information from the original value, and completing the deletion of the attribute information.

[0007] Furthermore, in step 3 of the knowledge graph storage and query method based on a graph database, the internal retrieval of the storage unit is performed, including: combining the attribute placeholder reference values ​​of all target attributes into a single retrieval verification reference value through a logical union calculation, performing a numerical matching verification calculation in the graph database, and performing a logical intersection test on the value of the recorded storage unit and the retrieval verification reference value. If the test result is completely equal to the retrieval verification reference value itself, it is proved that the recorded storage unit matches all query conditions; Perform cross-storage unit association retrieval, including: performing independent numerical matching verification calculations on each storage unit involved and the retrieval verification benchmark value corresponding to the storage unit, and associating the independent verification steps through logical AND (AND) to finally filter out the records of the storage units that meet all verification conditions.

[0008] The present invention also provides a knowledge graph storage and query device based on a graph database, comprising a mapping module, a storage module and a query module. The mapping module collects all the attributes involved in the knowledge graph and builds a central mapping registry of the global attributes of the knowledge graph in the graph database. The central mapping registry assigns a unique attribute location identifier to each attribute. The attribute location identifier includes a storage unit index and an attribute placeholder reference value. The storage unit index indicates which storage unit the attribute information is stored in, and the attribute placeholder reference value specifies the unique identity symbol of the attribute in the storage unit. The storage module uses the nodes in the graph database to perform attribute storage management, wherein a composite attribute storage body is preset in each node of the graph database, and the composite attribute storage body includes at least one of the storage units. When a new attribute is assigned to an entity in the knowledge graph, the attribute location identifier corresponding to the newly added attribute is found according to the central mapping registry, and the information of the new attribute is stored according to the obtained storage unit index and attribute placeholder reference value. When removing attributes from entities in the knowledge graph, the attribute location identifier corresponding to the attribute is found according to the central mapping registry, and the attribute information is deleted based on the obtained storage unit index and attribute placeholder reference value. The query module performs cross-dimensional multi-attribute combined query retrieval: based on the query request of multiple target attributes, the attribute location identifier of each target attribute is found according to the central mapping registry, and the storage unit index of each target attribute is obtained. If the storage unit indexes of all target attributes are the same, an internal storage unit search is performed. If the storage unit indexes of the target attributes are different, a cross-storage unit association search is performed.

[0009] Furthermore, the mapping module of the knowledge graph storage and query device based on the graph database assigns attribute location identifiers to attributes through a central mapping registration table, including: analyzing the co-occurrence frequency of different attributes being queried simultaneously based on historical query logs, the co-occurrence frequency refers to the frequency with which attributes are queried in combination in the same search, and preferentially assigning attributes with higher co-occurrence frequencies to the same storage unit index.

[0010] Furthermore, in the knowledge graph storage and query device based on a graph database, when a new attribute is introduced, the mapping module registers it through the central mapping registration table and searches for an unoccupied binary bit from the last storage unit to assign an attribute positioning identifier to the new attribute. When all the occupiers of the storage unit are allocated, a new storage unit is enabled through the composite attribute storage body.

[0011] Furthermore, the storage module of the graph database-based knowledge graph storage and query device assigns new attributes to entities in the knowledge graph, including: selecting a correct storage unit in the composite attribute storage body according to the obtained storage unit index, performing a logical union calculation on the attribute placeholder reference value of the new attribute and the value currently stored in the selected storage unit, and storing the calculated new value back into the storage unit, wherein the logical union calculation refers to merging the two values ​​while ensuring that their respective independent placeholder information is not lost, thereby completing the information storage of the new attribute; The storage module removes attributes for entities in the knowledge graph, including: selecting the correct storage unit in the composite attribute storage body according to the obtained storage unit index, performing a logical difference calculation on the attribute placeholder reference value of the attribute and the value currently stored in the selected storage unit, and storing the calculated new value back into the storage unit. The logical difference calculation refers to performing a logical intersection calculation with the inverse value of the attribute placeholder reference value of the attribute, eliminating the attribute placeholder information from the original value, and completing the deletion of the attribute information.

[0012] Furthermore, the query module of the graph database-based knowledge graph storage and query device performs internal retrieval of a storage unit, including: combining the attribute placeholder reference values ​​of all target attributes into a single retrieval verification reference value through a logical union calculation, performing a numerical matching verification calculation in the graph database, and performing a logical intersection test on the value of the recorded storage unit and the retrieval verification reference value. If the test result is completely equal to the retrieval verification reference value itself, it is proved that the recorded storage unit matches all query conditions; Perform cross-storage unit association retrieval, including: performing independent numerical matching verification calculations on each storage unit involved and the retrieval verification benchmark value corresponding to the storage unit, and associating the independent verification steps through logical AND (AND) to finally filter out the records of the storage units that meet all verification conditions.

[0013] The benefits of the present invention are: Optimized compression and efficiency: Compared with existing methods that serialize data into JSON arrays or directly store static attribute information, this invention can achieve a compression rate of over 90% in storage space. For example, storing 128 independent tags / attributes only requires 16 bytes, i.e., two 64-bit integers. This extreme compactness greatly reduces hardware costs and data transmission overhead. Optimize query performance: Since the core calculation is the numerical logic operation natively supported by the CPU, the query speed of the present invention far exceeds that of traditional methods. Flexibility and adaptability: The present invention supports efficient query and statistics of any tag / attribute combination, and through the intelligent optimization allocation strategy described in step 1, it can adapt to the business query mode and continuously improve the operation efficiency. Smooth system evolution capability: Through the dynamic expansion mechanism of "storage unit", this invention fundamentally solves the capacity limitation problem of existing bit operation solutions. New tags or attributes only need to be registered in the mapping table, without the need to change the structure of the graph database, ensuring 24 / 7 uninterrupted and smooth evolution of the business. Seamless integration with the existing ecosystem and dual optimization: This invention takes into account the breadth screening capabilities of native indexes and its own extreme performance in deep and complex filtering. Optimize development and usage experience: This invention greatly lowers the usage threshold for application developers, allowing them to focus on business logic without having to worry about the details of numerical coding, thereby accelerating the implementation and promotion of this invention in actual projects. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 Schematic diagram of the algorithm loss reduction process of the method of the present invention. DETAILED DESCRIPTION

[0015] The present invention will be further described below with reference to the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention.

[0016] Example 1: The present invention provides a knowledge graph storage and query method based on a graph database, comprising: Step 1: Collect all the attributes involved in the knowledge graph, and build a central mapping registry of the global attributes of the knowledge graph in the graph database. The central mapping registry is used to assign a unique attribute location identifier to each attribute. The attribute location identifier includes a storage unit index and an attribute placeholder reference value. The storage unit index indicates in which storage unit the attribute information is stored, and the attribute placeholder reference value specifies the unique identity symbol of the attribute within the storage unit. The storage unit index can be a zero-based ordinal number that clearly specifies in which independent storage unit in the subsequent data structure the attribute information should be stored. The attribute placeholder reference value can be a 64-bit value. In binary form, only one bit is "1" and the rest of the bits are "0", which serves as the unique and irreplaceable identity symbol of the attribute within the specified storage unit.

[0017] Moreover, when assigning attribute location identifiers to attributes through the central mapping registry in step 1, it may include: analyzing the co-occurrence frequency of different attributes being queried simultaneously based on historical query logs, the co-occurrence frequency refers to the frequency with which attributes are queried in combination in the same search, and giving priority to assigning attributes with higher co-occurrence frequency to the same storage unit index. For example, combinations of attribute items that are frequently retrieved together, in the above-mentioned financial scenario, the three label attributes of "high risk", "nighttime transactions", and "remote logins" are often queried in combination. Assign them to the same storage unit index first. Through this intelligent pre-aggregation allocation based on usage patterns, the highest-frequency complex queries in the future can be converted into the most efficient "storage unit internal search" to the maximum extent, thereby further improving the average query performance on a macro level and giving the present invention the ability of adaptive optimization.

[0018] In step 1, when a new attribute is introduced, it is registered through the central mapping registry. An unoccupied binary bit is found in the last storage unit and assigned as the attribute location identifier for the new attribute. Once all 64 bits in the storage unit are allocated, the new storage unit is enabled through the composite attribute storage bank. This entire process is non-invasive to existing data and system structures, enabling unlimited and smooth evolution of the attribute system.

[0019] Step 2: Use the nodes in the graph database to perform attribute storage management, wherein a composite attribute storage body is preset in each node of the graph database, and the composite attribute storage body includes at least one of the storage units. When a new attribute is assigned to an entity in the knowledge graph, the attribute location identifier corresponding to the newly added attribute is found according to the central mapping registry, and the information of the new attribute is stored according to the obtained storage unit index and attribute placeholder reference value. When removing an attribute from an entity in the knowledge graph, the attribute location identifier corresponding to the attribute is found according to the central mapping registry, and the attribute information is deleted based on the obtained storage unit index and attribute placeholder reference value.

[0020] Assigning a new attribute to an entity in the knowledge graph may include: selecting a correct storage unit in the composite attribute storage body according to the obtained storage unit index, performing a logical union calculation on the attribute placeholder reference value of the new attribute and the value currently stored in the selected storage unit, and storing the calculated new value back into the storage unit. The logical union calculation refers to merging two values ​​while ensuring that their respective independent placeholder information is not lost, thereby completing the information storage of the new attribute; Removing attributes from entities in the knowledge graph includes: selecting the correct storage unit in the composite attribute storage body according to the obtained storage unit index, performing a logical difference calculation on the attribute placeholder reference value of the attribute and the value currently stored in the selected storage unit, and storing the calculated new value back into the storage unit. The logical difference calculation refers to performing a logical intersection calculation on the inverse value of the attribute placeholder reference value of the attribute, eliminating the attribute placeholder information from the original value, and completing the deletion of the attribute information.

[0021] Step 3: Perform cross-dimensional multi-attribute combined query retrieval: Based on the query request of multiple target attributes, find the attribute location identifier of each target attribute according to the central mapping registry, and obtain the storage unit index of each target attribute. If the storage unit indexes of all target attributes are the same, perform an internal storage unit search; if the storage unit indexes of the target attributes are different, perform a cross-storage unit association search.

[0022] The internal retrieval of the storage unit includes: combining the attribute placeholder reference values ​​of all target attributes through a logical union calculation to form a single retrieval verification reference value, performing a value matching verification calculation in the graph database, and performing a logical intersection test on the value of the recorded storage unit and the retrieval verification reference value. If the test result is completely equal to the retrieval verification reference value itself, it is proved that the recorded storage unit matches all query conditions; Cross-storage unit correlation retrieval involves performing independent numerical matching verification calculations on each involved storage unit and its corresponding retrieval verification benchmark. These independent verification steps are then linked using a logical AND operation to ultimately select records from storage units that meet all verification criteria. This avoids the costly OR conditional joins or multiple queries typically found in traditional graph databases, while maintaining exceptional efficiency.

[0023] In addition, the present invention can also be applied to complex queries in graph structure traversal. The advantages of the present invention are further reflected in scenarios where graph traversal queries such as multi-hop relationship search and neighbor analysis are executed. At each step of the traversal process, the composite attribute storage of the current node can be checked in real time and efficiently. By executing the numerical matching verification calculation described in step 3, it is determined whether the current entity meets the complex attribute conditions preset on the path, thereby being able to quickly cut off a large number of invalid traversal paths, greatly improving the performance and response speed of complex graph analysis.

[0024] The proposed method seamlessly integrates with the underlying mechanisms of graph databases, such as indexing numeric fields, to further enhance query performance. Because its core data structure, the composite attribute storage, utilizes an extremely compact numeric format, it significantly reduces data storage costs and disk read / write overhead compared to existing text or multi-field storage methods. This provides powerful technical support for applications requiring high throughput and low latency, such as real-time analysis and risk warning.

[0025] Example 2: The present invention also provides a knowledge graph storage and query device based on a graph database, comprising a mapping module, a storage module and a query module. The mapping module collects all the attributes involved in the knowledge graph and builds a central mapping registry of the global attributes of the knowledge graph in the graph database. The central mapping registry assigns a unique attribute location identifier to each attribute. The attribute location identifier includes a storage unit index and an attribute placeholder reference value. The storage unit index indicates which storage unit the attribute information is stored in, and the attribute placeholder reference value specifies the unique identity symbol of the attribute in the storage unit. The storage module uses the nodes in the graph database to perform attribute storage management, wherein a composite attribute storage body is preset in each node of the graph database, and the composite attribute storage body includes at least one of the storage units. When a new attribute is assigned to an entity in the knowledge graph, the attribute location identifier corresponding to the newly added attribute is found according to the central mapping registry, and the information of the new attribute is stored according to the obtained storage unit index and attribute placeholder reference value. When removing attributes from entities in the knowledge graph, the attribute location identifier corresponding to the attribute is found according to the central mapping registry, and the attribute information is deleted based on the obtained storage unit index and attribute placeholder reference value. The query module performs cross-dimensional multi-attribute combined query retrieval: based on the query request of multiple target attributes, the attribute location identifier of each target attribute is found according to the central mapping registry, and the storage unit index of each target attribute is obtained. If the storage unit indexes of all target attributes are the same, an internal storage unit search is performed. If the storage unit indexes of the target attributes are different, a cross-storage unit association search is performed.

[0026] Since the information interaction, execution process and other contents between the modules in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention, the specific contents can be found in the description of the embodiment of the method of the present invention and will not be repeated here.

[0027] Likewise, the benefits of the device of the present invention are: Optimized compression and efficiency: Compared with existing methods that serialize data into JSON arrays or directly store static attribute information, this invention can achieve a compression rate of over 90% in storage space. For example, storing 128 independent tags / attributes only requires 16 bytes, i.e., two 64-bit integers. This extreme compactness greatly reduces hardware costs and data transmission overhead. Optimize query performance: Since the core calculation is the numerical logic operation natively supported by the CPU, the query speed of the present invention far exceeds that of traditional methods. Flexibility and adaptability: The present invention supports efficient query and statistics of any tag / attribute combination, and through the intelligent optimization allocation strategy described in step 1, it can adapt to the business query mode and continuously improve the operation efficiency. Smooth system evolution capability: Through the dynamic expansion mechanism of "storage unit", this invention fundamentally solves the capacity limitation problem of existing bit operation solutions. New tags or attributes only need to be registered in the mapping table, without the need to change the structure of the graph database, ensuring 24 / 7 uninterrupted and smooth evolution of the business. Seamless integration with the existing ecosystem and dual optimization: This invention takes into account the breadth screening capabilities of native indexes and its own extreme performance in deep and complex filtering. Optimize development and usage experience: This invention greatly lowers the usage threshold for application developers, allowing them to focus on business logic without having to worry about the details of numerical coding, thereby accelerating the implementation and promotion of this invention in actual projects.

[0028] It should be noted that not all steps and modules in the above-mentioned processes and device structures are required, and certain steps or modules can be omitted according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or may be implemented by certain components in multiple independent devices.

[0029] The above embodiments are merely preferred embodiments for the purpose of fully illustrating the present invention, and the scope of protection of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the present invention are within the scope of protection of the present invention. The scope of protection of the present invention shall be subject to the claims.

Claims

1. A knowledge graph storage and query method based on a graph database, characterized by include: Step 1: Collect all the attributes involved in the knowledge graph and build a central mapping registry of the global attributes of the knowledge graph in the graph database. The central mapping registry assigns a unique attribute location identifier to each attribute. The attribute location identifier includes a storage unit index and an attribute placeholder reference value. The storage unit index indicates which storage unit the attribute information is stored in, and the attribute placeholder reference value specifies the unique identity symbol of the attribute in the storage unit. Step 2: Use the nodes in the graph database to perform attribute storage management, wherein a composite attribute storage body is preset in each node of the graph database, and the composite attribute storage body includes at least one of the storage units. When a new attribute is assigned to an entity in the knowledge graph, the attribute location identifier corresponding to the newly added attribute is found according to the central mapping registry, and the information of the new attribute is stored according to the obtained storage unit index and attribute placeholder reference value. When removing attributes from entities in the knowledge graph, the attribute location identifier corresponding to the attribute is found according to the central mapping registry, and the attribute information is deleted based on the obtained storage unit index and attribute placeholder reference value. Step 3: Perform cross-dimensional multi-attribute combined query retrieval: Based on the query request of multiple target attributes, find the attribute location identifier of each target attribute according to the central mapping registry, and obtain the storage unit index of each target attribute. If the storage unit indexes of all target attributes are the same, perform an internal storage unit search; if the storage unit indexes of the target attributes are different, perform a cross-storage unit association search.

2. A knowledge graph storage and query method based on a graph database according to claim 1, characterized in that In step 1, attribute location identifiers are assigned to attributes through the central mapping registry, including: analyzing the co-occurrence frequency of different attributes being queried simultaneously based on historical query logs. The co-occurrence frequency refers to the frequency with which attributes are queried in combination in the same search, and preferentially assigning attributes with higher co-occurrence frequencies to the same storage unit index.

3. The knowledge graph storage and query method based on a graph database according to claim 1 is characterized by In step 1, when a new attribute is introduced, it is registered through the central mapping registry, and an unoccupied binary bit is found from the last storage unit to identify the attribute location assigned to the new attribute. When all the occupiers of the storage unit are allocated, a new storage unit is enabled through the composite attribute storage body.

4. The method for storing and querying a knowledge graph based on a graph database according to claim 1 is characterized in that In step 2, a new attribute is assigned to the entity in the knowledge graph, including: selecting the correct storage unit in the composite attribute storage body according to the obtained storage unit index, performing a logical union calculation on the attribute placeholder reference value of the new attribute and the value currently stored in the selected storage unit, and storing the calculated new value back into the storage unit. The logical union calculation refers to merging the two values ​​while ensuring that their independent placeholder information is not lost, thus completing the information storage of the new attribute; Removing attributes from entities in the knowledge graph includes: selecting the correct storage unit in the composite attribute storage body according to the obtained storage unit index, performing a logical difference calculation on the attribute placeholder reference value of the attribute and the value currently stored in the selected storage unit, and storing the calculated new value back into the storage unit. The logical difference calculation refers to performing a logical intersection calculation on the inverse value of the attribute placeholder reference value of the attribute, eliminating the attribute placeholder information from the original value, and completing the deletion of the attribute information.

5. The knowledge graph storage and query method based on a graph database according to claim 1 is characterized by In step 3, internal retrieval of the storage unit is performed, including: combining the attribute placeholder reference values ​​of all target attributes through a logical union calculation to form a single retrieval verification reference value, performing a value matching verification calculation in the graph database, and performing a logical intersection test on the value of the recorded storage unit and the retrieval verification reference value. If the test result is completely equal to the retrieval verification reference value itself, it is proved that the recorded storage unit matches all query conditions; Perform cross-storage unit association retrieval, including: performing independent numerical matching verification calculations on each storage unit involved and the retrieval verification benchmark value corresponding to the storage unit, and associating the independent verification steps through logical AND (AND) to finally filter out the records of the storage units that meet all verification conditions.

6. A knowledge graph storage and query device based on a graph database, characterized by Including mapping module, storage module and query module, The mapping module collects all the attributes involved in the knowledge graph and builds a central mapping registry of the global attributes of the knowledge graph in the graph database. The central mapping registry assigns a unique attribute location identifier to each attribute. The attribute location identifier includes a storage unit index and an attribute placeholder reference value. The storage unit index indicates which storage unit the attribute information is stored in, and the attribute placeholder reference value specifies the unique identity symbol of the attribute in the storage unit. The storage module uses the nodes in the graph database to perform attribute storage management, wherein a composite attribute storage body is preset in each node of the graph database, and the composite attribute storage body includes at least one of the storage units. When a new attribute is assigned to an entity in the knowledge graph, the attribute location identifier corresponding to the newly added attribute is found according to the central mapping registry, and the information of the new attribute is stored according to the obtained storage unit index and attribute placeholder reference value. When removing attributes from entities in the knowledge graph, the attribute location identifier corresponding to the attribute is found according to the central mapping registry, and the attribute information is deleted based on the obtained storage unit index and attribute placeholder reference value. The query module performs cross-dimensional multi-attribute combined query retrieval: based on the query request of multiple target attributes, the attribute location identifier of each target attribute is found according to the central mapping registry, and the storage unit index of each target attribute is obtained. If the storage unit indexes of all target attributes are the same, an internal storage unit search is performed. If the storage unit indexes of the target attributes are different, a cross-storage unit association search is performed.

7. A knowledge graph storage and query device based on a graph database according to claim 6, characterized in that The mapping module assigns attribute location identifiers to attributes through the central mapping registry, including: analyzing the co-occurrence frequency of different attributes being queried simultaneously based on historical query logs. The co-occurrence frequency refers to the frequency with which attributes are queried in combination in the same search, and preferentially assigning attributes with higher co-occurrence frequencies to the same storage unit index.

8. The knowledge graph storage and query device based on a graph database according to claim 6 is characterized by: When a new attribute is introduced, the mapping module registers it through the central mapping registry and searches for an unoccupied binary bit from the last storage unit to assign the attribute location identifier to the new attribute. When all the occupiers of the storage unit are allocated, a new storage unit is enabled through the composite attribute storage body.

9. The knowledge graph storage and query device based on a graph database according to claim 6 is characterized by: The storage module assigns new attributes to entities in the knowledge graph, including: selecting the correct storage unit in the composite attribute storage body based on the obtained storage unit index, performing a logical union calculation on the attribute placeholder reference value of the new attribute and the value currently stored in the selected storage unit, and storing the calculated new value back into the storage unit. The logical union calculation refers to merging two values ​​while ensuring that their independent placeholder information is not lost, completing the information storage of the new attribute; The storage module removes attributes for entities in the knowledge graph, including: selecting the correct storage unit in the composite attribute storage body according to the obtained storage unit index, performing a logical difference calculation on the attribute placeholder reference value of the attribute and the value currently stored in the selected storage unit, and storing the calculated new value back into the storage unit. The logical difference calculation refers to performing a logical intersection calculation with the inverse value of the attribute placeholder reference value of the attribute, eliminating the attribute placeholder information from the original value, and completing the deletion of the attribute information.

10. The knowledge graph storage and query device based on graph database according to claim 6 is characterized by The query module performs internal retrieval of storage units, including: combining the attribute placeholder reference values ​​of all target attributes through a logical union calculation to form a single retrieval verification reference value, performing a value matching verification calculation in the graph database, and performing a logical intersection test on the value of the recorded storage unit and the retrieval verification reference value. If the test result is completely equal to the retrieval verification reference value itself, it proves that the recorded storage unit meets all query conditions; Perform cross-storage unit association retrieval, including: performing independent numerical matching verification calculations on each storage unit involved and the retrieval verification benchmark value corresponding to the storage unit, and associating the independent verification steps through logical AND (AND) to finally filter out the records of the storage units that meet all verification conditions.

Citation Information

Patent Citations

  • Knowledge graph-based index creation method and device

    CN114297334A

  • Semantic search method based on secret state knowledge graph

    CN119691810A

  • Multi-source knowledge processing and querying method and device, equipment and medium

    CN120197681A

  • Distributed information search device for data network has input.output device of client computer used for entering search attributes for selected information format

    DE10045252A1

  • Data query method and system based on knowledge graph, and device and storage medium

    WO2023125718A1