WO2021237704A1 - Data synchronization method and related device - Google Patents

Data synchronization method and related device Download PDF

Info

Publication number
WO2021237704A1
WO2021237704A1 PCT/CN2020/093374 CN2020093374W WO2021237704A1 WO 2021237704 A1 WO2021237704 A1 WO 2021237704A1 CN 2020093374 W CN2020093374 W CN 2020093374W WO 2021237704 A1 WO2021237704 A1 WO 2021237704A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
database
binary
sub
binary log
Prior art date
Application number
PCT/CN2020/093374
Other languages
French (fr)
Chinese (zh)
Inventor
郭子亮
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to CN202080096693.2A priority Critical patent/CN115104092A/en
Priority to PCT/CN2020/093374 priority patent/WO2021237704A1/en
Publication of WO2021237704A1 publication Critical patent/WO2021237704A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Definitions

  • the invention relates to the technical field of database storage, in particular to a data synchronization method and related devices.
  • this application proposes a data synchronization method and related device.
  • batch processing and marking processing on binary logs when data synchronization between remote databases is performed, it is possible to identify which data is generated by the system and avoid The binary log is replicated continuously in the two databases, which greatly improves the effect of data synchronization.
  • an embodiment of the present application provides a data synchronization method, and the method includes:
  • the first binary log in the first database is processed in batches according to a preset batching rule to obtain N sub-binary logs, where N is a positive integer;
  • the data synchronization between the first database and the second database is completed according to the second binary log.
  • an embodiment of the present application provides a data synchronization device, and the device includes:
  • the batching unit is used to process the first binary log in the first database in batches according to a preset batching rule to obtain N sub-binary logs, where N is a positive integer;
  • the marking unit is used to insert a data mark at the preset position of each sub-binary log to obtain the second binary log;
  • the synchronization unit is configured to complete data synchronization between the first database and the second database according to the second binary log.
  • an embodiment of the present application provides an electronic device, including an application processor, a memory, and one or more programs.
  • the one or more programs are stored in the memory and configured by the The application processor executes the program, and the program includes instructions for executing the steps in the method according to any one of claims 1-7.
  • an embodiment of the present application provides a computer storage medium, the computer storage medium stores a computer program, and the computer program includes program instructions that, when executed by a processor, cause all The processor executes the method according to any one of the first aspects of the embodiments of the present application.
  • an embodiment of the present application provides a computer product, wherein the above-mentioned computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the above-mentioned computer program is operable to cause a computer to execute operations as described in the embodiments of the present application. Part or all of the steps described in any method of the first aspect.
  • the computer program product may be a software installation package.
  • the first binary log in the first database is first processed in batches according to the preset batching rule to obtain N sub-binary logs, where N is a positive integer; then, in the preset of each sub-binary log Insert a data mark at the position to obtain a second binary log; finally, complete data synchronization between the first database and the second database according to the second binary log.
  • the binary log can be processed in batches and marked, so that when data is synchronized between remote databases, it can automatically identify which data is generated by the system, avoiding the continuous circular replication of the binary log in the two databases, greatly improving data synchronization Effect.
  • FIG. 1 is a system architecture diagram of a data synchronization method provided by an embodiment of this application;
  • FIG. 2 is a schematic flowchart of a data synchronization method provided by an embodiment of this application.
  • FIG. 3 is a schematic diagram of an application scenario of a data synchronization method provided by an embodiment of the application
  • 4A is a schematic diagram of a truncated transaction fragment provided by an embodiment of the application.
  • 4B is a schematic diagram of another truncated transaction fragment provided by an embodiment of the application.
  • 4C is a schematic diagram of another truncated transaction fragment provided by an embodiment of the application.
  • FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of this application.
  • FIG. 6 is a block diagram of the functional unit composition of a data synchronization device provided by an embodiment of the application.
  • FIG. 7 is a block diagram of the functional unit composition of another data synchronization device provided by an embodiment of the application.
  • the current remote database synchronization generally involves establishing independent data centers in different cities, and the databases of these data centers will work at the same time. All databases accept the writing of corresponding business data and synchronize and update data to other databases to achieve two-way data synchronization between databases with multiple activities in different places.
  • the above databases can be relational database management systems, such as MySQL, and data update SQL Statement information will be stored in the binary log binlog.
  • the above binlog is a binary log that records all database table structure changes (such as CREATE, ALTER TABLE%) and table data modifications (INSERT, UPDATE, DELETE).
  • binlog can represent a transaction
  • a transaction is a sequence of database operations, which is the smallest unit of work in the database.
  • a transaction consists of all database operations performed between the start of the transaction and the end of the transaction.
  • FIG. 1 is a system architecture diagram of a data synchronization method provided by an embodiment of this application.
  • the system architecture 100 includes a first database 110, a second database 120, a replication module 130, a first terminal 141, and a second terminal 142.
  • the above-mentioned first database 110 is connected to the second database 120 through the replication module 130,
  • the first terminal 141 in the location of the first database 110 interacts with the first database 110
  • the second terminal 142 in the location of the second database 120 interacts with the second database 120.
  • first database 110 and the second database 120 may be MySQL databases, and data is stored in the first database 110 and the second database 120 in the form of tables.
  • the above-mentioned replication module 130 may be mounted on a server, and is used to read data from the above-mentioned first database 110 and synchronize to the above-mentioned second database 120, and at the same time, read data from the above-mentioned second database 120 and synchronize to the above-mentioned first database. 110.
  • the replication module 130 may also process the read data in batches, so that the data synchronization between the first data 110 and the second database 120 is performed in batches.
  • the aforementioned user terminal 140 may be installed with various communication client applications, such as database management applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, and so on.
  • the user terminal 140 may be various electronic devices with a display screen, including but not limited to smart phones, tablet computers, portable computers, desktop computers, and so on. There is no specific limitation here.
  • first database 110 and the second database 120 in the foregoing system architecture only represent different databases, and it does not mean that the embodiment of the present application can only be applied to two databases.
  • binary logs can be processed in batches and marked, so that when data is synchronized between remote databases, it can automatically identify which data is generated by the system, and avoid the continuous circular replication of binary logs in the two databases. Greatly improve the effect of data synchronization.
  • FIG. 2 is a data synchronization method provided by an embodiment of the application.
  • the schematic flow diagram of the synchronization method includes the following steps:
  • Step 201 Perform batch processing of the first binary log in the first database according to a preset batching rule to obtain N sub-binary logs.
  • N is a positive integer
  • the first binary log records the database operation sequence in the first database.
  • the size of the first binary log is the first amount of data.
  • the first amount of data can be set according to user needs.
  • the first amount of data is read from the first database through the replication module in the system architecture.
  • the second data volume corresponding to the second database is obtained. Because there is two-way synchronization between the first database and the second database, the second data volume can be used for the subsequent first
  • a binary log is processed in batches for data reference, and finally, the first two-level system log is processed in batches according to the first data volume and the second data volume to obtain N sub-binary logs.
  • FIG. 3 is provided for an embodiment of the application.
  • An application scenario diagram of a data synchronization method including a first database, a second database, and a replication (Repetition) module, a_select_size represents the first data volume, b_select_size represents the second data volume, and a_split_size represents the batch data volume, through the following pseudo
  • the code can determine the size of a_split_size:
  • a_split_size b_select_size-2; // means a head tag and a tail tag
  • a_split_size b_select_size
  • the replication module reads the first binary log of the first amount of data from the first database, performs batch processing on the first binary log, and then synchronizes to the second database, and reads from the second database at the same time.
  • the binary log of the second amount of data is synchronized to the above-mentioned first database.
  • FIG. 3 only shows the specific batch processing steps of synchronizing data from the above-mentioned first database to the above-mentioned second database.
  • the above-mentioned first database synchronization data is also the same processing step, which will not be repeated here.
  • the batch data volume when the first data volume is greater than the second data volume is named the first batch data volume;
  • the batch data volume can be determined to be the second data volume, that is, the size of each sub-binary log is the second data volume.
  • the first data volume is smaller than The batch data volume when it is equal to the above-mentioned second data volume is named the second batch data volume.
  • the size of one-time synchronization data can be reduced, the data volume pressure during synchronization is reduced, and the data volume pressure during synchronization is reduced. A deadlock situation occurs.
  • Step 202 Insert a data mark at a preset position of each sub-binary log to obtain a second binary log.
  • the data mark includes a head mark and a tail mark. Inserting a data mark at a preset position means inserting the head mark at the head of each sub-binary log and inserting the tail mark at the end of each sub-binary log, inserting the data mark
  • the size of each sub-binary log of is equal to the above-mentioned second data volume, so when the second database synchronizes data with the above-mentioned first database, at least one head mark or tail mark can be read.
  • each of the above-mentioned first database and the above-mentioned second database has a formulation table.
  • the binary log of the operation of generating data tags is stored in the formulation table.
  • a header can be inserted after each transaction header. Part mark, insert a tail mark before the end of each transaction.
  • the second binary log is obtained by inserting the data mark in the preset position of each sub-binary log, which can ensure the visibility of the data mark.
  • Step 203 Complete data synchronization between the first database and the second database according to the second binary log.
  • the system input segment and service input segment of the second binary log may be determined according to the head tag and the tail tag, that is, the segment between the head tag and the tail tag is determined as the
  • the system input fragments are determined to be the business input fragments other than the system input fragments.
  • the system input fragments represent data generated by the system. Recognizing the system input fragments during synchronization can avoid the phenomenon of data loopback.
  • the fragments represent the data entered into the database by the external terminal.
  • the data synchronization between the first database and the second database is completed according to the system input fragment and the service input fragment.
  • the data may be truncated when the batch-processed data is written into the second database.
  • Figure 4A is a kind of Schematic diagram of truncated transaction fragments
  • dml represents the operation sequence command for operating the database
  • transaction_begin represents the transaction head
  • transaction_end represents the transaction end
  • flag_begin represents the head tag
  • flag_end represents the tail tag.
  • the binary log By completing the data synchronization between the first database and the second database according to the second binary log, the binary log can be processed in batches and marked, reducing the data volume pressure of data synchronization, and making it remote When synchronizing data between databases, it automatically recognizes which data is generated by the system, avoids the continuous circular replication of binary logs in the two databases, and greatly improves the effect of data synchronization.
  • the electronic device includes hardware structures and/or software modules corresponding to each function.
  • this application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
  • FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of its own application.
  • the electronic device 500 may be an electronic device with communication capabilities.
  • the electronic device may include various handheld devices with wireless communication functions, vehicle-mounted devices, and wearables.
  • the electronic device 500 in this application may include one or more of the following components: a processor 510, a memory 520, and an input/output device 530.
  • the processor 510 may include one or more processing cores.
  • the processor 510 uses a communication interface to connect various parts of the entire terminal 500, and executes the operations of the electronic device 500 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 520, and calling data stored in the memory 520.
  • the processor 510 may include one or more processing units.
  • the processor 510 may include a central processing unit (CPU), an application processor (AP), a modem processor, and a graphics processor ( graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc.
  • the CPU is mainly used to process the operating system, user interface, and application programs; the GPU is used to render and draw the display content; the modem is used to process wireless communication.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals.
  • the central processing unit CPU is taken as an example for description. For example, when the electronic device 500 is running an application, the CPU can obtain drawing data of the UI thread and other threads for the application, and determine the current drawing data based on the drawing data. Whether the running application program has dropped frames, etc., after that, based on the performance usage of the CPU itself, the frequency of the CPU can be dynamically controlled.
  • the processor 510 may be provided with a memory 520 for storing instructions and data.
  • the memory 520 in the processor 510 is a cache memory.
  • the memory 520 can store instructions or data that the processor 510 has just used or used cyclically. If the processor 510 needs to use the instruction or data again, it can be directly called from the memory 520. Avoid repeated accesses, reduce the waiting time of the processor 510, and improve system efficiency.
  • the above-mentioned processor 510 can be mapped to a system-on-chip (SOC) in an actual product, and the above-mentioned processing unit and/or interface may not be integrated into the processor 510 and pass through a communication chip alone. Or electronic components realize the corresponding function.
  • SOC system-on-chip
  • the above-mentioned interface connection relationship between the modules is only a schematic description, and does not constitute the only limitation on the structure of the electronic device 500.
  • the memory 520 may include random access memory (Random Access Memory, RAM), and may also include read-only memory (Read-Only Memory).
  • RAM Random Access Memory
  • Read-Only Memory the memory 520 includes a non-transitory computer-readable storage medium.
  • the memory 520 may be used to store instructions, programs, codes, code sets or instruction sets.
  • the memory 520 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing the operating system and instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.) , Instructions used to implement the following various method embodiments, etc., the operating system can be the Android system (including the system based on the in-depth development of the Android system), the IOS system developed by Apple (including the system based on the in-depth development of the IOS system) ) Or other systems.
  • the data storage area can also store data created by the electronic device 500 during use.
  • the input and output device 530 may include a touch display screen, which is used to receive a user's touch operation on or near any suitable object such as a finger, a touch pen, etc., and to display a user interface of each application program.
  • the touch screen is usually arranged on the front panel of the terminal 500.
  • the touch screen can be designed as a full screen, curved screen or special-shaped screen.
  • the touch display screen can also be designed as a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the embodiment of the present application.
  • the embodiment of the present application may divide the electronic device into functional units according to the foregoing method examples.
  • each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
  • FIG. 6 is a block diagram of the functional unit composition of a data synchronization device provided in an embodiment of the application.
  • the data synchronization device 600 includes:
  • the batching unit 610 is configured to perform batch processing of the first binary log in the first database according to a preset batching rule to obtain N sub-binary logs, where N is a positive integer;
  • the marking unit 620 is configured to insert a data mark at the preset position of each sub-binary log to obtain the second binary log;
  • the synchronization unit 630 is configured to complete data synchronization between the first database and the second database according to the second binary log.
  • FIG. 7 is a functional unit composition block diagram of another central processor frequency control device 700 involved in an embodiment of the present application.
  • the device 700 for controlling the frequency of the central processing unit is applied to electronic equipment that supports display functions.
  • the electronic device includes a processor, a display module, etc.
  • the device for controlling the frequency of the central processing unit 700 includes a processing unit 701 and a communication unit 702, wherein ,
  • the processing unit 701 is configured to perform any step in the above method embodiment, and when performing data transmission such as sending, it can optionally call the communication unit 702 to complete the corresponding operation.
  • the device 700 for controlling the frequency of the central processing unit may further include a storage unit 703 for storing program codes and data of the electronic device.
  • the processing unit 701 may be a central processing unit
  • the communication unit 702 may be a touch screen or a transceiver
  • the storage unit 703 may be a memory.
  • Both the data synchronization device 600 and the data synchronization device 700 described above can execute all the data synchronization methods included in the foregoing embodiment.
  • An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any method as described in the above method embodiment ,
  • the above-mentioned computer includes electronic equipment.
  • the embodiments of the present application also provide a computer program product.
  • the above-mentioned computer program product includes a non-transitory computer-readable storage medium storing a computer program.
  • the above-mentioned computer program is operable to cause a computer to execute any of the methods described in the above-mentioned method embodiments. Part or all of the steps of the method.
  • the computer program product may be a software installation package, and the above-mentioned computer includes electronic equipment.
  • the disclosed device may be implemented in other ways.
  • the device embodiments described above are merely illustrative, for example, the division of the above-mentioned units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical or other forms.
  • the units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the aforementioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable memory.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, A number of instructions are included to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the foregoing methods of the various embodiments of the present application.
  • the aforementioned memory includes: U disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
  • the program can be stored in a computer-readable memory, and the memory can include: a flash disk , Read-only memory (English: Read-Only Memory, abbreviation: ROM), random access device (English: Random Access Memory, abbreviation: RAM), magnetic disk or optical disc, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A data synchronization method, comprising: first, processing first binary logs in a first database in batches according to a preset batching rule to obtain N sub binary logs, N being a positive integer (201); then, inserting a data marker into a preset position of each sub binary log to obtain second binary logs (202); and finally, completing the data synchronization between the first database and a second database according to the second binary logs (203). Binary logs can be processed in batches and marked, so that which data is generated by the system is automatically identified during data synchronization between remote databases, to avoid repeated circular replication of the binary logs in the two databases, thereby improving the data synchronization effect.

