CN109684410A - A kind of system, method and the storage medium of determining master-slave database synchronization delayed time - Google Patents

A kind of system, method and the storage medium of determining master-slave database synchronization delayed time Download PDF

Info

Publication number
CN109684410A
CN109684410A CN201811584312.6A CN201811584312A CN109684410A CN 109684410 A CN109684410 A CN 109684410A CN 201811584312 A CN201811584312 A CN 201811584312A CN 109684410 A CN109684410 A CN 109684410A
Authority
CN
China
Prior art keywords
event
database
timestamp
data
log
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201811584312.6A
Other languages
Chinese (zh)
Other versions
CN109684410B (en
Inventor
江瑜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201811584312.6A priority Critical patent/CN109684410B/en
Publication of CN109684410A publication Critical patent/CN109684410A/en
Application granted granted Critical
Publication of CN109684410B publication Critical patent/CN109684410B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses system, method and the storage medium of a kind of determining master-slave database synchronization delayed time, including primary database, from database, first event monitoring modular, second event monitoring modular and first processing module;First event monitoring modular sends primary database event to first processing module and executes timestamp;Second event monitoring modular sends from Database Events to first processing module and executes timestamp;First processing module executes timestamp and primary database event execution timestamp according to from Database Events, determines master-slave database synchronization delayed time.Since the master-slave database synchronization delayed time in embodiments of the present invention, determined is that primary database has the time of data update event to update the time completed to from database data, therefore the master-slave database synchronization delayed time that the embodiment of the present invention is determined is more acurrate.

Description

A kind of system, method and the storage medium of determining master-slave database synchronization delayed time
Technical field
The present invention relates to master-slave database synchronization delayed time computing technique field more particularly to a kind of determining master-slave database are same Walk system, method and the storage medium of time delay.
Background technique
Currently, relational model of database is still preferred model when data storage is done by Internet company, and relationship type number According to base management system MySQL due to its open source, support that the characteristics of a variety of storage engines usage scenario is the most extensive.Wherein, one is main One is most commonly seen from architecture mode, and primary database provides read-write service under the framework, provides the service of reading from database, which removes Realizing also has the advantages that data redundancy backup outside read and write abruption.How master slave mode guarantees that the data between master-slave database are consistent Property be that Internet company needs the emphasis that solves.
MySQL can be synchronized multiple by multiple version iterations and after updating by way of principal and subordinate's asynchronous replication or partly The mode of system realizes the data consistency between master-slave database.Principal and subordinate's asynchronous replication is will more when primary database has data update It is newly written in the form of event log in local binary log file, and the event log is pushed to from database, from number Event log is written from the binary log file of database local according to library, resettles at least one binary system day from database Will file playback thread carries out the playback of binary file, and the process summary of log playback is that the data of disk are loaded from database Page updates the data page into memory and according to event log, and updated data page is refreshed back disk again, covers original Data in magnetic disk.Half synchronous duplication is to need to disappear to from database one confirmation of transmission after primary database submits event log Breath, receives the event log from database and is written and send confirmation to primary database after file and reply message, and primary database receives Confirmation just operates successfully to client return after replying message, to achieve the purpose that user data final consistency, while as master Half synchronous duplication can be degenerated to asynchronous replication when from data bank network exception.
The data of master-slave database are synchronous to have delay, only accurately determines the direct synchronizing relay of master-slave database, It can confirm that the consistency situation of master-slave database data and finally confirm whether credible from the data of database.
A kind of delay calculation is provided in the prior art, which is to work as from database to receive primary database Record log renewal time when the event log of push re-records the time, so when playing back completion to transaction journal from database Time for recording subtracts event log renewal time and show that a rough value is that master-slave synchronisation prolongs when being completed afterwards according to playback When.The delay strictly, only embodies the delay time played back from Database Events log, does not include event log from main number The time-consuming from database is pushed to according to library.Therefore, the master-slave database synchronization delayed time determined in the prior art is inaccurate.
Summary of the invention
The embodiment of the invention provides system, method and the storage mediums of a kind of determining master-slave database synchronization delayed time, use To solve the problems, such as to determine master-slave database synchronization delayed time inaccuracy in the prior art.
The embodiment of the invention provides a kind of systems of determining master-slave database synchronization delayed time, and the system comprises master datas Library and from database, the system also includes: first event monitoring modular, second event monitoring modular and first processing module;
The first event monitoring modular is connect with the primary database and the first processing module respectively;Described second Event monitoring module is connect with described from database and the first processing module respectively;
The first event monitoring modular, for when monitoring that the primary database data update, at Xiang Suoshu first It manages module and sends the first instruction information, carry primary database event in the first instruction information and execute timestamp;
The second event monitoring modular, for when monitor it is described execute event from database when, at Xiang Suoshu first It manages module and sends second indication information, carry in the second indication information from Database Events and execute timestamp;
The first processing module, for executing timestamp and the primary database event from Database Events according to described Timestamp is executed, determines master-slave database synchronization delayed time.
Further, the second event monitoring modular, be also used to when monitor it is described from database write-in local two into When file event processed, Xiang Suoshu first processing module sends third and indicates information, carries in the third instruction information and this is written Ground binary file Event Timestamp;
The first processing module is also used to execute timestamp according to the primary database event and local binary system is written File event timestamp determines the data-pushing time delay of master-slave database;When according to said write local binary file event Between stab and from Database Events execute timestamp, determine from database data play back time delay.
Further, the system also includes Second processing modules;
The Second processing module is connect with the second event monitoring modular and first processing module respectively;
The second event monitoring modular, be specifically used for sending to the Second processing module second indication information and The third indicates information;
The Second processing module, for sending the second indication information and the third to the first processing module Indicate information.
Further, the first processing module is also used to send the first instruction information to the Second processing module;
The Second processing module is also used to execute timestamp and the primary database thing from Database Events according to described Part executes timestamp, determines master-slave database synchronization delayed time;Timestamp is executed according to the primary database event and write-in is local Binary file Event Timestamp determines the data-pushing time delay of master-slave database;According to said write local binary file Event Timestamp and from Database Events execute timestamp, determine from database data play back time delay.
Further, the first event monitoring modular is specifically used within the preset time cycle, monitors institute every time When stating the update of primary database data, Xiang Suoshu first processing module sends the first instruction information, takes in each first instruction information Band executes timestamp when the Global ID of time update event primary database event corresponding with the ID;
The second event monitoring modular was specifically used within the preset time cycle, monitor every time it is described from When database executes event, Xiang Suoshu first processing module sends second indication information, carries and works as in each second indication information The Global ID of secondary update event is corresponding with the ID to execute timestamp from Database Events;It monitors every time described from database write When entering local binary file event, Xiang Suoshu first processing module sends third and indicates that information, each third indicate in information It carries when the local binary file Event Timestamp of the Global ID of time update event write-in corresponding with the ID;
The first processing module is specifically used for executing timestamp according to the corresponding primary database event of each ID and from number Timestamp is executed according to library event, determines master-slave database synchronization delayed time;When being executed according to the corresponding primary database event of each ID Between stab and be written local binary file Event Timestamp, determine the data-pushing time delay of master-slave database;According to each ID pairs The write-in local binary file Event Timestamp answered and timestamp is executed from Database Events, determines and played back from database data Time delay.
Further, the first processing module, specifically for the update event that will be carried in each first instruction information Corresponding with the ID primary database event of Global ID execute timestamp and be added to the first log list;By each second instruction letter The Global ID of the update event carried in breath is corresponding with the ID to be added to the second log column from Database Events execution timestamp Table;The local binary file thing of the Global ID for the update event that each third is indicated to carry in information write-in corresponding with the ID Part timestamp is added to third log list;
The first processing module, specifically for the delay when determining, by first log list, the second log list It shears with the data in third log list to the old list of corresponding first log, the old list of the second log and the old column of third log Table;Principal and subordinate is determined respectively according to the data in the old list of first log, the old list of the second log and the old list of third log Database synchronization time delay, the data-pushing time delay of master-slave database and from database data play back time delay.
Further, the first processing module was also used within the preset time cycle, in an event, such as Global ID's primary database event corresponding with the ID in the first log list of fruit comprising update event executes timestamp, third day Data are sky in will list, determine data-pushing exception;If in third log list comprising update event Global ID and should The local binary file Event Timestamp of the corresponding write-in of ID, data are sky in the second log list, determine data readback exception; When data-pushing frequency of abnormity reaches preset first threshold, the first warning message is exported, when data readback frequency of abnormity reaches When to preset second threshold, the second warning message is exported.
On the other hand, the embodiment of the invention provides a kind of method of determining master-slave database synchronization delayed time, the methods Include:
Receive first event monitoring modular send carryings primary database event execute timestamp first instruction information with The carrying that second event monitoring modular is sent executes the second indication information of timestamp from Database Events;Wherein, described first Instruction information is that the first event monitoring module monitors are sent when updating to primary database data, the second indication information The second event monitoring module monitors to from database execute event when send;
Timestamp and primary database event execution timestamp are executed from Database Events according to described, determines principal and subordinate's number According to library synchronization delayed time.
Further, the method also includes:
Receive the third that local binary file Event Timestamp is written in the carrying that the second event monitoring modular is sent Indicate information, wherein the third instruction information is that the second event monitoring module monitors are written originally to described from database It is sent when ground binary file event;
Timestamp is executed according to the primary database event and local binary file Event Timestamp is written, and determines principal and subordinate The data-pushing time delay of database;When being executed according to said write local binary file Event Timestamp and from Database Events Between stab, determine from database data play back time delay.
Further, the first finger that the carrying primary database event that first event monitoring modular is sent executes timestamp is received Show information, the carrying of second event monitoring modular transmission executes second indication information, the second thing of timestamp from Database Events The third that local binary file Event Timestamp is written in the carrying that part monitoring modular is sent indicates that information includes:
Within the preset time cycle, the Global ID that time update event is worked as in the carrying that first event monitoring modular is sent is received Primary database event corresponding with the ID executes each of timestamp the first instruction information;Second event monitoring modular is received to send Carrying execute the second instruction of each of timestamp when the Global ID of time update event is corresponding with the ID from Database Events and believe Breath;Receive carrying that second event monitoring modular is sent when the write-in corresponding with ID of the Global ID of time update event locally two into Each third of file event timestamp processed indicates information;
Timestamp and primary database event execution timestamp are executed from Database Events according to described, determines principal and subordinate's number Timestamp is executed according to library synchronization delayed time, according to the primary database event and local binary file Event Timestamp is written, really Determine the data-pushing time delay of master-slave database, according to said write local binary file Event Timestamp and from Database Events Timestamp is executed, determines that playing back time delay from database data includes:
Timestamp is executed according to the corresponding primary database event of each ID and executes timestamp from Database Events, determines master From database synchronization time delay;Timestamp is executed according to the corresponding primary database event of each ID and local binary file thing is written Part timestamp determines the data-pushing time delay of master-slave database;According to the local binary file event of the corresponding write-in of each ID Timestamp and from Database Events execute timestamp, determine from database data play back time delay.
Further, after receiving the first instruction information, second indication information and third instruction information, principal and subordinate's data are determined Before library synchronization delayed time, the data-pushing time delay of master-slave database and the determining playback time delay from database data, the method is also Include:
Global ID's primary database event corresponding with the ID of the update event carried in each first instruction information is held Row timestamp is added to the first log list;By the Global ID of the update event carried in each second indication information and this ID pairs The slave Database Events answered execute timestamp and are added to the second log list;Each third is indicated to the update thing carried in information The local binary file Event Timestamp of the Global ID of part write-in corresponding with the ID is added to third log list;
It determines master-slave database synchronization delayed time, the data-pushing time delay of master-slave database and determines and played back from database data Time delay includes:
The data in first log list, the second log list and third log list are cut in the delay when determining It is switched to the old list of corresponding first log, the old list of the second log and the old list of third log;According to the old column of the first log Data in table, the old list of the second log and the old list of third log determine master-slave database synchronization delayed time, principal and subordinate's data respectively The data-pushing time delay in library and from database data play back time delay.
Further, the method also includes:
Within the preset time cycle, in an event, if complete comprising update event in the first log list Office ID primary database event corresponding with the ID executes timestamp, and data are sky in third log list, determines that data-pushing is different Often;If when Global ID's corresponding with ID write-in local binary file event in third log list comprising update event Between stab, in the second log list data be sky, determine data readback exception;When data-pushing frequency of abnormity reaches preset first When threshold value, the first warning message is exported, when data readback frequency of abnormity reaches preset second threshold, exports the second alarm signal Breath.
On the other hand, the embodiment of the invention provides a kind of computer readable storage medium, the computer-readable storages Dielectric memory contains computer program, and the computer program realizes method step described in any of the above embodiments when being executed by processor Suddenly.
The embodiment of the invention provides system, method and the storage medium of a kind of determining master-slave database synchronization delayed time, institutes The system of stating includes primary database and from database, the system also includes: first event monitoring modular, second event monitoring modular And first processing module;The first event monitoring modular is connect with the primary database and the first processing module respectively; The second event monitoring modular is connect with described from database and the first processing module respectively;The first event monitoring Module, for when monitoring that the primary database data update, Xiang Suoshu first processing module to send the first instruction information, institute It states and carries primary database event execution timestamp in the first instruction information;The second event monitoring modular is monitored for working as Described when executing event from database, Xiang Suoshu first processing module sends second indication information, in the second indication information It carries from Database Events and executes timestamp;The first processing module, for executing the time from Database Events according to described Stamp and the primary database event execute timestamp, determine master-slave database synchronization delayed time.
Since in embodiments of the present invention, whether first event monitoring modular real-time monitoring primary database has data update, When having monitored update, is sent to first processing module and carries the first instruction information that primary database event executes timestamp, After primary database data update, data update event can be executed from database, and second event monitoring modular real-time monitoring is from data Whether library executes event, when monitoring to execute event from database, sends and is carried from Database Events to first processing module Execute the second indication information of timestamp.First processing module executes timestamp and primary database event according to from Database Events Timestamp is executed, can determine master-slave database synchronization delayed time.The master-slave database synchronization delayed time determined in this way is master data There are the time of data update event to the time that completion is updated from database data, therefore the master that the embodiment of the present invention is determined in library It is more acurrate from database synchronization time delay.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly introduced, it should be apparent that, drawings in the following description are only some embodiments of the invention, for this For the those of ordinary skill in field, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is the system structure diagram of determining master-slave database synchronization delayed time provided in an embodiment of the present invention;
Fig. 2 is the system structure diagram of determining master-slave database synchronization delayed time provided in an embodiment of the present invention;
Fig. 3 is the process schematic of determining master-slave database synchronization delayed time provided in an embodiment of the present invention;
Fig. 4 is event information collecting flowchart schematic diagram provided in an embodiment of the present invention;
Fig. 5 is determining time delay flow diagram provided in an embodiment of the present invention;
Fig. 6 is the apparatus structure schematic diagram of determining master-slave database synchronization delayed time provided in an embodiment of the present invention;
Fig. 7 is a kind of electronic equipment schematic diagram provided in an embodiment of the present invention.
Specific embodiment
The present invention will be describe below in further detail with reference to the accompanying drawings, it is clear that described embodiment is only this Invention a part of the embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art exist All other embodiment obtained under the premise of creative work is not made, shall fall within the protection scope of the present invention.
Fig. 1 is the system structure diagram of determining master-slave database synchronization delayed time provided in an embodiment of the present invention, the system System includes primary database 11 and from database 12, the system also includes: first event monitoring modular 13, second event monitor mould Block 14 and first processing module 15;
The first event monitoring modular 13 is connect with the primary database 11 and the first processing module 15 respectively;Institute Second event monitoring modular 14 is stated to connect with described from database 12 and the first processing module 15 respectively;
The first event monitoring modular 13, for when monitoring that 11 data of primary database update, Xiang Suoshu the One processing module 15 sends the first instruction information, carries primary database event in the first instruction information and executes timestamp;
The second event monitoring modular 14, for when monitor it is described execute event from database 12 when, Xiang Suoshu the One processing module 15 sends second indication information, carries in the second indication information from Database Events and executes timestamp;
The first processing module 15, for executing timestamp and the primary database thing from Database Events according to described Part executes timestamp, determines master-slave database synchronization delayed time.
The system of determining master-slave database synchronization delayed time provided in an embodiment of the present invention includes primary database 11, from database 12, first event monitoring modular 13, second event monitoring modular 14 and first processing module 15.Primary database 11 and from database 12 can be the master-slave database in MySQL database, and first event monitoring modular 13 and second event monitoring modular 14 can be with It is the database plug-in unit for including Hook Function, first event monitoring modular 13 and second event monitoring modular 14 are respectively in principal and subordinate's number Start-up operation when starting according to library, and master-slave database event is monitored by Hook Function, such as first event monitoring modular 13 is supervised Primary database data update event is surveyed, second event monitoring modular 14 is monitored from database execution event etc..
In embodiments of the present invention, when first event monitoring modular 13 monitors that primary database data update, at first It manages module 15 and sends the first instruction information, carry primary database event in the first instruction information and execute timestamp, primary database thing Part executes the timestamp that timestamp characterization primary database submits update event.Second event monitoring modular 14 monitors described from number When executing event according to library, second indication information is sent to first processing module 15, is carried in second indication information from database thing Part executes timestamp, executes timestamp characterization from Database Events and the timestamp after updating data readback is completed from database.
After first processing module 15 receives the first instruction information and second indication information, obtain in the first instruction information Primary database event executes the slave Database Events in timestamp and second indication information and executes timestamp, then with from database Event executes timestamp and subtracts primary database event execution timestamp, obtains master-slave database synchronization delayed time.
Since in embodiments of the present invention, whether first event monitoring modular real-time monitoring primary database has data update, When having monitored update, is sent to first processing module and carries the first instruction information that primary database event executes timestamp, After primary database data update, data update event can be executed from database, and second event monitoring modular real-time monitoring is from data Whether library executes event, when monitoring to execute event from database, sends and is carried from Database Events to first processing module Execute the second indication information of timestamp.First processing module executes timestamp and primary database event according to from Database Events Timestamp is executed, can determine master-slave database synchronization delayed time.The master-slave database synchronization delayed time determined in this way is master data There are the time of data update event to the time that completion is updated from database data, therefore the master that the embodiment of the present invention is determined in library It is more acurrate from database synchronization time delay.
In order to determine in master-slave database data synchronization process primary database data-pushing time delay and be returned from database data Time delay is put, on the basis of the above embodiments, in embodiments of the present invention, the second event monitoring modular 14 is also used to work as When monitoring the binary file event local from database write-in, Xiang Suoshu first processing module 15 sends third instruction letter Breath, the third, which indicates to carry in information, is written local binary file Event Timestamp;
The first processing module 15, be also used to be executed according to the primary database event timestamp and write-in local two into File event timestamp processed determines the data-pushing time delay of master-slave database;According to said write local binary file event Timestamp and from Database Events execute timestamp, determine from database data play back time delay.
Hook Function in second event monitoring modular 14 can also monitor that local binary system text is written from database 12 Part event, when second event monitoring modular 14 monitors that local binary file event is written from database 12, at first It manages module 15 and sends third instruction information, third, which indicates to carry in information, is written local binary file Event Timestamp.
After first processing module 15 receives third instruction information, the write-in local binary system in third instruction information is obtained File event timestamp will be written local binary file Event Timestamp and subtract primary database event execution timestamp Obtain the data-pushing time delay of master-slave database.Timestamp will be executed from Database Events subtracts the local binary file thing of write-in Part timestamp can be obtained from database data and play back time delay.
Since master-slave database adheres to two equipment separately, in order to guarantee that first processing module 15 can receive second event monitoring The second indication information and third that module 14 is sent indicate information, and on the basis of the various embodiments described above, Fig. 2 is that the present invention is implemented The system structure diagram for the determination master-slave database synchronization delayed time that example provides, the system also includes: Second processing module 16;
The Second processing module 16 is connect with the second event monitoring modular 14 and first processing module 15 respectively;
The second event monitoring modular 14 is believed specifically for sending second instruction to the Second processing module 16 Breath and the third indicate information;
The Second processing module 16, for sending the second indication information and described to the first processing module 15 Third indicates information.
It in embodiments of the present invention, include first processing module 15 and Second processing module 16, the first processing mould in system Block 15 and primary database 11, the deployment of first event monitoring modular 13 within one device, Second processing module 16 and from database 12, second event monitoring modular 14 is deployed in another equipment.First processing module 15 and Second processing module 16 pass through net Network connection can carry out data interaction.
Second event monitoring modular 14 sends to Second processing module 16 and carries when monitoring to execute event from database The second indication information that timestamp is executed from Database Events, when monitoring that local binary file event is written from database When, it is sent to Second processing module 16 and carries the third instruction information that local binary file Event Timestamp is written.
In embodiments of the present invention, first processing module 15 and Second processing module 16 are periodically same by heartbeat message Event information is walked, that is, synchronous first instruction information, second indication information and third indicate information.Specifically, in the present invention In embodiment, second indication information and third instruction information are sent to first processing module 15 by Second processing module 16, by the One processing module 15 is according to the timestamp carried respectively in the first instruction information, second indication information and third instruction information, really Determine master-slave database synchronization delayed time, the data-pushing time delay of master-slave database and plays back time delay from database data.
In addition, first processing module 15 and Second processing module 16 periodically pass through heartbeat message synchronous event information, It is also possible to first processing module 15 and first instruction information is sent to Second processing module 16, specifically, implements in the present invention In example, the first processing module 15 is also used to send the first instruction information to the Second processing module 16;
The Second processing module 16 is also used to execute timestamp and the primary database from Database Events according to described Event executes timestamp, determines master-slave database synchronization delayed time;Timestamp and write-in are executed originally according to the primary database event Ground binary file Event Timestamp determines the data-pushing time delay of master-slave database;According to said write local binary system text Part Event Timestamp and from Database Events execute timestamp, determine from database data play back time delay.
Second processing module 16 determines master-slave database synchronization delayed time, the data-pushing time delay of master-slave database and from data The process of library data readback time delay determines that master-slave database synchronization delayed time, the data of master-slave database push away with first processing module 15 It send time delay identical with the process from database data playback time delay, is no longer repeated herein.
In order to make the data-pushing time delay of determining master-slave database synchronization delayed time, master-slave database and from database data It is more acurrate to play back time delay, on the basis of the various embodiments described above, in embodiments of the present invention, the first event monitoring modular 13, it is specifically used within the preset time cycle, when monitoring that the primary database data update every time, the processing of Xiang Suoshu first Module 15 sends the first instruction information, is carried in each first instruction information when the Global ID of time update event is corresponding with the ID Primary database event executes timestamp;
The second event monitoring modular 14 was specifically used within the preset time cycle, monitored every time described When executing event from database, Xiang Suoshu first processing module 15 sends second indication information, takes in each second indication information Band executes timestamp from Database Events when the Global ID of time update event is corresponding with the ID;It monitors every time described from data When local binary file event is written in library, Xiang Suoshu first processing module 15 sends third and indicates information, each third instruction It is carried in information when the local binary file Event Timestamp of the Global ID of time update event write-in corresponding with the ID;
The first processing module 15, be specifically used for being executed according to the corresponding primary database event of each ID timestamp and from Database Events execute timestamp, determine master-slave database synchronization delayed time;It is executed according to the corresponding primary database event of each ID Timestamp and the local binary file Event Timestamp of write-in, determine the data-pushing time delay of master-slave database;According to each ID The local binary file Event Timestamp of corresponding write-in and timestamp is executed from Database Events, determines and returned from database data Put time delay.
The embodiment of the present invention utilizes the characteristic of the unique ID of MySQL database event, and principal and subordinate's number can be determined more accurately Time delay is played back according to library synchronization delayed time, the data-pushing time delay of master-slave database and from database data.Wherein, MySQL database The characteristic of the unique ID of event be in same secondary data updating process, the ID of primary database data update event, primary database to The ID and the ID from database data playback event for pushing more new data from database are identical and unique.
In embodiments of the present invention, first event monitoring modular 13 monitors main number within the preset time cycle every time When updating according to library data, all it can indicate to carry in information when secondary to first processing module transmission the first instruction information, each first The Global ID of update event primary database event corresponding with the ID executes timestamp.
Such as the preset time cycle is 10 seconds, within this 10 seconds preset time cycle, first event monitors mould Block 13 monitors 5 primary database data update events altogether, then 5 first instruction information are sent into first processing module 15, It is carried in each first instruction information when the ID and primary database event of secondary primary database data update event execute timestamp. It should be noted that event id be by it is incremental rule generate, for example, the ID of first time primary database data update event be 1, The ID of second of primary database data update event is 2, and the ID of third time primary database data update event is 3 etc..
Second event monitoring modular 14 is within the preset time cycle, when monitoring to execute event from database every time, Second indication information can be sent to first processing module 15, and the Global ID when time update event is carried in each second indication information Timestamp is executed with from Database Events;It, also can be to the when monitoring that local binary file event is written from database every time One processing module 15 sends third and indicates information, and Global ID and the ID when time update event are carried in each third instruction information The local binary file Event Timestamp of corresponding write-in.
Also be illustrated with above-mentioned example, if the preset time cycle is 10 seconds, the preset time cycle this 10 In second, first event monitoring modular 13 monitors 5 primary database data update events altogether, then second event monitoring modular 14 can monitor local binary file event to be written from database from database execution event and 5 times 5 times.With primary main number Event is executed according to library data update event, from database and Global ID's phase of local binary file event is written from database Together.
It is corresponding according to the ID for each ID after first processing module 15 receives each ID and corresponding timestamp Primary database event executes timestamp and executes timestamp from Database Events, can determine the corresponding candidate principal and subordinate's data of the ID Then library synchronization delayed time calculates the average value of each candidate master-slave database synchronization delayed time, obtains master-slave database synchronization delayed time. For example, candidate master-slave database synchronization delayed time is P, then master-slave database synchronization delayed time be AVG (P)=(P1+P2+P3+ ...+ Pn)/n, in formula, n is the event times monitored in the preset time cycle.For each ID, according to the corresponding main number of the ID Timestamp is executed according to library event and local binary file Event Timestamp is written, and can determine the corresponding candidate principal and subordinate's number of the ID According to the data-pushing time delay in library, the average value of the data-pushing time delay of each candidate master-slave database is then calculated, principal and subordinate is obtained The data-pushing time delay of database.For example, the data-pushing time delay of candidate master-slave database is R, then data of master-slave database Push time delay is AVG (R)=(R1+R2+R3+ ...+Rn)/n, and in formula, n is the event time monitored in the preset time cycle Number.For each ID, when being executed according to the local binary file Event Timestamp of the corresponding write-in of the ID and from Database Events Between stab, can determine the ID it is corresponding it is candidate play back time delay from database data, then calculate each candidate from database data The average value for playing back time delay obtains playing back time delay from database data.For example, candidate play back time delay for D, then from database data Time delay is played back as AVG (D)=(D1+D2+D3+ ...+Dn)/n from database data, and in formula, n is prison in the preset time cycle The event times measured.
In addition, being delayed when determining each candidate, can also be obtained finally by calculating the variance of each candidate time delay Time delay, the process only need to by candidate time delay substitute into formula of variance can be obtained, no longer the process is repeated herein.
Since in embodiments of the present invention, first processing module 15 calculates master-slave database synchronization delayed time, master-slave database Data-pushing time delay and while being played back from database data be delayed, be delayed according to the candidate of multiple events in the preset time cycle Average value or the methods of variance determine final time delay, determining master-slave database synchronization delayed time, principal and subordinate's number can be made It is more acurrate that time delay is played back according to the data-pushing time delay in library and from database data.
On the basis of the various embodiments described above, in embodiments of the present invention, the first processing module 15, being specifically used for will Global ID's primary database event corresponding with the ID of the update event carried in each first instruction information executes timestamp and adds It is added to the first log list;The Global ID of the update event carried in each second indication information is corresponding with the ID from data Library event executes timestamp and is added to the second log list;The Global ID for the update event that each third is indicated to carry in information The local binary file Event Timestamp of write-in corresponding with the ID is added to third log list;
The first processing module 15 arranges first log list, the second log specifically for the delay when determining Data in table and third log list are sheared old to the old list of corresponding first log, the old list of the second log and third log List;Master is determined respectively according to the data in the old list of first log, the old list of the second log and the old list of third log Time delay is played back from database synchronization time delay, the data-pushing time delay of master-slave database and from database data.
In embodiments of the present invention, three consistent lists of preservation information format are preserved in first processing module 15, point It is not the first log list, the second log list and third log list, these three lists include that the Global ID of event, event are held Row timestamp and binary log filename, binary log file storage location.First log list be primary database Event log list is submitted, the second log list is that list of thing has been executed from database, and third log list is from database Local binary file event log list is written.
It, will the update that carry in each first instruction information after first processing module 15 receives each first instruction information The Global ID of event primary database event corresponding with the ID executes timestamp and is added to the first log list.Receive each It is after two instruction information, the Global ID of the update event carried in each second indication information is corresponding with the ID from database thing Part executes timestamp and is added to the second log list.After receiving each third instruction information, each third is indicated in information The local binary file Event Timestamp of the Global ID of the update event of carrying write-in corresponding with the ID is added to third log List.
It is delayed when first processing module 15 determines, needs to load the first log list, the second log list and third day Data in will list, when receiving the first instruction information, second indication information and third instruction information, it is also desirable to by these Indicating that the data in information are added in corresponding log list, this just will appear two operations and competes three log lists, from And will affect performance and load log list that data are added to corresponding log list, determine the performance of time delay.
To solve the above-mentioned problems, in embodiments of the present invention, first processing module 15 determines that the process of time delay is divided into two A stage: affairs freeze stage and calculation stages.
Freeze the stage in affairs, is also set up in first processing module 15 there are three the old list of log, be the first log respectively Old list, the old list of the second log and the old list of third log, within the preset time cycle, first processing module 15 will be each Global ID's primary database event corresponding with the ID of the update event carried in first instruction information executes timestamp and is added to First log list, the Global ID of the update event carried in each second indication information is corresponding with the ID from database thing Part executes timestamp and is added to the second log list, by the Global ID of the update event carried in each third instruction information and is somebody's turn to do The local binary file Event Timestamp of the corresponding write-in of ID is added to after third log list, and first processing module 15 is by the Data in one log list, the second log list and third log list are sheared to the old list of corresponding first log, second The old list of log and the old list of third log.Namely the data in the first log list are sheared to the old list of the first log, Data in the old list of second log are sheared to the old list of the second log, the data in the old list of third log are sheared to The old list of three logs.
In calculation stages, first processing module 15 is according to the old list of the first log, the old list of the second log and third log Data in old list determine master-slave database synchronization delayed time, the data-pushing time delay of master-slave database and respectively from database numbers According to playback time delay.Specifically, according to the complete of the update event carried in the instruction information of each of old list of the first log first Office ID primary database event corresponding with the ID executes each second indication information in timestamp and the old list of the second log The Global ID of the update event of middle carrying is corresponding with the ID to execute timestamp from Database Events, determines that master-slave database is synchronous Time delay.Global ID according to the update event carried in the instruction information of each of old list of the first log first is corresponding with the ID Primary database event execute the update thing carried in each third instruction information in timestamp and the old list of third log The local binary file Event Timestamp of the Global ID of part write-in corresponding with the ID, when determining the data-pushing of master-slave database Prolong.Global ID according to the update event carried in each second indication information in the old list of the second log is corresponding with the ID The update event carried in each third instruction information in timestamp and the old list of third log is executed from Database Events The local binary file Event Timestamp of corresponding with the ID write-in of Global ID, determine from database data and play back time delay.Its The middle each time delay of determination can be determined using the method averaged, and be also possible to determine using the method for seeking variance, specifically Method is same as the previously described embodiments, is no longer repeated herein.
First processing module 15 the data-pushing time delay for determining master-slave database synchronization delayed time, master-slave database and from Database data is delayed when playing back, can will be in the old list of the first log, the old list of the second log and the old list of third log Data dump falls.It can guarantee the delay when determining next time cycle, the old list of the first log, the old column of the second log in this way Data in table and the old list of third log are empty.
Due in embodiments of the present invention, the delay when determining of first processing module 15, by the first log list, second day Data in will list and third log list were sheared to the old list of corresponding first log, the old list of the second log and third day The old list of will;Master is determined respectively according to the data in the old list of the first log, the old list of the second log and the old list of third log Time delay is played back from database synchronization time delay, the data-pushing time delay of master-slave database and from database data.It in this way can be to avoid The problem of process of data write-in log list and the process of calculation delay compete three log lists, therefore will not influence data It is added to the performance and load log list of corresponding log list, determines the performance of time delay.
On the basis of the various embodiments described above, in embodiments of the present invention, the first processing module 15 is also used to pre- If time cycle in, in event, if the Global ID in the first log list comprising update event and this ID pairs The primary database event answered executes timestamp, and data are sky in third log list, determines data-pushing exception;If third day The local binary file Event Timestamp of Global ID's write-in corresponding with the ID in will list comprising update event, the second log Data are sky in list, determine data readback exception;When data-pushing frequency of abnormity reaches preset first threshold, output the One warning message exports the second warning message when data readback frequency of abnormity reaches preset second threshold.
In embodiments of the present invention, within the preset time cycle, first processing module 15 is directed to each update event, point Do not judge whether the data in the first log list, the second log list and third log list are empty, if the first log arranges Global ID's primary database event corresponding with the ID in table comprising update event executes timestamp, data in third log list For sky, then illustrate that the more new data of primary database does not push to normally from database, can determine data-pushing exception at this time. If the local binary file event time of Global ID's write-in corresponding with the ID in third log list comprising update event It stabs, data are sky in the second log list, illustrate that the more new data of primary database has become function and pushes to from database, still at this time More new data is played back from database and not successfully, can determine data readback exception at this time.
Preset first threshold and preset second threshold are preserved in first processing module 15, wherein preset first threshold Value and preset second threshold can be identical or different, for example, preset first threshold and preset second threshold can all be 2.Within the preset time cycle, first processing module 15 judges whether data-pushing frequency of abnormity reaches preset first threshold Value, exports the first warning message, the first warning message can be acoustic information, image information or text information if reaching Etc., as long as system data push exception can be characterized.First processing module 15 judges whether data readback frequency of abnormity reaches To preset second threshold, the second warning message is exported if reaching, the second warning message is also possible to acoustic information, image Information or text information etc., but to be distinguished with the first alarm, the second warning message is returned for that can characterize system data Put exception.
Due in embodiments of the present invention, first processing module 15 is when judging that data-pushing frequency of abnormity reaches preset the When one threshold value, the first warning message is exported, when judging that data readback frequency of abnormity reaches preset second threshold, output second Warning message, user can confirm which link breaks down according to the warning message that first processing module 15 exports, and in time It solves the problems, such as.
On the basis of the various embodiments described above, Fig. 3 is determining master-slave database synchronization delayed time provided in an embodiment of the present invention Process schematic, the process the following steps are included:
S101: the first instruction letter that the carrying primary database event that first event monitoring modular is sent executes timestamp is received The carrying that breath and second event monitoring modular are sent executes the second indication information of timestamp from Database Events;Wherein, described First instruction information is that the first event monitoring module monitors are sent when updating to primary database data, second instruction Information is the second event monitoring module monitors to sending when executing event from database.
S102: timestamp and primary database event execution timestamp are executed from Database Events according to described, is determined Master-slave database synchronization delayed time.
The system for determining master-slave database synchronization delayed time includes primary database, from database, first event monitoring modular, Two event monitoring modules and first processing module.Primary database and from database can be principal and subordinate's data in MySQL database Library, first event monitoring modular and second event monitoring modular can be the database plug-in unit including Hook Function, first event Monitoring modular and second event monitoring modular are enabled when master-slave database starts respectively, and monitor principal and subordinate's number by Hook Function According to library event, such as first event monitoring module monitors primary database data update event, second event monitoring module monitors from Database execution event etc..
In embodiments of the present invention, when first event monitoring module monitors are updated to primary database data, to the first processing Module sends the first instruction information, carries primary database event in the first instruction information and executes timestamp, primary database event is held Row timestamp characterizes the timestamp that primary database submits update event.Second event monitoring module monitors are held to described from database When acting part, second indication information is sent to first processing module, is carried in second indication information from when Database Events execution Between stab, from Database Events execute timestamp characterization from database be completed update data readback after timestamp.
After first processing module receives the first instruction information and second indication information, the master in the first instruction information is obtained Database Events execute the slave Database Events in timestamp and second indication information and execute timestamp, then with from database thing Part executes timestamp and subtracts primary database event execution timestamp, obtains master-slave database synchronization delayed time.
Since in embodiments of the present invention, whether first event monitoring modular real-time monitoring primary database has data update, When having monitored update, is sent to first processing module and carries the first instruction information that primary database event executes timestamp, After primary database data update, data update event can be executed from database, and second event monitoring modular real-time monitoring is from data Whether library executes event, when monitoring to execute event from database, sends and is carried from Database Events to first processing module Execute the second indication information of timestamp.First processing module executes timestamp and primary database event according to from Database Events Timestamp is executed, can determine master-slave database synchronization delayed time.The master-slave database synchronization delayed time determined in this way is master data There are the time of data update event to the time that completion is updated from database data, therefore the master that the embodiment of the present invention is determined in library It is more acurrate from database synchronization time delay.
In order to determine in master-slave database data synchronization process primary database data-pushing time delay and be returned from database data Time delay is put, on the basis of the various embodiments described above, in embodiments of the present invention, the method also includes:
Receive the third that local binary file Event Timestamp is written in the carrying that the second event monitoring modular is sent Indicate information, wherein the third instruction information is that the second event monitoring module monitors are written originally to described from database It is sent when ground binary file event;
Timestamp is executed according to the primary database event and local binary file Event Timestamp is written, and determines principal and subordinate The data-pushing time delay of database;When being executed according to said write local binary file Event Timestamp and from Database Events Between stab, determine from database data play back time delay.
Hook Function in second event monitoring modular can also monitor that local binary file thing is written from database Part is sent out when second event monitoring module monitors are to from database write-in local binary file event to first processing module Third is sent to indicate information, third, which indicates to carry in information, is written local binary file Event Timestamp.
After first processing module receives third instruction information, the write-in local binary system text in third instruction information is obtained Part Event Timestamp will be written local binary file Event Timestamp and subtract primary database event execution timestamp, can obtain To the data-pushing time delay of master-slave database.Timestamp will be executed from Database Events subtracts the local binary file event of write-in Timestamp can be obtained from database data and play back time delay.
In order to make the data-pushing time delay of determining master-slave database synchronization delayed time, master-slave database and from database data It is more acurrate to play back time delay, on the basis of the various embodiments described above, in embodiments of the present invention, receives first event monitoring modular hair The carrying that the carrying primary database event sent executes the first instruction information of timestamp, second event monitoring modular is sent is from data Local binary file thing is written in the carrying that library event executes the second indication information of timestamp, second event monitoring modular is sent The third of part timestamp indicates that information includes:
Within the preset time cycle, the Global ID that time update event is worked as in the carrying that first event monitoring modular is sent is received Primary database event corresponding with the ID executes each of timestamp the first instruction information;Second event monitoring modular is received to send Carrying execute the second instruction of each of timestamp when the Global ID of time update event is corresponding with the ID from Database Events and believe Breath;Receive carrying that second event monitoring modular is sent when the write-in corresponding with ID of the Global ID of time update event locally two into Each third of file event timestamp processed indicates information;
Timestamp and primary database event execution timestamp are executed from Database Events according to described, determines principal and subordinate's number Timestamp is executed according to library synchronization delayed time, according to the primary database event and local binary file Event Timestamp is written, really Determine the data-pushing time delay of master-slave database, according to said write local binary file Event Timestamp and from Database Events Timestamp is executed, determines that playing back time delay from database data includes:
Timestamp is executed according to the corresponding primary database event of each ID and executes timestamp from Database Events, determines master From database synchronization time delay;Timestamp is executed according to the corresponding primary database event of each ID and local binary file thing is written Part timestamp determines the data-pushing time delay of master-slave database;According to the local binary file event of the corresponding write-in of each ID Timestamp and from Database Events execute timestamp, determine from database data play back time delay.
The embodiment of the present invention utilizes the characteristic of the unique ID of MySQL database event, and principal and subordinate's number can be determined more accurately Time delay is played back according to library synchronization delayed time, the data-pushing time delay of master-slave database and from database data.Wherein, MySQL database The characteristic of the unique ID of event be in same secondary data updating process, the ID of primary database data update event, primary database to The ID and the ID from database data playback event for pushing more new data from database are identical and unique.
In embodiments of the present invention, first event monitoring modular monitors master data within the preset time cycle every time When library data update, the first instruction information can be all sent to first processing module, is carried in each first instruction information when time more The Global ID of new events primary database event corresponding with the ID executes timestamp.
Second event monitoring modular when monitoring to execute event from database every time, also can within the preset time cycle Send second indication information to first processing module, carry in each second indication information when time update event Global ID and from Database Events execute timestamp;It, also can be at first when monitoring that local binary file event is written from database every time It manages module and sends third instruction information, carried in each third instruction information when the Global ID of time update event is corresponding with the ID Local binary file Event Timestamp is written.
After first processing module receives each ID and corresponding timestamp, for each ID, according to the corresponding master of the ID Database Events execute timestamp and execute timestamp from Database Events, can determine the corresponding candidate master-slave database of the ID Then synchronization delayed time calculates the average value of each candidate master-slave database synchronization delayed time, obtains master-slave database synchronization delayed time.Example Such as, candidate master-slave database synchronization delayed time be P, then master-slave database synchronization delayed time be AVG (P)=(P1+P2+P3+ ...+ Pn)/n, in formula, n is the event times monitored in the preset time cycle.For each ID, according to the corresponding main number of the ID Timestamp is executed according to library event and local binary file Event Timestamp is written, and can determine the corresponding candidate principal and subordinate's number of the ID According to the data-pushing time delay in library, the average value of the data-pushing time delay of each candidate master-slave database is then calculated, principal and subordinate is obtained The data-pushing time delay of database.For example, the data-pushing time delay of candidate master-slave database is R, then data of master-slave database Push time delay is AVG (R)=(R1+R2+R3+ ...+Rn)/n, and in formula, n is the event time monitored in the preset time cycle Number.For each ID, when being executed according to the local binary file Event Timestamp of the corresponding write-in of the ID and from Database Events Between stab, can determine the ID it is corresponding it is candidate play back time delay from database data, then calculate each candidate from database data The average value for playing back time delay obtains playing back time delay from database data.For example, candidate play back time delay for D, then from database data Time delay is played back as AVG (D)=(D1+D2+D3+ ...+Dn)/n from database data, and in formula, n is prison in the preset time cycle The event times measured.
In addition, being delayed when determining each candidate, can also be obtained finally by calculating the variance of each candidate time delay Time delay, the process only need to by candidate time delay substitute into formula of variance can be obtained, no longer the process is repeated herein.
Due in embodiments of the present invention, first processing module calculates master-slave database synchronization delayed time, master-slave database Data-pushing time delay and while playing back from database data, are delayed, according to the candidate delay of multiple events in the preset time cycle The methods of average value or variance determine final time delay, can make determining master-slave database synchronization delayed time, principal and subordinate's data The data-pushing time delay in library and from database data playback time delay it is more acurrate.
On the basis of the various embodiments described above, in embodiments of the present invention, the first instruction information, second indication information is received After indicating information with third, determines master-slave database synchronization delayed time, the data-pushing time delay of master-slave database and determine from number Before library data readback time delay, the method also includes:
Global ID's primary database event corresponding with the ID of the update event carried in each first instruction information is held Row timestamp is added to the first log list;By the Global ID of the update event carried in each second indication information and this ID pairs The slave Database Events answered execute timestamp and are added to the second log list;Each third is indicated to the update thing carried in information The local binary file Event Timestamp of the Global ID of part write-in corresponding with the ID is added to third log list;
It determines master-slave database synchronization delayed time, the data-pushing time delay of master-slave database and determines and played back from database data Time delay includes:
The data in first log list, the second log list and third log list are cut in the delay when determining It is switched to the old list of corresponding first log, the old list of the second log and the old list of third log;According to the old column of the first log Data in table, the old list of the second log and the old list of third log determine master-slave database synchronization delayed time, principal and subordinate's data respectively The data-pushing time delay in library and from database data play back time delay.
In embodiments of the present invention, three consistent lists of preservation information format are preserved in first processing module, respectively It is the first log list, the second log list and third log list, these three lists include the Global ID of event, event execution Timestamp and binary log filename, binary log file storage location.First log list is that primary database has mentioned Event log list is handed over, the second log list is that list of thing has been executed from database, and third log list is from database write Enter local binary file event log list.
It, will the update thing that carry in each first instruction information after first processing module receives each first instruction information The Global ID of part primary database event corresponding with the ID executes timestamp and is added to the first log list.Receive each second It is after indicating information, the Global ID of the update event carried in each second indication information is corresponding with the ID from Database Events It executes timestamp and is added to the second log list.After receiving each third instruction information, each third is indicated to take in information The local binary file Event Timestamp of the Global ID of the update event of band write-in corresponding with the ID is added to third log column Table.
The delay when first processing module determines needs to load the first log list, the second log list and third log Data in list, when receiving the first instruction information, second indication information and third instruction information, it is also desirable to refer to these Showing that the data in information are added in corresponding log list, this just will appear two operations and competes three log lists, thus It will affect performance and load log list that data are added to corresponding log list, determine the performance of time delay.
To solve the above-mentioned problems, in embodiments of the present invention, first processing module determines that the process of time delay is divided into two Stage: affairs freeze stage and calculation stages.
Freeze the stage in affairs, is also set up in first processing module there are three the old list of log, be that the first log is old respectively List, the old list of the second log and the old list of third log, first processing module by the first log list, the second log list and Data in third log list are sheared to the old list of corresponding first log, the old list of the second log and the old column of third log Table.
In calculation stages, first processing module is old according to the old list of the first log, the old list of the second log and third log Data in list determine master-slave database synchronization delayed time, the data-pushing time delay of master-slave database and respectively from database datas Play back time delay.It wherein determines that each time delay can be determined using the method averaged, is also possible to using the method for seeking variance It determines, specific method is same as the previously described embodiments, is no longer repeated herein.
First processing module is in the data-pushing time delay for determining master-slave database synchronization delayed time, master-slave database and from number It is delayed when according to library data readback, it can be by the number in the old list of the first log, the old list of the second log and the old list of third log According to disposing.It can guarantee the delay when determining next time cycle, the old list of the first log, the old list of the second log in this way It is empty with the data in the old list of third log.
Due in embodiments of the present invention, first processing module delay when determining, by the first log list, the second log Data in list and third log list are sheared to the old list of corresponding first log, the old list of the second log and third log Old list;Principal and subordinate is determined respectively according to the data in the old list of the first log, the old list of the second log and the old list of third log Database synchronization time delay, the data-pushing time delay of master-slave database and from database data play back time delay.It in this way can be to avoid number The problem of competing three log lists according to the process of write-in log list and the process of calculation delay, therefore will not influence data and add It is added to the performance and load log list of corresponding log list, determines the performance of time delay.
On the basis of the various embodiments described above, in embodiments of the present invention, the method also includes:
Within the preset time cycle, in an event, if complete comprising update event in the first log list Office ID primary database event corresponding with the ID executes timestamp, and data are sky in third log list, determines that data-pushing is different Often;If when Global ID's corresponding with ID write-in local binary file event in third log list comprising update event Between stab, in the second log list data be sky, determine data readback exception;When data-pushing frequency of abnormity reaches preset first When threshold value, the first warning message is exported, when data readback frequency of abnormity reaches preset second threshold, exports the second alarm signal Breath.
In embodiments of the present invention, within the preset time cycle, first processing module is directed to each update event, respectively Judge whether the data in the first log list, the second log list and third log list are sky, if the first log list In Global ID's corresponding with ID primary database event execution timestamp comprising update event, data are in third log list Sky then illustrates that the more new data of primary database does not push to normally from database, can determine data-pushing exception at this time.Such as The local binary file Event Timestamp of Global ID's write-in corresponding with the ID in fruit third log list comprising update event, Data are sky in second log list, illustrate that the more new data of primary database has become function and pushes to from database at this time, but from Database simultaneously plays back more new data not successfully, can determine data readback exception at this time.
Preset first threshold and preset second threshold are preserved in first processing module, wherein preset first threshold Can be identical or different with preset second threshold, for example, preset first threshold and preset second threshold can all be 2. Within the preset time cycle, first processing module judges whether data-pushing frequency of abnormity reaches preset first threshold, such as Fruit reaches, and exports the first warning message, and the first warning message can be acoustic information, image information or text information etc., As long as system data push exception can be characterized.First processing module judges whether data readback frequency of abnormity reaches preset Second threshold, exports the second warning message if reaching, the second warning message be also possible to acoustic information, image information or Text information etc., but to be distinguished with the first alarm, the second warning message is abnormal for that can characterize system data playback.
Judge that data-pushing frequency of abnormity reaches preset first since in embodiments of the present invention, first processing module is worked as When threshold value, the first warning message is exported, when judging that data readback frequency of abnormity reaches preset second threshold, the second report of output Alert information, user can confirm which link breaks down according to the warning message that first processing module exports, and solve in time Problem.
Fig. 4 is event information collecting flowchart schematic diagram provided in an embodiment of the present invention, as shown in figure 4, information collection starts Afterwards, registration primary database event log submit and rollback monitoring Hook Function, and register from Database Events log write-in and Play back the Hook Function of monitoring.The binary log having been filed on that the monitoring Hook Function of primary database will test is sent to One processing module, the binary log write-in information and binary log playback that will test from the monitoring Hook Function of database Information is sent to Second processing module, and information is written in binary log by Second processing module and binary log plays back information It is sent to first processing module.First processing module parses event log information, specifically, being directed to each information, judges the letter Whether breath is that main Database Events submit information, if so, the information is stored in the first log list, that is, primary database is Event log list is submitted, if not, judging whether the information is that information is written from database binary log, if so, will The information is stored in third log list, that is, local binary file event log list is written from database, if not, sentencing Whether the information of breaking is to play back information from database binary log, if so, the information is stored in the second log list, also It is to have executed list of thing from database.
Fig. 5 is determining time delay flow diagram provided in an embodiment of the present invention, as shown in figure 5, into calculating cycle, also It is to enter the preset time cycle, in an event, judging whether there is includes update event in the first log list Global ID's primary database event corresponding with the ID executes timestamp, and data are empty situation in third log list, if so, It determines data-pushing exception, when data-pushing frequency of abnormity reaches preset first threshold, exports the first warning message.Judgement With the presence or absence of the local binary file event of Global ID's write-in corresponding with the ID in third log list including update event Timestamp, data are empty situation in the second log list, if so, determining that data readback is abnormal;When data readback is extremely secondary When number reaches preset second threshold, the second warning message is exported.If there is no abnormal conditions, by the first log list, Data in two log lists and third log list are sheared to the old list of corresponding first log, the old list of the second log and The old list of three logs.According to the data in the data and the old list of the second log in the old list of the first log, principal and subordinate's number is determined According to library synchronization delayed time.According to the data in the data and the old list of third log in the old list of the first log, principal and subordinate's number is determined According to the data-pushing time delay in library.According to the data in the data and the old list of third log in the old list of the second log, determine Time delay is played back from database data.Then the calculating cycle of next round is waited again.
Fig. 6 is the apparatus structure schematic diagram of determining master-slave database synchronization delayed time provided in an embodiment of the present invention, the device Include:
Receiving module 61, the carrying primary database event for receiving the transmission of first event monitoring modular execute timestamp The carrying that first instruction information and second event monitoring modular are sent executes the second indication information of timestamp from Database Events; Wherein, the first instruction information is that the first event monitoring module monitors are sent when updating to primary database data, institute Stating second indication information is the second event monitoring module monitors to sending when executing event from database;
Determining module 62, when for executing timestamp and primary database event execution from Database Events according to Between stab, determine master-slave database synchronization delayed time.
The receiving module 61 is also used to receive the carrying that the second event monitoring modular is sent and local binary system is written The third of file event timestamp indicates information, wherein the third instruction information is the second event monitoring module monitors To it is described from database local binary file event is written when send;
The determining module 62 is also used to execute timestamp according to the primary database event and local binary system text is written Part Event Timestamp determines the data-pushing time delay of master-slave database;According to said write local binary file event time It stabs and executes timestamp from Database Events, determine from database data and play back time delay.
The receiving module 61 was specifically used within the preset time cycle, received what first event monitoring modular was sent It carries when the Global ID of time update event primary database event corresponding with the ID executes each of timestamp the first instruction information; The carrying that second event monitoring modular is sent is received to hold when the Global ID of time update event is corresponding with the ID from Database Events Each second indication information of row timestamp;Receive the Global ID that time update event is worked as in the carrying that second event monitoring modular is sent Each third that local binary file Event Timestamp is written corresponding with the ID indicates information;
The determining module 62 is specifically used for executing timestamp according to the corresponding primary database event of each ID and from data Library event executes timestamp, determines master-slave database synchronization delayed time;The time is executed according to the corresponding primary database event of each ID Stamp and the local binary file Event Timestamp of write-in, determine the data-pushing time delay of master-slave database;It is corresponding according to each ID Write-in local binary file Event Timestamp and from Database Events execute timestamp, determine from database data play back when Prolong.
Described device further include:
The Global ID of adding module 63, the update event for will carry in each first instruction information is corresponding with the ID Primary database event executes timestamp and is added to the first log list;By the update event carried in each second indication information Global ID is corresponding with the ID to be added to the second log list from Database Events execution timestamp;Each third is indicated into information The local binary file Event Timestamp of the Global ID of the update event of middle carrying write-in corresponding with the ID is added to third day Will list;
The determining module 62, specifically for the delay when determining, by first log list, the second log list and Data in third log list are sheared to the old list of corresponding first log, the old list of the second log and the old column of third log Table;Principal and subordinate is determined respectively according to the data in the old list of first log, the old list of the second log and the old list of third log Database synchronization time delay, the data-pushing time delay of master-slave database and from database data play back time delay.
Described device further include:
Alarm module 64 was used within the preset time cycle, in an event, if wrapped in the first log list Global ID's primary database event corresponding with the ID containing update event executes timestamp, and data are sky in third log list, Determine data-pushing exception;If Global ID's write-in corresponding with the ID local two in third log list comprising update event Binary file Event Timestamp, data are sky in the second log list, determine data readback exception;When data-pushing frequency of abnormity When reaching preset first threshold, the first warning message is exported, when data readback frequency of abnormity reaches preset second threshold, Export the second warning message.
On the basis of the various embodiments described above, a kind of electronic equipment is additionally provided in the embodiment of the present invention, as shown in fig. 7, It include: processor 701, communication interface 702, memory 703 and communication bus 704, wherein processor 701, communication interface 702, Memory 703 completes mutual communication by communication bus 704;
It is stored with computer program in the memory 703, when described program is executed by the processor 701, so that The processor 701 executes following steps:
Receive first event monitoring modular send carryings primary database event execute timestamp first instruction information with The carrying that second event monitoring modular is sent executes the second indication information of timestamp from Database Events;Wherein, described first Instruction information is that the first event monitoring module monitors are sent when updating to primary database data, the second indication information The second event monitoring module monitors to from database execute event when send;
Timestamp and primary database event execution timestamp are executed from Database Events according to described, determines principal and subordinate's number According to library synchronization delayed time.
Based on the same inventive concept, a kind of electronic equipment is additionally provided in the embodiment of the present invention, due to above-mentioned electronic equipment The principle solved the problems, such as is similar to the method for master-slave database synchronization delayed time is determined, therefore the implementation of above-mentioned electronic equipment can be joined The implementation of square method, overlaps will not be repeated.
Electronic equipment provided in an embodiment of the present invention be specifically as follows desktop computer, portable computer, smart phone, Tablet computer, personal digital assistant (Personal Digital Assistant, PDA), network side equipment etc..
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication interface 702 is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit, network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal Processing, DSP), dedicated collection At circuit, field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hard Part component etc..
When processor executes the program stored on memory in embodiments of the present invention, realizes and receive first event monitoring The carrying primary database event that module is sent executes the first instruction information of timestamp and taking for second event monitoring modular transmission Band executes the second indication information of timestamp from Database Events;Wherein, the first instruction information is the first event prison Module monitors are surveyed to what is sent when the update of primary database data, the second indication information is the second event monitoring modular prison It measures and is sent when executing event from database.Timestamp and the primary database event are executed from Database Events according to described Timestamp is executed, determines master-slave database synchronization delayed time.The master-slave database synchronization delayed time determined in this way is that primary database has The time of data update event to the time that completion is updated from database data, therefore principal and subordinate's number that the embodiment of the present invention is determined It is more acurrate according to library synchronization delayed time.
On the basis of the various embodiments described above, the embodiment of the invention also provides a kind of computers to store readable storage medium Matter is stored with the computer program that can be executed by electronic equipment in the computer readable storage medium, when described program is in institute It states when being run on electronic equipment, so that the electronic equipment realizes following steps when executing:
Receive first event monitoring modular send carryings primary database event execute timestamp first instruction information with The carrying that second event monitoring modular is sent executes the second indication information of timestamp from Database Events;Wherein, described first Instruction information is that the first event monitoring module monitors are sent when updating to primary database data, the second indication information The second event monitoring module monitors to from database execute event when send;
Timestamp and primary database event execution timestamp are executed from Database Events according to described, determines principal and subordinate's number According to library synchronization delayed time.
Based on the same inventive concept, a kind of computer readable storage medium is additionally provided in the embodiment of the present invention, due to place The principle and determine principal and subordinate that reason device is solved the problems, such as in the computer program stored on executing above-mentioned computer readable storage medium The method of database synchronization time delay is similar, therefore processor is in the computer journey for executing above-mentioned computer-readable recording medium storage The implementation of sequence may refer to the implementation of method, and overlaps will not be repeated.
Above-mentioned computer readable storage medium can be any usable medium that the processor in electronic equipment can access Or data storage device, including but not limited to magnetic storage such as floppy disk, hard disk, tape, magneto-optic disk (MO) etc., optical memory Such as CD, DVD, BD, HVD and semiconductor memory such as ROM, EPROM, EEPROM, nonvolatile memory (NAND FLASH), solid state hard disk (SSD) etc..
Computer program, computer program quilt are provided in the computer readable storage medium provided in embodiments of the present invention When processor executes, realize that receiving the first of the carrying primary database event execution timestamp that first event monitoring modular is sent refers to Show that carrying that information and second event monitoring modular are sent executes the second indication information of timestamp from Database Events;Wherein, The first instruction information is that the first event monitoring module monitors are sent when updating to primary database data, described second Instruction information be the second event monitoring module monitors arrive from database execution event when send.According to described from database Event executes timestamp and the primary database event executes timestamp, determines master-slave database synchronization delayed time.It determines in this way Master-slave database synchronization delayed time be primary database have time of data update event to updated from database data complete when Between, therefore the master-slave database synchronization delayed time that the embodiment of the present invention is determined is more acurrate.
The embodiment of the invention provides system, method and the storage medium of a kind of determining master-slave database synchronization delayed time, institutes The system of stating includes primary database and from database, the system also includes: first event monitoring modular, second event monitoring modular And first processing module;The first event monitoring modular is connect with the primary database and the first processing module respectively; The second event monitoring modular is connect with described from database and the first processing module respectively;The first event monitoring Module, for when monitoring that the primary database data update, Xiang Suoshu first processing module to send the first instruction information, institute It states and carries primary database event execution timestamp in the first instruction information;The second event monitoring modular is monitored for working as Described when executing event from database, Xiang Suoshu first processing module sends second indication information, in the second indication information It carries from Database Events and executes timestamp;The first processing module, for executing the time from Database Events according to described Stamp and the primary database event execute timestamp, determine master-slave database synchronization delayed time.
Since in embodiments of the present invention, whether first event monitoring modular real-time monitoring primary database has data update, When having monitored update, is sent to first processing module and carries the first instruction information that primary database event executes timestamp, After primary database data update, data update event can be executed from database, and second event monitoring modular real-time monitoring is from data Whether library executes event, when monitoring to execute event from database, sends and is carried from Database Events to first processing module Execute the second indication information of timestamp.First processing module executes timestamp and primary database event according to from Database Events Timestamp is executed, can determine master-slave database synchronization delayed time.The master-slave database synchronization delayed time determined in this way is master data There are the time of data update event to the time that completion is updated from database data, therefore the master that the embodiment of the present invention is determined in library It is more acurrate from database synchronization time delay.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (13)

