Strongly-consistent secondary index for a distributed data set
US-10936559-B1 · Mar 2, 2021 · US
US11334544B2 · US · B2
| Field | Value |
|---|---|
| Publication number | US-11334544-B2 |
| Application number | US-201916691085-A |
| Country | US |
| Kind code | B2 |
| Filing date | Nov 21, 2019 |
| Priority date | Feb 27, 2019 |
| Publication date | May 17, 2022 |
| Grant date | May 17, 2022 |
A practical reading order for non-experts. Skip the full description unless you need deep technical detail.
What the patent document calls the invention.
A short plain-language summary of the technical disclosure.
Who owns or filed the patent and who is credited as inventor.
Filing, priority, publication, and grant dates set the timeline.
The legal scope of protection — read this for what is actually claimed.
Technology tags used to group this patent with similar filings.
Prior art links and similar publications in this corpus.
Official abstract text for this publication.
Embodiments of the present disclosure relate to a method, apparatus, device, and medium for storing and querying data. The method for storing data includes: generating, for to-be-stored data, a primary index for indexing the data. The method further includes: writing the primary index arid the data into a data row in a data table. The method further includes: generating a secondary index for indexing the primary index based on a query rule of the data table and the data. In addition, the method further includes: writing the secondary index and the primary index into an index row in the data table.
Opening claim text (preview).
What is claimed is: 1. A method for storing data, the data recording information related to an entity in a knowledge base, the method comprising: generating, for to-be-stored data, a primary index for indexing the data; writing the primary index and the data into a data row in a data table, wherein the data table is for storing one or more attribute values of the entity in the knowledge base, and/or a corresponding relationship between the entity and one or more objects; generating a secondary index for indexing the primary index based on a query rule of the data table and the data, the query rule of the data table indicating a query mode supported by the data table, wherein the generating the secondary index comprises: writing an expression related to the query rule into the secondary index; writing the secondary index and the primary index into an index row in the data table; updating the data in response to receiving a request to update the data stored in the data row; generating a new secondary index for indexing the primary index based on updated data and the query rule; and writing the new secondary index and the primary index into another index row in the data table. 2. The method according to claim 1 , wherein generating the primary index comprises: acquiring an identifier of the entity from the data; and generating the primary index based on the identifier of the entity. 3. The method according to claim 1 , wherein writing the primary index and the data into the data row comprises: writing the primary index as a key of the data row into the data row; and writing the data as a value of the data row into the data row. 4. The method according to claim 1 , wherein generating the secondary index comprises: acquiring index configuration information of the data table, the index configuration information indicating the query rule of the data table; and generating the secondary index based on the index configuration information and the data. 5. The method according to claim 1 , wherein the query rule comprises at least one of: querying an entity having a specific attribute value; querying an entity having a specific relationship to a specific object; querying an out-edge relationship between a specific entity and a specific object; querying an in-edge relationship between a specific entity and a specific object; querying data related to a specific entity; querying an entity having a specific out edge relationship; and querying an entity having a specific in edge relationship, wherein the in edge relationship and the out edge relationship are based on a triplet in a form of subject-predicate-object (SPO). 6. The method according to claim 1 , wherein generating the secondary index comprises: determining a starting primary key of the data table; and generating the secondary index by using the starting primary key of the data table as a prefix of the secondary index. 7. The method according to claim 1 , wherein writing the secondary index and the primary index into the index row comprises: writing the secondary index as a key of the index row into the index row; and writing the primary index as a value of the index row into the index row. 8. The method according to claim 1 , wherein removal of the index row from the data table is delayed until a data query is executed. 9. The method according to claim 1 , further comprising: storing the data table in a storage apparatus implemented using a first storage medium; caching the index row into a primary cache implemented using a second storage medium; and caching the data row into a secondary cache implemented using a third storage medium. 10. The method according to claim 9 , wherein an access speed of the second storage medium exceeds an access speed of the third storage medium, and the access speed of the third storage medium exceeds an access speed of the first storage medium. 11. A non-transitory computer readable storage medium, storing a computer program thereon, wherein the computer program, when executed by a processor, implements the method according to claim 1 . 12. A method for querying data, the data recording information related to an entity in a knowledge base, the method comprising: determining an index row that matches a query request from one or more index rows of a data table, in response to receiving the query request for data stored in the data table, the index row storing a primary index and a secondary index indexing the primary index, wherein the data table is for storing one or more attribute values of the entity in the knowledge base, and/or a corresponding relationship between the entity and one or more objects, wherein the secondary index is generated through writing an expression related to a query rule into the secondary index, the query rule of the data table indicating a query mode supported by the data table; determining, from one or more data rows of the data table, a data row associated with the index row based on the primary index in the index row, the data row storing the primary index and the data, the primary index indexing the data; determining whether the index row matches the data row; acquiring, in response to the index row matching the data row, the data from the data row as a response to the query request; and removing the index row from the data table, in response to determining that the index row does not match the data row. 13. The method according to claim 12 , wherein the query request is for querying at least one of: an entity having a specific attribute value; an entity having a specific relationship to a specific object; an out-edge relationship between a specific entity and a specific object; an in-edge relationship between a specific entity and a specific object; data related to a specific entity; an entity having a specific out edge relationship; and an entity having a specific in edge relationship, wherein the in edge relationship and the out edge relationship are based on a triplet in a form of subject-predicate-object (SPO). 14. The method according to claim 12 , wherein determining the index row from the one or more index rows comprises: determining at least one part of the secondary index at least based on a keyword in the query request; and determining the index row that matches the at least one part of the secondary index from the one or more index rows. 15. The method according to claim 12 , wherein the method further comprises: acquiring a first tag of the index row, the first tag identifying a first time when the index row is written into the data table; acquiring a second tag of the data row, the second tag identifying a second time when the data row is updated; determining whether the first tag matches the second tag; and determining that the index row does not match the data row, in response to determining that the first tag does not match the second tag. 16. The method according to claim 15 , wherein the method further comprises: generating a set of secondary indexes based on the data in the data row, in response to determining that the first tag matches the second tag; determining whether the secondary index in the index row is included in the set of secondary indexes; determining that the index row matches the data row, in response to determining that the secondary index in the index row is included in the set of secondary indexes; and determining that the index row does not match the data row, in response to determining that the secondary index in the index row is missing in the set of secondary index
Indexing structures · CPC title
Database cache management · CPC title
Updating · CPC title
Column-oriented storage; Management thereof · CPC title
Relational databases · CPC title
Related publications grouped by family.
Answers are generated from the same data shown on this page.