Description

数据同步方法及相关装置Data synchronization method and related device 技术领域Technical field
本发明涉及数据库存储技术领域,具体涉及一种数据同步方法及相关装置。The invention relates to the technical field of database storage, in particular to a data synchronization method and related devices.
背景技术Background technique
随着社会的进步,每天产生的数据也越来越多,许多的应用程序需要处理海量数据,这对于数据的存储与读取提出了非常高的要求。作为处理结构化数据的工具,数据库面临巨大的挑战。现在一般在不同的城市建立独立的数据中心,为保证各地区的数据库的数据一致,需要进行数据双向同步。With the progress of society, more and more data are generated every day, and many applications need to process massive amounts of data, which puts forward very high requirements for data storage and reading. As a tool for processing structured data, databases face huge challenges. Nowadays, independent data centers are generally established in different cities. In order to ensure the consistency of the data in the databases in various regions, two-way data synchronization is required.
在双向同步方案中,由于两地数据库都会有数据写入,在一些情况下,如果同一条数据在两地更新了不同值,那么会导致二进制日志在两地的数据库不停的循环传递,两地的数据也会不断的循环复制,影响数据同步的效果。In the two-way synchronization scheme, because there will be data written in the two databases, in some cases, if the same data is updated with different values in the two places, it will cause the binary log to be continuously transferred in the two databases. Local data will also be replicated continuously, which affects the effect of data synchronization.
发明内容Summary of the invention
基于上述问题,本申请提出了一种数据同步方法及相关装置,通过对二进制日志进行分批处理和标记处理,使得异地数据库之间进行数据同步时,可以识别出哪些数据是系统生成的,避免二进制日志在两地数据库不停的循环复制,大大提升了数据同步的效果。Based on the above-mentioned problems, this application proposes a data synchronization method and related device. By performing batch processing and marking processing on binary logs, when data synchronization between remote databases is performed, it is possible to identify which data is generated by the system and avoid The binary log is replicated continuously in the two databases, which greatly improves the effect of data synchronization.
第一方面,本申请实施例提供了一种数据同步方法,所述方法包括:In the first aspect, an embodiment of the present application provides a data synchronization method, and the method includes:
将第一数据库中的第一二进制日志按照预设分批规则进行分批处理得到N个子二进制日志,N为正整数;The first binary log in the first database is processed in batches according to a preset batching rule to obtain N sub-binary logs, where N is a positive integer;
在每个子二进制日志的预设位置插入数据标记得到第二二进制日志;Insert a data mark at the preset position of each sub-binary log to obtain the second binary log;
根据所述第二二进制日志完成所述第一数据库与所述第二数据库之间的数据同步。The data synchronization between the first database and the second database is completed according to the second binary log.
第二方面,本申请实施例提供了一种数据同步装置,所述装置包括:In a second aspect, an embodiment of the present application provides a data synchronization device, and the device includes:
分批单元,用于将第一数据库中的第一二进制日志按照预设分批规则进行分批处理得到N个子二进制日志,N为正整数;The batching unit is used to process the first binary log in the first database in batches according to a preset batching rule to obtain N sub-binary logs, where N is a positive integer;
标记单元,用于在每个子二进制日志的预设位置插入数据标记得到第二二进制日志;The marking unit is used to insert a data mark at the preset position of each sub-binary log to obtain the second binary log;
同步单元,用于根据所述第二二进制日志完成所述第一数据库与所述第二数据库之间的数据同步。The synchronization unit is configured to complete data synchronization between the first database and the second database according to the second binary log.
第三方面,本申请实施例提供了一种电子设备,包括应用处理器、存储器,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述应用处理器执行,所述程序包括用于执行如权利要求1~7任一项所述的方法中的步骤的指令。In a third aspect, an embodiment of the present application provides an electronic device, including an application processor, a memory, and one or more programs. The one or more programs are stored in the memory and configured by the The application processor executes the program, and the program includes instructions for executing the steps in the method according to any one of claims 1-7.
第四方面,第四方面,本申请实施例提供了一种计算机存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行如本申请实施例第一方面任一项所述的方法。In the fourth aspect, in the fourth aspect, an embodiment of the present application provides a computer storage medium, the computer storage medium stores a computer program, and the computer program includes program instructions that, when executed by a processor, cause all The processor executes the method according to any one of the first aspects of the embodiments of the present application.
第五方面,本申请实施例提供了一种计算机产品,其中,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如本申请实施例第一方面任一方法中所描述的部分或全部步骤。该计算机程序产品可以为一个软件安装包。In a fifth aspect, an embodiment of the present application provides a computer product, wherein the above-mentioned computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the above-mentioned computer program is operable to cause a computer to execute operations as described in the embodiments of the present application. Part or all of the steps described in any method of the first aspect. The computer program product may be a software installation package.
可见,通过上述方法,首先将第一数据库中的第一二进制日志按照预设分批规则进行分批处理得到N个子二进制日志,N为正整数;接着,在每个子二进制日志的预设位置插入数据标记得到第二二进制日志;最后,根据所述第二二进制日志完成所述第一数据库与所述第二数据库之间的数据同步。可以对二进制日志进行分批处理和标记处理,使得异地数据库之间进行数据同步时,自动识别出哪些数据是系统生成的,避免二进制日志在两地数据库不停的循环复制,大大提升了数据同步的效果。It can be seen that through the above method, the first binary log in the first database is first processed in batches according to the preset batching rule to obtain N sub-binary logs, where N is a positive integer; then, in the preset of each sub-binary log Insert a data mark at the position to obtain a second binary log; finally, complete data synchronization between the first database and the second database according to the second binary log. The binary log can be processed in batches and marked, so that when data is synchronized between remote databases, it can automatically identify which data is generated by the system, avoiding the continuous circular replication of the binary log in the two databases, greatly improving data synchronization Effect.
附图说明Description of the drawings
为了更清楚地说明本发明实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present invention more clearly, the following will briefly introduce the drawings used in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present invention. Ordinary technicians can obtain other drawings based on these drawings without creative work.
图1为本申请实施例提供的一种数据同步方法的系统构架图;FIG. 1 is a system architecture diagram of a data synchronization method provided by an embodiment of this application;
图2为本申请实施例提供的一种数据同步方法的流程示意图;2 is a schematic flowchart of a data synchronization method provided by an embodiment of this application;
图3为本申请实施例提供的一种数据同步方法的应用场景示意图;FIG. 3 is a schematic diagram of an application scenario of a data synchronization method provided by an embodiment of the application;
图4A为本申请实施例提供的一种被截断的事务片段示意图;4A is a schematic diagram of a truncated transaction fragment provided by an embodiment of the application;
图4B为本申请实施例提供的另一种被截断的事务片段示意图;4B is a schematic diagram of another truncated transaction fragment provided by an embodiment of the application;
图4C为本申请实施例提供的另一种被截断的事务片段示意图;4C is a schematic diagram of another truncated transaction fragment provided by an embodiment of the application;
图5为本申请实施例提供的一种电子设备的结构示意图;FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of this application;
图6为本申请实施例提供的一种数据同步装置的功能单元组成框图;6 is a block diagram of the functional unit composition of a data synchronization device provided by an embodiment of the application;
图7为本申请实施例提供的另一种数据同步装置的功能单元组成框图。FIG. 7 is a block diagram of the functional unit composition of another data synchronization device provided by an embodiment of the application.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to enable those skilled in the art to better understand the solutions of this application, the technical solutions in the embodiments of this application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only These are a part of the embodiments of this application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific sequence. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes unlisted steps or units, or optionally also includes Other steps or units inherent in these processes, methods, products or equipment.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference to "embodiments" herein means that a specific feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art clearly and implicitly understand that the embodiments described herein can be combined with other embodiments.
为便于理解,首先对本申请实施例涉及的背景技术和相关术语进行解释说明,目前的异地数据库同步,一般会在不同的城市建立独立的数据中心,且这 些数据中心的数据库会同时工作,任意一个数据库都会接受对应的业务数据的写入并向其他数据库同步更新数据,以实现异地多活的数据库之间的数据双向同步,上述数据库可以为关系型数据库管理系统,如MySQL,而数据更新的SQL语句信息都会存储在二进制日志binlog中,上述binlog即是记录所有数据库表结构变更(例如CREATE、ALTER TABLE…)以及表数据修改(INSERT、UPDATE、DELETE…)的二进制日志。需要说明的是,binlog可以表示事务(transaction),而事务是一个数据库操作序列,是数据库中最小的工作单位,事务由事务开始与事务结束之间执行的全部数据库操作组成。如何解决异地多活数据库之间双向同步时数据回环和保证双向同步的效率,成为本申请实施例关注的重点。For ease of understanding, the background technology and related terms involved in the embodiments of this application are first explained. The current remote database synchronization generally involves establishing independent data centers in different cities, and the databases of these data centers will work at the same time. All databases accept the writing of corresponding business data and synchronize and update data to other databases to achieve two-way data synchronization between databases with multiple activities in different places. The above databases can be relational database management systems, such as MySQL, and data update SQL Statement information will be stored in the binary log binlog. The above binlog is a binary log that records all database table structure changes (such as CREATE, ALTER TABLE...) and table data modifications (INSERT, UPDATE, DELETE...). It should be noted that binlog can represent a transaction, and a transaction is a sequence of database operations, which is the smallest unit of work in the database. A transaction consists of all database operations performed between the start of the transaction and the end of the transaction. How to solve the problem of data loopback and ensure the efficiency of the two-way synchronization during the two-way synchronization between multi-active databases in different places has become the focus of the embodiments of the present application.
上面对相关背景技术进行了说明,下面对本申请实施例中的数据同步方法的系统架构进行介绍。The related background technology is described above, and the system architecture of the data synchronization method in the embodiment of the present application is introduced below.
如图1所示,图1为本申请实施例提供的一种数据同步方法的系统构架图。该系统架构100包括第一数据库110、第二数据库120、复制模块130、第一终端141以及第二终端142,其中,上述第一数据库110通过所述复制模块130连接所述第二数据库120,上述第一数据库110所在地域的第一终端141与上述第一数据库110进行数据交互,上述第二数据库120所在地域的第二终端142与上述第二数据库120进行交互。As shown in FIG. 1, FIG. 1 is a system architecture diagram of a data synchronization method provided by an embodiment of this application. The system architecture 100 includes a first database 110, a second database 120, a replication module 130, a first terminal 141, and a second terminal 142. The above-mentioned first database 110 is connected to the second database 120 through the replication module 130, The first terminal 141 in the location of the first database 110 interacts with the first database 110, and the second terminal 142 in the location of the second database 120 interacts with the second database 120.
其中,上述第一数据库110和上述第二数据库120可以为MySQL数据库,数据以表的形式存储于上述第一数据库110和上述第二数据库120中。Wherein, the first database 110 and the second database 120 may be MySQL databases, and data is stored in the first database 110 and the second database 120 in the form of tables.
其中,上述复制模块130可以搭载在服务器上,用于从上述第一数据库110中读取数据同步至上述第二数据库120,同时也从上述第二数据库120中读取数据同步至上述第一数据库110,上述复制模块130还可以对读取的数据进行分批处理,使得上述第一数据110与上述第二数据库120之间的数据同步按批次进行。Wherein, the above-mentioned replication module 130 may be mounted on a server, and is used to read data from the above-mentioned first database 110 and synchronize to the above-mentioned second database 120, and at the same time, read data from the above-mentioned second database 120 and synchronize to the above-mentioned first database. 110. The replication module 130 may also process the read data in batches, so that the data synchronization between the first data 110 and the second database 120 is performed in batches.
上述用户终端140可以安装有各种通讯客户端应用,例如数据库管理应用、购物类应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等。用户终端140可以是具有显示屏的各种电子设备,包括但不限于智能手机、平板电脑、便携计算机和台式计算机等等。在此不做具体限定。The aforementioned user terminal 140 may be installed with various communication client applications, such as database management applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, and so on. The user terminal 140 may be various electronic devices with a display screen, including but not limited to smart phones, tablet computers, portable computers, desktop computers, and so on. There is no specific limitation here.
需要说明的是,上述系统架构中的第一数据库110和第二数据库120仅仅表示不同的数据库,并不代表本申请实施例只能应用在两个数据库上,同理上述复制模块130和用户终端140可以存在一个或者复数个。It should be noted that the first database 110 and the second database 120 in the foregoing system architecture only represent different databases, and it does not mean that the embodiment of the present application can only be applied to two databases. The same applies to the foregoing replication module 130 and the user terminal. There may be one or more than 140.
通过上述系统架构,可以对二进制日志进行分批处理和标记处理,使得异地数据库之间进行数据同步时,自动识别出哪些数据是系统生成的,避免二进制日志在两地数据库不停的循环复制,大大提升了数据同步的效果。Through the above system architecture, binary logs can be processed in batches and marked, so that when data is synchronized between remote databases, it can automatically identify which data is generated by the system, and avoid the continuous circular replication of binary logs in the two databases. Greatly improve the effect of data synchronization.
上面对本申请实施例中的一种数据同步方法的系统架构进行了介绍,下面结合图2对本申请实施例中的一种数据同步方法进行详细说明,图2为本申请实施例提供的一种数据同步方法的流程示意图,具体包括以下步骤:The system architecture of a data synchronization method in an embodiment of the application is described above, and a data synchronization method in an embodiment of the application is described in detail below with reference to FIG. 2. FIG. 2 is a data synchronization method provided by an embodiment of the application. The schematic flow diagram of the synchronization method includes the following steps:
步骤201,将第一数据库中的第一二进制日志按照预设分批规则进行分批处理得到N个子二进制日志。Step 201: Perform batch processing of the first binary log in the first database according to a preset batching rule to obtain N sub-binary logs.
其中,N为正整数,上述第一二进制日志记录了上述第一数据库中的数据库操作序列。Wherein, N is a positive integer, and the first binary log records the database operation sequence in the first database.
具体的,该第一二进制日志大小为第一数据量,上述第一数据量可以根据用户需求自行设置,首先,通过系统架构中的复制模块从上述第一数据库中读取第一数据量的上述第一二进制日志,然后,获取第二数据库对应的第二数据量,因为上述第一数据库与上述第二数据库之间存在双向同步,所以通过上述第二数据量可以为后续的第一二进制日志分批处理做数据参考,最后,根据上述第一数据量和上述第二数据量对上述第一二级制日志进行分批处理得到N个子二进制日志。Specifically, the size of the first binary log is the first amount of data. The first amount of data can be set according to user needs. First, the first amount of data is read from the first database through the replication module in the system architecture. Then, the second data volume corresponding to the second database is obtained. Because there is two-way synchronization between the first database and the second database, the second data volume can be used for the subsequent first A binary log is processed in batches for data reference, and finally, the first two-level system log is processed in batches according to the first data volume and the second data volume to obtain N sub-binary logs.
进一步的,结合图3对如何根据上述第一数据量和上述第二数据量对上述第一二级制日志进行分批处理得到N个子二进制日志进行详细说明,图3为本申请实施例提供的一种数据同步方法的应用场景图,包括第一数据库,第二数据库,复制(Repetition)模块,a_select_size表示第一数据量,b_select_size表示第二数据量,a_split_size表示分批处理数据量,通过以下伪代码可以确定a_split_size的大小:Further, in conjunction with FIG. 3, how to perform batch processing on the first two-level system log to obtain N sub-binary logs according to the foregoing first data volume and the foregoing second data volume will be described in detail. FIG. 3 is provided for an embodiment of the application. An application scenario diagram of a data synchronization method, including a first database, a second database, and a replication (Repetition) module, a_select_size represents the first data volume, b_select_size represents the second data volume, and a_split_size represents the batch data volume, through the following pseudo The code can determine the size of a_split_size:
If(a_select_size>b_select_size){If(a_select_size>b_select_size){
a_split_size=b_select_size-2;//2表示一个头部标记和一个尾部标记a_split_size=b_select_size-2; // means a head tag and a tail tag
}Else{}Else{
a_split_size=b_select_size;a_split_size=b_select_size;
}}
可见,复制模块从第一数据库读取第一数据量的第一二进制日志,并对上述第一二进制日志进行分批处理后同步至上述第二数据库,同时从上述第二数据库读取第二数据量的二进制日志同步至上述第一数据库,需要说明的是,图3中只示出了上述第一数据库向上述第二数据库同步数据的具体分批处理步骤,上述第二数据库向上述第一数据库同步数据也是同样处理步骤,在此不再赘述。It can be seen that the replication module reads the first binary log of the first amount of data from the first database, performs batch processing on the first binary log, and then synchronizes to the second database, and reads from the second database at the same time. The binary log of the second amount of data is synchronized to the above-mentioned first database. It should be noted that FIG. 3 only shows the specific batch processing steps of synchronizing data from the above-mentioned first database to the above-mentioned second database. The above-mentioned first database synchronization data is also the same processing step, which will not be repeated here.
当上述第一数据量大于上述第二数据量时,由于每批次的数据标记数量为2,即一个头部标记一个尾部标记,此时可以确定分批数据量为上述第二数据量减2,即每个子二进制日志的大小为上述第二数据量减2,为便于区分,将第一数据量大于第二数据量时的分批数据量命名为第一分批数据量;当上述第一数据量小于或等于上述第二数据量时,可以确定分批数据量为上述第二数据量,即每个子二进制日志的大小为上述第二数据量,为便于区分,将上述第一数据量小于或等于上述第二数据量时的分批数据量命名为第二分批数据量。When the above-mentioned first data amount is greater than the above-mentioned second data amount, since the number of data tags in each batch is 2, that is, a head tag and a tail tag, it can be determined that the batch data amount is the second data amount minus 2 , That is, the size of each sub-binary log is the above-mentioned second data volume minus 2. For easy distinction, the batch data volume when the first data volume is greater than the second data volume is named the first batch data volume; When the data volume is less than or equal to the second data volume, the batch data volume can be determined to be the second data volume, that is, the size of each sub-binary log is the second data volume. In order to facilitate the distinction, the first data volume is smaller than The batch data volume when it is equal to the above-mentioned second data volume is named the second batch data volume.
通过将第一数据库中的第一二进制日志按照预设分批规则进行分批处理得到N个子二进制日志,可以减少一次性同步数据的大小,减小了同步时的数据量压力,降低了死锁的情况发生。By processing the first binary log in the first database in batches according to a preset batching rule to obtain N sub-binary logs, the size of one-time synchronization data can be reduced, the data volume pressure during synchronization is reduced, and the data volume pressure during synchronization is reduced. A deadlock situation occurs.
步骤202,在每个子二进制日志的预设位置插入数据标记得到第二二进制日志。Step 202: Insert a data mark at a preset position of each sub-binary log to obtain a second binary log.
其中,上述数据标记包括头部标记和尾部标记,在预设位置插入数据标记即表示在每个子二进制日志的首部插入上述头部标记和在每个子二进制日志的尾部插入上述尾部标记,插入数据标记的每个子二进制日志的大小等于上述第二数据量,如此第二数据库向上述第一数据库同步数据的时候,至少可以读取到一个头部标记或者尾部标记。Wherein, the data mark includes a head mark and a tail mark. Inserting a data mark at a preset position means inserting the head mark at the head of each sub-binary log and inserting the tail mark at the end of each sub-binary log, inserting the data mark The size of each sub-binary log of is equal to the above-mentioned second data volume, so when the second database synchronizes data with the above-mentioned first database, at least one head mark or tail mark can be read.
具体的,上述第一数据库和上述第二数据库中各自存在一张制定表,该制定表中保存生成数据标记这个操作的二进制日志,通过操作该制定表即可在每个事务头后插入一个头部标记,在每个事务尾前插入一个尾部标记。Specifically, each of the above-mentioned first database and the above-mentioned second database has a formulation table. The binary log of the operation of generating data tags is stored in the formulation table. By operating the formulation table, a header can be inserted after each transaction header. Part mark, insert a tail mark before the end of each transaction.
通过在每个子二进制日志的预设位置插入数据标记得到第二二进制日志, 可以保证数据标记的可见性。The second binary log is obtained by inserting the data mark in the preset position of each sub-binary log, which can ensure the visibility of the data mark.
步骤203,根据所述第二二进制日志完成所述第一数据库与所述第二数据库之间的数据同步。Step 203: Complete data synchronization between the first database and the second database according to the second binary log.
其中,可以根据所述头部标记和所述尾部标记确定所述第二二进制日志的系统输入片段和业务输入片段,即将所述头部标记与所述尾部标记之间的片段确定为所述系统输入片段,将所述系统输入片段之外的片段确定为所述业务输入片段,上述系统输入片段表示系统生成的数据,在同步时识别出系统输入片段可以避免数据回环现象,上述业务输入片段表示外界终端输入数据库的数据。最后,根据所述系统输入片段和所述业务输入片段完成所述第一数据库与所述第二数据库之间的数据同步。Wherein, the system input segment and service input segment of the second binary log may be determined according to the head tag and the tail tag, that is, the segment between the head tag and the tail tag is determined as the The system input fragments are determined to be the business input fragments other than the system input fragments. The system input fragments represent data generated by the system. Recognizing the system input fragments during synchronization can avoid the phenomenon of data loopback. The fragments represent the data entered into the database by the external terminal. Finally, the data synchronization between the first database and the second database is completed according to the system input fragment and the service input fragment.
具体的,由于进行了分批处理,在将分批处理后的数据写入第二数据库时,可能会将数据截断,结合图4A、图4B和图4C进行举例说明,图4A为一种被截断的事务片段示意图,dml表示操作数据库的操作序列命令,transaction_begin表示事务头,transaction_end表示事务尾,flag_begin表示头部标记,flag_end表示尾部标记,图4A中只读取到一个头部标记,所以头部标记之后的dml序列都属于系统输入片段,头部标记之前的dml序列输入业务输入片段;图4B只读取到一个尾部标记,所以尾部标记之前的dml序列都属于系统输入片段,尾部标记之后的dml序列属于业务输入片段;图4C中读取到了完整的头部标记和尾部标记,所以头部标记和尾部标记之间的dml序列属于系统输入片段。需要说明的是,上述只是示例性说明了可能的截断情况,并不代表对本申请实施例的限定。Specifically, due to batch processing, the data may be truncated when the batch-processed data is written into the second database. For example, in conjunction with Figure 4A, Figure 4B and Figure 4C, Figure 4A is a kind of Schematic diagram of truncated transaction fragments, dml represents the operation sequence command for operating the database, transaction_begin represents the transaction head, transaction_end represents the transaction end, flag_begin represents the head tag, and flag_end represents the tail tag. In Figure 4A, only one head tag is read, so the head The dml sequence after the part mark belongs to the system input fragment, and the dml sequence before the head mark is input to the business input fragment; Figure 4B only reads a tail mark, so the dml sequence before the tail mark belongs to the system input fragment, after the tail mark The dml sequence belongs to the business input segment; Figure 4C reads the complete head and tail tags, so the dml sequence between the head tag and the tail tag belongs to the system input segment. It should be noted that the foregoing is only illustrative of possible truncation situations, and does not represent a limitation to the embodiments of the present application.
通过根据所述第二二进制日志完成所述第一数据库与所述第二数据库之间的数据同步,可以对二进制日志进行分批处理和标记处理,降低数据同步的数据量压力,使得异地数据库之间进行数据同步时,自动识别出哪些数据是系统生成的,避免二进制日志在两地数据库不停的循环复制,大大提升了数据同步的效果。By completing the data synchronization between the first database and the second database according to the second binary log, the binary log can be processed in batches and marked, reducing the data volume pressure of data synchronization, and making it remote When synchronizing data between databases, it automatically recognizes which data is generated by the system, avoids the continuous circular replication of binary logs in the two databases, and greatly improves the effect of data synchronization.
上述主要从方法侧执行过程的角度对本申请实施例的方案进行了介绍。可以理解的是,上述方法可以独立实现也可以结合实现,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人 员应该很容易意识到,结合本文中所提供的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The foregoing mainly introduces the solution of the embodiment of the present application from the perspective of the execution process on the method side. It can be understood that the above methods can be implemented independently or in combination. In order to implement the above functions, the electronic device includes hardware structures and/or software modules corresponding to each function. Those skilled in the art should easily realize that in combination with the units and algorithm steps of the examples described in the embodiments provided herein, this application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
下面对本申请实施例中应用该数据同步方法的硬件设备进行说明。The following describes the hardware devices that apply the data synchronization method in the embodiments of the present application.
图5为本身申请实施例提供的一种电子设备的结构示意图,该电子设备500可以是具备通信能力的电子设备,该电子设备可以包括各种具有无线通信功能的手持设备、车载设备、可穿戴设备、计算设备或连接到无线调制解调器的其他处理设备,以及各种形式的用户设备(User Equipment,UE),移动台(Mobile Station,MS),终端设备(terminal device)等等。本申请中的电子设备500可以包括一个或多个如下部件:处理器510、存储器520和输入输出设备530。FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of its own application. The electronic device 500 may be an electronic device with communication capabilities. The electronic device may include various handheld devices with wireless communication functions, vehicle-mounted devices, and wearables. Equipment, computing equipment or other processing equipment connected to a wireless modem, as well as various forms of user equipment (User Equipment, UE), mobile station (Mobile Station, MS), terminal equipment (terminal device), and so on. The electronic device 500 in this application may include one or more of the following components: a processor 510, a memory 520, and an input/output device 530.
处理器510可以包括一个或者多个处理核心。处理器510利用通信接口连接整个终端500内的各个部分,通过运行或执行存储在存储器520内的指令、程序、代码集或指令集,以及调用存储在存储器520内的数据,执行电子设备500的各种功能和处理数据。处理器510可以包括一个或多个处理单元,例如:处理器510可以包括中央处理器(Central Processing Unit,CPU)、应用处理器(application processor,AP)、调制解调处理器、图形处理器(graphics processing unit,GPU)、图像信号处理器(image signal processor,ISP)、控制器、视频编解码器、数字信号处理器(digital signal processor,DSP)、基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。CPU主要用于处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。本申请实施例中以中央处理器CPU为例进行说明,例如,当电子设备500在运行应用程序时,CPU可以获取到UI线程等线程针对该应用程序的绘制数据,并基于该绘制数据判断当前运行的应用程序是否出现掉帧卡顿等情况,之后,基于CPU自身的性能使用情况,可以对CPU的频率进行动态控制。The processor 510 may include one or more processing cores. The processor 510 uses a communication interface to connect various parts of the entire terminal 500, and executes the operations of the electronic device 500 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 520, and calling data stored in the memory 520. Various functions and processing data. The processor 510 may include one or more processing units. For example, the processor 510 may include a central processing unit (CPU), an application processor (AP), a modem processor, and a graphics processor ( graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. The CPU is mainly used to process the operating system, user interface, and application programs; the GPU is used to render and draw the display content; the modem is used to process wireless communication. Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. In the embodiment of this application, the central processing unit CPU is taken as an example for description. For example, when the electronic device 500 is running an application, the CPU can obtain drawing data of the UI thread and other threads for the application, and determine the current drawing data based on the drawing data. Whether the running application program has dropped frames, etc., after that, based on the performance usage of the CPU itself, the frequency of the CPU can be dynamically controlled.
处理器510中可以设置存储器520,用于存储指令和数据。在一些实施例中,处理器510中的存储器520为高速缓冲存储器。该存储器520可以保存处理器510刚用过或循环使用的指令或数据。如果处理器510需要再次使用该指令或数据,可从所述存储器520中直接调用。避免重复存取,减少处理器510的等待时间,提高系统效率。The processor 510 may be provided with a memory 520 for storing instructions and data. In some embodiments, the memory 520 in the processor 510 is a cache memory. The memory 520 can store instructions or data that the processor 510 has just used or used cyclically. If the processor 510 needs to use the instruction or data again, it can be directly called from the memory 520. Avoid repeated accesses, reduce the waiting time of the processor 510, and improve system efficiency.
可以理解的是,上述处理器510在实际产品中可以映射为系统级芯片(System on a Chip,SOC),上述处理单元和/或接口也可以不集成到处理器510中,单独通过一块通信芯片或者电子元器件实现对应的功能。上述各模块间的接口连接关系,只是示意性说明,并不构成对电子设备500的结构的唯一限定。It is understandable that the above-mentioned processor 510 can be mapped to a system-on-chip (SOC) in an actual product, and the above-mentioned processing unit and/or interface may not be integrated into the processor 510 and pass through a communication chip alone. Or electronic components realize the corresponding function. The above-mentioned interface connection relationship between the modules is only a schematic description, and does not constitute the only limitation on the structure of the electronic device 500.
存储器520可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。可选地,该存储器520包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器520可用于存储指令、程序、代码、代码集或指令集。存储器520可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等,该操作系统可以是安卓(Android)系统(包括基于Android系统深度开发的系统)、苹果公司开发的IOS系统(包括基于IOS系统深度开发的系统)或其它系统。存储数据区还可以存储电子设备500在使用中所创建的数据。The memory 520 may include random access memory (Random Access Memory, RAM), and may also include read-only memory (Read-Only Memory). Optionally, the memory 520 includes a non-transitory computer-readable storage medium. The memory 520 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 520 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing the operating system and instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.) , Instructions used to implement the following various method embodiments, etc., the operating system can be the Android system (including the system based on the in-depth development of the Android system), the IOS system developed by Apple (including the system based on the in-depth development of the IOS system) ) Or other systems. The data storage area can also store data created by the electronic device 500 during use.
输入输出设备530可以包括触摸显示屏,该触摸显示屏用于接收用户使用手指、触摸笔等任何适合的物体在其上或附近的触摸操作,以及显示各个应用程序的用户界面。触摸显示屏通常设置在终端500的前面板。触摸显示屏可被设计成为全面屏、曲面屏或异形屏。触摸显示屏还可被设计成为全面屏与曲面屏的结合,异形屏与曲面屏的结合,本申请实施例对此不加以限定。The input and output device 530 may include a touch display screen, which is used to receive a user's touch operation on or near any suitable object such as a finger, a touch pen, etc., and to display a user interface of each application program. The touch screen is usually arranged on the front panel of the terminal 500. The touch screen can be designed as a full screen, curved screen or special-shaped screen. The touch display screen can also be designed as a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the embodiment of the present application.
本申请实施例可以根据上述方法示例对电子设备进行功能单元的划分,例如,可以对应各个功能划分各个功能单元,也可以将两个或两个以上的功能集成在一个处理单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiment of the present application may divide the electronic device into functional units according to the foregoing method examples. For example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
在采用对应各个功能划分各个功能模块的情况下,图6为本申请实施例提供的一种数据同步装置的功能单元组成框图,如图6所示,数据同步装置600包括:In the case of dividing each functional module corresponding to each function, FIG. 6 is a block diagram of the functional unit composition of a data synchronization device provided in an embodiment of the application. As shown in FIG. 6, the data synchronization device 600 includes:
分批单元610,用于将第一数据库中的第一二进制日志按照预设分批规则进行分批处理得到N个子二进制日志,N为正整数;The batching unit 610 is configured to perform batch processing of the first binary log in the first database according to a preset batching rule to obtain N sub-binary logs, where N is a positive integer;
标记单元620,用于在每个子二进制日志的预设位置插入数据标记得到第二二进制日志;The marking unit 620 is configured to insert a data mark at the preset position of each sub-binary log to obtain the second binary log;
同步单元630,用于根据所述第二二进制日志完成所述第一数据库与所述第二数据库之间的数据同步。The synchronization unit 630 is configured to complete data synchronization between the first database and the second database according to the second binary log.
其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。Among them, all relevant content of the steps involved in the foregoing method embodiments can be cited in the functional description of the corresponding functional module, and will not be repeated here.
在采用集成的单元的情况下,图7是本申请实施例中所涉及的另一种中央处理器频率的控制装置700的功能单元组成框图。该中央处理器频率的控制装置700应用于支持显示功能的电子设备,所述电子设备包括处理器、显示模块等,所述中央处理器频率的控制装置700包括处理单元701和通信单元702,其中,所述处理单元701,用于执行如上述方法实施例中的任一步骤,且在执行诸如发送等数据传输时,可选择的调用所述通信单元702来完成相应操作。In the case of using an integrated unit, FIG. 7 is a functional unit composition block diagram of another central processor frequency control device 700 involved in an embodiment of the present application. The device 700 for controlling the frequency of the central processing unit is applied to electronic equipment that supports display functions. The electronic device includes a processor, a display module, etc., and the device for controlling the frequency of the central processing unit 700 includes a processing unit 701 and a communication unit 702, wherein , The processing unit 701 is configured to perform any step in the above method embodiment, and when performing data transmission such as sending, it can optionally call the communication unit 702 to complete the corresponding operation.
其中,所述中央处理器频率的控制装置700还可以包括存储单元703,用于存储电子设备的程序代码和数据。所述处理单元701可以是中央处理器,所述通信单元702可以是触控显示屏或者收发器,存储单元703可以是存储器。Wherein, the device 700 for controlling the frequency of the central processing unit may further include a storage unit 703 for storing program codes and data of the electronic device. The processing unit 701 may be a central processing unit, the communication unit 702 may be a touch screen or a transceiver, and the storage unit 703 may be a memory.
可以理解的是,由于方法实施例与装置实施例为相同技术构思的不同呈现形式,因此,本申请中方法实施例部分的内容应同步适配于装置实施例部分,此处不再赘述。上述数据同步装置600和数据同步装置700均可执行上述实施例包括的全部数据同步方法。It is understandable that because the method embodiment and the device embodiment are different presentation forms of the same technical concept, the content of the method embodiment part of this application should be synchronized to the device embodiment part, and will not be repeated here. Both the data synchronization device 600 and the data synchronization device 700 described above can execute all the data synchronization methods included in the foregoing embodiment.
本申请实施例还提供一种计算机存储介质,其中,该计算机存储介质存储用于电子数据交换的计算机程序,该计算机程序使得计算机执行如上述方法实施例中记载的任一方法的部分或全部步骤,上述计算机包括电子设备。An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any method as described in the above method embodiment , The above-mentioned computer includes electronic equipment.
本申请实施例还提供一种计算机程序产品,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计 算机执行如上述方法实施例中记载的任一方法的部分或全部步骤。该计算机程序产品可以为一个软件安装包,上述计算机包括电子设备。The embodiments of the present application also provide a computer program product. The above-mentioned computer program product includes a non-transitory computer-readable storage medium storing a computer program. The above-mentioned computer program is operable to cause a computer to execute any of the methods described in the above-mentioned method embodiments. Part or all of the steps of the method. The computer program product may be a software installation package, and the above-mentioned computer includes electronic equipment.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that this application is not limited by the described sequence of actions. Because according to this application, certain steps can be performed in other order or at the same time. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in an embodiment, reference may be made to related descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed device may be implemented in other ways. For example, the device embodiments described above are merely illustrative, for example, the division of the above-mentioned units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical or other forms.
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网 络设备等)执行本申请各个实施例上述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the aforementioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable memory. Based on this understanding, the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, A number of instructions are included to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the foregoing methods of the various embodiments of the present application. The aforementioned memory includes: U disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、只读存储器(英文:Read-Only Memory,简称:ROM)、随机存取器(英文:Random Access Memory,简称:RAM)、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by a program instructing relevant hardware. The program can be stored in a computer-readable memory, and the memory can include: a flash disk , Read-only memory (English: Read-Only Memory, abbreviation: ROM), random access device (English: Random Access Memory, abbreviation: RAM), magnetic disk or optical disc, etc.
以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The embodiments of the application are described in detail above, and specific examples are used in this article to illustrate the principles and implementation of the application. The descriptions of the above examples are only used to help understand the methods and core ideas of the application; at the same time, for Persons of ordinary skill in the art, based on the idea of the application, will have changes in the specific implementation and the scope of application. In summary, the content of this specification should not be construed as limiting the application.