1. a kind of system of determining master-slave database synchronization delayed time, the system comprises primary database and from database, feature It is, the system also includes: first event monitoring modular, second event monitoring modular and first processing module;
The first event monitoring modular is connect with the primary database and the first processing module respectively;The second event Monitoring modular is connect with described from database and the first processing module respectively;
The first event monitoring modular, for when monitoring that the primary database data update, Xiang Suoshu first to handle mould Block sends the first instruction information, carries primary database event in the first instruction information and executes timestamp;
The second event monitoring modular, for when monitoring the execution event from database, Xiang Suoshu first to handle mould Block sends second indication information, carries in the second indication information from Database Events and executes timestamp;
The first processing module, for executing timestamp and primary database event execution from Database Events according to described Timestamp determines master-slave database synchronization delayed time.
2. the system as claimed in claim 1, which is characterized in that the second event monitoring modular is also used to monitor institute It states when local binary file event is written from database, Xiang Suoshu first processing module sends third and indicates information, and described the It is carried in three instruction information and local binary file Event Timestamp is written;
The first processing module is also used to execute timestamp according to the primary database event and local binary file is written Event Timestamp determines the data-pushing time delay of master-slave database;According to said write local binary file Event Timestamp Timestamp is executed with from Database Events, determines from database data and plays back time delay.
3. system as claimed in claim 2, which is characterized in that the system also includes: Second processing module;
The Second processing module is connect with the second event monitoring modular and first processing module respectively;
The second event monitoring modular is specifically used for sending the second indication information and described to the Second processing module Third indicates information;
The Second processing module, for sending the second indication information and third instruction to the first processing module Information.
4. system as claimed in claim 3, which is characterized in that the first processing module is also used to the second processing Module sends the first instruction information;
The Second processing module is also used to be held according to described from Database Events execution timestamp and the primary database event Row timestamp determines master-slave database synchronization delayed time;According to the primary database event execute timestamp and write-in local two into File event timestamp processed determines the data-pushing time delay of master-slave database;According to said write local binary file event Timestamp and from Database Events execute timestamp, determine from database data play back time delay.
5. system as claimed in claim 2, which is characterized in that the first event monitoring modular is specifically used for preset In time cycle, when monitoring that the primary database data update every time, Xiang Suoshu first processing module sends the first instruction letter Breath, each first indicates to be carried in information when the Global ID of time update event primary database event corresponding with the ID executes the time Stamp;
The second event monitoring modular was specifically used within the preset time cycle, monitored every time described from data When library executes event, Xiang Suoshu first processing module sends second indication information, carries in each second indication information when time more The Global ID of new events is corresponding with the ID to execute timestamp from Database Events;This is written from database described in monitoring every time When ground binary file event, Xiang Suoshu first processing module sends third and indicates information, carries in each third instruction information When the local binary file Event Timestamp of the Global ID of secondary update event write-in corresponding with the ID;
The first processing module is specifically used for executing timestamp according to the corresponding primary database event of each ID and from database Event executes timestamp, determines master-slave database synchronization delayed time;Timestamp is executed according to the corresponding primary database event of each ID With the local binary file Event Timestamp of write-in, the data-pushing time delay of master-slave database is determined;It is corresponding according to each ID Local binary file Event Timestamp is written and executes timestamp from Database Events, determines from when database data playback Prolong.
6. system as claimed in claim 5, which is characterized in that the first processing module, specifically for each first is referred to Show that the Global ID of the update event carried in information primary database event corresponding with the ID executes timestamp and is added to first Will list;The Global ID of the update event carried in each second indication information is corresponding with the ID from Database Events execution Timestamp is added to the second log list;The Global ID for the update event that each third is indicated to carry in information is corresponding with the ID Write-in local binary file Event Timestamp be added to third log list;
The first processing module, specifically for the delay when determining, by first log list, the second log list and Data in three log lists are sheared to the old list of corresponding first log, the old list of the second log and the old list of third log; Principal and subordinate's data are determined respectively according to the data in the old list of first log, the old list of the second log and the old list of third log Library synchronization delayed time, the data-pushing time delay of master-slave database and from database data play back time delay.
7. system as claimed in claim 6, which is characterized in that the first processing module was also used in preset week time In phase, in an event, if in the first log list including Global ID's master data corresponding with the ID of update event Library event executes timestamp, and data are sky in third log list, determines data-pushing exception;If wrapped in third log list The local binary file Event Timestamp of Global ID containing update event write-in corresponding with the ID, data in the second log list For sky, data readback exception is determined;When data-pushing frequency of abnormity reaches preset first threshold, the first alarm signal is exported Breath exports the second warning message when data readback frequency of abnormity reaches preset second threshold.
8. a kind of method of determining master-slave database synchronization delayed time, which is characterized in that the described method includes:
Receive the first instruction information and second that the carrying primary database event that first event monitoring modular is sent executes timestamp The carrying that event monitoring module is sent executes the second indication information of timestamp from Database Events;Wherein, first instruction Information is that the first event monitoring module monitors are sent when updating to primary database data, and the second indication information is institute Second event monitoring module monitors are stated to sending when executing event from database;
Timestamp and primary database event execution timestamp are executed from Database Events according to described, determines master-slave database Synchronization delayed time.
9. method according to claim 8, which is characterized in that the method also includes:
Receive the third instruction that local binary file Event Timestamp is written in the carrying that the second event monitoring modular is sent Information, wherein the third instruction information is the second event monitoring module monitors to described from database write-in local two It is sent when binary file event;
Timestamp is executed according to the primary database event and local binary file Event Timestamp is written, and determines principal and subordinate's data The data-pushing time delay in library;The time is executed according to said write local binary file Event Timestamp and from Database Events Stamp determines from database data and plays back time delay.
10. method as claimed in claim 9, which is characterized in that receive the carrying master data that first event monitoring modular is sent The carrying that library event executes the first instruction information of timestamp, second event monitoring modular is sent executes the time from Database Events The third of local binary file Event Timestamp is written in the carrying that the second indication information of stamp, second event monitoring modular are sent Indicate that information includes:
Within the preset time cycle, the carrying for receiving the transmission of first event monitoring modular is worked as the Global ID of time update event and is somebody's turn to do The corresponding primary database event of ID executes each of timestamp the first instruction information;Receive taking for second event monitoring modular transmission Band is when the Global ID of time update event each second indication information for executing timestamp from Database Events corresponding with the ID;It connects Receive the local binary system text of Global ID's write-in corresponding with the ID that time update event is worked as in the carrying that second event monitoring modular is sent Each third of part Event Timestamp indicates information;
Timestamp and primary database event execution timestamp are executed from Database Events according to described, determines master-slave database Synchronization delayed time executes timestamp according to the primary database event and local binary file Event Timestamp is written, and determines master It is executed from the data-pushing time delay of database, according to said write local binary file Event Timestamp and from Database Events Timestamp determines that playing back time delay from database data includes:
Timestamp is executed according to the corresponding primary database event of each ID and executes timestamp from Database Events, determines principal and subordinate's number According to library synchronization delayed time;When executing timestamp according to the corresponding primary database event of each ID and local binary file event be written Between stab, determine the data-pushing time delay of master-slave database;According to the local binary file event time of the corresponding write-in of each ID It stabs and executes timestamp from Database Events, determine from database data and play back time delay.
11. method as claimed in claim 10, which is characterized in that receive the first instruction information, second indication information and third After indicating information, determines master-slave database synchronization delayed time, the data-pushing time delay of master-slave database and determine from database number Before playback time delay, the method also includes:
When Global ID's primary database event corresponding with the ID of the update event carried in each first instruction information is executed Between stamp be added to the first log list;The Global ID of the update event carried in each second indication information is corresponding with the ID Timestamp, which is executed, from Database Events is added to the second log list;The update event that each third is indicated to carry in information The local binary file Event Timestamp of Global ID's write-in corresponding with the ID is added to third log list;
It determines master-slave database synchronization delayed time, the data-pushing time delay of master-slave database and determines from database data and play back time delay Include:
The delay when determining, by the data in first log list, the second log list and third log list shear to The old list of corresponding first log, the old list of the second log and the old list of third log;According to the old list of first log, Data in the old list of two logs and the old list of third log determine the number of master-slave database synchronization delayed time, master-slave database respectively Time delay is played back according to push time delay and from database data.
12. method as claimed in claim 11, which is characterized in that the method also includes:
Within the preset time cycle, in an event, if in the first log list including the Global ID of update event Primary database event corresponding with the ID executes timestamp, and data are sky in third log list, determines data-pushing exception;Such as The local binary file Event Timestamp of Global ID's write-in corresponding with the ID in fruit third log list comprising update event, Data are sky in second log list, determine data readback exception;When data-pushing frequency of abnormity reaches preset first threshold When, the first warning message is exported, when data readback frequency of abnormity reaches preset second threshold, exports the second warning message.
13. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium Program realizes claim 8-12 described in any item method and steps when the computer program is executed by processor.
CN201811584312.6A 2018-12-24 2018-12-24 System, method and storage medium for determining synchronization delay of master database and slave database Active CN109684410B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811584312.6A CN109684410B (en) 2018-12-24 2018-12-24 System, method and storage medium for determining synchronization delay of master database and slave database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811584312.6A CN109684410B (en) 2018-12-24 2018-12-24 System, method and storage medium for determining synchronization delay of master database and slave database

