A storage optimization method and system for traditional Chinese medicine field knowledge graph crowdsourcing query

By optimizing the crowdsourced query of TCM knowledge graph through adjacency list storage and hybrid index structure, the problem of low efficiency in existing technologies is solved, achieving efficient storage, fast query and low-cost update, which is suitable for the complex data characteristics of the TCM field.

CN121705377BActive Publication Date: 2026-06-19BEIJING UNIV OF CHINESE MEDICINE
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING UNIV OF CHINESE MEDICINE
Filing Date
2025-12-01
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing RDF data storage and indexing schemes are inefficient in crowdsourced queries in the field of traditional Chinese medicine. They cannot efficiently map graph structures, suffer from index mismatch, poor update and scalability, and are difficult to adapt to the complexity and continuous growth of traditional Chinese medicine knowledge graphs.

Method used

We use an adjacency list to store RDF data and build a hybrid index structure, including uncertain edge indexes and certain edge indexes. We use hash tables and B+ tree indexes to handle different query modes respectively, and combine the top-K matching algorithm of max heap to optimize the query process.

Benefits of technology

It significantly improves query speed and system responsiveness, supports efficient storage and frequent updates, reduces economic costs, and adapts to the data characteristics of the traditional Chinese medicine field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121705377B_ABST
    Figure CN121705377B_ABST
Patent Text Reader

Abstract

This invention discloses a storage optimization method and system for crowdsourced querying of knowledge graphs in the field of Traditional Chinese Medicine (TCM). The method includes: storing TCM RDF triple data in the form of an adjacency list; constructing an uncertain edge index based on a hash table and a definite edge index based on a B+ tree for different patterns in crowdsourced queries, where the known predicate is not the subject / object or the known subject / predicate / object combination, with index entries pointing to an inverted linked list storing entity ID sequences; supporting dynamic maintenance of the adjacency list and indexes during incremental data updates; for unknown nodes in the query graph, retrieving the candidate entity ID set for each edge using a hybrid index, and calculating and returning the top K candidate nodes with the minimum overall cost based on a preset crowdsourcing cost using a Top-K matching algorithm based on a max-heap. This invention effectively solves the problems of low storage efficiency, index mismatch, and poor update scalability in TCM knowledge graph crowdsourced query scenarios, achieving efficient storage, fast querying, and low-cost crowdsourcing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graph and database technology, and in particular to a storage optimization method and system for crowdsourced query of knowledge graphs in the field of traditional Chinese medicine. Background Technology

[0002] With the development of Semantic Web technology, Resource Description Framework (RDF) has become the mainstream standard for constructing and representing knowledge graphs. Knowledge graphs in the field of Traditional Chinese Medicine (TCM) are characterized by complex entity relationships, non-standardized terminology, and a massive and continuously growing data volume. Meanwhile, to address the ambiguity and uncertainty in queries, a crowdsourcing model has been introduced into knowledge graph queries, which involves decomposing complex query tasks and distributing them to the general public online.

[0003] However, existing RDF data storage and indexing solutions have significant shortcomings when dealing with crowdsourced queries in the field of traditional Chinese medicine:

[0004] 1. Low storage efficiency: Most crowdsourcing systems are based on relational databases, whose two-dimensional table structure cannot efficiently map the graph structure of RDF data, resulting in a large number of "join" operations during queries and poor performance.

[0005] 2. Index Mismatch: Existing indexing methods (such as general indexes based on B-trees or hashes) are not optimized for the specific scenario of "crowdsourced queries." In crowdsourced queries, the query graph typically contains known edges and unknown vertices, requiring the rapid discovery of candidate entities based on known predicates or subject-verb / verb-object combinations, which traditional indexes do not adequately support.

[0006] 3. Poor updateability and scalability: Many systems do not support frequent data updates, or the index maintenance cost is high under large data volume, making it difficult to adapt to the continuous evolution of TCM knowledge graph.

[0007] Therefore, there is an urgent need in this field for a dedicated technical solution that can balance efficient storage, fast retrieval, low-cost crowdsourcing, and easy updates. Summary of the Invention

[0008] This invention addresses the shortcomings of existing technologies by providing a storage optimization method and system for crowdsourced querying of knowledge graphs in the field of traditional Chinese medicine, thereby achieving efficient storage, rapid indexing, and low-cost crowdsourced querying of RDF data in traditional Chinese medicine.

