CN106570135A - Data synchronization method and device for databases - Google Patents

Data synchronization method and device for databases Download PDF

Info

Publication number
CN106570135A
CN106570135A CN201610958069.4A CN201610958069A CN106570135A CN 106570135 A CN106570135 A CN 106570135A CN 201610958069 A CN201610958069 A CN 201610958069A CN 106570135 A CN106570135 A CN 106570135A
Authority
CN
China
Prior art keywords
data base
data
information
database
base
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
CN201610958069.4A
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.)
Shenzhen City Department Of Changhai Polytron Technologies Inc
Original Assignee
Shenzhen City Department Of Changhai Polytron Technologies Inc
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 Shenzhen City Department Of Changhai Polytron Technologies Inc filed Critical Shenzhen City Department Of Changhai Polytron Technologies Inc
Priority to CN201610958069.4A priority Critical patent/CN106570135A/en
Publication of CN106570135A publication Critical patent/CN106570135A/en
Pending legal-status Critical Current

Links

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

Abstract

The invention relates to a data synchronization method and device for databases. The method comprises following steps: obtaining configuration information; analyzing the configuration information to obtain connecting information and mapping information of a first database and a second database; establishing connection between the first database and the second database according to the connecting information of the first database and the second database; synchronizing data of the second database to the first database according to the mapping information of the first database and the second database. Data of databases can be directly synchronized by establishing connecting and mapping between databases without the synchronization through systems and interfaces of systems, which effectively increases the data synchronization efficiency and reduces the difficulty and cost for data synchronization.

Description