Publications (2)

Publication Number Publication Date
CN109684410A true CN109684410A (en) 2019-04-26
CN109684410B CN109684410B (en) 2021-06-15

Family

ID=66188298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811584312.6A Active CN109684410B (en) 2018-12-24 2018-12-24 System, method and storage medium for determining synchronization delay of master database and slave database

Country Status (1)

Country Link
CN (1) CN109684410B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110430091A (en) * 2019-07-09 2019-11-08 上海易点时空网络有限公司 Suitable for the principal and subordinate's time delay monitoring method and device of redis, storage medium
CN111342945A (en) * 2020-02-19 2020-06-26 广东乐心医疗电子股份有限公司 Master-slave communication method and device
CN112395181A (en) * 2019-08-13 2021-02-23 福建天泉教育科技有限公司 System and method for testing timeliness of metadata remote multi-activity
WO2023123956A1 (en) * 2021-12-31 2023-07-06 郑州云海信息技术有限公司 Io full-lifecycle latency monitoring method and related apparatus

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064860A (en) * 2011-10-21 2013-04-24 阿里巴巴集团控股有限公司 Database high availability implementation method and device
CN103500229A (en) * 2013-10-24 2014-01-08 北京奇虎科技有限公司 Database synchronization method and database system
CN105589797A (en) * 2015-09-17 2016-05-18 中国银联股份有限公司 Method for synchronous data time delay detection between master database and slave database
WO2016195781A1 (en) * 2015-05-29 2016-12-08 Oracle International Corporation Elimination of log file synchronization delay at transaction commit time
CN106453297A (en) * 2016-09-30 2017-02-22 努比亚技术有限公司 Master and slave time delay detection method, device and system
CN106528803A (en) * 2016-11-14 2017-03-22 武汉斗鱼网络科技有限公司 Method and apparatus for monitoring MongoDB database object replication delay
CN106649577A (en) * 2016-11-17 2017-05-10 杭州沃趣科技股份有限公司 Method for detecting running state of synchronous software of Oracle database
CN107766575A (en) * 2017-11-14 2018-03-06 中国联合网络通信集团有限公司 The data bank access method and device of read and write abruption
CN107957933A (en) * 2017-12-05 2018-04-24 泰康保险集团股份有限公司 The monitoring method and device of data duplication
CN108121782A (en) * 2017-12-18 2018-06-05 新华三云计算技术有限公司 Distribution method, database middleware system and the electronic equipment of inquiry request
CN108319617A (en) * 2017-01-17 2018-07-24 阿里巴巴集团控股有限公司 Determine the method, apparatus and method for handover control, device of database principal and subordinate's difference

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064860A (en) * 2011-10-21 2013-04-24 阿里巴巴集团控股有限公司 Database high availability implementation method and device
CN103500229A (en) * 2013-10-24 2014-01-08 北京奇虎科技有限公司 Database synchronization method and database system
WO2016195781A1 (en) * 2015-05-29 2016-12-08 Oracle International Corporation Elimination of log file synchronization delay at transaction commit time
CN105589797A (en) * 2015-09-17 2016-05-18 中国银联股份有限公司 Method for synchronous data time delay detection between master database and slave database
CN106453297A (en) * 2016-09-30 2017-02-22 努比亚技术有限公司 Master and slave time delay detection method, device and system
CN106528803A (en) * 2016-11-14 2017-03-22 武汉斗鱼网络科技有限公司 Method and apparatus for monitoring MongoDB database object replication delay
CN106649577A (en) * 2016-11-17 2017-05-10 杭州沃趣科技股份有限公司 Method for detecting running state of synchronous software of Oracle database
CN108319617A (en) * 2017-01-17 2018-07-24 阿里巴巴集团控股有限公司 Determine the method, apparatus and method for handover control, device of database principal and subordinate's difference
CN107766575A (en) * 2017-11-14 2018-03-06 中国联合网络通信集团有限公司 The data bank access method and device of read and write abruption
CN107957933A (en) * 2017-12-05 2018-04-24 泰康保险集团股份有限公司 The monitoring method and device of data duplication
CN108121782A (en) * 2017-12-18 2018-06-05 新华三云计算技术有限公司 Distribution method, database middleware system and the electronic equipment of inquiry request

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110430091A (en) * 2019-07-09 2019-11-08 上海易点时空网络有限公司 Suitable for the principal and subordinate's time delay monitoring method and device of redis, storage medium
CN112395181A (en) * 2019-08-13 2021-02-23 福建天泉教育科技有限公司 System and method for testing timeliness of metadata remote multi-activity
CN111342945A (en) * 2020-02-19 2020-06-26 广东乐心医疗电子股份有限公司 Master-slave communication method and device
CN111342945B (en) * 2020-02-19 2022-09-27 广东乐心医疗电子股份有限公司 Master-slave communication method and device
WO2023123956A1 (en) * 2021-12-31 2023-07-06 郑州云海信息技术有限公司 Io full-lifecycle latency monitoring method and related apparatus

