CN107741965A - Database synchronization processing method, device, computing device and computer-readable storage medium - Google Patents
Database synchronization processing method, device, computing device and computer-readable storage medium Download PDFInfo
- Publication number
- CN107741965A CN107741965A CN201710923159.4A CN201710923159A CN107741965A CN 107741965 A CN107741965 A CN 107741965A CN 201710923159 A CN201710923159 A CN 201710923159A CN 107741965 A CN107741965 A CN 107741965A
- Authority
- CN
- China
- Prior art keywords
- data
- synchronized
- database
- buffering area
- primary database
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F16/275—Synchronous replication
Abstract
The invention discloses a kind of database synchronization processing method, device, computing device and computer-readable storage medium, wherein, database synchronization processing method includes:Data to be synchronized in primary database are write into primary database buffering area, and in primary database buffering area for the data to be synchronized that are write set corresponding to timestamp;And according to the data to be synchronized write in primary database buffering area, data transfer to be synchronized is recorded to from database, and updating synchrodata from data base buffer.According to technical scheme provided by the invention, by for data to be synchronized set corresponding to timestamp, effectively the synchrodata record from database can be updated, data to be synchronized are clearly recorded from primary database buffer transfer to the transmission situation from database, the transmission of data cover formula is helped avoid, improves database synchronization treatment effeciency.
Description
Technical field
The present invention relates to Internet technical field, and in particular to a kind of database synchronization processing method, device, computing device
And computer-readable storage medium.
Background technology
Many database purchase schemes in the prior art be present, in some storage schemes, database includes primary database
Need to be synchronized to from database with least one data from database, primary database.By taking Redis storage schemes as an example,
By the data syn-chronization in primary database to from during database, it is necessary to which first the data in primary database are write to main number
According to the data in the buffering area of storehouse, then write in foundation primary database buffering area, by data syn-chronization extremely from database.But one
Denier due to network such as disconnects at the reason and when causing the synchronization process to disconnect, then need again to write the data of primary database to main number
Data transfer is re-started according to first data in the buffering area of storehouse, then write since primary database buffering area, from
And cause synchronization process to complete the data of transmission before disconnecting and be also required to re-start transmission.It will expend in this process
Many unnecessary times, thus there is database synchronization treatment effeciency it is low the problem of.
The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome above mentioned problem or at least in part solve on
State database synchronization processing method, device, computing device and the computer-readable storage medium of problem.
According to an aspect of the invention, there is provided a kind of database synchronization processing method, this method include:
Data to be synchronized in primary database are write into primary database buffering area, and are in primary database buffering area
Timestamp corresponding to the data to be synchronized setting write;And
The data to be synchronized write in foundation primary database buffering area, by data transfer to be synchronized extremely from database,
And synchrodata record is being updated from data base buffer.
According to another aspect of the present invention, there is provided a kind of database synchronization processing unit, the device include:
Writing module, suitable for the data to be synchronized in primary database are write into primary database buffering area, and in main number
According in the buffering area of storehouse for the data to be synchronized that are write set corresponding to timestamp;
Transport module, suitable for the data to be synchronized write in foundation primary database buffering area, by data transfer to be synchronized
To from database;And
Update module, suitable for updating synchrodata record from data base buffer.
According to another aspect of the invention, there is provided a kind of computing device, including:Processor, memory, communication interface and
Communication bus, processor, memory and communication interface complete mutual communication by communication bus;
Memory is used to deposit an at least executable instruction, and executable instruction makes at the above-mentioned database synchronization of computing device
Operated corresponding to reason method.
In accordance with a further aspect of the present invention, there is provided a kind of computer-readable storage medium, be stored with least one in storage medium
Executable instruction, executable instruction make computing device be operated as corresponding to above-mentioned database synchronization processing method.
According to technical scheme provided by the invention, the data to be synchronized in primary database are write to primary database buffering area
In, and in primary database buffering area for the data to be synchronized that are write set corresponding to timestamp, then according to primary database
The data to be synchronized write in buffering area, by data transfer to be synchronized extremely from database, and from data base buffer
Update synchrodata record.Technical scheme provided by the invention by for data to be synchronized set corresponding to timestamp, Neng Gouyou
Effect ground is updated to the synchrodata record from database, clearly records data to be synchronized from primary database buffer transfer
To the transmission situation from database, the transmission of data cover formula is helped avoid, improves database synchronization treatment effeciency.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention,
And can be practiced according to the content of specification, and in order to allow above and other objects of the present invention, feature and advantage can
Become apparent, below especially exemplified by the embodiment of the present invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, it is various other the advantages of and benefit it is common for this area
Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention
Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 shows the schematic flow sheet of database synchronization processing method according to an embodiment of the invention;
Fig. 2 shows the schematic flow sheet of database synchronization processing method in accordance with another embodiment of the present invention;
Fig. 3 shows the schematic flow sheet of the database synchronization processing method according to another embodiment of the invention;
Fig. 4 shows the structured flowchart of database synchronization processing unit according to an embodiment of the invention;
Fig. 5 shows the structured flowchart of database synchronization processing unit in accordance with another embodiment of the present invention;
Fig. 6 shows a kind of structural representation of computing device according to embodiments of the present invention.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
Completely it is communicated to those skilled in the art.
Fig. 1 shows the schematic flow sheet of database synchronization processing method according to an embodiment of the invention, such as Fig. 1 institutes
Show, this method comprises the following steps:
Step S100, the data to be synchronized in primary database are write into primary database buffering area, and in primary database
In buffering area for the data to be synchronized that are write set corresponding to timestamp.
In the prior art, primary database has primary database buffering area, and is buffered from database and without corresponding
Area, in order that being able to record that synchrodata records from database, the present invention is from data lab setting from data base buffer, is used for
Store synchrodata record.Method provided by the invention is according to primary database buffering area possessed by primary database and is from number
Performed according to lab setting from data base buffer.
When needing to synchronize, the data to be synchronized in primary database are write into primary database buffering area, in addition,
For the ease of determining synchronously to resume position, to be synchronized data setting pair of the present invention also in primary database buffering area to be write
The timestamp answered.Specifically, be provided with corresponding timestamp for each data to be synchronized, therefore, data to be synchronized and when
Between stab correspond.Wherein, the accuracy of set timestamp is microsecond rank.
Those skilled in the art can according to be actually needed the specific set-up mode of selection for data to be synchronized setting corresponding to
Timestamp, do not limit herein.For example, can be by predetermined symbol by the data content of data to be synchronized and set timestamp
Make a distinction and come, specifically, predetermined symbol can be added after the data content of data to be synchronized, then predetermined symbol it
Timestamp corresponding to setting afterwards, it follows that for certain data to be synchronized, the content before predetermined symbol is to be synchronized for this
The data content of data, the content after predetermined symbol are corresponding timestamp.Those skilled in the art can be according to being actually needed
Predetermined symbol is set, not limited herein.For example, predetermined symbol can be three single quotation marks.
Step S101, according to the data to be synchronized write in primary database buffering area, by data transfer to be synchronized to from
In database, and synchrodata record is being updated from data base buffer.
Specifically, according to the write sequence of data to be synchronized in primary database buffering area, by data transfer to be synchronized to from
In database, and synchrodata record is being updated from data base buffer.Wherein, synchrodata record is completed according to current
The situation of transmission carries out real-time update.Specifically, synchrodata record includes:The current data to be synchronized for completing transmission and
Corresponding timestamp.
For example, after data 1 to be synchronized are transmitted to from database, from the synchrodata record in data base buffer
Synchrodata record 1 is updated to, wherein, synchrodata record 1 includes data 1 to be synchronized and corresponding timestamp time1;Connect
, after data 2 to be synchronized are transmitted to from database, be updated to from the synchrodata record 1 in data base buffer same
Step data record 2, wherein, synchrodata record 2 includes data 2 to be synchronized and corresponding timestamp time2.Pass through this side
Formula can it clearly and effectively record data to be synchronized from primary database buffer transfer to the transmission situation from database.
Specifically, can be from the data to be synchronized received from database when data transfer to be synchronized is to from database
In filter out timestamp, only the data content of data to be synchronized is stored to from database, without by corresponding to data to be synchronized
Timestamp is stored to from database, is gone storage time to stab so as to consume from the memory space of database, is avoided from number
According to the waste of the memory space in storehouse.For example, it is that default symbol is added after the data content of data to be synchronized in the step s 100
Number, then set after the predetermined symbol corresponding to timestamp, then when data transfer to be synchronized is to from database, from
The content that database can be only taken from the data to be synchronized received before predetermined symbol is (in the data of data i.e. to be synchronized
Hold) stored, and the content (timestamp corresponding to data i.e. to be synchronized) after predetermined symbol is abandoned.
The database synchronization processing method provided according to the present embodiment, the data to be synchronized in primary database are write to master
In data base buffer, and in primary database buffering area for the data to be synchronized that are write set corresponding to timestamp, then
According to the data to be synchronized write in primary database buffering area, by data transfer to be synchronized to from database, and from number
Recorded according to synchrodata is updated in the buffering area of storehouse.When technical scheme provided by the invention is by for corresponding to data to be synchronized setting
Between stab, can clearly record data to be synchronized from master data effectively to be updated from the synchrodata of database record
Storehouse buffer transfer helps avoid the transmission of data cover formula, improves database synchronization processing to the transmission situation from database
Efficiency.
Fig. 2 shows the schematic flow sheet of database synchronization processing method in accordance with another embodiment of the present invention, such as Fig. 2
Shown, this method comprises the following steps:
Step S200, the data to be synchronized in primary database are write into primary database buffering area, and in primary database
In buffering area for the data to be synchronized that are write set corresponding to timestamp.
When needing to synchronize, the data to be synchronized in primary database are write into primary database buffering area, in order to
It is easy to determine synchronously to resume position, the present invention is also in primary database buffering area corresponding to the data to be synchronized setting that is write
Timestamp.Specifically, corresponding timestamp, therefore, data to be synchronized and timestamp are provided with for each data to be synchronized
Correspond.Wherein, the accuracy of set timestamp is microsecond rank.
Step S201, record, determined in primary database buffering area same according to from the synchrodata in data base buffer
Step resumes position.
When by data transfer to be synchronized to from database, synchrodata note is being have updated from data base buffer
Record, then recorded according to from the synchrodata in data base buffer, can be effectively and rapidly in primary database buffering area
It is determined that synchronously resume position.Specifically, recorded according to synchrodata, inquiry and synchrodata record in primary database buffering area
The data to be synchronized to match, so that it is determined that synchronously resuming position.
, also can be effectively and rapidly when recovering after synchronization process is interrupted again using method provided by the invention
Determine synchronously to resume position in primary database buffering area, then according to the transmission for synchronously resuming position and continuing data to be synchronized,
Without re-starting data transfer first data being write since primary database buffering area.Specifically, in network
When interruption, synchronization process is interrupted, and data to be synchronized will be unable to continue to transmit to from database, extensive in synchronization process
When multiple, due to have recorded synchrodata record from data base buffer, therefore it can delay in step s 201 according to from database
The synchrodata record rushed in area, determines synchronously to resume position in primary database buffering area.
Step S202, position is synchronously resumed according to identified, by the data transfer to be synchronized in primary database buffering area
Recorded to from database, and updating synchrodata from data base buffer.
After determining and synchronously resuming position, then position is synchronously resumed according to identified, by primary database buffering area
Data to be synchronized continue to transmit to from database, and synchrodata record is being updated from data base buffer, so as to i.e.
Make when synchronization process is recovered without again writing the data of primary database into primary database buffering area, more need not be from master
First data write in data base buffer start to re-start data transfer.Wherein, synchrodata record includes:When
The preceding data to be synchronized for completing transmission and corresponding timestamp.
The database synchronization processing method provided according to the present embodiment, can clearly record data to be synchronized from master data
Storehouse buffer transfer effectively determines synchronously to resume position to from the transmission situation of database, and according to synchronously resume position after
It is continuous to carry out data transmission, delay when synchronization process is recovered without again writing the data of primary database to primary database
Rush in area, data transfer is re-started first data that need not be more write since primary database buffering area, so as to keep away
The transmission of data cover formula is exempted from, has improved database synchronization treatment effeciency, optimize database synchronization processing mode.
Fig. 3 shows the schematic flow sheet of the database synchronization processing method according to another embodiment of the invention, such as Fig. 3
Shown, this method comprises the following steps:
Step S300, the data to be synchronized in primary database are write into primary database buffering area, and in primary database
In buffering area for the data to be synchronized that are write set corresponding to timestamp.
Method provided by the invention is according to primary database buffering area possessed by primary database and is from data lab setting
Performed from data base buffer.For the ease of determining synchronously to resume position, the present invention is institute in primary database buffering area
Timestamp corresponding to the data to be synchronized setting of write-in.Specifically, it is provided with the corresponding time for each data to be synchronized
Stamp.Wherein, the accuracy of set timestamp is microsecond rank so that data to be synchronized can correspond with timestamp.
Step S301, the data to be synchronized in primary database buffering area and corresponding timestamp are transmitted to from database
In.
When synchronizing processing, according to the write sequence of data to be synchronized in primary database buffering area, by primary database
Data to be synchronized and corresponding timestamp in buffering area are transmitted to from database, are treated together from what is received from database
Data to be synchronized are extracted in step data and corresponding timestamp to be stored.
Step S302, according to the current data to be synchronized for completing transmission and corresponding timestamp, buffered from database
Synchrodata record is updated in area.
Wherein, synchrodata is recorded for recording the current data to be synchronized for completing transmission, and synchrodata record may include:
The current data to be synchronized for completing transmission and corresponding timestamp.It is assumed that the current data to be synchronized for completing transmission are same to treat
Step data 2, then timestamp corresponding to data 2 and data to be synchronized 2 to be synchronized can be recorded in synchrodata record
time2。
Step S303, synchrodata record is read from from data base buffer.
For example, when recovering after synchronization process is interrupted again, in order to determine synchronously to resume position, it is necessary to from from database
Synchrodata record is read in buffering area.
Step S304, data to be synchronized and corresponding time according to the current completion transmission in synchrodata record
Stamp, the data to be synchronized that inquiry matches with synchrodata record in primary database buffering area.
After it have read synchrodata record, inquiry and synchrodata record match in primary database buffering area
Data to be synchronized.Specifically, the data to be synchronized to match with synchrodata record are corresponding timestamp and synchrodata
The data to be synchronized of timestamp unanimously recorded in record, or, the data to be synchronized to match with synchrodata record are
Corresponding timestamp and synchrodata record recorded in timestamp is consistent and data content recorded with synchrodata in institute
The consistent data to be synchronized of the data content of the data to be synchronized of record.It is excellent because data to be synchronized and timestamp correspond
Selection of land, it is consistent with the timestamp recorded in synchrodata record that corresponding timestamp can be inquired about in primary database buffering area
Data to be synchronized.
Step S305, the data to be synchronized to match with synchrodata record obtained according to inquiry, delays in primary database
Rush in area and determine synchronously to resume position.
Specifically, can be in primary database buffering area by position corresponding with the data to be synchronized that match of synchrodata record
Put and be defined as synchronously resuming position.
Step S306, position is synchronously resumed according to identified, by the data transfer to be synchronized in primary database buffering area
To from database.
For example, be written with successively in primary database buffering area data 1 to be synchronized, data to be synchronized 2, data to be synchronized 3,
Data 4 and data to be synchronized 5 to be synchronized etc., the data to be synchronized to match with synchrodata record for inquiring about to obtain are to be synchronized
Data 3, then position corresponding to data 3 to be synchronized is defined as synchronously resuming position in primary database buffering area, then according to
Position is synchronously resumed, successively transmits the data to be synchronized 4 in primary database buffering area and data to be synchronized 5 etc. to from database
In, and after each data to be synchronized completes transmission, synchrodata record is being updated from data base buffer, so as to right
The current data to be synchronized for completing transmission are recorded.
In addition, in the case of synchronization process generation interruption is unrecovered for a long time, write-in is needed in primary database to master
The data to be synchronized of data base buffer, which are possible to override, does not complete the to be synchronized of transmission currently in primary database buffering area
Data.In order to solve this problem, alternatively, when needed in primary database write-in to primary database buffering area data to be synchronized
When will override the data to be synchronized of current unfinished transmission in primary database buffering area, the storage to primary database buffering area
Space is expanded, and the memory space expanded will override current unfinished biography in primary database buffering area for writing those
The data to be synchronized of defeated data to be synchronized, so as to solve the current number to be synchronized for not completing transmission in primary database buffering area
According to it is capped the problem of.Those skilled in the art can be configured according to being actually needed to the size of the memory space of expansion, this
Place does not limit.Synchronization process recovery after, according to synchrodata record in current completion transmission data to be synchronized and
Corresponding timestamp determines synchronously to resume position, is then resumed according to synchronously resuming position.Alternatively, when primary database is delayed
, can depositing extended primary database buffering area when rushing the data to be synchronized write in area and all transmitting to from database
The size in storage space reverts to the size of the memory space of original primary database buffering area.
According to the present embodiment provide database synchronization processing method, pass through recorded current completion transmission data and
Corresponding timestamp can quickly and accurately determine synchronously to resume position, and continue data biography according to position is synchronously resumed
It is defeated, so as to avoid the transmission of data cover formula, the time needed for database synchronization processing is greatly reduced, improves database
Synchronization process efficiency, optimize database synchronization processing mode.
Fig. 4 shows the structured flowchart of database synchronization processing unit according to an embodiment of the invention, wherein, the dress
Put according to primary database buffering area possessed by primary database and be being run from data base buffer from data lab setting.
As shown in figure 4, the device includes:Writing module 410, transport module 420 and update module 430.
Writing module 410 is suitable to:Data to be synchronized in primary database are write into primary database buffering area, and in master
In data base buffer for the data to be synchronized that are write set corresponding to timestamp.
Transport module 420 is suitable to:According to the data to be synchronized write in primary database buffering area, data to be synchronized are passed
Transport to from database.
Update module 430 is suitable to:Synchrodata record is being updated from data base buffer.
Wherein, synchrodata record includes:The current data to be synchronized for completing transmission and corresponding timestamp.
According to the present embodiment provide database synchronization processing unit, by for data to be synchronized set corresponding to the time
Stamp, effectively the synchrodata record from database can be updated, clearly record data to be synchronized from primary database
Buffer transfer helps avoid the transmission of data cover formula, improves database synchronization processing effect to the transmission situation from database
Rate.
Fig. 5 shows the structured flowchart of database synchronization processing unit in accordance with another embodiment of the present invention, wherein, should
Device is according to primary database buffering area possessed by primary database and is being transported from data base buffer from data lab setting
OK.As shown in figure 5, the device includes:Setup module 510, writing module 520, transport module 530 and update module 540.
Setup module 510 is suitable to:From data lab setting from data base buffer, to be recorded for storing synchrodata.
Writing module 520 is suitable to:Data to be synchronized in primary database are write into primary database buffering area, and in master
In data base buffer for the data to be synchronized that are write set corresponding to timestamp.Wherein, set timestamp is accurate
Spend for microsecond rank.Data to be synchronized correspond with timestamp.
Transport module 530 is suitable to:According to the data to be synchronized write in primary database buffering area, data to be synchronized are passed
Transport to from database
Alternatively, transport module 530 is further adapted for:Recorded according to from the synchrodata in data base buffer, in master
Determine synchronously to resume position in data base buffer;And position is synchronously resumed according to identified, by primary database buffering area
In data transfer to be synchronized to from database.
Alternatively, transport module 530 is further adapted for:Synchrodata record is read from from data base buffer;Foundation
The data to be synchronized of current completion transmission in synchrodata record and corresponding timestamp, are looked into primary database buffering area
Ask the data to be synchronized to match with synchrodata record;Matching with synchrodata record for being obtained according to inquiry is to be synchronized
Data, determine synchronously to resume position in primary database buffering area.
Alternatively, transport module 530 is further adapted for:By data to be synchronized in primary database buffering area and corresponding
Timestamp is transmitted to from database.
Update module 540 is suitable to:According to the current data to be synchronized for completing transmission and corresponding timestamp, from data
Synchrodata record is updated in the buffering area of storehouse.
According to the present embodiment provide database synchronization processing unit, pass through recorded current completion transmission data and
Corresponding timestamp can quickly and accurately determine synchronously to resume position, and continue data biography according to position is synchronously resumed
It is defeated, so as to avoid the transmission of data cover formula, the time needed for database synchronization processing is greatly reduced, improves database
Synchronization process efficiency, optimize database synchronization processing mode.
Present invention also offers a kind of nonvolatile computer storage media, computer-readable storage medium is stored with least one can
Execute instruction, the computer executable instructions can perform the database synchronization processing method in above-mentioned any means embodiment.
Fig. 6 shows a kind of structural representation of computing device according to embodiments of the present invention, the specific embodiment of the invention
The specific implementation to computing device does not limit.
As shown in fig. 6, the computing device can include:Processor (processor) 602, communication interface
(Communications Interface) 604, memory (memory) 606 and communication bus 608.
Wherein:
Processor 602, communication interface 604 and memory 606 complete mutual communication by communication bus 608.
Communication interface 604, for being communicated with the network element of miscellaneous equipment such as client or other servers etc..
Processor 602, for configuration processor 610, it can specifically perform in above-mentioned database synchronization processing method embodiment
Correlation step.
Specifically, program 610 can include program code, and the program code includes computer-managed instruction.
Processor 602 is probably central processor CPU, or specific integrated circuit ASIC (Application
Specific Integrated Circuit), or it is arranged to implement the integrated electricity of one or more of the embodiment of the present invention
Road.The one or more processors that computing device includes, can be same type of processor, such as one or more CPU;Also may be used
To be different types of processor, such as one or more CPU and one or more ASIC.
Memory 606, for depositing program 610.Memory 606 may include high-speed RAM memory, it is also possible to also include
Nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.
Program 610 specifically can be used for so that processor 602 performs the database synchronization in above-mentioned any means embodiment
Processing method.The specific implementation of each step may refer to the corresponding step in above-mentioned database synchronization Processing Example in program 610
Corresponding description in rapid and unit, will not be described here.It is apparent to those skilled in the art that the side for description
Just and succinctly, the specific work process of the equipment of foregoing description and module, it may be referred to corresponding in preceding method embodiment
Journey describes, and will not be repeated here.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein.
Various general-purpose systems can also be used together with teaching based on this.As described above, required by constructing this kind of system
Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that it can utilize various
Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair
Bright preferred forms.
In the specification that this place provides, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention
Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect,
Above in the description to the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor
The application claims of shield features more more than the feature being expressly recited in each claim.It is more precisely, such as following
Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself
Separate embodiments all as the present invention.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment
Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or
Sub-component.In addition at least some in such feature and/or process or unit exclude each other, it can use any
Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint
Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power
Profit requires, summary and accompanying drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation
Replace.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention
Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed
One of meaning mode can use in any combination.
The all parts embodiment of the present invention can be realized with hardware, or to be run on one or more processor
Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that it can use in practice
Microprocessor or digital signal processor (DSP) are come one of some or all parts in realizing according to embodiments of the present invention
A little or repertoire.The present invention is also implemented as setting for performing some or all of method as described herein
Standby or program of device (for example, computer program and computer program product).Such program for realizing the present invention can deposit
Storage on a computer-readable medium, or can have the form of one or more signal.Such signal can be from because of spy
Download and obtain on net website, either provide on carrier signal or provided in the form of any other.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not
Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of some different elements and being come by means of properly programmed computer real
It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch
To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame
Claim.
A1. a kind of database synchronization processing method, including:
Data to be synchronized in primary database are write into primary database buffering area, and in the primary database buffering area
In for the data to be synchronized that are write set corresponding to timestamp;And
According to the data to be synchronized write in the primary database buffering area, by the data transfer to be synchronized extremely from number
According in storehouse, and synchrodata record is being updated from data base buffer.
A2. the method according to A1, wherein, it is described according to the number to be synchronized write in the primary database buffering area
According to by the data transfer to be synchronized to further comprising from database:
Recorded, determined in the primary database buffering area synchronous according to the synchrodata from data base buffer
Resume position;And
Position is synchronously resumed according to identified, by the data transfer to be synchronized in the primary database buffering area to described
From database.
A3. the method according to A1 or A2, wherein, the synchrodata record includes:It is current to complete treating together for transmission
Step data and corresponding timestamp.
A4. the method according to A3, wherein, it is described according to the number to be synchronized write in the primary database buffering area
According to by the data transfer to be synchronized to from database, and being recorded updating synchrodata from data base buffer into one
Step includes:
Data to be synchronized in the primary database buffering area and corresponding timestamp are transmitted to described from database
In;
According to the current data to be synchronized for completing transmission and corresponding timestamp, it is described from data base buffer more
New synchrodata record.
A5. the method according to A3, wherein, recorded described in the basis from the synchrodata in data base buffer,
Determine that synchronously resuming position further comprises in the primary database buffering area:
The synchrodata record is read from data base buffer from described;
The data to be synchronized of current completion transmission in being recorded according to the synchrodata and corresponding timestamp, in institute
State the data to be synchronized that inquiry matches with synchrodata record in primary database buffering area;
The data to be synchronized to match with synchrodata record obtained according to inquiry, are buffered in the primary database
Determine described synchronously to resume position in area.
A6. the method according to any one of A3-A5, wherein, the accuracy of the timestamp is microsecond rank.
A7. the method according to any one of A1-A6, wherein, methods described also includes:
From data lab setting from data base buffer, to be recorded for storing the synchrodata.
B8. a kind of database synchronization processing unit, including:
Writing module, suitable for the data to be synchronized in primary database are write into primary database buffering area, and described
In primary database buffering area for the data to be synchronized that are write set corresponding to timestamp;
Transport module, will be described to be synchronized suitable for according to the data to be synchronized write in the primary database buffering area
Data transfer is to from database;And
Update module, suitable for updating synchrodata record from data base buffer.
B9. the device according to B8, wherein, the transport module is further adapted for:
Recorded, determined in the primary database buffering area synchronous according to the synchrodata from data base buffer
Resume position;And
Position is synchronously resumed according to identified, by the data transfer to be synchronized in the primary database buffering area to described
From database.
B10. the device according to B8 or B9, wherein, the synchrodata record includes:It is current to complete treating together for transmission
Step data and corresponding timestamp.
B11. the device according to B10, wherein, the transport module is further adapted for:The primary database is buffered
Data to be synchronized and corresponding timestamp in area are transmitted to described from database;
The update module is further adapted for:The data to be synchronized transmitted according to current completion and corresponding timestamp,
Synchrodata record is updated from data base buffer described.
B12. the device according to B10, wherein, the transport module is further adapted for:
The synchrodata record is read from data base buffer from described;
The data to be synchronized of current completion transmission in being recorded according to the synchrodata and corresponding timestamp, in institute
State the data to be synchronized that inquiry matches with synchrodata record in primary database buffering area;
The data to be synchronized to match with synchrodata record obtained according to inquiry, are buffered in the primary database
Determine described synchronously to resume position in area.
B13. the device according to any one of B10-B12, wherein, the accuracy of the timestamp is microsecond rank.
B14. the device according to any one of B8-B13, wherein, described device also includes:
Setup module, it is suitable for from data lab setting from data base buffer, for storing the synchrodata record.
C15. a kind of computing device, including:Processor, memory, communication interface and communication bus, the processor, institute
State memory and the communication interface and mutual communication is completed by the communication bus;
The memory is used to deposit an at least executable instruction, and the executable instruction makes the computing device such as
Operated corresponding to database synchronization processing method any one of A1-A7.
D16. a kind of computer-readable storage medium, an at least executable instruction is stored with the storage medium, it is described to hold
Row instruction makes operation corresponding to database synchronization processing method of the computing device as any one of A1-A7.
Claims (10)
1. a kind of database synchronization processing method, including:
Data to be synchronized in primary database are write into primary database buffering area, and are in the primary database buffering area
Timestamp corresponding to the data to be synchronized setting write;And
According to the data to be synchronized write in the primary database buffering area, by the data transfer to be synchronized extremely from database
In, and synchrodata record is being updated from data base buffer.
2. the method according to claim 11, wherein, it is described to be synchronized according to being write in the primary database buffering area
Data, the data transfer to be synchronized is extremely further comprised from database:
Recorded according to the synchrodata from data base buffer, determine synchronously to resume in the primary database buffering area
Position;And
Position is synchronously resumed according to identified, by the data transfer to be synchronized in the primary database buffering area to described from number
According in storehouse.
3. method according to claim 1 or 2, wherein, the synchrodata record includes:It is current to complete treating together for transmission
Step data and corresponding timestamp.
4. the method according to claim 11, wherein, it is described to be synchronized according to being write in the primary database buffering area
Data, by the data transfer to be synchronized to from database, and updated from data base buffer synchrodata record into
One step includes:
Data to be synchronized in the primary database buffering area and corresponding timestamp are transmitted to described from database;
According to the current data to be synchronized for completing transmission and corresponding timestamp, updated together from data base buffer described
Step data records.
5. according to the method for claim 3, wherein, remember described in the basis from the synchrodata in data base buffer
Record, determines that synchronously resuming position further comprises in the primary database buffering area:
The synchrodata record is read from data base buffer from described;
The data to be synchronized of current completion transmission in being recorded according to the synchrodata and corresponding timestamp, in the master
The data to be synchronized that inquiry matches with synchrodata record in data base buffer;
The data to be synchronized to match with synchrodata record obtained according to inquiry, in the primary database buffering area
Determine described synchronously to resume position.
6. according to the method described in claim any one of 3-5, wherein, the accuracy of the timestamp is microsecond rank.
7. according to the method described in claim any one of 1-6, wherein, methods described also includes:
From data lab setting from data base buffer, to be recorded for storing the synchrodata.
8. a kind of database synchronization processing unit, including:
Writing module, suitable for the data to be synchronized in primary database are write into primary database buffering area, and in the main number
According in the buffering area of storehouse for the data to be synchronized that are write set corresponding to timestamp;
Transport module, suitable for according to the data to be synchronized write in the primary database buffering area, by the data to be synchronized
Transmit to from database;And
Update module, suitable for updating synchrodata record from data base buffer.
9. a kind of computing device, including:Processor, memory, communication interface and communication bus, the processor, the storage
Device and the communication interface complete mutual communication by the communication bus;
The memory is used to deposit an at least executable instruction, and the executable instruction makes the computing device such as right will
Ask and operated corresponding to the database synchronization processing method any one of 1-7.
10. a kind of computer-readable storage medium, an at least executable instruction, the executable instruction are stored with the storage medium
Make operation corresponding to database synchronization processing method of the computing device as any one of claim 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710923159.4A CN107741965B (en) | 2017-09-30 | 2017-09-30 | Database synchronous processing method and device, computing equipment and computer storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710923159.4A CN107741965B (en) | 2017-09-30 | 2017-09-30 | Database synchronous processing method and device, computing equipment and computer storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107741965A true CN107741965A (en) | 2018-02-27 |
CN107741965B CN107741965B (en) | 2021-06-29 |
Family
ID=61236674
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710923159.4A Expired - Fee Related CN107741965B (en) | 2017-09-30 | 2017-09-30 | Database synchronous processing method and device, computing equipment and computer storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107741965B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109819048A (en) * | 2019-02-27 | 2019-05-28 | 北京字节跳动网络技术有限公司 | Method of data synchronization, device, terminal and storage medium |
CN110990435A (en) * | 2019-12-03 | 2020-04-10 | 秒针信息技术有限公司 | Data synchronization method, device and computer readable storage medium |
CN111221861A (en) * | 2019-12-31 | 2020-06-02 | 武汉中海庭数据技术有限公司 | Method and device for synchronizing local cache and database data |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102760126A (en) * | 2011-04-26 | 2012-10-31 | 阿里巴巴集团控股有限公司 | Data synchronization method in distributive system, and distributive system |
CN104731956A (en) * | 2015-04-02 | 2015-06-24 | 北京奇虎科技有限公司 | Method and system for synchronizing data and related database |
CN104881494A (en) * | 2015-06-12 | 2015-09-02 | 北京奇虎科技有限公司 | Method, device and system for performing data synchronization with Redis server |
CN105205175A (en) * | 2015-10-15 | 2015-12-30 | 北京农信互联科技有限公司 | Data operation method and system for distributed database cluster |
US9507842B2 (en) * | 2013-04-13 | 2016-11-29 | Oracle International Corporation | System for replication-driven repository cache invalidation across multiple data centers |
-
2017
- 2017-09-30 CN CN201710923159.4A patent/CN107741965B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102760126A (en) * | 2011-04-26 | 2012-10-31 | 阿里巴巴集团控股有限公司 | Data synchronization method in distributive system, and distributive system |
US9507842B2 (en) * | 2013-04-13 | 2016-11-29 | Oracle International Corporation | System for replication-driven repository cache invalidation across multiple data centers |
CN104731956A (en) * | 2015-04-02 | 2015-06-24 | 北京奇虎科技有限公司 | Method and system for synchronizing data and related database |
CN104881494A (en) * | 2015-06-12 | 2015-09-02 | 北京奇虎科技有限公司 | Method, device and system for performing data synchronization with Redis server |
CN105205175A (en) * | 2015-10-15 | 2015-12-30 | 北京农信互联科技有限公司 | Data operation method and system for distributed database cluster |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109819048A (en) * | 2019-02-27 | 2019-05-28 | 北京字节跳动网络技术有限公司 | Method of data synchronization, device, terminal and storage medium |
CN109819048B (en) * | 2019-02-27 | 2022-03-15 | 北京字节跳动网络技术有限公司 | Data synchronization method, device, terminal and storage medium |
CN110990435A (en) * | 2019-12-03 | 2020-04-10 | 秒针信息技术有限公司 | Data synchronization method, device and computer readable storage medium |
CN111221861A (en) * | 2019-12-31 | 2020-06-02 | 武汉中海庭数据技术有限公司 | Method and device for synchronizing local cache and database data |
CN111221861B (en) * | 2019-12-31 | 2023-06-02 | 武汉中海庭数据技术有限公司 | Method and device for synchronizing local cache and database data |
Also Published As
Publication number | Publication date |
---|---|
CN107741965B (en) | 2021-06-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6816300B2 (en) | Parallel execution of transactions in a blockchain network | |
CN107330522B (en) | Method, device and system for updating deep learning model | |
JP7093599B2 (en) | How to manage snapshots on the blockchain, computer programs, snapshot nodes, auditor nodes and systems | |
JP6827564B2 (en) | Performing parallel execution of transactions in a distributed ledger system | |
US10749668B2 (en) | Reduction in storage usage in blockchain | |
CN106649828B (en) | Data query method and system | |
CN104965757A (en) | Virtual machine live migration method, virtual machine migration management apparatus, and virtual machine live migration system | |
CN107741965A (en) | Database synchronization processing method, device, computing device and computer-readable storage medium | |
CN101739381A (en) | Barrier synchronization apparatus, barrier synchronization process system and method | |
CN103229172B (en) | Replicate data | |
US9547707B2 (en) | Copy of replication status for synchronization | |
JP2020531949A (en) | Lazy update of database hash code in blockchain | |
CN108197486A (en) | Big data desensitization method, system, computer-readable medium and equipment | |
CN108009642A (en) | Distributed machines learning method and system | |
CN111078672B (en) | Data comparison method and device for database | |
CN106605217B (en) | For the method and system for being moved to another website from a website will to be applied | |
CN110599166A (en) | Method and device for acquiring transaction dependency relationship in block chain | |
CN109492049A (en) | Data processing, block generation and synchronous method for block chain network | |
CN104462342B (en) | database snapshot synchronization processing method and device | |
WO2015085901A1 (en) | File transmission method and device, and related system | |
CN104991836A (en) | Database recovery method and apparatus and database server | |
US11381630B2 (en) | Transmitting data over a network in representational state transfer (REST) applications | |
CN106874341B (en) | Database synchronization method | |
US8375188B1 (en) | Techniques for epoch pipelining | |
RU2698766C1 (en) | Method and device for transmitting, sending and receiving information |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20210629 |