[0009] To achieve the above-mentioned objectives, the technical solution adopted by the present invention is as follows:

[0010] A storage optimization method for crowdsourced querying of knowledge graphs in the field of traditional Chinese medicine, characterized by the following steps:

[0011] The RDF triple data in the field of traditional Chinese medicine is stored in the form of an adjacency list, where each entity is assigned a unique ID and associated with an adjacency list consisting of all its outgoing edges, where the outgoing edges are predicate-object pairs;

[0012] A hybrid index structure is constructed to support different edge query modes in crowdsourced queries. The hybrid index structure includes uncertain edge indexes and deterministic edge indexes.

[0013] The uncertain edge index is for edges where the predicate is known but the subject or object is unknown. It uses a hash table index to map the predicate to a hash key and uses a hash function to locate the disk location of the inverted linked list storing the corresponding subject or object ID sequence.

[0014] The defined edge index is for edges where the subject and predicate are known but the object is unknown, or the predicate and object are known but the subject is unknown. A B+ tree index is used to concatenate the strings of the subject and predicate or the predicate and object into a key. The B+ tree maintains the mapping of this key to the disk location of the inverted linked list storing the corresponding object or subject ID sequence.

[0015] In response to the addition of new RDF triple data, the adjacency list and the corresponding inverted list in the hybrid index structure are dynamically updated;

[0016] For an unknown node in the crowdsourcing query graph, the hybrid index structure is used to retrieve the candidate entity ID sequence corresponding to all edges connected to the unknown node.

[0017] Based on the pre-set crowdsourcing cost for each edge in the crowdsourcing query, a Top-K matching algorithm based on max-heap is used to calculate and return the top K candidate entity IDs with the smallest overall crowdsourcing cost.

[0018] Furthermore, the hash table index used to construct the uncertain edge index includes:

[0019] Map the predicate string to a hash key;

[0020] The hash key is mapped to a disk storage bucket using a hash function;

[0021] The sequence of subject IDs or object IDs that meet the predicate condition is stored in the file location pointed to by the disk storage bucket in the form of an inverted linked list.

[0022] Furthermore, the construction of the B+ tree index that determines the edge index includes:

[0023] Concatenate and encode the subject string and predicate string, or the predicate string and object string, to form the key of the B+ tree;

[0024] The B+ tree maintains a mapping from the keys to disk pointers of inverted linked lists that store the corresponding object ID or subject ID sequence.

[0025] Furthermore, the space allocation of the inverted linked list adopts a dynamic multiplication growth strategy, and when the space allocation reaches a predetermined threshold in a single allocation, it is switched to a fixed size allocation.

[0026] Furthermore, the Top-K matching algorithm based on max-heap includes:

[0027] Sort the candidate entity ID sequence corresponding to each edge in descending order of its crowdsourcing cost;

[0028] Iterate through the sorted sequence to calculate the overall crowdsourcing cost for the current entity ID;

[0029] We use a max-heap to maintain the top K candidate IDs with the minimum overall cost, and prune them using the cost cap during the traversal. The calculation ends when it is determined that the remaining candidate IDs cannot enter the top K.

[0030] This invention also discloses a storage optimization system for crowdsourced querying of knowledge graphs in the field of traditional Chinese medicine to implement the above method, the system comprising:

[0031] The storage module is used to store traditional Chinese medicine RDF data in the form of an adjacency list;

[0032] The index module includes hash table index units and B+ tree index units, used to construct and maintain the uncertain edge index and the deterministic edge index, respectively;

[0033] The update module is used to dynamically update the adjacency list in the storage module and the inverted linked list in the index module in response to data update requests.

[0034] The query processing module is used to receive crowdsourced query requests, call the index module to obtain the candidate entity ID sequence, and execute the Top-K candidate node matching algorithm to output the results.

[0035] Furthermore, the system is deployed on a server, the storage module and index module are implemented using disk files, and the update module and query processing module run as background service processes.

[0036] Compared with the prior art, the advantages of the present invention are as follows:

[0037] 1. This invention innovatively designs a hybrid indexing strategy (combining hash tables and B+ trees) targeting the two core patterns of "uncertain edges" and "determined edges" in crowdsourced queries. The hash table index provides fast lookup capabilities with approximately O(1) time complexity for queries with known predicates, while the B+ tree index provides stable O(log N) high-performance range query support for queries with known subject-predicate or predicate-object combinations. This targeted index design accurately matches the typical graph pattern of crowdsourced queries, avoiding unnecessary full table scans or complex join operations, thereby significantly accelerating the retrieval speed of candidate entity nodes and greatly improving the overall query response capability of the system.

