CN103559198A - Data synchronizing method and equipment - Google Patents

Data synchronizing method and equipment Download PDF

Info

Publication number
CN103559198A
CN103559198A CN201310454695.6A CN201310454695A CN103559198A CN 103559198 A CN103559198 A CN 103559198A CN 201310454695 A CN201310454695 A CN 201310454695A CN 103559198 A CN103559198 A CN 103559198A
Authority
CN
China
Prior art keywords
data
database
source
backup
backup 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.)
Pending
Application number
CN201310454695.6A
Other languages
Chinese (zh)
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.)
CHINA REALTIME DATABASE Co Ltd
YINENG ELECTRIC TECHNOLOGY Co Ltd HANGZHOU
HANGZHOU YINENG SOFTWARE Co Ltd
Original Assignee
CHINA REALTIME DATABASE Co Ltd
YINENG ELECTRIC TECHNOLOGY Co Ltd HANGZHOU
HANGZHOU YINENG SOFTWARE 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 CHINA REALTIME DATABASE Co Ltd, YINENG ELECTRIC TECHNOLOGY Co Ltd HANGZHOU, HANGZHOU YINENG SOFTWARE Co Ltd filed Critical CHINA REALTIME DATABASE Co Ltd
Priority to CN201310454695.6A priority Critical patent/CN103559198A/en
Publication of CN103559198A publication Critical patent/CN103559198A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Abstract

The invention discloses a data synchronizing method and equipment. The data synchronizing method is applied to a database and includes updating data in a source database when receiving a data updating command for the source database; synchronizing the updated data into a preset backup database according to the updating type of the updated data in the source database. The data in the source database are synchronized into the backup database by the data synchronizing method, so that when the data in the source database are lost, data identical with those in the source database are stored in the backup database, and data safety is improved.

Description

