Method and apparatus for realizing globally unique index

US11880367B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-11880367-B2
Application numberUS-202017622794-A
CountryUS
Kind codeB2
Filing dateMar 31, 2020
Priority dateJun 26, 2019
Publication dateJan 23, 2024
Grant dateJan 23, 2024

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

Disclosed in embodiments of the present disclosure are methods and apparatuses for realizing a globally unique index, which are applicable to a distributed database. One of the methods includes: receiving a structured query language, SQL, request, obtaining a conflict detection SQL statement corresponding to the SQL request and calculating an expected value; issuing the conflict detection SQL statement to each database node for execution; obtaining an execution result of the conflict detection SQL statement, and comparing the execution result of the conflict detection SQL statement with the expected value; and when the execution result of the conflict detection SQL statement is less than or equal to the expected value, processing an original SQL statement of the SQL request, and issuing the original SQL statement to the each database node for execution.

First claim

Opening claim text (preview).

What is claimed is: 1. A method for realizing a globally unique index, applicable to a distributed database, comprising: receiving a structured query language (SQL) request; obtaining a conflict detection SQL statement corresponding to the SQL request; calculating an expected value; issuing the conflict detection SQL statement to each database node for execution; obtaining an execution result of the conflict detection SQL statement; comparing the execution result of the conflict detection SQL statement with the expected value; and in response to the execution result of the conflict detection SQL statement being less than or equal to the expected value, processing an original SQL statement of the SQL request, and issuing the original SQL statement to the each database node for execution, wherein obtaining the conflict detection SQL statement corresponding to the SQL request comprises: in response to the SQL request being an insert request, determining whether an insert field of the insert request includes the globally unique index, and in response to the insert field including the globally unique index, splicing a globally unique index field and an insert field value to form the conflict detection SQL statement; wherein a where condition of the conflict detection SQL statement is that the globally unique index field is equal to the insert field value; and in response to the SQL request being an update request, determining whether an update field of the update request includes the globally unique index, and in response to the update field including the globally unique index, splicing the globally unique index field and an update field value to form the conflict detection SQL statement; wherein the where condition of the conflict detection SQL statement is that the globally unique index field is equal to the update field value; wherein one globally unique index is spliced with one conflict detection SQL statement. 2. The method according to claim 1 , wherein obtaining the conflict detection SQL statement corresponding to the SQL request comprises: in response to the SQL request being an update request, determining whether an update field of the update request includes the globally unique index, and in response to the update field including the globally unique index, splicing a globally unique index field, an update field value and a newly added field to form the conflict detection SQL statement; wherein a where condition of the conflict detection SQL statement is that the globally unique index field is equal to the update field value; and the newly added field is equal to the update field value; wherein one globally unique index is spliced with one conflict detection SQL statement, and the newly added field is a field added to a database table with a same field number and a same type as those of the globally unique index field. 3. A method for realizing a globally unique index, applicable to a distributed database, comprising: receiving a structured query language (SQL) request, processing an original SQL statement of the SQL request, and issuing the original SQL statement to each database node for execution; obtaining an execution result of the original SQL statement, and obtaining a conflict detection SQL statement corresponding to the SQL request and calculating an expected value; issuing the conflict detection SQL statement to each database node for execution; obtaining an execution result of the conflict detection SQL statement, and comparing the execution result of the conflict detection SQL statement with the expected value; and in response to the execution result of the conflict detection SQL statement being less than or equal to the expected value, sending the execution result of the original SQL statement, wherein obtaining the conflict detection SQL statement corresponding to the SQL request comprises: in response to the SQL request being an insert request, determining whether an insert field of the insert request includes the globally unique index, and in response to the insert field including the globally unique index, splicing a globally unique index field and an insert field value to form the conflict detection SQL statement; wherein a where condition of the conflict detection SQL statement is that the globally unique index field is equal to the insert field value; and in response to the SQL request being an update request, determining whether an update field of the update request includes the globally unique index, and in response to the update field including the globally unique index, splicing the globally unique index field and an update field value to form the conflict detection SQL statement; wherein the where condition of the conflict detection SQL statement is that the globally unique index field is equal to the update field value; wherein one globally unique index is spliced with one conflict detection SQL statement. 4. The method according to claim 3 , wherein obtaining the conflict detection SQL statement corresponding to the SQL request comprises: in response to the SQL request being an update request, determining whether an update field of the update request includes the globally unique index, and in response to the update field including the globally unique index, splicing a globally unique index field, an update field value and a newly added field to form the conflict detection SQL statement; wherein a where condition of the conflict detection SQL statement is that the globally unique index field is equal to the update field value; and the newly added field is equal to the update field value; wherein one globally unique index is spliced with one conflict detection SQL statement, and the newly added field is a field added to a database table with a same field number and a same type as those of the globally unique index field. 5. An apparatus for realizing a globally unique index, applicable to a distributed database, wherein the apparatus comprises a memory, a processor and a computer program stored on the memory and executable on the processor, and the computer program, when executed, causes the processor to implement a method for realizing a globally unique index, and the method comprises: receiving a structured query language (SQL) request; obtaining a conflict detection SQL statement corresponding to the SQL request; calculating an expected value; issuing the conflict detection SQL statement to each database node for execution; obtaining an execution result of the conflict detection SQL statement; comparing the execution result of the conflict detection SQL statement with the expected value; and in response to the execution result of the conflict detection SQL statement being less than or equal to the expected value, processing an original SQL statement of the SQL request, and issuing the original SQL statement to the each database node for execution, wherein obtaining the conflict detection SQL statement corresponding to the SQL request comprises: in response to the SQL request being an insert request, determining whether an insert field of the insert request includes the globally unique index, and in response to the insert field including the globally unique index, splicing a globally unique index field and an insert field value to form the conflict detection SQL statement; wherein a where condition of the conflict detection SQL statement is that the globally unique index field is equal to the insert field value; and in response to the SQL request being an update request, determining whether an update field of the update request includes the globally unique index, and in response to the update field including the globally unique index, splicing the globally unique index field and an update field value to form the conflict detection SQL statement;

Assignees

Inventors

Classifications

  • of query operations · CPC title

  • Indexing structures · CPC title

  • Tablespace storage structures; Management thereof · CPC title

  • Change logging, detection, and notification (replication G06F16/27) · CPC title

  • Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US11880367B2 cover?
Disclosed in embodiments of the present disclosure are methods and apparatuses for realizing a globally unique index, which are applicable to a distributed database. One of the methods includes: receiving a structured query language, SQL, request, obtaining a conflict detection SQL statement corresponding to the SQL request and calculating an expected value; issuing the conflict detection SQL s…
Who is the assignee on this patent?
Zte Corp, Xian Zhongxing New Software Co Ltd
What technology area does this patent fall under?
Primary CPC classification G06F16/24553. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Jan 23 2024 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 2 related publications on this page (citations in our corpus or others sharing the same primary CPC).