[0038] 2. At the storage level, this invention abandons the traditional two-dimensional table structure of relational databases and adopts an adjacency list storage method that is more in line with the essence of RDF data graph structure, naturally expressing the relationships between entities and reducing storage redundancy. At the underlying storage of the index, the inverted linked list adopts a dynamic allocation strategy that multiplies the space required for growth, achieving a good balance between space utilization and disk I / O efficiency during initial data insertion and subsequent incremental updates. This collaborative design of storage and index structures makes the system not only compact in storage but also capable of supporting efficient and frequent incremental updates of knowledge graph data, well-suited to the continuously evolving characteristics of data in the field of traditional Chinese medicine.

[0039] 3. This invention goes beyond simple, fast querying; it delves into the core economic efficiency of crowdsourcing applications, designing a Top-K candidate node matching algorithm based on a max-heap. This algorithm effectively integrates the multilateral constraints connecting unknown nodes in the query graph with the crowdsourcing cost preset by the user for each edge, intelligently calculating the comprehensive cost of candidate nodes. By introducing a cost cap pruning strategy, the algorithm can terminate invalid calculations on high-cost candidate sets early during traversal, quickly and accurately locating the top K candidate nodes with the minimum comprehensive crowdsourcing cost. This provides optimal input for subsequent crowdsourcing task distribution, directly reducing the economic cost of crowdsourcing operations from the source.

[0040] 4. This invention is not a general solution, but rather a customized design specifically for the domain characteristics of Traditional Chinese Medicine (TCM) knowledge graphs, which are characterized by "complex entity relationships, non-standard terminology, and massive and continuously growing data volume." Adjacency list storage flexibly handles complex entity relationships; hybrid indexes effectively support flexible queries based on non-standard terminology; and an efficient dynamic update mechanism meets the needs of continuously growing data. Therefore, compared to general storage and indexing solutions, this invention demonstrates superior applicability, flexibility, and scalability when dealing with the unique data structures and query patterns of the TCM field. Attached Figure Description

[0041] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 This is an overall structural block diagram in an embodiment of the present invention;

[0043] Figure 2 This is a schematic diagram of a query image in an embodiment of the present invention;

[0044] Figure 3 This is a flowchart of the hybrid index creation process in an embodiment of the present invention;

[0045] Figure 4 This is a schematic diagram of the B+ tree node structure in an embodiment of the present invention;

[0046] Figure 5 This is a schematic diagram of the initial allocation of space in the inverted linked list during its exponential growth, as described in an embodiment of the present invention.

[0047] Figure 6 This is a schematic diagram illustrating the multiple allocation of space in the inverted linked list during exponential growth in an embodiment of the present invention;

[0048] Figure 7 This is a flowchart of the Top-K candidate node matching algorithm in an embodiment of the present invention. Detailed Implementation

[0049] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0050] This invention provides a storage optimization method for crowdsourced querying of knowledge graphs in the field of traditional Chinese medicine, comprising the following steps:

[0051] The RDF triple data in the field of traditional Chinese medicine is stored in the form of an adjacency list, where each entity is assigned a unique ID and associated with an adjacency list consisting of all its outgoing edges, where the outgoing edges are predicate-object pairs;

[0052] A hybrid index structure is constructed to support different edge query modes in crowdsourced queries. The hybrid index structure includes uncertain edge indexes and deterministic edge indexes.

[0053] The uncertain edge index is for edges where the predicate is known but the subject or object is unknown. It uses a hash table index to map the predicate to a hash key and uses a hash function to locate the disk location of the inverted linked list storing the corresponding subject or object ID sequence.

[0054] The defined edge index is for edges where the subject and predicate are known but the object is unknown, or the predicate and object are known but the subject is unknown. A B+ tree index is used to concatenate the strings of the subject and predicate or the predicate and object into a key. The B+ tree maintains the mapping of this key to the disk location of the inverted linked list storing the corresponding object or subject ID sequence.

[0055] In response to the addition of new RDF triple data, the adjacency list and the corresponding inverted list in the hybrid index structure are dynamically updated;

[0056] For an unknown node in the crowdsourcing query graph, the hybrid index structure is used to retrieve the candidate entity ID sequence corresponding to all edges connected to the unknown node.

[0057] Based on the pre-set crowdsourcing cost for each edge in the crowdsourcing query, a Top-K matching algorithm based on max-heap is used to calculate and return the top K candidate entity IDs with the smallest overall crowdsourcing cost.

[0058] I. System Hardware and Operating Environment

[0059] refer to Figure 1 The storage optimization method described in this invention can be deployed on one or more servers. A server typically includes a computing unit, system memory (RAM), and a system bus. The computing unit can be a central processing unit (CPU). System memory includes read-only memory (ROM) and random access memory (RAM). The basic input / output system (BIOS) is stored in ROM. The server operating system (such as Linux or Windows Server) and various application software are stored in RAM. The storage module and indexing module are implemented using non-volatile storage media such as the server's hard disk drive (HDD) or solid-state drive (SSD). The update module and query processing module run as background service processes (such as Java Spring Boot applications or Python Daemon processes) and receive external requests and return results via network APIs (such as RESTful APIs).

[0060] II. Specific Implementation of Data Storage

[0061] The storage module is responsible for storing traditional Chinese medicine RDF data in the form of an adjacency list. The specific steps are as follows:

[0062] Data parsing and ID assignment: The original TCM RDF file (such as Turtle or N-Triples format) is parsed to extract all subject, predicate, and object entities. For each unique entity (such as "Astragalus membranaceus", "Wind-Cold Common Cold", "Qi-tonifying and Exterior-strengthening"), a fixed-length unique key (e.g., 64 bits) is generated using a hash function (such as MD5 or SHA-1), and an auto-incrementing integer ID (e.g., 1, 2, 3, ...) is assigned. Simultaneously, an "entity dictionary" file is maintained to record the mapping relationship between entity ID and the original entity description.

[0063] Adjacency list construction: Create an adjacency list entry for each entity ID. Each adjacency list entry contains information about all outgoing edges for that entity. Each outgoing edge is a (predicate, object ID) pair. For example, the adjacency list entry for the entity "Astragalus" (ID=01) might contain the following list of outgoing edges:

[0064] (hasProperty, 02) / / Where "02" is the entity ID of the attribute "temperature".

[0065] (hasEfficacy,03) / / Where "03" is the entity ID for the efficacy "replenishing qi and strengthening the exterior".

[0066] (isTreatedBy,04) / / Where "04" is the entity ID of the formula "Yu Ping Feng San".

[0067] The adjacency list entries for all entities are stored sequentially in one or more disk files, and an index is used to quickly locate the starting position of the adjacency list entry corresponding to each entity ID.

[0068] III. Specific Implementation of Hybrid Index Construction

[0069] refer to Figure 3 The index module includes hash table index units and B+ tree index units.

[0070] Implementation of an uncertain edge index (hash table index):

[0071] This index is used to speed up the "given predicate, query subject or object" pattern. For example, query all entities (subjects) that have the hasEfficacy relation.

[0072] Implementation process: Create a hash file. Take a predicate string (e.g., "hasEfficacy") as input and use a hash function (e.g., MurmurHash) to calculate a bucket index. Each bucket corresponds to a fixed-size storage area in the disk file.

[0073] Inverted linked list storage: such as Figure 5 and Figure 6 As shown, for each predicate, all subject entity IDs (or object entity IDs) that match the predicate are collected to form an ordered list of IDs (i.e., an inverted linked list). This list is stored at the disk location pointed to by the corresponding hash bucket. To support efficient updates, the space allocation of the inverted linked list adopts a dynamic doubling strategy: initially, a small fixed space (e.g., 512 bytes) is allocated; when space is insufficient, a new region twice the current space is allocated, data is migrated, and pointers are updated. When a single allocation of space reaches a predetermined threshold (e.g., 4KB), it switches to fixed-size incremental allocation to balance space and I / O efficiency.

[0074] Determine the implementation of edge indexes (B+ tree indexes):

[0075] This index is used to speed up the "Given subject and verb, query object" (SP->O) or "Given verb and object, query subject" (OP->S) patterns. For example, query all subjects that satisfy the subject-verb-object combination (hasProperty, sexual temperature).

[0076] Key generation: Concatenate and encode the known strings to generate the keys of the B+ tree.

[0077] For the SP->O pattern, the key is subject ID + separator + predicate.

[0078] For the OP->S pattern, the key is the object ID + separator + predicate.

[0079] Using IDs instead of raw strings can shorten the key length and improve indexing efficiency.