The method and apparatus that a kind of data are synchronous
Technical field
The application relates to database field, relates in particular to the synchronous method and apparatus of a kind of data.
Background technology
Along with the develop rapidly of infotech, all conglomeraties or enterprise can produce the data message of magnanimity in real time, and information security, especially becomes clear day by day to the importance of data backup.If data do not back up, store after the media damage such as disk of described data, need to take a long time and carry out data and resume work, when serious, possible data is directly irrecoverable, thereby causes irremediable loss.In such cases, the security of data is low.
Summary of the invention
In view of this, the application provides a kind of data synchronous method and apparatus, and in order to solve in prior art after the media damage of storage data, data are irrecoverable causes the problem that data security is low.The application's technical scheme is specific as follows:
The method that data are synchronous, described method is applied to database, and the method comprises:
When receive source database Data Update instruction time, the data in described source database are upgraded;
According to the updating type of the data that in described source database, process is upgraded, by described, through the data of upgrading, be synchronized in default backup database.
Preferably, before carrying out described method, also comprise:
The address parameter of obtaining described default backup database generates connection string;
According to described connection string, described source database is connected with described backup database.
Preferably, described renewal comprises:
Increase, delete or revise.
Preferably, when described, be updated to while increasing, describedly by described, through the data of upgrading, be synchronized in default backup database, comprising:
The source data increasing in described source database is sent in described default backup database;
In described default backup database, store the source data of described increase.
Preferably, when described, be updated to while deleting, describedly by described, through the data of upgrading, be synchronized in default backup database, comprising:
The source data of deleting in described source database is sent in described default backup database;
In described default backup database, search the Backup Data corresponding with the source data of described deletion, and described Backup Data is deleted.
Preferably, when described, be updated to while revising, describedly by described, through the data of upgrading, be synchronized in default backup database, comprising:
The first source data in described source database and the second source data of being revised as by described the first source data are sent in described default backup database;
In described default backup database, search the Backup Data corresponding with described the first source data, correspondingly store described the second source data after deleting described Backup Data.
Preferably, by described through the data of upgrading, be synchronized to default backup database in before, also comprise:
Judge whether described data meet default condition, if so, carry out subsequent step.
Preferably, the described data that described process is upgraded are synchronized in default backup database, comprising:
In synchronizing process, to backup database, send packet, and described packet is copied to buffer memory;
When monitoring described packet, do not send when successful, from described buffer memory, obtain described packet and retransmit.
The equipment that data are synchronous, described equipment is applied to database, and this equipment comprises:
Update module, during for Data Update instruction when receiving source database, upgrades the data in described source database;
Synchronization module, for the updating type through the data of renewal according to described source database, is synchronized in default backup database through the data of upgrading described.
Preferably, also comprise:
Acquiring unit, generates connection string for obtaining the address parameter of described default backup database;
Link block, for being connected described source database according to described connection string with described backup database.
Preferably, described synchronization module comprises:
Increase unit, delete cells and modification unit.
Preferably, described increase unit comprises:
First increases subelement, for the source data that described source database is increased, is sent in described default backup database;
Second increases subelement, for store the source data of described increase at described default backup database.
Preferably, described delete cells comprises:
First deletes subelement, for the source data that described source database is deleted, is sent in described default backup database;
Second deletes subelement, at described default backup database, searches the Backup Data corresponding with the source data of described deletion, and described Backup Data is deleted.
Preferably, described modification unit comprises:
First revises subelement, for the first source data of described source database and the second source data of being revised as by described the first source data are sent in described default backup database;
Second revises subelement, at described default backup database, searches the Backup Data corresponding with described the first source data, correspondingly stores described the second source data after deleting described Backup Data.
Preferably, also comprise:
Determination module, meets pre-conditioned data for determining.
Preferably, described synchronization module comprises:
The first lock unit, for sending packet in synchronizing process to backup database, and is copied to buffer memory by described packet;
The second lock unit for not sending when successful when monitoring described packet, obtains described packet and retransmits from described buffer memory.
From above technical scheme, the application provides a kind of data synchronous method and apparatus, and described method is applied to database, and the method comprises: when receive source database Data Update instruction time, the data in described source database are upgraded; And the updating type of the data that in the described source database of foundation, process is upgraded, by described, through the data of upgrading, be synchronized in default backup database.In reality, after the media damage such as disk due to storage data, data are recovered to expend a large amount of time and resource, when serious, even cause data directly irrecoverable, and the security of data is low.Described method is by being synchronized to the data in described source data in described backup database, after loss of data in described source database, in described backup database, preserve the data consistent with data in described source database, the security that has therefore improved data.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present application, below the accompanying drawing of required use during embodiment is described is briefly described, apparently, accompanying drawing in the following describes is only some embodiment of the application, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
The schematic flow sheet of the embodiment of a kind of method of data synchronization that Fig. 1 provides for the application;
The schematic flow sheet of a kind of another embodiment of method of data synchronization that Fig. 2 provides for the application;
The schematic flow sheet of the another embodiment of a kind of method of data synchronization that Fig. 3 provides for the application;
The schematic flow sheet of the another embodiment of a kind of method of data synchronization that Fig. 4 provides for the application;
The schematic flow sheet of the another embodiment of a kind of method of data synchronization that Fig. 5 provides for the application;
The schematic flow sheet of the another embodiment of a kind of method of data synchronization that Fig. 6 provides for the application;
The schematic flow sheet of the another embodiment of a kind of method of data synchronization that Fig. 7 provides for the application;
The structural representation of the embodiment of a kind of data synchronizer that Fig. 8 provides for the application;
The structural representation of a kind of another embodiment of data synchronizer that Fig. 9 provides for the application;
In a kind of data synchronizer that Figure 10 provides for the application, increase the structural representation of unit;
The structural representation of delete cells in a kind of data synchronizer that Figure 11 provides for the application;
In a kind of data synchronizer that Figure 12 provides for the application, revise the structural representation of unit;
The structural representation of the another embodiment of a kind of data synchronizer that Figure 13 provides for the application;
The structural representation of synchronization module in a kind of data synchronizer that Figure 14 provides for the application;
A kind of source database server that Figure 15 provides for the application and backup database server are at the structural representation of different segment.。
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present application, the technical scheme in the embodiment of the present application is clearly and completely described, obviously, described embodiment is only the application's part embodiment, rather than whole embodiment.Embodiment based in the application, those of ordinary skills are not making the every other embodiment obtaining under creative work prerequisite, all belong to the scope of the application's protection.
Development along with infotech, all conglomeraties or enterprise are used computer equipment to store mass data, and after the medium infringements such as disk of the described data of storage, data are carried out to recovery and can spend a large amount of time and resource, when serious, may occur the direct expendable situation of data, data security is in such cases low.For this reason, the application provides embodiment of a kind of synchronous method of data in order to solve described problem.Refer to Fig. 1, it shows the schematic flow sheet of this embodiment, and the method for the present embodiment is applied to database, and described method can comprise:
Step S101: when receive source database Data Update instruction time, the data in described source database are upgraded;
Described industry or enterprise utilize the database in computer equipment to carry out data storage, and described database is source database.
Step S102: according to the updating type of the data that in described source database, process is upgraded, be synchronized in default backup database through the data of upgrading described.
In described embodiment, need set in advance some or a plurality of databases is backup database.Content is set to be comprised: preservation position of IP address separately of source of configuration database and backup database, server end slogan, database side slogan, data file etc.Described backup database can be the database on same station server, can be also the database on other servers.When described source database is from described backup database on different servers time, described source database server can be arranged on the different network segments from described backup database server, also can be arranged on the identical network segment.
Refer to Figure 15, it shows a kind of source database server and backup database server at the structural representation of different segment.In such cases, need to use xegregating unit that described source database server is connected with described backup database server.Described xegregating unit can be used the special-purpose lateral isolation equipment of electric power, is divided into forward and reverse.Place of safety I/II is forward to the one-way data transmission of place of safety III, and the one-way data transmission of IIIDao place of safety, place of safety IV is reverse.
When receiving when the data in described source database are carried out to update instruction, carry out described update instruction, complete the renewal that the data in described source database are carried out.After the renewal in described source database completes, type according to described renewal, by described, through the data of upgrading, be sent in described default backup database, and according to described, through the data of upgrading, in described default backup database, carry out and renewal identical in described source database, so that the data in the data in described backup database and described source database are consistent.Wherein, described in, be updated to increase, delete or revise.
It should be noted that, the renewal of in described source database, described source data being carried out, and through the data of upgrading, be synchronized to the operation in default backup database by described, be all that the functional module in described source database end server is carried out.
From the technical scheme of the present embodiment, when receive source database Data Update instruction time, the data in described source database are upgraded; And the updating type of the data that in the described source database of foundation, process is upgraded, by described, through the data of upgrading, be synchronized in default backup database.In reality, after the media damage such as disk due to storage data, data are recovered to expend a large amount of time and resource, when serious, even cause data directly irrecoverable, and the security of data is low.Described method is by being synchronized to the data in described source data in described backup database, after loss of data in described source database, in described backup database, preserve the data consistent with data in described source database, the security that has therefore improved data.
Meanwhile, when a plurality of users upgrade the data in described source database simultaneously, if use exclusive lock when a certain user modifies to described source database, can limit the access of other users to described source database.Now, other users can access described backup database, and needn't wait until that the described user that exclusive lock is set removes described exclusive lock, thereby have realized the concurrent operations of database, have saved the stand-by period.
In the synchronous process of data, the data of upgrading need to be sent in backup database, so that the data in the data in described backup database and described source database are consistent in source database.The realization of described synchronizing process, need to be connected described source database with described backup database.Refer to Fig. 2, it shows the schematic flow sheet of a kind of another embodiment of method of data synchronization, and the present embodiment provides the method that described source database is connected with described backup database.The method of the present embodiment can comprise:
Step S201: the address parameter of obtaining described default backup database generates connection string;
Database in a certain server is set to backup database, need to configure the configuration file of described database, the deploy content that described configuration file comprises comprises the IP address of described backup database server, the port numbers of described backup database server, the port numbers of described backup database, the address of data file storage etc.
From described configuration file, obtain the address parameter of the described backup database setting in advance, described parameter can comprise: the IP address of described backup database server, as 192.168.11.125; Described backup database port numbers, as 10012.According to described parameter, generate connection string, described connection string comprises the address of described backup database, 192.168.11.125:10012 for example, and described connection string is used for connecting described backup database.
Step S202: described source database is connected with described backup database according to described connection string;
The IP address that includes the server at described backup database place in described connection string, and the port numbers that comprises described backup database, according to described parameter information, to described backup database, send connection request, for connecting with described backup database.
Step S203: when receive source database Data Update instruction time, the data in described source database are upgraded; And the updating type of the data that in the described source database of foundation, process is upgraded, by described, through the data of upgrading, be synchronized in default backup database.
This step is identical with the step S101 in first embodiment, at this, does not repeat.
Technical scheme from the present embodiment, the method being connected with described backup database is provided in the present embodiment, by obtaining the address parameter of described default backup database, generate connection string, according to described connection string, described source database is connected with described backup database, for follow-up synchronizing process is laid a good foundation.
From above-mentioned each embodiment, the renewal of data in described source database is comprised increase, deletes or revised.When described in be updated to while increasing,, when increasing the data of a certain type in described database, the synchronous method of described data refers to Fig. 3, it shows the schematic flow sheet of a kind of another embodiment of method of data synchronization, described method is applied to database.The method of the present embodiment can comprise:
Step S301: when receiving when the data of source database are increased to instruction, increase data in described source database;
Receive when the data of source data are increased to instruction, obtain the data of described increase, and increase described data in described source data.
Step S302: the source data increasing in described source database is sent in described default backup database;
Step S303: the source data of storing described increase in described default backup database.
In described backup database, store the source data of described increase, the described source data of the increase in described backup database is Backup Data, and sets up the corresponding relation between described source data and described Backup Data.Thereby described source database and described backup database synchronously increase data, have guaranteed the consistance of described source database and described Backup Data database data.
From above-mentioned each embodiment, the renewal of data in described source database is comprised increase, deletes or revised.When described in be updated to while deleting,, when deleting the data of a certain type in described database, the synchronous method of described data refers to Fig. 4, it shows the schematic flow sheet of a kind of another embodiment of method of data synchronization, described method is applied to database.The method of the present embodiment can comprise:
Step S401: when receive source database data delete instruction time, in described source database, delete data;
While receiving the data delete instruction to source data, search the described data that will delete, and in described source data, delete described data.
Step S402: the source data of deleting in described source database is sent in described default backup database;
Step S403: in described default backup database, search the Backup Data corresponding with the source data of described deletion, and described Backup Data is deleted.
According to being sent to the source data of deleting in described backup database, and the corresponding relation between the Backup Data in described source data and described backup database, in described backup database, search the Backup Data corresponding with the source data of described deletion, and the Backup Data finding is deleted.Thereby described source database and described backup database are synchronously deleted data, have guaranteed the consistance of described source database and described Backup Data database data.
From above-mentioned each embodiment, the renewal of data in described source database is comprised increase, deletes or revised.When described in be updated to while revising,, when revising the data of a certain type in described database, the synchronous method of described data refers to Fig. 4, it shows the schematic flow sheet of a kind of another embodiment of method of data synchronization, described method is applied to database.The method of the present embodiment can comprise:
Step S501: when receive source database data modification instruction time, Update Table in described source database;
While receiving the data modification instruction to source data, search described the first source data that will revise and obtain described in the second source data of being revised as, and store accordingly described the second source data after will described the first source data deleting.
Step S502: the first source data in described source database and the second source data of being revised as by described the first source data are sent in described default backup database;
Step S503: in described default backup database, search the Backup Data corresponding with described the first source data, correspondingly store described the second source data after deleting described Backup Data.
According to being sent to the first source data in described backup database, and the corresponding relation between the Backup Data in described the first source data and described backup database, in described backup database, search the Backup Data corresponding with described the first source data, and the Backup Data finding is deleted, meanwhile, relatively store described the second source data.Thereby described source database and described backup database be Update Table synchronously, guaranteed the consistance of described source database and described Backup Data database data.
The data of upgrading in source data comprise polytype, wherein some data is important data messages, default setting is for being synchronized to forcibly in backup database after upgrading, whether other data may need to need to carry out synchronously according to actual conditions setting, therefore, refer to Fig. 6, it shows the schematic flow sheet of the another embodiment of a kind of method of data synchronization that the application provides, this embodiment comprises the judgement of the data type to upgrading, and concrete grammar comprises:
Step S601: when receive source database Data Update instruction time, the data in described source database are upgraded;
Step S602: judge whether described data meet default condition, if so, carry out subsequent step;
Described pre-conditioned for belonging to the data of giving tacit consent to or being provided with synchronous service.Measuring point, user, group or role are the higher data of importance level in database, belong to the synchronous data of acquiescence needs, when receiving, described measuring point, user, group or role are upgraded, and directly carry out the step of subsequent synchronisation.Interpolated data, the data that are stored in described measuring point belong to the data that importance level is lower, need to check whether described data are provided with synchronous service before carrying out synchronizing step, if so, can carry out follow-up synchronous.
Step S603: according to the updating type of the data that in described source database, process is upgraded, be synchronized in default backup database through the data of upgrading described.
This step is identical with the content in step S101 in first embodiment, at this, does not repeat.
From the technical scheme of the present embodiment, before the data of described renewal being carried out synchronously, judge that whether described data meet default condition, whether belong to synchronous data type, are if so, synchronized to the data of described renewal in described backup database.Data are carried out optionally synchronous, improved described synchronous efficiency.
The data in source database being synchronized in the process of backup database, may there is connecting fault, cause the loss of data in described synchronizing process.For this reason, refer to Fig. 7, the schematic flow sheet that it shows the another embodiment of a kind of method of data synchronization that the application provides, carries out buffer memory by described data in this embodiment.The method of the present embodiment can comprise:
Step S701: when receive source database Data Update instruction time, the data in described source database are upgraded;
Step S702: send packet to backup database in synchronizing process, and described packet is copied to buffer memory;
In described synchronizing process, the synchronous renewal of doing by the data of described renewal and to described backup database is encapsulated in packet, described packet is sent to described backup database, and described packet is copied in buffer memory simultaneously.
Step S703: do not send when successful when monitoring described packet, obtain described packet and retransmit from described buffer memory.
Monitor the transmission situation of described packet, implementation can be: be the package number sending, and receive the numbering of the packet receiving returning in described backup database, when not receiving the numbering of returning of some or a plurality of packets, illustrate that described packet does not send successfully, described in obtaining, do not send successful packet from described buffer memory, and retransmit until receive and return to numbering.In addition, when receiving the returning after numbering of packet, can delete and described in described buffer memory, return to packet corresponding to numbering.
From the technical scheme of the present embodiment, it provides a kind of Monitoring Data to send situation, and by the method for data synchronization that does not send successful data and retransmit, can avoid data-bag lost is situation, thereby has guaranteed better the reliability of synchronizing process.
In above-mentioned each embodiment, the renewal to data in source database, and the synchronous renewal of described Backup Data being carried out according to described updating type is Implement of Function Module in source database end server.Certainly, the Implement of Function Module that described renewal and synchronous renewal also can be in backup database end servers, the method for the present embodiment comprises:
When monitoring source database and receive Data Update instruction, the data in described source database are upgraded; And the updating type of the data that in the described source data of foundation, process is upgraded, the data in backup database are synchronously upgraded.
When the described embodiment method being updated to while increasing is:
When monitoring source database, receive while increasing data command, in described source database, increase data, and obtain the data that increase in described source data, the data of obtaining described in storage in described backup database.
When the described embodiment method being updated to while deleting is:
When monitoring source database, receive while deleting data command, in described source database, delete data, and obtain the data of deleting in described source data, in described backup database, search the Backup Data corresponding with the data of described deletion, and described Backup Data is deleted.
When the described embodiment method being updated to while revising is:
When monitoring source database and receive Update Table instruction, in described source database, by described data, be the second source data, and obtain described data and described the second source data, in described backup database, search the Backup Data corresponding with described data, and described Backup Data is revised as to described the second source data.
Refer to Fig. 8, it shows the structural representation of an embodiment of a kind of data synchronizer, and the equipment of the present embodiment can comprise: update module 801 and synchronization module 802;
Described update module 801, during for Data Update instruction when receiving source database, upgrades the data in described source database;
Described update module 801, when receiving when the data in described source database are carried out to update instruction, is carried out described update instruction, completes the renewal that the data in described source database are carried out.
Described synchronization module 802, for the updating type through the data of renewal according to described source database, is synchronized in default backup database through the data of upgrading described.
After the renewal in described source database completes, described synchronization module 802 is according to the type of described renewal, by described, through the data of upgrading, be sent in described default backup database, and according to described, through the data of upgrading, in described default backup database, carry out and renewal identical in described source database, so that the data in the data in described backup database and described source database are consistent.
It should be noted that, renewal in described update module 801 for described source data being carried out at source database, and described synchronization module 802 is synchronized to the operation in default backup database by described through the data of upgrading, described two subelements are arranged in described source database end server.
Technical scheme from the present embodiment, described update module 801 when receive source database Data Update instruction time, data in described source database are upgraded, described synchronization module 802, according to the updating type of the data that in described source database, process is upgraded, is synchronized in default backup database through the data of upgrading described.In reality, after the media damage such as disk due to storage data, data are recovered to expend a large amount of time and resource, when serious, even cause data directly irrecoverable, and the security of data is low.Described method is by being synchronized to the data in described source data in described backup database, after loss of data in described source database, in described backup database, preserve the data consistent with data in described source database, the security that has therefore improved data.
Meanwhile, when a plurality of users upgrade the data in described source database simultaneously, if use exclusive lock when a certain user modifies to described source database, can limit the access of other users to described source database.Now, other users can access the backup database of described renewal of the equipment, and needn't wait until that the described user that exclusive lock is set removes described exclusive lock, thereby have realized the concurrent operations of database, have saved the stand-by period.
Refer to Fig. 9, it shows the structural representation of a kind of another embodiment of data synchronizer, and the equipment of this enforcement can comprise: acquiring unit 901, link block 902, update module 903 and synchronization module 904;
Described acquiring unit 901, generates connection string for obtaining the address parameter of described default backup database;
Database in a certain server is set to backup database, need to configure the configuration file of described database, the deploy content that described configuration file comprises comprises the IP address of described backup database server, the port numbers of described backup database server, the port numbers of described backup database, the address of data file storage etc.
Acquiring unit 901 obtains the address parameter of the described backup database setting in advance from described configuration file, and described parameter can comprise: the IP address of described backup database server, as 192.168.11.125; Described backup database port numbers, as 10012.According to described parameter, generate connection string, described connection string comprises the address of described backup database, 192.168.11.125:10012 for example, and described connection string is used for connecting described backup database.
Described link block 902, for being connected described source database according to described connection string with described backup database;
The IP address that includes the server at described backup database place in described connection string, and the port numbers that comprises described backup database, described link block 902 sends connection request according to described parameter information to described backup database, for connecting with described backup database.
Described update module 903, during for Data Update instruction when receiving source database, upgrades the data in described source database;
Described synchronization module 904, for the updating type through the data of renewal according to described source database, is synchronized in default backup database through the data of upgrading described.
Technical scheme from the present embodiment, the unit being connected with described backup database is provided in the present embodiment, by obtaining the address parameter of described default backup database, generate connection string, according to described connection string, described source database is connected with described backup database, for synchronization module, realizes synchronizing function and lay a good foundation.
In described data synchronizer, the renewal that functional unit realizes comprises increase, deletes or revises, and described equipment correspondingly comprises increases unit, delete cells or revises unit.
Refer to Figure 10, it shows the structural representation that increases unit in a kind of data synchronizer, and this unit comprises: first increases subelement 1001 and second increases subelement 1002;
Described first increases subelement 1001, for the source data that described source database is increased, is sent in described default backup database;
Described second increases subelement 1002, for store the source data of described increase at described default backup database.
Described second increases subelement 1002 stores the source data of described increase in described backup database, and the described source data of the increase in described backup database is Backup Data, and sets up the corresponding relation between described source data and described Backup Data.Thereby described source database and described backup database synchronously increase data, have guaranteed the consistance of described source database and described Backup Data database data.
Refer to Figure 11, it shows the structural representation of delete cells in a kind of data synchronizer, and this unit comprises: first deletes subelement 1101 and second deletes subelement 1102;
Described first deletes subelement 1101, for the source data that described source database is deleted, is sent in described default backup database;
Described second deletes subelement 1102, at described default backup database, searches the Backup Data corresponding with the source data of described deletion, and described Backup Data is deleted.
Described second deletes subelement 1102 according to being sent to the source data of deleting in described backup database, and the corresponding relation between the Backup Data in described source data and described backup database, in described backup database, search the Backup Data corresponding with the source data of described deletion, and the Backup Data finding is deleted.Thereby described source database and described backup database are synchronously deleted data, have guaranteed the consistance of described source database and described Backup Data database data.
Refer to Figure 12, it shows the structural representation of revising unit in a kind of data synchronizer, and this unit comprises: first revises subelement 1201 and second revises subelement 1202;
Described first revises subelement 1201, for the first source data of described source database and the second source data of being revised as by described the first source data are sent in described default backup database;
Described second revises subelement 1202, at described default backup database, searches the Backup Data corresponding with described the first source data, correspondingly stores described the second source data after deleting described Backup Data.
Described second revises subelement 1202 according to being sent to the first source data in described backup database, and the corresponding relation between the Backup Data in described the first source data and described backup database, in described backup database, search the Backup Data corresponding with described the first source data, and the Backup Data finding is deleted, meanwhile, relatively store described the second source data.Thereby described source database and described backup database be Update Table synchronously, guaranteed the consistance of described source database and described Backup Data database data.
Refer to Figure 13, it shows the structural representation of the another embodiment of a kind of data synchronizer, and the equipment of the present embodiment comprises: determination module 1301, update module 1302 and synchronization module 1303;
Described determination module 1301, meets pre-conditioned data for determining;
Described pre-conditioned for belonging to the data of giving tacit consent to or being provided with synchronous service.Measuring point, user, group or role are the higher data of importance level in database, belong to the synchronous data of acquiescence needs, when described update module 1302 receives, described measuring point, user, group or role are upgraded, and directly carry out the step of subsequent synchronisation.Interpolated data, the data that are stored in described measuring point belong to the data that importance level is lower, need to check whether described data are provided with synchronous service before carrying out synchronizing step, if so, can carry out follow-up synchronous.
Described update module 1302, during for Data Update instruction when receiving source database, upgrades the data in described source database;
Described synchronization module 1303, for the updating type through the data of renewal according to described source database, is synchronized in default backup database through the data of upgrading described.
Technical scheme from the present embodiment, described determination module 1301 determines and meets pre-conditioned data before synchronous the data of described renewal are carried out, and 1303 of the described synchronization modules data by the described renewal satisfying condition are synchronized in described backup database.Data are carried out optionally synchronous, improved described synchronous efficiency.
Refer to Figure 14, it shows the structural representation of synchronization module in a kind of data synchronizer, and the synchronization module of the present embodiment comprises: the first lock unit 1401 and the second lock unit 1402;
Described the first lock unit 1401, for sending packet in synchronizing process to backup database, and is copied to buffer memory by described packet;
In described synchronizing process, the synchronous renewal that described the first lock unit 1401 is done by the data of described renewal and to described backup database is encapsulated in packet, described packet is sent to described backup database, and described packet is copied in buffer memory simultaneously.
Described the second lock unit 1402 for not sending when successful when monitoring described packet, obtains described packet and retransmits from described buffer memory.
The transmission situation of the described packet of described the second lock unit 1402 monitoring, implementation can be: be the package number sending, and receive the numbering of the packet receiving returning in described backup database, when not receiving the numbering of returning of some or a plurality of packets, illustrate that described packet does not send successfully, described the second lock unit 1402 does not send successful packet described in obtaining from described buffer memory, and retransmits until receive and return to numbering.In addition, described the second lock unit 1402 is when receiving the returning after numbering of packet, can delete and described in described buffer memory, return to packet corresponding to numbering.
From the technical scheme of the present embodiment, it provides a kind of Monitoring Data to send situation, and by the data synchronizer that does not send successful data and retransmit, can avoid data-bag lost is situation, thereby has guaranteed better the reliability of synchronizing process.
It should be noted that, each embodiment in this instructions all adopts the mode of going forward one by one to describe, and each embodiment stresses is the difference with other embodiment, between each embodiment identical similar part mutually referring to.
Above the synchronous method and apparatus of a kind of data provided by the present invention is described in detail, the above-mentioned explanation to the disclosed embodiments, makes professional and technical personnel in the field can realize or use the present invention.To the multiple modification of these embodiment, will be apparent for those skilled in the art, General Principle as defined herein can, in the situation that not departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention will can not be restricted to these embodiment shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.

Claims (16)

1. the synchronous method of data, is characterized in that, described method is applied to database, and the method comprises:
When receive source database Data Update instruction time, the data in described source database are upgraded;
According to the updating type of the data that in described source database, process is upgraded, by described, through the data of upgrading, be synchronized in default backup database.
2. method according to claim 1, is characterized in that, before carrying out described method, also comprises:
The address parameter of obtaining described default backup database generates connection string;
According to described connection string, described source database is connected with described backup database.
3. method according to claim 1, is characterized in that, described renewal comprises:
Increase, delete or revise.
4. method according to claim 3, is characterized in that, when described, is updated to while increasing, and describedly by described, through the data of upgrading, is synchronized in default backup database, comprising:
The source data increasing in described source database is sent in described default backup database;
In described default backup database, store the source data of described increase.
5. method according to claim 3, is characterized in that, when described, is updated to while deleting, and describedly by described, through the data of upgrading, is synchronized in default backup database, comprising:
The source data of deleting in described source database is sent in described default backup database;
In described default backup database, search the Backup Data corresponding with the source data of described deletion, and described Backup Data is deleted.
6. method according to claim 3, is characterized in that, when described, is updated to while revising, and describedly by described, through the data of upgrading, is synchronized in default backup database, comprising:
The first source data in described source database and the second source data of being revised as by described the first source data are sent in described default backup database;
In described default backup database, search the Backup Data corresponding with described the first source data, correspondingly store described the second source data after deleting described Backup Data.
7. method according to claim 1, is characterized in that, by described through the data of upgrading, be synchronized to default backup database in before, also comprise:
Judge whether described data meet default condition, if so, carry out subsequent step.
8. method according to claim 1, is characterized in that, the described data that described process is upgraded are synchronized in default backup database, comprising:
In synchronizing process, to backup database, send packet, and described packet is copied to buffer memory;
When monitoring described packet, do not send when successful, from described buffer memory, obtain described packet and retransmit.
9. the synchronous equipment of data, is characterized in that, comprising:
Update module, during for Data Update instruction when receiving source database, upgrades the data in described source database;
Synchronization module, for the updating type through the data of renewal according to described source database, is synchronized in default backup database through the data of upgrading described.
10. equipment according to claim 9, is characterized in that, also comprises:
Acquisition module, generates connection string for obtaining the address parameter of described default backup database;
Link block, for being connected described source database according to described connection string with described backup database.
11. equipment according to claim 9, is characterized in that, described synchronization module comprises:
Increase unit, delete cells or modification unit.
12. equipment according to claim 11, is characterized in that, described increase unit comprises:
First increases subelement, for the source data that described source database is increased, is sent in described default backup database;
Second increases subelement, for store the source data of described increase at described default backup database.
13. equipment according to claim 11, is characterized in that, described delete cells comprises:
First deletes subelement, for the source data that described source database is deleted, is sent in described default backup database;
Second deletes subelement, at described default backup database, searches the Backup Data corresponding with the source data of described deletion, and described Backup Data is deleted.
14. equipment according to claim 11, is characterized in that, described modification unit comprises:
First revises subelement, for the first source data of described source database and the second source data of being revised as by described the first source data are sent in described default backup database;
Second revises subelement, at described default backup database, searches the Backup Data corresponding with described the first source data, correspondingly stores described the second source data after deleting described Backup Data.
15. equipment according to claim 9, is characterized in that, also comprise:
Determination module, meets pre-conditioned data for determining.
16. equipment according to claim 9, is characterized in that, described synchronization module comprises:
The first lock unit, for sending packet in synchronizing process to backup database, and is copied to buffer memory by described packet;
The second lock unit for not sending when successful when monitoring described packet, obtains described packet and retransmits from described buffer memory.
CN201310454695.6A 2013-09-27 2013-09-27 Data synchronizing method and equipment Pending CN103559198A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310454695.6A CN103559198A (en) 2013-09-27 2013-09-27 Data synchronizing method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310454695.6A CN103559198A (en) 2013-09-27 2013-09-27 Data synchronizing method and equipment