Method for synchronizing data of database and device
Technical field
The present invention relates to data synchronization technology field, more particularly to method for synchronizing data of database and device.
Background technology
In enterprise development and informatization, information island can be run in any enterprise development process in the whole world Problem.Information island refers to that information does not share exchange, information, operation flow and application mutually disconnection between application system.Enterprise The application system of industry such as HR (Human Resources, human resourcess) system, (Office Automation, office is certainly for OA Dynamicization) system, financial system etc. is all different software supplier development mostly, and respective system has the data base of oneself, mutually Between Dynamic data exchange, and these basic datas such as employee information, department information and customer information can not be shared, and need at each Go to register in application system, change, extra work amount is brought to enterprise, cause business administration cost big, management inconvenience.
The shared scheme of each system data of traditional solution is the data sharing for realizing between system by system docking, is led to The docking of Interface for System is crossed, but due to differences such as design language between system and methods for designing, there is interface exploitation difficulty Greatly, numerous drawbacks such as cycle length and cost height.
The content of the invention
Based on this, it is necessary to for traditional inter-system data synchronization inefficiency, difficulty is big, and the defect of high cost is carried For a kind of method for synchronizing data of database and device.
A kind of method for synchronizing data of database, including:
Obtain configuration information;
The configuration information is parsed, the link information and map information of the first data base and the second data base is obtained;
According to first data base and the link information of second data base, first data base and described is set up The connection of the second data base;
According to first data base and the map information of second data base, will be the data of second data base same Walk to first data base.
In one embodiment, it is described according to first data base and the link information of second data base, set up The step of connection of first data base and second data base, includes:
The link information is parsed, the target information of first data base is obtained, and is obtained second data base's Source information;
According to the target information and the source information of second data base of first data base, institute is set up State the connection of the first data base and second data base.
In one embodiment, it is described according to first data base and the map information of second data base, by institute The step of data syn-chronization of the second data base is stated to first data base includes:
According to first data base and the map information of second data base, at interval of Preset Time by described second The data syn-chronization of data base is to first data base.
In one embodiment, it is described according to first data base and the map information of second data base, by institute The step of data syn-chronization of the second data base is stated to first data base includes:
According to first data base and the map information of second data base, the second of second data base is obtained Field;
Judge first data base with the presence or absence of with the first field of the second field identical, be then by described second The data syn-chronization of field is to first data base.
In one embodiment, the data syn-chronization by second data base is wrapped to the step of first data base Include:
Obtain the second main information of second data base;
Judge in first data base with the presence or absence of the main information identical with described the second of second data base the One main information, in this way, then the first data base according to the described second main information updating, otherwise, according to the described second main information The data comprising the described second main information are inserted in first data base.
A kind of database in phase device, including:
Configuration information acquisition module, for obtaining configuration information;
Configuration information parsing module, for parsing the configuration information, obtains the company of the first data base and the second data base Connect information and map information;
Connection establishment module, for the link information according to first data base and second data base, sets up institute State the connection of the first data base and second data base;
Data simultaneous module, for the map information according to first data base and second data base, will be described The data syn-chronization of the second data base is to first data base.
In one embodiment, the connection establishment module includes:
Source information acquisition submodule, for parsing the link information, obtains the target information of first data base, and Obtain the source information of second data base;
Connection establishment submodule, for the target information according to first data base and second data base The source information, set up the connection of first data base and second data base.
In one embodiment, the data simultaneous module includes:
Interval synchronization submodule, for the map information according to first data base and second data base, per Every Preset Time by the data syn-chronization of second data base to first data base.
In one embodiment, the data simultaneous module includes:
Second field acquisition submodule, for the map information according to first data base and second data base, Obtain second field of second data base;
Judge synchronous submodule, for judge first data base with the presence or absence of with the second field identical first Field, is then by the data syn-chronization of second field to first data base.
In one embodiment, the data simultaneous module includes:
Second main acquisition of information submodule, for obtaining the second main information of second data base;
Update insertion submodule, for judge in first data base with the presence or absence of with described in second data base Second the first main information of main information identical, in this way, then the first data base according to the described second main information updating, otherwise, Data comprising the described second main information are inserted in first data base according to the described second main information.
Above-mentioned method for synchronizing data of database and device, by the connection set up between data base and mapping so that number Can be directly synchronous according to the data between storehouse, and without the need for being synchronized by the interface between system and system, effectively improve The synchronous efficiency of data, and reduce the difficulty and cost of data syn-chronization.
Description of the drawings
Figure 1A is the schematic flow sheet of the method for synchronizing data of database of an embodiment;
Figure 1B is the schematic flow sheet of the method for synchronizing data of database of another embodiment;
Fig. 1 C are the schematic flow sheet of the method for synchronizing data of database of another embodiment;
Fig. 1 D are the schematic flow sheet of the method for synchronizing data of database of another embodiment;
Fig. 2A is the functional block diagram of the database in phase device of an embodiment;
Fig. 2 B are the functional block diagram of the connection establishment module of an embodiment;
Fig. 2 C are the functional block diagram of the data simultaneous module of an embodiment;
Fig. 2 D are the functional block diagram of the data simultaneous module of an embodiment;
Fig. 3 is the schematic flow sheet of the generation of the configuration information of an embodiment;
Fig. 4 is the schematic flow sheet of the process of the database in phase of an embodiment.
Specific embodiment
For the ease of understanding the present invention, the present invention is described more fully below with reference to relevant drawings.In accompanying drawing Give presently preferred embodiments of the present invention.But, the present invention can be realized in many different forms, however it is not limited to this paper institutes The embodiment of description.On the contrary, the target for providing these embodiments is to make the understanding to the disclosure more thorough Comprehensively.
In one embodiment, as shown in Figure 1A, a kind of method for synchronizing data of database of an embodiment, including following step Suddenly:
Step 120, obtains configuration information.
In the present embodiment, the configuration information is the configuration information for prestoring, and for example, the configuration information is given birth to according to input instruction Into, and store in systems, for example, in the configuration information storage memory space in systems.For example, the system is in fortune Reading database after row, the data of the system are obtained from data base.For example, system at least one data base of correspondence, example Such as, a system connects at least one data base.
Step 140, parses the configuration information, obtains link information and the mapping of the first data base and the second data base Information.
In the present embodiment, the first data base is target database, and the second data base is source database, and source database is The data base in data syn-chronization source, target database are the target database of data syn-chronization, the first data base and the second data Storehouse is respectively connecting to different two systems.
For example, the first data base and the second data base are different data base, for example, the first data base and the second data base Different types, i.e. the first data base and the second data base are different types of data base, and for example, the first data base is Access, the second data base are SQLSERVER, and and for example, the first data base is oracle, and the second data base is SQLSERVER.
The configuration information includes link information and map information, in this step, reads the configuration information, parses this and match somebody with somebody Confidence ceases, and obtains the link information of the first data base and the second data base, and obtains the first data base and the second data base Map information, the link information are annexation, for setting up the connection of the first data base and the second data base, i.e., so that first Data base can be connected to the second data base, and the map information is mapping relations, and the map information is for by the second data base Table or View Mapping to the first data base.
Step 160, according to first data base and the link information of second data base, sets up first data Storehouse and the connection of second data base.
Specifically, the link information includes the routing information of the second data base, and for example, the routing information is address information, For pointing to the second data base, in this step, according to the link information so that the first data base is connected with the second Database Connect, i.e., so that the first data base is connected to the second data base, for example so that the first data base reads the second data base, for example, makes Obtain first the second data base of database access.
For example, by setting up ODBC (Open Database Connectivity, open CNC) data source, build Vertical first data base and the connection of the second data base, for example, by data base's connection string, set up the first data base and second The connection of data base.By setting up odbc data source, by by data base's connection string, different types of number can be realized According to the connection between storehouse.
Step 180, according to first data base and the map information of second data base, by second data base Data syn-chronization to first data base.
In the present embodiment, the map information includes the table information and view information of the second data base, is worth mentioning , multiple tables are included in data base, each table has corresponding table name, and data base includes multiple views, each view With corresponding view name, the table information describes table name, and view information describes view name, due to the first data base The connection with the second data base has been established, therefore, the first data base is able to access that the second data base, obtains in the second data base Data in table and view, by table in the second data base and the data syn-chronization in view to the first data base.
It is noted that in the present embodiment, described synchronization be one-way synchronization, i.e. data by the second database synchronization extremely First data base.
Connection and mapping by setting up between data base of the invention so that the data between data base can be directly same Step, and without the need for being synchronized by the interface between system and system, effectively increase the synchronous efficiency of data, and reduce The difficulty and cost of data syn-chronization.
In one embodiment, as shown in Figure 1B, the step 160 includes:
Step 162, parses the link information, obtains the target information of first data base, and obtains described second The source information of data base.
Specifically, the target information includes Target database name, target database routing information, target database user Name and target database password etc., specifically, the target database is the first data base;The source information includes source database name Title, source database routing information, source database user name and source database password etc..Specifically, the source database is second Data base.
The first data base is determined by getting Target database name and target database routing information, by getting Target database user name and target database password are so as to obtaining the access rights of the first data base;By getting source number The second data base is determined according to library name and source database routing information, by getting source database user name and source database Password is so as to obtaining the access rights of the second data base.
In the present embodiment, the target information and source information also include odbc data source title and data base's connection string, ODBC provides standard API (Application Programming Interface, the application programming to database access Interface), enable to different types of data base and can set up connection, data base's connection string is used to set up between data base Connection, data base's connection string is close with data base by database-name, database path information database user name Code sets up the connection with data base, so that two database realizing connections.
Step 164, according to the target information and the source letter of second data base of first data base Breath, sets up the connection of first data base and second data base.
Specifically, after target information and source information is obtained, according to target information and source information, set up target database with The connection of source database so that target database can orientation source database, obtain source database data, copy source data storehouse Data.
In one embodiment, the step 180 includes:According to reflecting for first data base and second data base Information is penetrated, at interval of Preset Time by the data syn-chronization of second data base to first data base.
It is noted that system is operationally, data, write data is constantly read out to its data base or is repaiied Change data, then, the data of the data base will be continuously updated.In the present embodiment, in order that number in the first data base According to real-time synchronization is obtained, in real time by the data syn-chronization of the second data base to the first data base, when at interval of a Preset Time, Then by the data syn-chronization of the second data base to the first data base, so, the data of the first data base constantly can be updated, and protect Hold synchronous with the data of the second data base, so that the real-time property of the first data base is higher.For example, the Preset Time For 30min, for example, the Preset Time is 1 hour, and and for example, the Preset Time is 2 hours.And for example, the Preset Time is according to described The accessed number of times of second data base is generated, and and for example, Preset Time is averagely accessed number of times according to second data base and generates, example Such as, Preset Time is negatively correlated with the accessed number of times of second data base, it is worth mentioning at this point that, within a period of time, the second number More by system access times according to storehouse, then the quantity of the renewal of the second data base is bigger, so, in order to make data same in time The first data base is walked, and improves synchronous efficiency, need the multiple synchrodata on the interval of shorter Preset Time, therefore, When within a period of time, the second data base is more by system access times, Preset Time is less, then the first data base is from the second number It is higher according to the synchronous frequency in storehouse, so, per hyposynchronous data volume by first to reducing, so as to improve synchronous efficiency so that second The data of data base update after can Fast synchronization to the first data base.
In one embodiment, as shown in Figure 1 C, the step 180 includes:
Step 182, according to first data base and the map information of second data base, obtains second data Second field in storehouse.
Specifically, field is the general designation of the data with predicable, and for example, field is the data of same row in data base General designation, for example, field is an attribute in the table in data base, and different fields is the data of different attributes, For example, the field be " department ", or the field be " age ".
In the present embodiment, map information includes the table information and view information of the second data base, the table information with And view information includes in table corresponding field information in corresponding field information and view.For example, parse described first Data base and the map information of second data base, obtain the table information and view information of the second data base, obtain second Second field of data base, for example, obtains each second field in the second data base.
Step 184, judge first data base with the presence or absence of with the first field of the second field identical, be then will The data syn-chronization of second field is to first data base.
For example, the map information of first data base and second data base is parsed, the table of the first data base is obtained Information and view information, obtain first field of the first data base, for example, obtain each first word of the first data base Section.
In this step, judge the first data base with the presence or absence of with second the first field of field identical, that is, judge first number Whether contain and second data base's same field according to storehouse, or judge whether the first data base contains and second data base's phase With the data of attribute, in this way, then by the data syn-chronization of the second field in the second data base to the first data base.Due to the first word Section is identical with the second field, then the data attribute in the second field is identical with the attribute of the data in the first field, for example, second Field is " department ", and the first field is " department ", then both attributes are identical, then can be by the data syn-chronization in the second field to the One data base.
For example, judge first data base with the presence or absence of with the first field of the second field identical, such as otherwise not Second field is synchronized.In the present embodiment, field is not increased to the table in the first data base, and only to existing Field in data be updated, i.e., so that the data in the first data base in field are according to same field in the second data base In data synchronize.
In one embodiment, as shown in figure ip, the step 180 includes:
Step 180a, obtains the second main information of second data base.
Specifically, in data base comprising it is a plurality of record or multiple entries, the every a line in table be called one " record " or " entry ", each record include all information in this row, and the row record includes the data of multiple fields, and main information is record In a certain field data, the main information be subrecord in for recognize this record data, i.e., the main letter in each record Cease for the identification marking in the record, the main information in different records is different, the data of other fields in different records can be with Identical or different, for example, each record includes field " name ", " job number ", " department ", " age ", then, it is somebody's turn to do " name " Field or " job number " field main information then for the record, the data in " name " field or " job number " field have uniqueness, For distinguishing different records, and field " department " and field " age " then can be with identical or different, for example, and individual more can be with Same department, it is also possible to which different departments, more individual can have same age, it is possible to have the different ages.
In the present embodiment, the second main information in table or view in the second data base is obtained, the main information is used to distinguish note Record, or for distinguishing entry.
Step 180b, judges in first data base with the presence or absence of the described second main information with second data base The first main information of identical, in this way, then execution step 180c, otherwise execution step 180d.
Step 180c, the first data base according to the described second main information updating.
Step 180d, is inserted into comprising the described second main information in first data base according to the described second main information Data.
For example, obtain the first main information in the first data base, judge first data base it is interior with the presence or absence of with it is described The described second first main information of main information identical of the second data base.In the present embodiment, judge whether have in the first data base Have and the corresponding record in the second data base, in other words, whether judge in the first data base with the phase in the second data base With record, such as judged result be yes, then show to exist in the first data base and record with second data base's identical, then according to the The corresponding record of two main information updates the first data bases, for example, according to the multiple fields in the corresponding record of the second main information Data are updated to the multiple fields in the corresponding record of the first of the first data base the main information;As judged result be it is no, then Show exist in the middle part of the first data base and second data base's identical record, then the second main information pair of insertion in the first data base The record answered, for example, is inserted into note comprising described second main information in first data base according to the described second main information The data of record.
In one embodiment, also include after step 140:Obtain mission bit stream.
For example, configuration information is parsed, obtains mission bit stream.
For example, the mission bit stream includes task execution time and task entry information, for example, obtains mission bit stream, parsing The mission bit stream, obtains task execution time and task entry information.For example, the task execution time is Preset Time, After obtaining Preset Time, then task is performed at interval of Preset Time, include step 160 to step 180 the step of each task, Realize the real-time synchronization of data.For example, task entry information includes the link information of the first data base and the second data base, and Such as, the task entry information also includes the map information of first data base and second data base, so, each task The first data base and the second data base in items for information is different, for example, the first data base in each task entry information and Second data base ground link information is different, and and for example, the first data base's and the second data base in each task entry information reflects Penetrate information different, i.e. each task is used to perform the data syn-chronization in different two data base, so, obtaining with confidence After breath, the data syn-chronization between multiple data bases can be performed according to mission bit stream.
In one embodiment, also include before step 120:Obtain the connection letter of the first data base and the second data base Breath, obtains the map information of the first data base and the second data base, and according to the link information and the map information, generation is matched somebody with somebody Confidence ceases.
For example, the target information and the source information of second data base according to the first data base, generates the first data base With the link information of the second data base, and for example, according to the target information and the source information of second data base of the first data base, Generate the map information of the first data base and the second data base.
For example, also including step after configuration information is generated:Whether Test database connection is abnormal, for example, detects number Whether connect according to storehouse.Specifically, the configuration information is obtained by system and is parsed, and it is same that system carries out data according to the configuration information Step, such as there is exception or mistake in configuration information, and system will be caused to cannot connect to corresponding data base, therefore, with confidence After breath is generated, system need to detect whether corresponding data base connection is abnormal, to judge configuration information whether exception or mistake.
A specifically embodiment is presented herein below:
As shown in figure 3, which is the generating process of configuration information:Configuration starts, that is, start to generate configuration information;First, match somebody with somebody The connection of each data base is put, that is, is generated the link information of data base, is connected between data base two-by-two;Subsequently, configure library to library, Mapping relations of the table to table, i.e., one target database one source database of correspondence, the table correspondence source data in target database Table in storehouse, generates map information;Subsequently, corresponding literary name section configuration, the mapping of same field in database are generated The map information of field;The configuration of a synchronous task is completed, the life of the configuration information between two data bases is now completed Into;Judge whether to continue the next synchronous task of configuration, in this way, then return and configure library to library, mapping relations of the table to table, otherwise open Dynamic program is tested to configuration, and in the present embodiment, program is system, and the program is used to access data base, to data base's Data are written and read, and program starts, and whether the connection for being capable of Test database is abnormal;Whether Test database connection is normal, such as Connection is normal, then detect whether table is correct with field, if not, returning the connection for configuring each data base, configuration information is entered Row amendment;When detecting that table is correct with field, then configuration terminates.
As shown in figure 4, which is the process of database in phase:Synchronously start, read configuration information first, parse this and match somebody with somebody Confidence ceases, and obtains timed task, under the timed task, then performs a timed task at interval of Preset Time, parse this and match somebody with somebody Confidence ceases, and gets multiple tasks, and tasks carrying one by one:In task, carry out data base's connection first, target database with The link information of source database is as follows:
Configuration information is described as follows:
;//DBConfig_Src:Data source
;//DBDataSource:Odbc data source title
;//DBUserName:User name
;//DBUserPsw:Password
;//DBName:Data base
;//ConnStr:Data base's connection string
;The configuration of // // // // // ///data base starts // // // // // // // ///
[DBConfig1]
DBDataSource=dhnp
DBUserName=
DBUserPsw=
DBName=
ConnStr=Provider=OraOLEDB.Oracle.1;Password=shnp;Persist Security Info=True;User ID=shnp;Data Source=orcl
[DBConfig2]
DBDataSource=dwgl
DBUserName=
DBUserPsw=
DBName=
ConnStr=Provider=MSDASQL.1;Password=shnp;Persist Security Info= True;User ID=shnp;Data Source=test
;ConnStr=Provider=Provider=MSDASQL.1;Persist Security Info=False; User ID=shnp;Data Source=test
;The configuration of // // // // // ///data base terminates // // // // // // // ///
Subsequently, corresponding data is read according to mapping relations, i.e., source data is read from source database, one by one data syn-chronization, It is the mapping of target database and source database first, followed by the mapping of table and table, it is the mapping of field again, according to above-mentioned Mapping, one by one data are synchronized.
Configuration information is described as follows:
;//DataSync(n):Nth data is synchronously configured
;//ViewSql:The view paths configuration of data conversion, can be sky, if having matched somebody with somebody view, below TableSrc must be arranged to view
;//DataBaseSrc:Source data base selects
;//DataBaseDest:Target database is selected
;//TableSrc :Source tables of data configuration (this can be with configuration view)
;//TableDest:Target matrix configuration (this can only configuration data table)
;//UseStatus:Synchronously enable mark (0 does not enable, and 1 enables)
;//ShowLog:Synchronization log shows (0 does not show, 1 shows)
;// // // // // // // // data syn-chronization it is main configuration start // // // // // // // //
[DataSync1]
DataBaseSrc=DBConfig1
DataBaseDest=DBConfig2
TableSrc=customer
TableName=
BackField=
BackValue=
ViewSql=select CUSTOMEROID, CUSTOMERNAME, IDNO, MOBILE, Customerid, ' 5180001'market_no from customer where CUSTOMEROID>1and rownum<=50
TableDest=center_customer_basic
UseStatus=0
ShowLog=1
;// // // // // // // // tables of data configuration is said Bright // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // ///
;//KeyField(n):The configuration of n-th major key (sequence number n starts to increase from 1, it is middle must be continuous, every table can be with Multiple major keys are configured, at least one)
;//Field(n):(sequence number n starts to increase from 1, and middle necessary continuous, every table can be matched somebody with somebody for n-th key configuration Multiple major keys are put, at least one)
;//////////////////////////////////////////////////////////////////////////// /////////////////////////
[FEEITEM]
KeyField1=FEEITEMOID
Field1=FEEITEMNAME
Field2=FEEITEMID
[center_bse_feeitem]
KeyField1=feeitemoid
Field1=feeitemna
Field2=feeitemno
For example, table FEEITEM synchronous with the needs in table center_customer_basic field number is consistent, Correspond.
In synchronization, judge the whether existing object library of data, i.e., in target database with the presence or absence of with phase in source database Same record, in this way, then updates new data, i.e., update target database according to the data of the corresponding record in source database, New data is otherwise inserted, target database will be inserted into by corresponding record in source database, so as to complete a data synchronization, One data is a record;Judge that the task is completed, be such as otherwise back to data syn-chronization one by one, remaining data are entered Row is synchronous, and the such as task is completed, then judge whether that all tasks are completed, such as no, is returning tasks carrying one by one, under execution One task, until all tasks complete, and after Preset Time, tasks carrying one by one again.
In one embodiment, as shown in Figure 2 A, a kind of database in phase device of a preferred embodiment, including:
Configuration information acquisition module 210, for obtaining configuration information.
Configuration information parsing module 230, for parsing the configuration information, the first data base of acquisition and the second data base Link information and map information.
Connection establishment module 250, for the link information according to first data base and second data base, sets up First data base and the connection of second data base.
Data simultaneous module 270, for the map information according to first data base and second data base, by institute The data syn-chronization of the second data base is stated to first data base.
In one embodiment, as shown in Figure 2 B, the connection establishment module 250 includes:
Source information acquisition submodule 251, for parsing the link information, obtains the target letter of first data base Breath, and obtain the source information of second data base.
Connection establishment submodule 253, for the target information according to first data base and second number According to the source information in storehouse, the connection of first data base and second data base is set up.
In one embodiment, the data simultaneous module 270 includes:Interval synchronization submodule, for according to described One data base and the map information of second data base, at interval of Preset Time by the data syn-chronization of second data base extremely First data base.
In one embodiment, as shown in Figure 2 C, the data simultaneous module 270 includes:
Second field acquisition submodule 271, for being believed according to the mapping of first data base and second data base Breath, obtains second field of second data base.
Judge synchronous submodule 273, for judge first data base with the presence or absence of with the second field identical First field, is then by the data syn-chronization of second field to first data base.
In one embodiment, as shown in Figure 2 D, the data simultaneous module 270 includes:
Second main acquisition of information submodule 270a, for obtaining the second main information of second data base.
Insertion submodule 270b is updated, for judging in first data base with the presence or absence of with second data base's The first main information of the second main information identical, in this way, then the first data base according to the described second main information updating, no Then, the data comprising the described second main information are inserted in first data base according to the described second main information.
It should be noted that in said system embodiment, included modules simply carry out drawing according to function logic Point, but above-mentioned division is not limited to, as long as corresponding function can be realized;In addition, each functional module is concrete Title is also only to facilitate mutually differentiation, is not limited to protection scope of the present invention.
In addition, one of ordinary skill in the art will appreciate that realizing all or part of step in the various embodiments described above method Program be can be by instruct the hardware of correlation to complete, corresponding program can be stored in read/write memory medium.
Each technical characteristic of embodiment described above arbitrarily can be combined, to make description succinct, not to above-mentioned reality Apply all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited In contradiction, the scope of this specification record is all considered to be.
Embodiment described above only expresses the several embodiments of the present invention, and its description is more concrete and detailed, but and Therefore can not be construed as limiting the scope of the patent.It should be pointed out that for one of ordinary skill in the art comes Say, without departing from the inventive concept of the premise, some deformations and improvement can also be made, these belong to the protection of the present invention Scope.Therefore, the protection domain of patent of the present invention should be defined by claims.