Claims (10)

  1. 一种数据同步方法,其特征在于,所述方法包括:A data synchronization method, characterized in that the method includes:
    将第一数据库中的第一二进制日志按照预设分批规则进行分批处理得到N个子二进制日志,N为正整数;The first binary log in the first database is processed in batches according to a preset batching rule to obtain N sub-binary logs, where N is a positive integer;
    在每个子二进制日志的预设位置插入数据标记得到第二二进制日志;Insert a data mark at the preset position of each sub-binary log to obtain the second binary log;
    根据所述第二二进制日志完成所述第一数据库与所述第二数据库之间的数据同步。The data synchronization between the first database and the second database is completed according to the second binary log.
  2. 根据权利要求1所述的方法,其特征在于,所述将第一数据库中的第一二进制日志按照预设分批规则进行分批处理得到N个子二进制日志,包括:The method according to claim 1, wherein the step of processing the first binary log in the first database in batches according to a preset batching rule to obtain N sub-binary logs comprises:
    从所述第一数据库中读取第一数据量的所述第一二进制日志;Read the first binary log of a first amount of data from the first database;
    获取所述第二数据库对应的第二数据量,所述第二数据量表示所述第二数据库向所述第一数据库同步数据的容量大小;Acquiring a second amount of data corresponding to the second database, where the second amount of data represents the size of the synchronization data of the second database with the first database;
    根据所述第一数据量和所述第二数据量对所述第一二级制日志进行分批处理得到N个子二进制日志。Perform batch processing on the first two-level system log according to the first data volume and the second data volume to obtain N sub-binary logs.
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述第一数据量和所述第二数据量对所述第一二级制日志进行分批处理得到N个子二进制日志,包括:The method according to claim 2, wherein the batch processing of the first two-level system log according to the first data volume and the second data volume to obtain N sub-binary logs comprises:
    当所述第一数据量大于所述第二数据量时,根据所述第二数据量和所述数据标记确定第一分批数据量,所述第一分批数据量表示每个子二进制日志的大小;When the first data volume is greater than the second data volume, the first batch data volume is determined according to the second data volume and the data mark, and the first batch data volume represents the amount of each sub-binary log size;
    根据所述第一分批数据量将所述第一二进制日志进行分批处理得到所述N个子二进制日志。The first binary log is processed in batches according to the amount of the first batch of data to obtain the N sub-binary logs.
  4. 根据权利要求2所述的方法,其特征在于,所述根据所述第一数据量和所述第二数据量对所述第一二级制日志进行分批处理得到N个子二进制日志,包括:The method according to claim 2, wherein the batch processing of the first two-level system log according to the first data volume and the second data volume to obtain N sub-binary logs comprises:
    当所述第一数据量小于或等于所述第二数据量时,将所述第二数据量确定为第二分批数据量;When the first data amount is less than or equal to the second data amount, determining the second data amount as a second batch data amount;
    根据所述第二分批数据量将所述第一二进制日志进行分批处理得到所述 N个子二进制日志。The first binary log is processed in batches according to the second batch data amount to obtain the N sub-binary logs.
  5. 根据权利要求1所述的方法,其特征在于,所述在每个子二进制日志的预设位置插入数据标记得到第二二进制日志,包括:The method according to claim 1, wherein the inserting a data mark in a preset position of each sub-binary log to obtain the second binary log comprises:
    在每个子进制日志的首部插入头部标记,以及,在每个子二进制日志的尾部插入尾部标记得到所述第二二进制日志。Inserting a head mark at the head of each sub-binary log, and inserting a tail mark at the end of each sub-binary log to obtain the second binary log.
  6. 根据权利要求5所述的方法,其特征在于,所述根据所述第二二进制日志完成所述第一数据库与所述第二数据库之间的数据同步,包括:The method according to claim 5, wherein the completing data synchronization between the first database and the second database according to the second binary log comprises:
    根据所述头部标记和所述尾部标记确定所述第二二进制日志的系统输入片段和业务输入片段;Determining a system input segment and a business input segment of the second binary log according to the head tag and the tail tag;
    根据所述系统输入片段和所述业务输入片段完成所述第一数据库与所述第二数据库之间的数据同步。Complete data synchronization between the first database and the second database according to the system input fragment and the service input fragment.
  7. 根据权利要求6所述的方法,其特征在于,所述根据所述头部标记和所述尾部标记确定所述第二二进制日志的系统输入片段和业务输入片段,包括:The method according to claim 6, wherein the determining the system input segment and the service input segment of the second binary log according to the head tag and the tail tag comprises:
    将所述头部标记与所述尾部标记之间的片段确定为所述系统输入片段;Determining the segment between the head tag and the tail tag as the system input segment;
    将所述系统输入片段之外的片段确定为所述业务输入片段。A segment other than the system input segment is determined as the service input segment.
  8. 一种数据同步装置,其特征在于,所述装置包括:A data synchronization device, characterized in that the device includes:
    分批单元,用于将第一数据库中的第一二进制日志按照预设分批规则进行分批处理得到N个子二进制日志,N为正整数;The batching unit is used to process the first binary log in the first database in batches according to a preset batching rule to obtain N sub-binary logs, where N is a positive integer;
    标记单元,用于在每个子二进制日志的预设位置插入数据标记得到第二二进制日志;The marking unit is used to insert a data mark at the preset position of each sub-binary log to obtain the second binary log;
    同步单元,用于根据所述第二二进制日志完成所述第一数据库与所述第二数据库之间的数据同步。The synchronization unit is configured to complete data synchronization between the first database and the second database according to the second binary log.
  9. 一种电子设备,其特征在于,包括应用处理器、存储器,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述应用处理器执行,所述程序包括用于执行如权利要求1~7任一项所述的方法中的步骤的指令。An electronic device, characterized by comprising an application processor, a memory, and one or more programs, the one or more programs are stored in the memory and configured to be executed by the application processor, so The program includes instructions for executing the steps in the method according to any one of claims 1-7.
  10. 一种计算机存储介质,其特征在于,所述计算机存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行如权利要求1~7任一项所述的方法。A computer storage medium, wherein the computer storage medium stores a computer program, the computer program includes program instructions, and when executed by a processor, the program instructions cause the processor to execute as claimed in claims 1 to 7. Any one of the methods.
PCT/CN2020/093374 2020-05-29 2020-05-29 Data synchronization method and related device WO2021237704A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080096693.2A CN115104092A (en) 2020-05-29 2020-05-29 Data synchronization method and related device
PCT/CN2020/093374 WO2021237704A1 (en) 2020-05-29 2020-05-29 Data synchronization method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/093374 WO2021237704A1 (en) 2020-05-29 2020-05-29 Data synchronization method and related device

Publications (1)

Publication Number Publication Date
WO2021237704A1 true WO2021237704A1 (en) 2021-12-02

Family

ID=78745454

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/093374 WO2021237704A1 (en) 2020-05-29 2020-05-29 Data synchronization method and related device

Country Status (2)

Country Link
CN (1) CN115104092A (en)
WO (1) WO2021237704A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116010172A (en) * 2023-02-28 2023-04-25 天翼云科技有限公司 Data synchronization method, database, data synchronization device and product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130318044A1 (en) * 2010-07-27 2013-11-28 Oracle International Corporation Mysql database heterogeneous log based replication
CN104376017A (en) * 2013-08-15 2015-02-25 阿里巴巴集团控股有限公司 Method and system for inter-database data synchronization
CN104391954A (en) * 2014-11-27 2015-03-04 北京国双科技有限公司 Database log processing method and device
CN107729366A (en) * 2017-09-08 2018-02-23 广东省建设信息中心 A kind of pervasive multi-source heterogeneous large-scale data synchronization system
CN109492050A (en) * 2018-10-19 2019-03-19 北京极数云舟科技有限公司 The method and device for preventing MySQL dual-active system circulation from replicating
CN110659256A (en) * 2019-09-30 2020-01-07 掌阅科技股份有限公司 Multi-computer room synchronization method, computing device and computer storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130318044A1 (en) * 2010-07-27 2013-11-28 Oracle International Corporation Mysql database heterogeneous log based replication
CN104376017A (en) * 2013-08-15 2015-02-25 阿里巴巴集团控股有限公司 Method and system for inter-database data synchronization
CN104391954A (en) * 2014-11-27 2015-03-04 北京国双科技有限公司 Database log processing method and device
CN107729366A (en) * 2017-09-08 2018-02-23 广东省建设信息中心 A kind of pervasive multi-source heterogeneous large-scale data synchronization system
CN109492050A (en) * 2018-10-19 2019-03-19 北京极数云舟科技有限公司 The method and device for preventing MySQL dual-active system circulation from replicating
CN110659256A (en) * 2019-09-30 2020-01-07 掌阅科技股份有限公司 Multi-computer room synchronization method, computing device and computer storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
BRIELLA: "MySQL database two-way synchronous replication", CSDN BLOG, 25 November 2015 (2015-11-25), pages 1 - 7, XP055871583, Retrieved from the Internet <URL:https://blog.csdn.net/weixin_33738982/article/details/85776255> [retrieved on 20211210] *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116010172A (en) * 2023-02-28 2023-04-25 天翼云科技有限公司 Data synchronization method, database, data synchronization device and product

Also Published As

Publication number Publication date
CN115104092A (en) 2022-09-23

Similar Documents

Publication Publication Date Title
WO2017028514A1 (en) Method and device for storing and reading data
EP3113043A1 (en) Method, device and host for updating metadata stored in columns in distributed file system
WO2022134428A1 (en) Applet page rendering method and apparatus, electronic device, and storage medium
PH12016500339B1 (en) Ascertaining command completion in flash memories
CN110489440B (en) Data query method and device
CN109241015B (en) Method for writing data in a distributed storage system
WO2023231665A1 (en) Distributed transaction processing method, system and device, and readable storage medium
WO2020259227A1 (en) Thread task communication system, method, and related product
CN102272751A (en) Data integrity in a database environment through background synchronization
CN113722124B (en) Content processing method, device, equipment and storage medium of cloud mobile phone
WO2024156191A1 (en) Local refreshing method, system and apparatus for chart, and device and medium
US20220309040A1 (en) Method and apparatus of synchronizing data, electronic device and storage medium
WO2019179012A1 (en) Method, device, apparatus and computer readable storage medium for processing text data
WO2024193561A1 (en) Document directory processing method and related device
WO2021237704A1 (en) Data synchronization method and related device
US20240220334A1 (en) Data processing method in distributed system, and related system
CN109347899B (en) Method for writing log data in distributed storage system
CN109271247A (en) Memory Optimize Method, device, computer installation and storage medium
CN112613964A (en) Account checking method, account checking device, account checking equipment and storage medium
CN116721007A (en) Task control method, system and device, electronic equipment and storage medium
CN111767433A (en) Data processing method, device, storage medium and terminal
US20230048813A1 (en) Method of storing data and method of reading data
CN115905322A (en) Service processing method and device, electronic equipment and storage medium
CN115639966A (en) Data writing method and device, terminal equipment and storage medium
CN115168440A (en) Data read-write method, distributed storage system, device, equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20937226

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 19.04.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20937226

Country of ref document: EP

Kind code of ref document: A1