Publications (1)

Publication Number Publication Date
CN103559198A true CN103559198A (en) 2014-02-05

Family

ID=50013445

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310454695.6A Pending CN103559198A (en) 2013-09-27 2013-09-27 Data synchronizing method and equipment

Country Status (1)

Country Link
CN (1) CN103559198A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104281506A (en) * 2014-07-10 2015-01-14 中国科学院计算技术研究所 Data maintenance method and system for file system
CN104699760A (en) * 2015-02-11 2015-06-10 安徽继远电网技术有限责任公司 Data synchronization method used for heterogeneous system and based on safety isolation
CN106021559A (en) * 2016-05-31 2016-10-12 乐视控股(北京)有限公司 Data backup and recovery method, execution module and system
CN107015884A (en) * 2016-01-28 2017-08-04 杭州海康威视数字技术股份有限公司 A kind of date storage method and device
CN107798015A (en) * 2016-09-06 2018-03-13 盛趣信息技术(上海)有限公司 Game services end offline operation method
CN108073653A (en) * 2016-11-16 2018-05-25 蓝盾信息安全技术有限公司 The heterogeneous database synchronization method of one-way optical gate is realized based on data-flow analysis

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5615364A (en) * 1992-10-16 1997-03-25 Siemens Energy & Automation, Inc. Apparatus and method for performing the backup of a primary database using a back up database
CN1339134A (en) * 1999-02-10 2002-03-06 艾利森电话股份有限公司 Database system having at least two host databases and a remote database, and method of synchronizing such databases
CN1529457A (en) * 2003-09-29 2004-09-15 中兴通讯股份有限公司 Communication system base station and server database real-time synchronizing method
CN102982126A (en) * 2012-11-14 2013-03-20 浙江星汉信息技术有限公司 Method and system of real-time delivery of database table data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5615364A (en) * 1992-10-16 1997-03-25 Siemens Energy & Automation, Inc. Apparatus and method for performing the backup of a primary database using a back up database
CN1339134A (en) * 1999-02-10 2002-03-06 艾利森电话股份有限公司 Database system having at least two host databases and a remote database, and method of synchronizing such databases
CN1529457A (en) * 2003-09-29 2004-09-15 中兴通讯股份有限公司 Communication system base station and server database real-time synchronizing method
CN102982126A (en) * 2012-11-14 2013-03-20 浙江星汉信息技术有限公司 Method and system of real-time delivery of database table data

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郝雅青: ""网络隔离环境下有外健约束的数据库同步方法实现"", 《中国科技论文在线》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104281506A (en) * 2014-07-10 2015-01-14 中国科学院计算技术研究所 Data maintenance method and system for file system
CN104281506B (en) * 2014-07-10 2017-02-15 中国科学院计算技术研究所 Data maintenance method and system for file system
CN104699760A (en) * 2015-02-11 2015-06-10 安徽继远电网技术有限责任公司 Data synchronization method used for heterogeneous system and based on safety isolation
CN107015884A (en) * 2016-01-28 2017-08-04 杭州海康威视数字技术股份有限公司 A kind of date storage method and device
CN107015884B (en) * 2016-01-28 2019-12-20 杭州海康威视数字技术股份有限公司 Data storage method and device
CN106021559A (en) * 2016-05-31 2016-10-12 乐视控股(北京)有限公司 Data backup and recovery method, execution module and system
CN107798015A (en) * 2016-09-06 2018-03-13 盛趣信息技术(上海)有限公司 Game services end offline operation method
CN108073653A (en) * 2016-11-16 2018-05-25 蓝盾信息安全技术有限公司 The heterogeneous database synchronization method of one-way optical gate is realized based on data-flow analysis