Claims (10)

1. a kind of method for synchronizing data of database, it is characterised in that include:
Obtain configuration information;
The configuration information is parsed, the link information and map information of the first data base and the second data base is obtained;
According to first data base and the link information of second data base, first data base and described second are set up The connection of data base;
According to first data base and the map information of second data base, by the data syn-chronization of second data base extremely First data base.
2. method for synchronizing data of database according to claim 1, it is characterised in that described according to first data base With the link information of second data base, wrap the step of set up the connection of first data base and second data base Include:
The link information is parsed, the target information of first data base is obtained, and is obtained the source letter of second data base Breath;
According to the target information and the source information of second data base of first data base, described is set up One data base and the connection of second data base.
3. method for synchronizing data of database according to claim 1, it is characterised in that described according to first data base With the map information of second data base, the data syn-chronization of second data base is wrapped to the step of first data base Include:
According to first data base and the map information of second data base, at interval of Preset Time by second data The data syn-chronization in storehouse is to first data base.
4. method for synchronizing data of database according to claim 1, it is characterised in that described according to first data base With the map information of second data base, the data syn-chronization of second data base is wrapped to the step of first data base Include:
According to first data base and the map information of second data base, second word of second data base is obtained Section;
Judge first data base with the presence or absence of with the first field of the second field identical, be then by second field Data syn-chronization to first data base.
5. method for synchronizing data of database according to claim 1, it is characterised in that described by second data base's The step of data syn-chronization is to first data base includes:
Obtain the second main information of second data base;
Judge to lead with the presence or absence of the main information identical first with described the second of second data base in first data base Information, in this way, then the first data base according to the described second main information updating, otherwise, according to the described second main information in institute State the first data base and be inserted into the data comprising the described second main information.
6. a kind of database in phase device, it is characterised in that include:
Configuration information acquisition module, for obtaining configuration information;
Configuration information parsing module, for parsing the configuration information, obtains the connection letter of the first data base and the second data base Breath and map information;
Connection establishment module, for the link information according to first data base and second data base, sets up described One data base and the connection of second data base;
Data simultaneous module, for the map information according to first data base and second data base, by described second The data syn-chronization of data base is to first data base.
7. database in phase device according to claim 6, it is characterised in that the connection establishment module includes:
Source information acquisition submodule, for parsing the link information, obtains the target information of first data base, and obtains The source information of second data base;
Connection establishment submodule, for the target information according to first data base and the institute of second data base Source information is stated, the connection of first data base and second data base is set up.
8. database in phase device according to claim 6, it is characterised in that the data simultaneous module includes:
Interval synchronization submodule, for the map information according to first data base and second data base, at interval of pre- If the time is by the data syn-chronization of second data base to first data base.
9. database in phase device according to claim 6, it is characterised in that the data simultaneous module includes:
Second field acquisition submodule, for the map information according to first data base and second data base, obtains Second field of second data base;
Judge synchronous submodule, for judge first data base with the presence or absence of with the first word of the second field identical Section, is then by the data syn-chronization of second field to first data base.
10. database in phase device according to claim 6, it is characterised in that the data simultaneous module includes:
Second main acquisition of information submodule, for obtaining the second main information of second data base;
Insertion submodule is updated, for judging in first data base with the presence or absence of described second with second data base The first main information of main information identical, in this way, then the first data base according to the described second main information updating, otherwise, according to The second main information is inserted into the data comprising the described second main information in first data base.
CN201610958069.4A 2016-10-27 2016-10-27 Data synchronization method and device for databases Pending CN106570135A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610958069.4A CN106570135A (en) 2016-10-27 2016-10-27 Data synchronization method and device for databases

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610958069.4A CN106570135A (en) 2016-10-27 2016-10-27 Data synchronization method and device for databases

