CN108228814A - Method of data synchronization and device - Google Patents
Method of data synchronization and device Download PDFInfo
- Publication number
- CN108228814A CN108228814A CN201711486489.8A CN201711486489A CN108228814A CN 108228814 A CN108228814 A CN 108228814A CN 201711486489 A CN201711486489 A CN 201711486489A CN 108228814 A CN108228814 A CN 108228814A
- Authority
- CN
- China
- Prior art keywords
- data
- tables
- database
- target database
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F16/275—Synchronous replication
Abstract
Method of data synchronization and device provided by the invention, by the information for obtaining the tables of data that data variation occurs in source database, data are inquired according to the mark of data changed data table and synchronize configuration information, obtain the address of target database, it will be in the data variation synchronizing information to target database of database according to the address of the target database got, it by the above method, realizes and the data variation of source database is synchronized in each target database, it is ensured that the normal operation of Database Systems.
Description
Technical field
The present invention relates to database synchronization technical field more particularly to a kind of method of data synchronization and device.
Background technology
With the extensive use of Enterprise Informatization system, information system has become the pass that enterprise maintains business operating
Key.The diversified type of service of enterprise causes data access demand to sharply increase, and core database can not often support so
Big concurrent operations, cause database server can't bear the heavy load.For the above situation, general way be by core database into
Row is split, by a large number of services data landing to multiple target databases.Therefore, build core database and each target database it
Between data synchronous system it is particularly important.
At present, existing Database Systems need largely to be manually operated by operation maintenance personnel mostly, to complete core
Database and the data simultaneously operating of each target database, not only bring larger risk of error, but also will appear data leakage more
The problem of newly or updating not in time.In addition, between database under different development environments, due to development language it is different often very
Hardly possible realizes data sharing and interaction.
Invention content
The present invention provides a kind of method of data synchronization and device, realizes that the data between disparate databases synchronize, it is ensured that number
According to the normal operation of library system.
The first aspect of the present invention provides a kind of method of data synchronization, including:
The information for the tables of data that data variation occurs in source database is obtained, the tables of data is described for storing data
The information of tables of data includes the mark of the tables of data;
Data are inquired according to the mark of the tables of data and synchronize configuration information, determine the address of target database;Wherein, institute
It states data and synchronizes configuration information and include correspondence between each tables of data and target database;
According to the address of the target database by the data variation synchronizing information of the tables of data to the target data
Library.
Optionally, the data variation information of the tables of data is basic code change information, the foundation code variation letter
Newly-increased or the corresponding first foundation code of deletion attribute, the data that breath is included in tables of data synchronize configuration information and further include number
According to bank code conversion table;
The address according to the target database is by the data variation synchronizing information of the tables of data to the target
Database, including:
It is target database identifiable the by the first foundation code conversion according to the database code conversion table
Two foundation codes;
Second foundation code is synchronized to the attribute of the target database according to the address of the target database
In configuration code section.
Optionally, the database code conversion table includes the code statement of source database and the code of each target database
The transformation rule table of sentence;It is described according to the database code conversion table, be number of targets by the first foundation code conversion
According to identifiable second foundation code in library, including:
According to the database code conversion table, the corresponding first code sentence of the first foundation code is converted to
The corresponding second code sentence of two foundation codes.
Optionally, the data variation information of the tables of data be business datum change information, the business change information packet
Include the corresponding business datum value of the first field in addition, modification or deletion tables of data;The information of the tables of data further includes industry
The mark for changed first field of data of being engaged in;
The address according to the target database is by the data variation synchronizing information of the tables of data to the target
Database, including:
Obtain the mark of the second field of the target database corresponding with the mark of first field;
The business datum value is synchronized to by institute according to the mark of the address of the target database and second field
It states in the second field of target database.
Optionally, the data synchronize the execution period that configuration information further includes each target database, the execution period
Period and the second execution period are performed including first;
The first execution period is by the newly-increased or deletion attribute corresponding first in the tables of data of the source database
Foundation code is synchronized to the period in each target database;
The second execution period is by the corresponding business datum value of the first field in the tables of data of the source database
The period being synchronized in each target database.
Optionally, described first the period is performed less than the described second execution period.
Optionally, the address according to the target database is by the data variation synchronizing information of the tables of data to institute
Before stating target database, further include:
Obtain the username and password of the target database;
The username and password of the target database is sent to the target data;
Receive the information being proved to be successful that the target database is sent.
The second aspect of the present invention provides a kind of data synchronization unit, including:
Acquisition module, for obtaining the information for the tables of data that data variation occurs in source database, the tables of data is used for
Data are stored, the information of the tables of data includes the mark of the tables of data;
Determining module synchronizes configuration information for inquiring data according to the mark of the tables of data, determines target database
Address;Wherein, the data synchronization configuration information includes the correspondence between each tables of data and target database;
Synchronization module arrives the data variation synchronizing information of the tables of data for the address according to the target database
The target database.
The third aspect of the present invention provides a kind of computer readable storage medium, is stored thereon with computer program, described
The method described in any one of first aspect is realized when program is executed by processor.
The fourth aspect of the present invention provides a kind of electronic equipment, including:
Processor;And
Memory, for storing the executable instruction of the processor;
Wherein, the processor is configured to perform described in any one of first aspect via the executable instruction is performed
Method.
By obtaining data variation occurs for method of data synchronization and device provided in an embodiment of the present invention in source database
The information of tables of data inquires data according to the mark of data changed data table and synchronizes configuration information, obtains target data
The address in library, according to the address of the target database got by the data variation synchronizing information of database to target database
In, by the above method, realize and the data variation of source database is synchronized in each target database, it is ensured that Database Systems
Normal operation.
Description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair
Some bright embodiments, for those of ordinary skill in the art, without having to pay creative labor, can be with
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is the application scenario diagram of method of data synchronization provided by the invention;
Fig. 2 is the flow diagram of method of data synchronization that one embodiment of the invention provides;
Fig. 3 is the data variation schematic diagram of a tables of data of source database provided by the invention;
Fig. 4 is the flow diagram of method of data synchronization that another embodiment of the present invention provides;
Fig. 5 is the flow diagram of method of data synchronization that further embodiment of this invention provides;
Fig. 6 is the flow diagram of method of data synchronization that yet another embodiment of the invention provides;
Fig. 7 is the structure diagram of data synchronization unit that one embodiment of the invention provides;
Fig. 8 is the structure diagram of data synchronization unit that another embodiment of the present invention provides;
Fig. 9 is the structure diagram of electronic equipment embodiment provided by the invention.
Specific embodiment
Purpose, technical scheme and advantage to make the embodiment of the present invention are clearer, below in conjunction with the embodiment of the present invention
In attached drawing, the technical solution in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
Part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
All other embodiments obtained without creative efforts shall fall within the protection scope of the present invention.
Term " first ", " second " in description and claims of this specification and above-mentioned attached drawing etc. are for distinguishing
Similar object describes specific sequence or precedence without being used for.It should be appreciated that the data used in this way are in appropriate feelings
It can be interchanged under condition, so that the embodiment of the present invention described herein can be with other than those for illustrating or describing herein
Sequence implement.
It should be appreciated that term " comprising " and " having " used herein and their any deformation, it is intended that cover
Cover it is non-exclusive include, be not necessarily limited to for example, containing the process of series of steps or unit, method, system, product or equipment
Those steps or unit clearly listed, but may include not listing clearly or for these processes, method, product
Or the intrinsic other steps of equipment or unit.
Fig. 1 is the application scenario diagram of method of data synchronization provided by the invention, as shown in Figure 1, data provided by the invention
Synchronous method is applied to data synchronous system, and data synchronous system includes source database, data synchronization unit and N number of number of targets
According to library, N is positive integer.Wherein,
Source database and N number of target database can be using identical version and the database with identical storage organization,
It can also be the database that there are different storage organizations using different editions, can also be the database of different development environments.
There are multiple tables of data in source database, mapping relations and storing process between tables of data, corresponding, each mesh
Marking also has multiple tables of data in database, mapping relations and storing process between tables of data.Target database can be
The data of partial data table synchronous to the data of all tables of data of source database or to source database synchronize, right
This present embodiment is not specifically limited.
When data variation occurs for some tables of data in source database, there is the target data of correspondence with the tables of data
The quantity in library is at least one, and in other words, each tables of data of source database and the correspondence of target database may be a pair of
One relationship, it is also possible to one-to-many relationship.Each tables of data of source database and the correspondence of target database are deposited in advance
Storage, can be with by data synchronization unit when data variation occurs for a certain tables of data of source database in data synchronization unit
Inquire the target database for having correspondence with the tables of data.
Data synchronization unit can be specifically server or processor, for according to the number stored on server or processor
According to synchronous configuration information, the data variation in source database is synchronized in each target database.
Technical scheme of the present invention is described in detail with specifically embodiment below.These specific implementations below
Example can be combined with each other, and the same or similar concept or process may be repeated no more in some embodiments.
Fig. 2 is the method for data synchronization that one embodiment of the invention provides, and Fig. 3 is a number of source database provided by the invention
According to the data variation schematic diagram of table.As shown in Fig. 2, method of data synchronization provided in this embodiment, specifically includes following steps:
S201, the information for obtaining the tables of data that data variation occurs in source database;
Wherein, for the tables of data for storing data, the information of the tables of data includes the mark of the tables of data.
It is that number occurs for the tables of data in source database specifically when data variation occurs for source database in the present embodiment
During according to variation, the data variation of tables of data is recorded in the data variation list of source database, in the data variation list at least
Mark including tables of data can also include the mark of the changed field of data in tables of data.Data synchronization unit passes through
The data variation list obtains the data variation information of tables of data.
Data variation information in the present embodiment include foundation code change information, business datum change information at least one
.
Specifically, foundation code change information includes the corresponding foundation code of attribute in newly-increased or deletion tables of data.
It should be pointed out that each tables of data includes a set of properties in source database, there are multiple attributes in set of properties, the tables of data
Each record include the data content of all properties or part attribute, the attribute of wherein unique mark record is the number
Data content according to the major key of table, and major key cannot be sky.For example, the set of properties of user message table includes five attributes, respectively
For Customs Assigned Number, user name, gender, the age, phone, wherein, Customs Assigned Number is the major key of the tables of data, as shown in Figure 3.
When increasing an address properties newly in the user message table of source database, need in the foundation code library of source database
It is middle to increase the corresponding foundation code configuration of the address properties.Source database is matched in the above-mentioned foundation code of completion postpones meeting by basic generation
Code change information is recorded into the data variation list of source database.
Specifically, business datum change information includes the corresponding business of certain field in addition, modification or deletion tables of data
Data value.Wherein, the field of tables of data specifically includes the attribute of the mark of field, the type of field, field.The mark of field is used
In the address of the field of certain business datum of mark data table, the type of field include text-type, numeric type, date-time type,
Currency, whether type, hyperlink direct type etc., the attribute of field is field size, form, default value, required field, validity rule
Deng.For example, the phone of certain user changes in user message table, which belongs to business datum variation, source database
It needs the data variation being recorded in data variation list, record the mark of the changed field of the business datum and is somebody's turn to do
Updated business datum value of field etc..
S202, data synchronization configuration information is inquired according to the mark of tables of data, obtains the address of target database;
Wherein, the data synchronization configuration information includes the correspondence between each tables of data and target database;
Target database in the present embodiment can be the database or and source database with the same version of source database
The database of different editions.Wherein, database structure of the database under different editions has differences, for example, source database is
The database of latest edition, target database are the database of early version, and the difference of the two both includes set of properties pair in tables of data
The difference for the business datum answered, and include the difference of the corresponding foundation code of set of properties in tables of data (non-traffic data).
Data synchronization unit determines to have with the tables of data corresponding according to the mark of changed data table in source database
The address of the target database of relationship.Specifically,
Data synchronization unit inquires data according to the mark of tables of data and synchronizes configuration information, which synchronizes in configuration information
Including the correspondence between tables of data each in source database and target database, i.e., in source database the mark of each tables of data with
The correspondence of the mark of target database determines the address of target database according to the mark of target database.
S203, according to the address of target database by the data variation synchronizing information of tables of data to target database.
According to the address of target database by the data variation synchronizing information of tables of data to mesh corresponding with the data variation
It marks in database.Specifically,
Data synchronization unit can be in real time by the data variation synchronizing information of the tables of data of source database to each target data
In library, also the period can be performed by the change information batch synchronization of the tables of data of source database to each target database according to preset
In.Source database and the data automatic synchronization of each target database, substantially reduce related operation maintenance personnel to multiple database hands
The workload of dynamic operation, reduces the risk artificially to malfunction.
The tables of data of data variation occurs by obtaining in source database for method of data synchronization provided in an embodiment of the present invention
Information, data are inquired according to the mark of data changed data table and synchronize configuration information, obtain the ground of target database
Location according to the address of the target database got by the data variation synchronizing information to target database of database, passes through
The above method is realized and the data variation of source database is synchronized in each target database, it is ensured that the normal fortune of Database Systems
Row.
Below using detailed embodiment, the data variation information to tables of data is that the data of basic code change information are same
The specific implementation of one step process is described in detail.
Fig. 4 is the flow diagram of method of data synchronization that another embodiment of the present invention provides, as shown in figure 4, this implementation
The method of data synchronization that example provides includes the following steps:
The data variation information of the tables of data is basic code change information,
S301, the information for obtaining the tables of data that data variation occurs in source database;
Wherein, for the tables of data for storing data, the information of the tables of data includes the mark of the tables of data.
In the present embodiment, data variation in source database is non-traffic data variation, i.e., the basic generation in source database
Code variation.Corresponding, the data variation information of tables of data is basic code change information, and foundation code change information includes data
The newly-increased or corresponding first foundation code of deletion attribute in table.Such as:Add Address attribute in user data table, source data
Increase the corresponding first foundation code configuration of the address properties in foundation code library in library newly.
Optionally, the property value that is newly-increased or deleting existing attribute that foundation code change information is further included in tables of data corresponds to
Foundation code, such as:An attribute in set of properties in information of vehicles table is car plate type, which includes small
Vehicle car plate, special purpose vehicle car plate, cart and agricultural vehicle car plate etc. increase new energy car plate, the new energy vehicle newly in the car plate type
Board is the property value for having attribute.
S302, data synchronization configuration information is inquired according to the mark of tables of data, obtains the address of target database;
Wherein, data synchronization configuration information includes the correspondence between each tables of data and target database, passes through number
The mark of each target database corresponding with tables of data is inquired according to the mark of table, target is obtained according to the mark of each target database
The address of database.
S303, according to database code conversion table, be target database identifiable second by first foundation code conversion
Foundation code;
In the present embodiment, data synchronize configuration information and further include:Database code conversion table.
Specifically, database code conversion table includes the code statement of source database and the code language of each target database
The transformation rule table of sentence.Wherein,
Code statement includes insert sentences, update sentences, delete sentences etc..
Based on above-mentioned database code conversion table, the corresponding first code sentence of the first foundation code of source database is turned
It is changed to the corresponding second code sentence of identifiable second foundation code of target database.
Wherein, first code sentence is specially the identifiable insert sentences of source database, update sentences, delete languages
Sentence, corresponding, second code sentence is the identifiable insert sentences of target database, update sentences, delete sentences.
In the present embodiment, due to the difference of the development environment of disparate databases, corresponding code statement is configured in foundation code
Therefore, in data synchronization unit difference stores the transformation rule table of code statement between disparate databases, to realize that difference is opened
The data synchronisation requirement of source database and target database under hair ring border.
S304, the attribute configuration code that the second foundation code is synchronized to target database according to the address of target database
In section.
In this step, data synchronization unit is according to the address of each target database by the corresponding second generation of the second foundation code
Code sentence is synchronized in the attribute configuration code segment of each target database.
The present embodiment is by obtaining the corresponding first foundation code of attribute for increasing newly or deleting in source database, and by source number
Identifiable second foundation code of target database is converted into according to the corresponding first code sentence of the first foundation code in library to correspond to
Second code sentence, complete the synchronizing process to the non-traffic data of each target database, realize the number of each target database
According to timely updating for library version.
It is same for the data of business datum change information to the data variation information of tables of data below using detailed embodiment
The specific implementation of one step process is described in detail.
Fig. 5 is the flow diagram of method of data synchronization that further embodiment of this invention provides, as shown in figure 5, this implementation
The method of data synchronization that example provides, specifically comprises the following steps:
S401, the information for obtaining the tables of data that data variation occurs in source database;
Wherein, for the tables of data for storing data, the information of the tables of data includes the mark of the tables of data.
In the present embodiment, the data variation in source database changes for business datum, i.e., the industry of certain field in source database
Addition, modification or the deletion of business data value.Corresponding, the data variation information of tables of data is business datum change information, business
Data variation information includes the corresponding business datum value of the first field in addition, modification or deletion tables of data.
The information of the tables of data of the present embodiment further includes:The mark of changed first field of business datum;
For example, the first field of source database is used to record in user message table the data information of ' age ' attribute, certain use
The original service data value of first field at family is null value, and the business datum value that the user is added in source database is 26, should
Data variation is Added Business data variation.
S402, data synchronization configuration information is inquired according to the mark of tables of data, obtains the address of target database;
Wherein, the data synchronization configuration information includes the correspondence between each tables of data and target database;
In the present embodiment, S402 is identical with above-described embodiment S202, has same or similar concept, to this present embodiment
It repeats no more.
S403, it obtains and the mark of the second field of the corresponding target database of mark of the first field;
Data synchronization unit is synchronized according to the mark of tables of data in source database and the mark of the first field, inquiry data
Configuration information obtains the mark of corresponding with the mark of tables of data each target database and corresponding with the mark of the first field
Each target database the second field mark.
S404, business datum value is synchronized to by target database according to the address of target database and the mark of the second field
The second field in.
Data synchronization unit is according to the second of the address of target database and the changed target database of business datum
Business datum changing value is synchronized in the second field of target database by the mark of field, so as to complete to business datum
Synchronizing process.
The present embodiment is by obtaining in source database first in the mark and tables of data of the tables of data that business datum changes
The mark of field, inquiry data synchronize configuration information and obtain the mark of target database and the mark of the second field, according to mesh
The mark for marking data determines the address of target database, and business datum changing value is synchronized to the second field of target database
In, complete the synchronizing process of the business datum to each target database, realize the service data information of each target database and
Shi Gengxin.
Optionally, on the basis of the various embodiments described above, data synchronize configuration information and further include:
The execution period of each target database, execution period include first and perform period and the second execution period;
First execution period was the newly-increased or corresponding first foundation code of deletion attribute in the tables of data by source database
The period being synchronized in each target database;
Second execution period was that the corresponding business datum value of the first field in the tables of data by source database is synchronized to respectively
Period in target database.
Optionally, first the period is performed less than the second execution period.
It will be understood by those skilled in the art that if first performs the period more than the second execution period, i.e., foundation code is same
Synchronizing frequency is less than the synchronizing frequency of data service value, in fact it could happen that following situation:
Certain business datum value is Added Business data value, is reported an error when carrying out data synchronization to the Added Business data value,
The reason is that the basic generation of the corresponding attribute of Added Business data is not yet configured in the foundation code section of target database
Code.Therefore, in order to avoid the above problem, the data in data synchronization unit synchronize should increase in configuration information it is same to two kinds of data
The setting in the execution period of step.
The present embodiment passes through the setting to foundation code change information and the execution period of business datum change information, it is ensured that
The foundation code update cycle of each target database is less than the service data updating period, avoids and is led since foundation code does not update
Cause corresponding with foundation code data service can not normal synchronized to target database the problem of.
Period and the second execution period are performed to first in this present embodiment, it should be pointed out that a kind of special situation,
After increasing the corresponding foundation code configuration of attribute in the tables of data of source database newly, until the source database of latest edition reaches the standard grade it
Before, be not in the corresponding business datum of newly-increased attribute.The first execution period at this time is often below the second execution period, example
Property, increase address properties in certain tables of data of source database, include the source data of the corresponding foundation code configuration of address properties
Library can reach the standard grade at second day completes to synchronize, and the first execution period at this time is set as 1 day, and for having the business datum of attribute
Variation, the second execution period are often set as 1 minute or 30 seconds.
Optionally, on the basis of the various embodiments described above, data synchronization unit is according to the address of target database by data
Before the data variation synchronizing information to target database of table, the process of data synchronous safety verification is further included, avoids outside
Equipment is to the malicious intrusions of Database Systems.
Fig. 6 is the flow diagram of method of data synchronization that yet another embodiment of the invention provides, as shown in fig. 6, this implementation
The method of data synchronization that example provides specifically comprises the following steps:
S501, the information for obtaining the tables of data that data variation occurs in source database;
Wherein, for the tables of data for storing data, the information of the tables of data includes the mark of the tables of data.
S502, data synchronization configuration information is inquired according to the mark of the tables of data, obtains the address of target database;
Wherein, the data synchronization configuration information includes the correspondence between each tables of data and target database;
S503, the username and password for obtaining target database;
S504, the username and password that target database is sent to target database;
S505, the information being proved to be successful that target database is sent is received;
In the Database Systems of the present embodiment, source database and each target database be both provided with database user name and
Password, to ensure the data safety of each database.
Specifically, source database and the username and password of each target database are stored in data synchronization unit,
There are during data variation in source database, data synchronization unit obtains the use of target database by the mark of target database
Name in an account book and password, before data synchronization is carried out, data synchronization unit sends the user name of target database to target database
And password, so that target database verifies whether the username and password is correct, if correctly, being tested to data synchronization unit transmission
Demonstrate,prove successful information.
Data synchronization unit performs S506 after the information being proved to be successful that target database is sent is received.
S506, according to the address of target database by the data variation synchronizing information of tables of data to target database.
S501-S502, S506 in the present embodiment is identical with the S201-S203 of above-described embodiment, realization principle and skill
Art effect is similar, and details are not described herein again.
The present embodiment by obtaining the username and password of target database to be synchronized, be verified successful information it
Afterwards by the data variation synchronizing information to each target database of source database, the safety of data synchronous system is increased, is kept away
Exempt from data tampering of the external equipment to data synchronous system.
Fig. 7 is the structure diagram of data synchronization unit that one embodiment of the invention provides, as shown in fig. 7, the present embodiment
The data synchronization unit 60 of offer, including:
Acquisition module 61, for obtaining the information for the tables of data that data variation occurs in source database, the tables of data is used
In storage data, the information of the tables of data includes the mark of the tables of data;
Determining module 62 synchronizes configuration information for inquiring data according to the mark of the tables of data, determines target data
The address in library;Wherein, the data synchronization configuration information includes the correspondence between each tables of data and target database;
Synchronization module 63, for the address according to the target database by the data variation synchronizing information of the tables of data
To the target database.
Data synchronization unit provided in an embodiment of the present invention including acquisition module, determining module and synchronization module, passes through
Acquisition module obtains the data variation information in source database, and determining module determines number of targets corresponding with the data variation information
According to the address in library, synchronization module, by data variation synchronizing information to target database, is realized according to the address of target database
The data variation of source database is synchronized in each target database, it is ensured that the normal operation of Database Systems.
Optionally, the data variation information of the tables of data is basic code change information, the foundation code variation letter
Newly-increased or the corresponding first foundation code of deletion attribute, the data that breath is included in tables of data synchronize configuration information and further include number
According to bank code conversion table.
Fig. 8 is the structure diagram of data synchronization unit that another embodiment of the present invention provides, further, in Fig. 7 institutes
On the basis of showing device embodiment, the data synchronization unit 60 further includes:
Modular converter 64, for being target by the first foundation code conversion according to the database code conversion table
Identifiable second foundation code of database;
The synchronization module 63 is additionally operable to be synchronized to second foundation code according to the address of the target database
In the attribute configuration code segment of the target database.
Optionally, the database code conversion table includes the code statement of source database and the code of each target database
The transformation rule table of sentence;
The modular converter 64 is additionally operable to according to the database code conversion table, and the first foundation code is corresponded to
First code sentence be converted to the corresponding second code sentence of the second foundation code.
Optionally, the data variation information of the tables of data be business datum change information, the business change information packet
Include the corresponding business datum value of the first field in addition, modification or deletion tables of data;The information of the tables of data further includes industry
The mark for changed first field of data of being engaged in;
The acquisition module 61 is additionally operable to obtain the of corresponding with the mark of first field target database
The mark of two fields;
The synchronizing device 63 is additionally operable to institute according to the address of the target database and the mark of second field
Business datum value is stated to be synchronized in the second field of the target database.
Optionally, the acquisition module 61 is additionally operable to obtain the username and password of the target database;
The data synchronization unit 60 further includes:
Sending module 65, for sending the username and password of the target database to the target data;
Receiving module 66, for receiving the information being proved to be successful that the target database is sent.
Data synchronization unit provided in this embodiment can perform the technical solution of above method embodiment, realize former
Reason is similar with technique effect, and details are not described herein again for the present embodiment.
The present embodiment provides a kind of computer readable storage mediums, are stored thereon with computer program, the computer journey
The technical solution as described in any one of aforementioned embodiment of the method, implementing principle and technical effect are realized when sequence is executed by processor
Similar, details are not described herein again.
Fig. 9 is the structure diagram of electronic equipment embodiment provided by the invention, as shown in figure 9, the electronics of the present embodiment
Equipment, including:
Processor 71;And
Memory 72, for storing the executable instruction of the processor;
Wherein, the processor is configured to perform any one of aforementioned embodiment of the method via the executable instruction is performed
The technical solution, implementing principle and technical effect are similar, and details are not described herein again.
The function of each module in above system can be realized by processor 71.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to
The relevant hardware of program instruction is crossed to complete.Aforementioned program can be stored in a computer read/write memory medium.The journey
Sequence when being executed, performs the step of including above-mentioned each method embodiment;And aforementioned storage medium includes:ROM、RAM、SRAM、
The various media that can store program code such as DRAM, FLASH, magnetic disc or CD.
Finally it should be noted that:The above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe is described in detail the present invention with reference to foregoing embodiments, it will be understood by those of ordinary skill in the art that:Its according to
Can so modify to the technical solution recorded in foregoing embodiments either to which part or all technical features into
Row equivalent replacement;And these modifications or replacement, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme.
Claims (10)
1. a kind of method of data synchronization, which is characterized in that including:
The information for the tables of data that data variation occurs in source database is obtained, the tables of data is used to store data, the data
The information of table includes the mark of the tables of data;
Data are inquired according to the mark of the tables of data and synchronize configuration information, determine the address of target database;Wherein, the number
Include the correspondence between each tables of data and target database according to synchronous configuration information;
According to the address of the target database by the data variation synchronizing information of the tables of data to the target database.
2. according to the method described in claim 1, it is characterized in that, the data variation information of the tables of data is basic code change
Change information, the foundation code change information includes the newly-increased or corresponding first foundation code of deletion attribute in tables of data, institute
It states data synchronization configuration information and further includes database code conversion table;
The address according to the target database is by the data variation synchronizing information of the tables of data to the target data
Library, including:
It is identifiable second base of target database by the first foundation code conversion according to the database code conversion table
Plinth code;
Second foundation code is synchronized to the attribute configuration of the target database according to the address of the target database
In code segment.
3. the method according to claim 2, which is characterized in that the database code conversion table includes the generation of source database
The transformation rule table of code sentence and the code statement of each target database;It is described according to the database code conversion table, by institute
First foundation code conversion is stated as identifiable second foundation code of target database, including:
According to the database code conversion table, the corresponding first code sentence of the first foundation code is converted into the second base
The corresponding second code sentence of plinth code.
4. according to the method described in claim 1, it is characterized in that, the data variation information of the tables of data becomes for business datum
Change information, the business change information includes the corresponding business datum value of the first field in addition, modification or deletion tables of data;
The information of the tables of data further includes the mark of changed first field of business datum;
The address according to the target database is by the data variation synchronizing information of the tables of data to the target data
Library, including:
Obtain the mark of the second field of the target database corresponding with the mark of first field;
The business datum value is synchronized to by the mesh according to the mark of the address of the target database and second field
In the second field for marking database.
5. according to the method in claim 2 or 3, which is characterized in that the data synchronize configuration information and further include each target
The execution period of database, the execution period include first and perform period and the second execution period;
The first execution period is by the newly-increased or corresponding first foundation of deletion attribute in the tables of data of the source database
Code synchronisation is to the period in each target database;
The second execution period is to synchronize the corresponding business datum value of the first field in the tables of data of the source database
To the period in each target database.
6. according to the method described in claim 5, it is characterized in that, it is described first execution the period perform week less than described second
Phase.
7. according to the method described in claim 1, it is characterized in that, the address according to the target database is by the number
Before the data variation synchronizing information to the target database of table, further include:
Obtain the username and password of the target database;
The username and password of the target database is sent to the target data;
Receive the information being proved to be successful that the target database is sent.
8. a kind of data synchronization unit, which is characterized in that including:
Acquisition module, for obtaining the information for the tables of data that data variation occurs in source database, the tables of data is used to store
Data, the information of the tables of data include the mark of the tables of data;
Determining module synchronizes configuration information for inquiring data according to the mark of the tables of data, determines the ground of target database
Location;Wherein, the data synchronization configuration information includes the correspondence between each tables of data and target database;
Synchronization module, for the address according to the target database by the data variation synchronizing information of the tables of data to described
Target database.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that
Claim 1-7 any one of them methods are realized when described program is executed by processor.
10. a kind of electronic equipment, which is characterized in that including:
Processor;And
Memory, for storing the executable instruction of the processor;
Wherein, the processor is configured to carry out perform claim requirement 1-7 any one of them via the execution executable instruction
Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711486489.8A CN108228814B (en) | 2017-12-29 | 2017-12-29 | Data synchronization method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711486489.8A CN108228814B (en) | 2017-12-29 | 2017-12-29 | Data synchronization method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108228814A true CN108228814A (en) | 2018-06-29 |
CN108228814B CN108228814B (en) | 2022-02-15 |
Family
ID=62647418
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711486489.8A Active CN108228814B (en) | 2017-12-29 | 2017-12-29 | Data synchronization method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108228814B (en) |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108933828A (en) * | 2018-07-04 | 2018-12-04 | 中国银行股份有限公司 | A kind of data synchronizer and method |
CN109241183A (en) * | 2018-08-16 | 2019-01-18 | 武汉元鼎创天信息科技有限公司 | A kind of method of data synchronization and system based on socket communication |
CN109254997A (en) * | 2018-08-27 | 2019-01-22 | 广州城市信息研究所有限公司 | Method of data synchronization, system, computer equipment and readable storage medium storing program for executing |
CN109542872A (en) * | 2018-10-26 | 2019-03-29 | 金蝶软件(中国)有限公司 | Method for reading data, device, computer equipment and storage medium |
CN109597687A (en) * | 2018-10-31 | 2019-04-09 | 东软集团股份有限公司 | Data synchronous resource allocation methods, device, storage medium and electronic equipment |
CN109634975A (en) * | 2018-12-10 | 2019-04-16 | 拉扎斯网络科技(上海)有限公司 | Method of data synchronization and device, electronic equipment and computer readable storage medium |
CN109657004A (en) * | 2018-12-10 | 2019-04-19 | 北京明朝万达科技股份有限公司 | A kind of method of data synchronization and device |
CN109657002A (en) * | 2018-11-09 | 2019-04-19 | 山东中创软件商用中间件股份有限公司 | A kind of multilist batch data synchronous method, device and equipment |
CN109885614A (en) * | 2019-01-04 | 2019-06-14 | 平安科技(深圳)有限公司 | A kind of method and apparatus that data are synchronous |
CN111090803A (en) * | 2019-11-22 | 2020-05-01 | 贝壳技术有限公司 | Data processing method and device, electronic equipment and storage medium |
CN111241198A (en) * | 2020-01-02 | 2020-06-05 | 广州虎牙科技有限公司 | Data synchronization method and device and data processing equipment |
CN111259104A (en) * | 2020-01-22 | 2020-06-09 | 山东浪潮通软信息科技有限公司 | Report data synchronization method and device capable of defining rules |
CN111611244A (en) * | 2020-05-20 | 2020-09-01 | 浩云科技股份有限公司 | Method and device for cascading data of database |
CN113032480A (en) * | 2019-12-25 | 2021-06-25 | 陕西西部资信股份有限公司 | Data synchronization method, system and device |
CN113407209A (en) * | 2021-06-18 | 2021-09-17 | 湖南快乐阳光互动娱乐传媒有限公司 | Configuration data updating method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102129478A (en) * | 2011-04-26 | 2011-07-20 | 广州从兴电子开发有限公司 | Database synchronization method and system thereof |
CN103020112A (en) * | 2012-11-06 | 2013-04-03 | 深圳中兴网信科技有限公司 | Heterogeneous database synchronizing system and heterogeneous database synchronizing method |
CN103699580A (en) * | 2013-12-03 | 2014-04-02 | 中铁程科技有限责任公司 | Database synchronization method and database synchronization device |
CN104268234A (en) * | 2014-09-26 | 2015-01-07 | 东软集团股份有限公司 | Method and device for synchronizing data based on SQL statements |
CN106649378A (en) * | 2015-11-02 | 2017-05-10 | 北大方正集团有限公司 | Data synchronizing method and device |
-
2017
- 2017-12-29 CN CN201711486489.8A patent/CN108228814B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102129478A (en) * | 2011-04-26 | 2011-07-20 | 广州从兴电子开发有限公司 | Database synchronization method and system thereof |
CN103020112A (en) * | 2012-11-06 | 2013-04-03 | 深圳中兴网信科技有限公司 | Heterogeneous database synchronizing system and heterogeneous database synchronizing method |
CN103699580A (en) * | 2013-12-03 | 2014-04-02 | 中铁程科技有限责任公司 | Database synchronization method and database synchronization device |
CN104268234A (en) * | 2014-09-26 | 2015-01-07 | 东软集团股份有限公司 | Method and device for synchronizing data based on SQL statements |
CN106649378A (en) * | 2015-11-02 | 2017-05-10 | 北大方正集团有限公司 | Data synchronizing method and device |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108933828A (en) * | 2018-07-04 | 2018-12-04 | 中国银行股份有限公司 | A kind of data synchronizer and method |
CN109241183A (en) * | 2018-08-16 | 2019-01-18 | 武汉元鼎创天信息科技有限公司 | A kind of method of data synchronization and system based on socket communication |
CN109254997A (en) * | 2018-08-27 | 2019-01-22 | 广州城市信息研究所有限公司 | Method of data synchronization, system, computer equipment and readable storage medium storing program for executing |
CN109542872A (en) * | 2018-10-26 | 2019-03-29 | 金蝶软件(中国)有限公司 | Method for reading data, device, computer equipment and storage medium |
CN109597687A (en) * | 2018-10-31 | 2019-04-09 | 东软集团股份有限公司 | Data synchronous resource allocation methods, device, storage medium and electronic equipment |
CN109657002A (en) * | 2018-11-09 | 2019-04-19 | 山东中创软件商用中间件股份有限公司 | A kind of multilist batch data synchronous method, device and equipment |
CN109657002B (en) * | 2018-11-09 | 2022-04-08 | 山东中创软件商用中间件股份有限公司 | Multi-table batch data synchronization method, device and equipment |
CN109634975B (en) * | 2018-12-10 | 2022-02-25 | 拉扎斯网络科技(上海)有限公司 | Data synchronization method and device, electronic equipment and computer readable storage medium |
CN109634975A (en) * | 2018-12-10 | 2019-04-16 | 拉扎斯网络科技(上海)有限公司 | Method of data synchronization and device, electronic equipment and computer readable storage medium |
CN109657004A (en) * | 2018-12-10 | 2019-04-19 | 北京明朝万达科技股份有限公司 | A kind of method of data synchronization and device |
CN109885614A (en) * | 2019-01-04 | 2019-06-14 | 平安科技(深圳)有限公司 | A kind of method and apparatus that data are synchronous |
CN111090803A (en) * | 2019-11-22 | 2020-05-01 | 贝壳技术有限公司 | Data processing method and device, electronic equipment and storage medium |
CN113032480A (en) * | 2019-12-25 | 2021-06-25 | 陕西西部资信股份有限公司 | Data synchronization method, system and device |
CN111241198A (en) * | 2020-01-02 | 2020-06-05 | 广州虎牙科技有限公司 | Data synchronization method and device and data processing equipment |
CN111241198B (en) * | 2020-01-02 | 2024-02-27 | 广州虎牙科技有限公司 | Data synchronization method and device and data processing equipment |
CN111259104A (en) * | 2020-01-22 | 2020-06-09 | 山东浪潮通软信息科技有限公司 | Report data synchronization method and device capable of defining rules |
CN111611244A (en) * | 2020-05-20 | 2020-09-01 | 浩云科技股份有限公司 | Method and device for cascading data of database |
CN113407209A (en) * | 2021-06-18 | 2021-09-17 | 湖南快乐阳光互动娱乐传媒有限公司 | Configuration data updating method and device |
Also Published As
Publication number | Publication date |
---|---|
CN108228814B (en) | 2022-02-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108228814A (en) | Method of data synchronization and device | |
CN105487864B (en) | The method and apparatus of Code automatic build | |
CN102656557B (en) | Automate enterprise-software-development | |
US9456038B2 (en) | Session table framework | |
CN109947767A (en) | System in multiple lease database system shares type | |
CN110147369A (en) | Data separating and write-in in multiple lease database system redirect | |
CN109167811A (en) | A kind of across chain data access method and device based on block chain | |
US20100001834A1 (en) | System and method for a message registry and message handling in a service -oriented business framework | |
US10127218B2 (en) | Object templates for data-driven applications | |
CN101583953A (en) | Method and apparatus for dissociating binding information from objects to enable proper rights management | |
CN108600148A (en) | A kind of transaction message processing method and processing device | |
CN105550306A (en) | Multi-copy data reading/writing method and system | |
US20120030166A1 (en) | System integration architecture | |
Tutcher et al. | Enabling data integration in the rail industry using RDF and OWL: The RaCoOn ontology | |
US8190646B2 (en) | Associative object model for composite entity information | |
CN102982171A (en) | Database synchronization method | |
CN104239412B (en) | The data mapping to thesaurus and correlation technique, system and computer-readable medium are applied in data repository | |
CN115114372A (en) | Data processing method, device and equipment based on block chain and readable storage medium | |
US20060112104A1 (en) | Apparatus and method of hosting on-demand business context information | |
WO2009039411A1 (en) | Systems and methods for receiving and sending messages about changes to data attributes | |
US20090037484A1 (en) | Programming system for occasionally-connected mobile business applications | |
WO2012012236A2 (en) | Parameter value binding for mobile business objects | |
US20050071740A1 (en) | Task extraction and synchronization | |
WO2009147705A1 (en) | Database connection program and device | |
US11368304B2 (en) | Systems and methods for generating a parts logbook using blockchain technology |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: Floor 36, Zheshang Building, No. 718 Jianshe Avenue, Jiang'an District, Wuhan, Hubei 430019 Patentee after: TK.CN INSURANCE Co.,Ltd. Patentee after: TAIKANG INSURANCE GROUP Co.,Ltd. Address before: Taikang Life Building, 156 fuxingmennei street, Xicheng District, Beijing 100031 Patentee before: TAIKANG INSURANCE GROUP Co.,Ltd. Patentee before: TK.CN INSURANCE Co.,Ltd. |