Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method, device, and apparatus for data update, and medium

A data update and to-be-updated technology, applied in electrical digital data processing, special data processing applications, program control design, etc., can solve the problems of binary log replication, stop business services, and no guarantee of transaction synchronization, and achieve synchronous data update. Effect

Active Publication Date: 2018-12-04
BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF4 Cites 11 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, at this time, the binary log of the transaction to be updated has not been copied to the slave library
Therefore, the slave library cannot update the corresponding data, which leads to the inconsistency between the data in the slave library and the data in the master library.
[0005] At the same time, in the semi-synchronous and non-destructive semi-synchronous replication mechanisms, MySQL officially only optimizes between user visibility (reflected by returning user responses) and data synchronization results, but there is still no guarantee that the submitted transactions must be synchronized to the slave database.
[0006] In a typical case, in a transaction scenario, when the payment process is completed in the main library, the deduction record cannot be updated to the slave library in the database cluster due to the failure of the main library
As a result, the deduction is complete, but the user cannot read the deduction record from the library, which leads to the suspension of business services

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method, device, and apparatus for data update, and medium
  • Method, device, and apparatus for data update, and medium
  • Method, device, and apparatus for data update, and medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0040] figure 2 It is a flow chart of a data update method provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation of updating data in a database cluster. The method can be executed by a data update device, which can be realized by software and / or hardware, and the device is associated with a master database. see figure 2 , the data update method provided in this embodiment includes:

[0041] S110. Send the transaction to be updated to at least one slave library.

[0042] Wherein, the slave database is the abbreviation of the slave database, and the slave database is data other than the master database in the database cluster.

[0043] Usually, a database cluster includes a master database and at least one slave database. The client sends the transaction to be updated to the master database, and the master database writes the transaction to be updated into the binary log to update data according to the transaction to be updated....

Embodiment 2

[0062] image 3 It is a flow chart of a data update method provided by Embodiment 2 of the present invention. This embodiment is an optional solution proposed on the basis of the foregoing embodiments. see image 3 , the data update method provided in this embodiment includes:

[0063] S210. Send the transaction to be updated to at least one slave library.

[0064] S220. Control the local database to update the transaction to be updated, and issue an update instruction to the at least one slave database synchronously.

[0065] S230. Using the main library service thread to generate a main library offline message according to the new main library elected by the local state machine, and using the main library working thread to log off the main library according to the main library offline message.

[0066] Usually, a third-party component elects a new master library, and the third-party component will send the elected new master library to each database, and each database wi...

Embodiment 3

[0078] Figure 4 It is a flow chart of a data updating method provided by Embodiment 3 of the present invention. This embodiment is applicable to the situation of updating data in a database cluster. The method can be executed by a data updating device, which can be realized by software and / or hardware, and the device is associated with a slave database. see Figure 4 , a data update method provided in this embodiment includes:

[0079] S310. Store the received transaction to be updated in a local disk or hard disk.

[0080] Optionally, in addition to the local disk or hard disk, it can also be stored in other local long-term storage media.

[0081] S320. If an update instruction issued by the master database is received, perform data update on the local database based on the received transaction to be updated.

[0082] Specifically, write the Relaylog according to the received transaction to be updated. Data update is performed according to the written Relaylog.

[008...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

Embodiments of the invention disclose a method, a device, and an apparatus for data update, and a medium, and the invention relates to the field of an associated database management system. The methodincludes: sending a to-be-updated transaction to at least one slave library; controlling a local database to update the to-be-updated transaction, and synchronously issuing an update instruction to the at least one slave library, wherein the update instruction is used to indicate the at least one slave library to synchronously update the received to-be-updated transaction. The method, the device,and the apparatus for data update, and the medium realize synchronous update of data of the slave library and a primary library.

Description

technical field [0001] The embodiment of the present invention relates to the field of relational database management system (MySQL), and in particular to a data update method, device, equipment and medium. Background technique [0002] With the explosive growth of Internet data, databases, as the storage medium of Internet data, undertake more and more data and access requests for data. Especially in financial business scenarios, the database is required to achieve high data reliability (that is, distributed and strong consistency), otherwise it will cause capital damage to the business or even stop the service. [0003] see figure 1 , usually the data synchronization update process between the master database (ie master database, also known as Master) and the slave database (ie slave database, also known as Slave) in MySQL can be described as: a transaction is updated, and the master database in the database cluster is first based on The pre-written log system (Write-Ahe...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
CPCG06F9/542G06F16/2379G06F16/275G06F9/3836
Inventor 王天宇
Owner BEIJING BAIDU NETCOM SCI & TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products