Publications (1)

Publication Number Publication Date
CN106570135A true CN106570135A (en) 2017-04-19

Family

ID=58535810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610958069.4A Pending CN106570135A (en) 2016-10-27 2016-10-27 Data synchronization method and device for databases

Country Status (1)

Country Link
CN (1) CN106570135A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203642A (en) * 2017-06-19 2017-09-26 山东浪潮通软信息科技有限公司 A kind of method of data synchronization and device
CN107343049A (en) * 2017-07-06 2017-11-10 上海观谷科技有限公司 Method of data synchronization and device
CN107885884A (en) * 2017-12-01 2018-04-06 深圳市天下房仓科技有限公司 A kind of hotel's method of data synchronization, system and storage medium
CN109271454A (en) * 2018-10-26 2019-01-25 金蝶软件(中国)有限公司 A kind of method and the network equipment that data are synchronous
CN109800273A (en) * 2018-12-03 2019-05-24 北京明略软件系统有限公司 A kind of method, apparatus of data processing, computer storage medium and terminal
CN110019494A (en) * 2017-07-26 2019-07-16 北京国双科技有限公司 Media data processing method and device, storage medium and processor
CN110740291A (en) * 2018-07-20 2020-01-31 视联动力信息技术股份有限公司 synchronization method and device based on video networking monitoring data
CN112527897A (en) * 2020-12-01 2021-03-19 深圳市鹰硕技术有限公司 Data processing method and system
CN108573006B (en) * 2017-06-06 2021-03-26 北京金山云网络技术有限公司 Cross-machine-room data synchronization system, method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020107876A1 (en) * 2000-09-08 2002-08-08 Masashi Tsuchida Method and system for managing multiple database storage units
CN1905434A (en) * 2006-08-08 2007-01-31 华为技术有限公司 Data synchronous method, wireless network controller configurating method and tool
CN104239476A (en) * 2014-09-04 2014-12-24 上海天脉聚源文化传媒有限公司 Method, device and system for synchronizing databases
CN104572672A (en) * 2013-10-15 2015-04-29 北大方正集团有限公司 Heterogeneous database synchronization method and application system
CN105554114A (en) * 2015-12-17 2016-05-04 深圳市从晶科技有限公司 Data synchronization method and data synchronization firmware platform
CN105930389A (en) * 2016-04-14 2016-09-07 北京京东尚科信息技术有限公司 Method and system for transferring data

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020107876A1 (en) * 2000-09-08 2002-08-08 Masashi Tsuchida Method and system for managing multiple database storage units
CN1905434A (en) * 2006-08-08 2007-01-31 华为技术有限公司 Data synchronous method, wireless network controller configurating method and tool
CN104572672A (en) * 2013-10-15 2015-04-29 北大方正集团有限公司 Heterogeneous database synchronization method and application system
CN104239476A (en) * 2014-09-04 2014-12-24 上海天脉聚源文化传媒有限公司 Method, device and system for synchronizing databases
CN105554114A (en) * 2015-12-17 2016-05-04 深圳市从晶科技有限公司 Data synchronization method and data synchronization firmware platform
CN105930389A (en) * 2016-04-14 2016-09-07 北京京东尚科信息技术有限公司 Method and system for transferring data

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108573006B (en) * 2017-06-06 2021-03-26 北京金山云网络技术有限公司 Cross-machine-room data synchronization system, method and device and electronic equipment
CN107203642A (en) * 2017-06-19 2017-09-26 山东浪潮通软信息科技有限公司 A kind of method of data synchronization and device
CN107343049A (en) * 2017-07-06 2017-11-10 上海观谷科技有限公司 Method of data synchronization and device
CN107343049B (en) * 2017-07-06 2020-03-24 上海观谷科技有限公司 Data synchronization method and device
CN110019494A (en) * 2017-07-26 2019-07-16 北京国双科技有限公司 Media data processing method and device, storage medium and processor
CN110019494B (en) * 2017-07-26 2021-09-07 北京国双科技有限公司 Media data processing method and device, storage medium and processor
CN107885884A (en) * 2017-12-01 2018-04-06 深圳市天下房仓科技有限公司 A kind of hotel's method of data synchronization, system and storage medium
CN110740291A (en) * 2018-07-20 2020-01-31 视联动力信息技术股份有限公司 synchronization method and device based on video networking monitoring data
CN109271454A (en) * 2018-10-26 2019-01-25 金蝶软件(中国)有限公司 A kind of method and the network equipment that data are synchronous
CN109271454B (en) * 2018-10-26 2021-02-02 金蝶软件(中国)有限公司 Data synchronization method and network equipment
CN109800273A (en) * 2018-12-03 2019-05-24 北京明略软件系统有限公司 A kind of method, apparatus of data processing, computer storage medium and terminal
CN112527897A (en) * 2020-12-01 2021-03-19 深圳市鹰硕技术有限公司 Data processing method and system