[0080] B+ tree structure: Reference Figure 4 Construct a B+ tree whose order (the maximum number of child nodes per node) can be set according to the disk page size (e.g., 100). Leaf nodes store the generated keys and a pointer to the disk location of the inverted linked list storing the corresponding object ID (or subject ID) sequence. The space allocation strategy for this inverted linked list is the same as that in hash table indexes.

[0081] IV. Specific Implementation of Query Processing

[0082] refer to Figure 2 and Figure 7 Let's take a specific query as an example to illustrate the workflow of the query processing module.

[0083] Query Example: A user submits a query graph that means "find unknown medicinal materials (i.e., unknown nodes in the query graph) that are connected to 'cold and flu' (known entity) through isTreatedBy (known predicate) and have the attribute of 'warm nature' (known entity)".

[0084] Processing steps:

[0085] Query parsing: The module parses the query graph and identifies two edge constraints:

[0086] Edge 1 (Confirmed Edge): Unknown medicinal material —hasProperty—>Warm in nature

[0087] Edge 2 (Uncertain Edge): Common Cold - isTreatedBy --> Unknown Medicinal Herbs

[0088] Index query: Two indexes are called in parallel.

[0089] By determining the edge index (B+ tree), and searching by key (ID of nature and temperature, hasProperty), we can obtain the set S1 of all medicinal material IDs with the "nature and temperature" attribute.

[0090] Using an uncertain edge index (hash table), the query retrieves the set S2 of IDs of all entities pointed to by the `isTreatedBy` relation (i.e., all ailments that can be treated by a certain prescription; in this case, the medicinal material pointed to by `isTreatedBy` for "cold and flu"). (Note: Based on the query graph, "cold and flu" should be the subject, with `isTreatedBy` pointing to the unknown medicinal material as the object. Therefore, the index query should be: using the IDs of the predicate `isTreatedBy` and the subject "cold and flu" as keys, query the object set S2. This may require another deterministic edge index (PS->O). The description of this pattern in the specification may be ambiguous; consistent logic is required during implementation.)

[0091] Top-K candidate node matching:

[0092] Input: The crowdsourcing cost preset by the user for the two edges. For example, the cost of validating a hasProperty edge is 0.1 units, and the cost of validating an isTreatedBy edge is 0.5 units.

[0093] Algorithm: Calculate candidate entities in the intersection of S1 and S2 (or process other graph patterns). For each candidate entity, its total crowdsourcing cost is the sum of the costs required to verify all edges connected to it (i.e., 0.1 + 0.5 = 0.6 units).

[0094] Pruning based on max-heap:

[0095] Sort the candidate entities in descending order based on the highest possible cost on one side.

[0096] Initialize a min-heap of size K (to maintain Top-K results) or use a max-heap strategy for pruning.

[0097] Iterate through the candidate entities one by one and calculate their total cost. If the current heap is full (with K elements) and the total cost of the new candidate is greater than the maximum value in the heap, skip it; otherwise, add it to the heap and adjust it.

[0098] During the traversal, a cost upper limit can be calculated. When the theoretical minimum cost of the remaining candidates can no longer be lower than the maximum cost in the current heap, the traversal is terminated early to achieve pruning.

[0099] Results Return: After the algorithm finishes, the top K candidate entity IDs with the smallest overall cost in the heap (and their calculated costs) will be returned to the user via API for subsequent crowdsourcing task distribution.

[0100] V. Specific Implementation of Dynamic Updates

[0101] When a new RDF triple (such as <new medicinal material, hasProperty, warm nature>) needs to be added to the system, the update module performs the following atomic operations:

[0102] Check the "entity dictionary" and assign a unique ID (e.g., ID=99) to the new subject "new medicinal material".

[0103] Update the adjacency list in the storage module by adding an outgoing edge (hasProperty, ID of the property) to the adjacency list entry with ID=99.

[0104] Parallel index update module:

[0105] Update the uncertain edge index: Insert the new subject ID99 into the inverted list corresponding to the predicate hasProperty.

[0106] Update the edge index: In the inverted linked list pointed to by the leaf node of the B+ tree corresponding to the key (ID of temperature, hasProperty), insert subject ID99.

[0107] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory). This computer-readable storage medium is a memory device in a terminal device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and extended storage media supported by the terminal device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device.