Similar Documents

Publication Publication Date Title
CN103473277B (en) The Snapshot Method and device of file system
CN103559198A (en) Data synchronizing method and equipment
CN102098342B (en) Transaction level-based data synchronizing method, device thereof and system thereof
CN103095769B (en) Across method of data synchronization and the system of machine room
CN103220358B (en) The online file synchronisation method in a kind of multiple terminals, system, server and terminal unit
CN104468521B (en) Online moving method, device and system
CN102200901A (en) Image transfer method, image transfer system, and projector
CN103051681B (en) Collaborative type log system facing to distribution-type file system
CN103841170A (en) Cloud storage method and server
WO2016177231A1 (en) Dual-control-based active-backup switching method and device
CN105338090A (en) WebSocket-based breakpoint continuous transmission method and device
CN104866234A (en) Data migration method, device and system
CN102420863B (en) Rapid file distribution system, method thereof and apparatus thereof
CN104601366A (en) Configuration service method and device for control and service nodes
CN108347463A (en) A kind of terminal document method for uploading
CN105681420A (en) Method for realizing backup of switch operating system based on Docker
CN104506462A (en) MAC (Media Access Control) address management method and equipment in distributed switch
CN104506367A (en) Updating management system
CN109413210A (en) Target drives upgrade method, device, equipment and the medium of distributed cluster system
CN104750738A (en) Data information updating method, data node, management node and system
CN104793981A (en) Online snapshot managing method and device for virtual machine cluster
CN104079623A (en) Method and system for controlling multilevel cloud storage synchrony
CN105007310A (en) Information synchronization method, device and system
CN105760398A (en) Log recording system and log record operating method
KR20160090485A (en) Method and apparatus for operating distributed controllers of software defined network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20140205

RJ01 Rejection of invention patent application after publication