Similar Documents

Publication Publication Date Title
CN106570135A (en) Data synchronization method and device for databases
US7818292B2 (en) SQL change tracking layer
US6931390B1 (en) Method and mechanism for database partitioning
CN105608088B (en) A kind of database based on configuration file automatically creates and data dynamic recording method
US10235435B2 (en) Database application federation
AU2014233672B2 (en) System for metadata management
US7562102B1 (en) Extensible handling of new or modified data within an independent distributed database system
US7979456B2 (en) Method of managing and providing parameterized queries
US20080201296A1 (en) Partitioning of nested tables
US20090055429A1 (en) Method and system for data collection
CN104484478B (en) A kind of association cluster data method for reducing body weight and system
US20090132607A1 (en) Techniques for log file processing
CN103810094B (en) Execution method, device and the testing tool of a kind of test cases
CN114780641A (en) Multi-library multi-table synchronization method and device, computer equipment and storage medium
US7136861B1 (en) Method and system for multiple function database indexing
CN115757626A (en) Data quality detection method and device, electronic equipment and storage medium
CN111177244A (en) Data association analysis method for multiple heterogeneous databases
CN111159020B (en) Method and device applied to synchronous software test
CN116975649A (en) Data processing method, device, electronic equipment, storage medium and program product
CN105868384A (en) Method, device and system for updating shared data
US8316013B2 (en) Programmatic retrieval of tabular data within a cell of a query result
US9177008B1 (en) Positioned updates in a distributed shared-nothing data store
Gašpar et al. Integrating Two Worlds: Relational and NoSQL
CN108959309A (en) The method and apparatus of data analysis
CN112765197A (en) Data query method and device, computer equipment and storage medium

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170419