Also Published As

Publication number Publication date
CN109684410B (en) 2021-06-15

Similar Documents

Publication Publication Date Title
CN109684410A (en) A kind of system, method and the storage medium of determining master-slave database synchronization delayed time
US11755414B2 (en) Data recovery using bitmap data structure
CN102834811B (en) Multi-cascade backup procedure
CN111177165B (en) Method, device and equipment for detecting data consistency
CN107209704A (en) Detect the write-in lost
CN105824846B (en) Data migration method and device
TW201019149A (en) Method and apparatus for merging EDA coverage logs of coverage data
CN108460598A (en) A kind of real-time automation supervision reporting system based on double-strand framework block chain
CN105426410A (en) Data acquisition system and analytic method for same
CN103631967B (en) A kind of processing method and processing device of the tables of data with independent increment identification field
CN106933843A (en) database heartbeat detecting method and device
CN106453297A (en) Master and slave time delay detection method, device and system
CN109284331B (en) Certificate making information acquisition method based on service data resources, terminal equipment and medium
CN110058962A (en) Determine the method, equipment and computer program product of the consistency level of virtual machine snapshot
TW202008147A (en) Compression processing method and apparatus for block chain data
CN112100275A (en) Data synchronization method, system and electronic equipment
CN115080275A (en) Twin service assembly based on real-time data model and method thereof
CN113535665B (en) Method and device for synchronizing log files between main database and standby database
CN110895545A (en) Shared data synchronization method and device
CN111078418B (en) Operation synchronization method, device, electronic equipment and computer readable storage medium
CN108459927A (en) A kind of data back up method, device and server
CN104731786A (en) Data management method and device for rail transit comprehensive monitoring system
CN111274255A (en) Service data monitoring method and system, monitoring architecture, equipment and storage medium
CN110430091A (en) Suitable for the principal and subordinate's time delay monitoring method and device of redis, storage medium
US10956369B1 (en) Data aggregations in a distributed environment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant