Data complementing method and apparatus

US10045397B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-10045397-B2
Application numberUS-201515539966-A
CountryUS
Kind codeB2
Filing dateNov 9, 2015
Priority dateDec 24, 2014
Publication dateAug 7, 2018
Grant dateAug 7, 2018

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.

Embodiments of the invention provide a data complementing method and apparatus, which relate to the field of computer. In the method provided by the invention, in the process of master database switching in a master-slave database cluster, a slave database is selected from the database cluster to act as a new master database; first connections between the new master database and all the other slave databases are established successively; the data of the new master database is compared with the data of all the other slave databases, respectively, to synchronize new data in all the other slave databases into the new master database, to accomplish data complementing of the new master database, which causes the new master database to have the latest data in the database cluster, guarantees smooth switching of the master database, and therefore will not influence normal running of database services.

First claim

Opening claim text (preview).

The invention claimed is: 1. A data complementing method applied in master database switching in a master-slave database cluster, the method comprising: selecting a slave database from the database cluster to act as a new master database; establishing first connections between the new master database and all the other slave databases successively; comparing data of the new master database with data of all the other slave databases, respectively, to synchronize new data in all the other slave databases into the new master database; and finishing data complementing of the new master database when data comparison and synchronization of all the other slave databases is accomplished, wherein selecting a slave database from the database cluster to act as a new master database comprises: obtaining a list of all the slave databases of the database cluster before the establishing connections between the new master database and all the slave databases successively; and from all the slave databases recorded by the list, screening out and obtaining a slave database that meets a preset condition to act as the new master database, and wherein the preset condition comprises at least one of: the state of the slave database being identified as alive; and the number of delayed transactions of the slave database being less than a preset number. 2. The method as claimed in claim 1 , wherein the first connections are master-slave connections, and the other slave databases and the new master database have the master and slave statuses, respectively. 3. The method as claimed in claim 1 , wherein the step of comparing the data of the new master database with the data of all the other slave databases, respectively, to synchronize new data in all the other slave databases into the new master database, further comprises: after data comparison and synchronization is accomplished between the new master database and one other slave database, disconnecting the first connection between them. 4. The method as claimed in claim 1 , wherein the method further comprises: establishing second connections between the new master database and all the other slave databases successively after data complementing of the new master database is finished; and synchronizing data of the new master database to all the other slave databases. 5. The method as claimed in claim 4 , wherein the second connections are master-slave connections, and the new master database and the other slave databases have the master and slave statuses, respectively. 6. The method as claimed in claim 1 , wherein the database cluster is a MYSQL database cluster. 7. A data complementing apparatus applied in master database switching in a master-slave database cluster, the apparatus comprising: a memory having instructions stored thereon: a processor configured to execute the instructions to perform the following operations: selecting a slave database from the database cluster to act as a new master database; establishing first connections between the new master database and all the other slave databases successively; comparing data of the new master database with data of all the other slave databases, respectively, to synchronize new data in all the other slave databases into the new master database; and finishing data complementing of the new master database when the data comparison and synchronization of all the other slave databases is accomplished, wherein selecting a slave database from the database cluster to act as a new master database comprises: obtaining a list of all the slave databases of the database cluster before the establishing connections between the new master database and all the slave databases successively; and from all the slave databases recorded by the list, screening out and obtaining a slave database that meets a preset condition to act as the new master database, and wherein the preset condition comprises at least one of: the state of the slave database being identified as alive; and the number of delayed transactions of the slave database being less than a preset number. 8. The apparatus as claimed in claim 7 , wherein the first connections are master-slave connections, and the other slave databases and the new master database have the master and slave statuses, respectively. 9. The apparatus as claimed in claim 7 , wherein the comparing the data of the new master database with the data of all the other slave databases, respectively, to synchronize new data in all the other slave databases into the new master database, further comprises: after data comparison and synchronization is accomplished between the new master database and one other slave database, disconnecting the first connection between them. 10. The apparatus as claimed in claim 7 , wherein the operations further comprises: establishing second connections between the new master database and all the other slave databases successively after data complementing of the new master database is finished; and synchronizing data of the new master database to all the other slave databases. 11. The apparatus as claimed in claim 10 , wherein the second connections are master-slave connections, and the new master database and the other slave databases have the master and slave statuses, respectively. 12. The apparatus as claimed in claim 7 , wherein the database cluster is a MYSQL database cluster. 13. A non-transitory computer readable medium having instructions stored thereon that when executed by at least one processor, cause the at least one processor to perform following operations: selecting a slave database from the database cluster to act as a new master database: establishing first connections between the new master database and all the other slave databases successively: comparing data of the new master database with data of all the other slave databases, respectively, to synchronize new data in all the other slave databases into the new master database; and finishing data complementing of the new master database when data comparison and synchronization of all the other slave databases is accomplished, wherein selecting a slave database from the database cluster to act as a new master database comprises: obtaining a list of all the slave databases of the database cluster before the establishing connections between the new master database and all the slave databases successively; and from all the slave databases recorded by the list, screening out and obtaining a slave database that meets a preset condition to act as the new master database, and wherein the preset condition comprises at least one of: the state of the slave database being identified as alive; and the number of delayed transactions of the slave database being less than a preset number.

Assignees

Inventors

Classifications

  • G06F16/275Primary

    Synchronous replication · CPC title

  • H04W84/20Primary

    Leader-follower arrangements · CPC title

  • Integrating or interfacing systems involving database management systems · CPC title

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

  • Physics · mapped topic

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 US10045397B2 cover?
Embodiments of the invention provide a data complementing method and apparatus, which relate to the field of computer. In the method provided by the invention, in the process of master database switching in a master-slave database cluster, a slave database is selected from the database cluster to act as a new master database; first connections between the new master database and all the other s…
Who is the assignee on this patent?
Beijing Qihoo Technology Co
What technology area does this patent fall under?
Primary CPC classification G06F16/275. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Aug 07 2018 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 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).