[0108] One or more instructions stored in a computer-readable storage medium can be loaded and executed by a processor to implement the corresponding steps of the storage optimization method for crowdsourcing queries of knowledge graphs in the field of traditional Chinese medicine in the above embodiments; one or more instructions in the computer-readable storage medium are loaded and executed by a processor.

[0109] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A storage optimization method for crowdsourced querying of knowledge graphs in the field of traditional Chinese medicine, characterized in that, The method includes the following steps: The RDF triple data in the field of traditional Chinese medicine is stored in the form of an adjacency list, where each entity is assigned a unique ID and associated with an adjacency list consisting of all its outgoing edges, where the outgoing edges are predicate-object pairs; A hybrid index structure is constructed to support different edge query modes in crowdsourced queries. The hybrid index structure includes uncertain edge indexes and deterministic edge indexes. The uncertain edge index is for edges with known predicates but unknown subjects or objects. It uses a hash table index to map the predicate to a hash key and uses a hash function to locate the disk location of the inverted linked list storing the corresponding subject or object ID sequence. The defined edge index is for edges where the subject and predicate are known but the object is unknown, or the predicate and object are known but the subject is unknown. A B+ tree index is used to concatenate the strings of the subject and predicate or the predicate and object into a key. The B+ tree maintains the mapping of this key to the disk location of the inverted linked list storing the corresponding object or subject ID sequence. In response to the addition of new RDF triple data, the adjacency list and the corresponding inverted list in the hybrid index structure are dynamically updated; For an unknown node in the crowdsourcing query graph, the hybrid index structure is used to retrieve the candidate entity ID sequence corresponding to all edges connected to the unknown node. Based on the pre-set crowdsourcing cost for each edge in the crowdsourcing query, a Top-K matching algorithm based on max-heap is used to calculate and return the top K candidate entity IDs with the smallest overall crowdsourcing cost.

2. The storage optimization method for crowdsourced query of knowledge graphs in the field of traditional Chinese medicine according to claim 1, characterized in that, The hash table index used to construct the uncertain edge index includes: Map the predicate string to a hash key; The hash key is mapped to a disk storage bucket using a hash function; The sequence of subject IDs or object IDs that meet the predicate condition is stored in the file location pointed to by the disk storage bucket in the form of an inverted linked list.

3. The storage optimization method for crowdsourced query of knowledge graphs in the field of traditional Chinese medicine according to claim 1, characterized in that, The construction of the B+ tree index that determines the edge index includes: Concatenate and encode the subject string and predicate string, or the predicate string and object string, to form the key of the B+ tree; The B+ tree maintains a mapping from the keys to disk pointers of inverted linked lists that store the corresponding object ID or subject ID sequence.

4. The storage optimization method for crowdsourced query of knowledge graphs in the field of traditional Chinese medicine according to claim 2, characterized in that, The inverted linked list uses a dynamic doubling strategy for space allocation, and switches to fixed-size allocation when the space allocation reaches a predetermined threshold in a single allocation.

5. The storage optimization method for crowdsourced query of knowledge graphs in the field of traditional Chinese medicine according to claim 1, characterized in that, The Top-K matching algorithm based on max-heap includes: Sort the candidate entity ID sequence corresponding to each edge in descending order of its crowdsourcing cost; Iterate through the sorted sequence to calculate the overall crowdsourcing cost for the current entity ID; We use a max-heap to maintain the top K candidate IDs with the minimum overall cost, and prune them using the cost cap during the traversal. The calculation ends when it is determined that the remaining candidate IDs cannot enter the top K.

6. A storage optimization system for implementing the method of any one of claims 1 to 5 for crowdsourced querying of knowledge graphs in the field of traditional Chinese medicine, characterized in that, The system includes: The storage module is used to store traditional Chinese medicine RDF data in the form of an adjacency list; The index module includes hash table index units and B+ tree index units, used to construct and maintain the uncertain edge index and the deterministic edge index, respectively; The update module is used to dynamically update the adjacency list in the storage module and the inverted linked list in the index module in response to data update requests. The query processing module is used to receive crowdsourced query requests, call the index module to obtain the candidate entity ID sequence, and execute the Top-K candidate node matching algorithm to output the results.

7. The system according to claim 6, characterized in that, The system is deployed on a server, the storage module and index module are implemented using disk files, and the update module and query processing module run as background service processes.

Citation Information

Patent Citations

  • In-memory hash sorting construction method based on novel memory

    CN113254720A

  • Methods and apparatus for querying a relational data store using schema-less queries

    US20030158841A1