CN111125254A - Database synchronization method and device, electronic equipment and computer readable medium - Google Patents

Database synchronization method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN111125254A
CN111125254A CN201911340924.5A CN201911340924A CN111125254A CN 111125254 A CN111125254 A CN 111125254A CN 201911340924 A CN201911340924 A CN 201911340924A CN 111125254 A CN111125254 A CN 111125254A
Authority
CN
China
Prior art keywords
database
target
definition information
information
source
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
CN201911340924.5A
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.)
Beijing Yiyiyun Technology Co ltd
Original Assignee
Beijing Yiyiyun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Yiyiyun Technology Co ltd filed Critical Beijing Yiyiyun Technology Co ltd
Priority to CN201911340924.5A priority Critical patent/CN111125254A/en
Publication of CN111125254A publication Critical patent/CN111125254A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Abstract

The disclosure relates to a database synchronization method, a database synchronization device, an electronic device and a computer readable medium. The method comprises the following steps: acquiring the database type and source database definition information of each source database; determining target database definition information according to the source database definition information; executing a command according to the type of the target library and the definition information of the target library to generate a target database; and responding to a data synchronization request, and synchronizing the data of each source database to the target database according to the field type comparison dictionary. According to the scheme disclosed by the invention, the target database definition information can be automatically generated according to the source database definition information, the target database is automatically generated according to the target database type and the target database definition information, and data synchronization is carried out in response to the data synchronization request, so that the synchronous integration of multiple source databases can be quickly and effectively completed, and the method can be repeatedly used.

Description

Database synchronization method and device, electronic equipment and computer readable medium
Technical Field
The present disclosure relates to the field of database technologies, and in particular, to a database synchronization method, an apparatus, an electronic device, and a computer-readable medium.
Background
The database is used for realizing the storage and maintenance of data. In practical application, the databases are diverse in types, different databases have different structures, and the definition languages thereof are different. In order to ensure the consistency of data between application systems in practical application, the data needs to be synchronized.
At present, in the related art, interface programs are developed based on the customization of data specifications, and data acquisition and conversion are performed through the customized interface programs, so that data of each source data is synchronized to a target library. However, the above method relies on developing a customized interface program, which is labor-intensive, requires re-development when facing different projects, and cannot be reused.
Therefore, a new database synchronization method, apparatus, electronic device and computer readable medium are needed.
The above information disclosed in this background section is only for enhancement of understanding of the background of the disclosure and therefore it may contain information that does not constitute prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
The application provides a database synchronization method, which can quickly and effectively complete the synchronous integration of a plurality of source databases and can be repeatedly used.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to an aspect of the present disclosure, there is provided a database synchronization method, including: acquiring the database type and source database definition information of each source database; determining target database definition information according to the source database definition information; executing a command according to the type of the target library and the definition information of the target library to generate a target database; and responding to a data synchronization request, and synchronizing the data of each source database to the target database according to the field type comparison dictionary.
According to some embodiments, determining the target repository definition information from the source repository definition information comprises: processing field type information in the source database definition information based on the field type comparison dictionary and the target library type to generate target library field type information; converting the source database definition information according to the target database type to generate a target database creation statement; integrating the target library field type information and the target library creation statement into the target library definition information.
According to some embodiments, converting the source database definition information according to the target library type, and generating a target library creation statement includes: acquiring table configuration information of each source database; and converting the source data definition information based on the table configuration information and the target library type to generate a target library creating statement.
According to some embodiments, the table configuration information comprises at least one of the following features: source database table name, target database table name, synchronization mechanism, timestamp information.
According to some embodiments, synchronizing data of the source databases to the target database against a dictionary according to field type in response to a data synchronization request comprises: reading target data from each source database according to the table configuration information of each source database; converting the target data based on the field type comparison dictionary; and responding to the data synchronization request, and writing the converted target data into the target database.
According to some embodiments, the source database definition information comprises at least one of the following features: table information, primary key information, index information, field remark information and field type information.
According to some embodiments, the aforementioned method further comprises: and generating the field type comparison dictionary according to the corresponding relation between the field types of the databases of different types.
According to another aspect of the present disclosure, there is provided a database synchronization apparatus including: the source database reading module is configured to acquire the database type and the source database definition information of each source database; the target library definition information generating module is configured to determine target library definition information according to the source database definition information; the target library generation module is configured to execute a command according to the type of the target library and the definition information of the target library to generate a target database; and the data synchronization module is configured to respond to a data synchronization request and synchronize the data of each source database to the target database according to the field type comparison dictionary.
According to still another embodiment of the present disclosure, there is provided an electronic apparatus including:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement any of the methods described above.
According to yet another embodiment of the disclosure, a computer-readable medium is provided, on which a computer program is stored, characterized in that the program, when executed by a processor, implements any of the methods described above.
According to some embodiments of the present disclosure, the target library definition information can be automatically generated according to the source database definition information, the target database can be automatically generated according to the target library type and the target library definition information, and further, analysis can be performed according to different source databases, and the target library can be adaptively created. And the data synchronization is carried out in response to the data synchronization request, so that the synchronization of the data of the multi-source database can be quickly and effectively finished, the labor and the time are saved, and the data synchronization method can be repeatedly used.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings. The drawings described below are merely some embodiments of the present disclosure, and other drawings may be derived from those drawings by those of ordinary skill in the art without inventive effort.
Fig. 1 illustrates a block diagram of a system to which a method or apparatus according to an embodiment of the present disclosure may be applied, according to an exemplary embodiment;
FIG. 2 illustrates a flow diagram of a database synchronization method according to an exemplary embodiment of the present disclosure;
FIG. 3 shows a flow diagram of a database synchronization method according to another example embodiment of the present disclosure;
FIG. 4 shows a flow diagram of a database synchronization method according to yet another example embodiment of the present disclosure;
FIG. 5 shows a flow diagram of a database synchronization method according to yet another example embodiment of the present disclosure;
FIG. 6 shows a flow diagram of a database synchronization method according to yet another example embodiment of the present disclosure;
FIG. 7 shows a flow chart of a database synchronization method according to yet another example embodiment of the present disclosure;
FIG. 8 illustrates a generation interface schematic of a data synchronization request according to an exemplary embodiment of the present disclosure;
FIG. 9 schematically illustrates a block diagram for a database synchronization apparatus according to an example embodiment of the present disclosure;
FIG. 10 shows a block diagram of an electronic device for database synchronization, according to an example embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals denote the same or similar parts in the drawings, and thus, a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the disclosure.
The block diagrams shown in the figures do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It will be understood that, although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one element from another. Thus, a first component discussed below may be termed a second component without departing from the teachings of the disclosed concept. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
It is to be understood by those skilled in the art that the drawings are merely schematic representations of exemplary embodiments, and that the blocks or processes shown in the drawings are not necessarily required to practice the present disclosure and are, therefore, not intended to limit the scope of the present disclosure.
The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
Fig. 1 illustrates a block diagram of a system to which a method or apparatus according to an embodiment of the present disclosure may be applied, according to an exemplary embodiment.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a prediction application, a web browser application, a search-type application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server that provides various services, such as a background management server that provides processing for information submitted by users using the terminal apparatuses 101, 102, 103. The background management server can acquire the database types and the source database definition information of the source databases; determining target database definition information according to the source database definition information; executing a command according to the type of the target library and the definition information of the target library to generate a target database; and responding to the data synchronization request, synchronizing the data of each source database to the target database according to the field type comparison dictionary, and feeding back the processing result to the terminal equipment. The server 105 may also perform other related operations and processes as needed. The server 105 may be a server of one entity, and may also be composed of a plurality of servers, for example.
Fig. 2 illustrates a flowchart of a database synchronization method according to an exemplary embodiment of the present disclosure.
As shown in fig. 2, the database synchronization method of the embodiment of the present disclosure may include the following steps.
In step S210, the database type and the source database definition information of each source database are obtained.
In the embodiment of the present disclosure, the source database may include one or more databases, and the number of the source databases is not particularly limited in the present disclosure. For example, each source database may be determined according to a target library creation request sent by the client. The database type of the source database may be, for example, a relational database (e.g., Oracle, MySQL), a non-relational database, or the like. Database Definition information (DDL) is a Language for describing real-world entities to be stored in a database. These definitions include structural definitions, operational method definitions, and the like. In particular, the database definition information may be used to define a relationship schema, delete a relationship, modify a relationship schema, and the like.
In an exemplary embodiment, a link may be established with each source data to obtain the database type and source database definition information for each source data. Wherein the source database definition information may include at least one of the following characteristics: table information, primary key information, index information, field remark information and field type information.
In step S220, target library definition information is determined from the source library definition information.
In the embodiment of the present disclosure, conversion may be performed according to field type information in the source database definition information to obtain field type information in the target database definition information. The field types of different databases are different, and the field type information in the source data definition information can be converted through the mapping relation between the field types of the different databases to obtain the field type information in the target database definition information. In addition, other definition statements and the like of different databases are different. E.g., statements that create an index, etc. The source database definition information of each source database can be converted according to the definition method of the target database to obtain the definition information of the target database.
The embodiment of the disclosure can adaptively and rapidly generate the target database definition information according to the source database definition information, can be suitable for different application scenarios, saves labor and time consumption, and can be recycled.
In step S230, a command is executed according to the target library type and the target library definition information, and a target database is generated.
In the embodiment of the disclosure, the target library creation request sent by the client may include the target library type. The target library type is, for example, a relational database (e.g., Oracle, MySQL) or a non-relational database, which is not particularly limited by this disclosure.
The method and the device for creating the target library can automatically create the target library according to the type of the target library and the definition information of the target library, can be suitable for various application scenes, and can be repeatedly used.
In step S240, in response to the data synchronization request, the data of each source database is synchronized to the target database according to the field type against the dictionary.
In the embodiment of the disclosure, a database synchronization request sent by a client can be received. Wherein the database synchronization request may include an execution cycle. For example, the operations of the step may be performed in response to the data synchronization request when the current time satisfies the execution period of the database synchronization request. The field type describes the mapping relation between field types of different databases in comparison with the dictionary. For example, the field type LONGTEXT in the MySQL database may be against the field type CLOB in the Oracle database.
According to the database synchronization method provided by the embodiment of the disclosure, the target database definition information can be automatically generated according to the source database definition information, the target database can be automatically generated according to the target database type and the target database definition information, and further, the analysis can be performed according to different source databases, and the target database can be adaptively created. And the data synchronization is carried out in response to the data synchronization request, so that the synchronization of the data of the multi-source database can be quickly and effectively finished, the labor and the time are saved, and the data synchronization method can be repeatedly used.
Fig. 3 illustrates a flowchart of a database synchronization method according to another exemplary embodiment of the present disclosure.
As shown in fig. 3, the database synchronization method of the embodiment of the present disclosure may include the following steps.
In step S221, the field type information in the source database definition information is processed based on the field type comparison dictionary and the target database type, so as to generate target database field type information.
Wherein the field type describes the mapping relation between the field types of different databases compared with the dictionary. For example, when the field type LONGTEXT in the MySQL database corresponds to the field type CLOB in the Oracle database, the field type comparison dictionary may include a mapping relationship between the field type LONGTEXT in the MySQL database and the field type CLOB in the Oracle database.
In the embodiment of the present disclosure, the field type information in the source database definition information may be used as an index, and the field type comparison dictionary is searched for, so as to determine the field type information in the target database definition information according to the mapping relationship of the field type information in the source database definition information in the field type comparison dictionary. And determining the definition form of the field type information according to the target library type to generate the field type information of the target library.
In step S222, the source database definition information is converted according to the target database type, and a target database creation statement is generated.
In the embodiment of the present disclosure, for example, the creating statement in the source database definition information may be converted to generate a target database creating statement corresponding to the target database type. For example, the target library creation statements may include statements that create an index. The index creating statement can be converted into the index creating statement corresponding to the target library type.
In step S223, the target library field type information and the target library creation statement are integrated as target library definition information.
In an exemplary embodiment, step S220 in the database synchronization method of the embodiment of fig. 2 may further include steps S221 to S223 in the database synchronization method of the embodiment of the present disclosure.
According to the database synchronization method, the field type information in the source database definition information can be generated into the field type information of the target database according to the field type comparison dictionary; and the source database definition information is converted according to the type of the target database to generate a target database creation statement, so that the target database definition information can be automatically obtained, repeated operation can be avoided, manpower and material resources are saved, and the efficiency of data synchronization is improved.
Fig. 4 illustrates a flowchart of a database synchronization method according to still another exemplary embodiment of the present disclosure.
As shown in fig. 4, the database synchronization method of the embodiment of the present disclosure may include the following steps.
In step S2221, table configuration information of each source database is acquired.
In the embodiment of the present disclosure, the table configuration information of each source database describes a correspondence relationship between each table in each source data to each table in the target database and a corresponding correspondence rule. Wherein the table configuration information may be determined based on the data synchronization request.
In an exemplary embodiment, the table configuration information includes at least one of the following features: source database table name, target database table name, synchronization mechanism, timestamp information. The synchronization mechanism may be, for example, incremental synchronization, full synchronization, etc. The timestamp information describes a timestamp range of the data to be synchronized. Each table configuration information may include a source database table name, a target database table name, a synchronization mechanism, and timestamp information.
The structure of each table configuration information may be as follows:
table configuration information X:
{
the name of the source database table is,
the name of the table of the target library,
the mechanism of synchronization is that the synchronization mechanism,
time stamp information
}
In step S2222, the source data definition information is converted based on the table configuration information and the target library type, and a target library creation statement is generated.
In the embodiment of the present disclosure, the creation statements in the source database definition information may be converted based on the type of the target database and the correspondence information between each table of each source data in the table configuration information and each table in the target database, so as to obtain the creation statements of the target database.
In an exemplary embodiment, step S222 in the database synchronization method in the embodiment of fig. 3 may further include steps S2221 to S2222 in the database synchronization method in the embodiment of the present disclosure.
According to the database synchronization method, the table configuration information is used as the guide information, the source data definition information can be converted, the target library creating statement is generated, the target library creating statement can be obtained quickly and effectively, and powerful support is provided for creating the target library.
Fig. 5 illustrates a flowchart of a database synchronization method according to still another exemplary embodiment of the present disclosure.
As shown in fig. 5, the database synchronization method of the embodiment of the present disclosure may include the following steps.
In step S241, the target data is read from each source database according to the table configuration information of each source database.
In the embodiment of the present disclosure, the target data may be read from the database according to the source database table name in the table configuration information. The target data is data to be synchronized.
In step S242, the target data is converted based on the field type collation dictionary.
In the embodiment of the present disclosure, the target type is a corresponding type in the source database table. The corresponding field type of the target data in the target library table can be determined based on the field type contrast dictionary, and the target data can be converted into the corresponding field type.
In step S243, the converted target data is written to the target database in response to the data synchronization request.
In an exemplary embodiment, step S240 in the database synchronization method of the embodiment of fig. 2 may further include steps S241 to S243 in the database synchronization method of the embodiment of the present disclosure.
According to the database synchronization method, the field type is used as guidance for the dictionary, the data synchronization command responding to the data synchronization request can be automatically executed, and therefore synchronous integration of multi-source data can be rapidly and effectively completed.
Fig. 6 illustrates a flowchart of a database synchronization method according to still another exemplary embodiment of the present disclosure.
As shown in fig. 6, the database synchronization method of the embodiment of the present disclosure may include the following steps.
In step S610, a field type collation dictionary is generated according to the correspondence between the field types of the different types of databases.
Fig. 7 shows a flowchart of a database synchronization method according to still another exemplary embodiment of the present disclosure.
As shown in fig. 7, the database synchronization method of the embodiment of the present disclosure may include the following steps.
In step S710, the database type and the source database definition information of each source database are obtained.
In the embodiment of the present disclosure, the database type and the source database definition information of each source database may be determined according to the database address, the port, the database name, the user, the password information, and the like of each source database.
In step S720, target library definition information is determined from the source library definition information.
In the embodiment of the present disclosure, the field type information in the source database definition information may be processed based on the field type comparison dictionary and the target library type, so as to generate target library field type information; converting the source database definition information according to the target database type to generate a target database creation statement; integrating the target library field type information and the target library creation statement into the target library definition information.
In step S730, a command is executed according to the target library type and the target library definition information, and a target database is generated.
In step S740, table configuration information of each source database is acquired.
In step S750, in response to the data synchronization request, the data of each source database is synchronized to the target database according to the table configuration information.
In an exemplary embodiment, the table structure creating statements of the source databases can be obtained and converted into corresponding data types, and the creation of each heterogeneous database is automatically executed. And simultaneously, data can be read from each source database according to the table configuration information and corresponding data types can be converted.
In the embodiment of the disclosure, a data synchronization request sent by a client can be received. FIG. 8 illustrates a generation interface schematic of a data synchronization request according to an exemplary embodiment of the present disclosure. As shown in fig. 8, the data synchronization request may include a synchronization task name, task component information, belonging item information, task description information, execution start time, execution rule, execution frequency, task status, message status, commissioning status, and the like.
The database synchronization method of the embodiment of the disclosure can be applied to analysis and report of medical information data, and provides technical support for companies in the aspects of multi-source data integration analysis and processing.
The database synchronization method of the embodiment of the disclosure can automatically analyze the structural information of each source data, create and obtain the target database information, and can realize the automatic creation of the target database. And the automatic synchronization of the data from each source database to the target database can be realized by taking the field type as the basis for contrasting the dictionary.
Those skilled in the art will appreciate that all or part of the steps implementing the above embodiments are implemented as computer programs executed by a CPU. When executed by the CPU, performs the functions defined by the above-described methods provided by the present disclosure. The program may be stored in a computer readable storage medium, which may be a read-only memory, a magnetic or optical disk, or the like.
Furthermore, it should be noted that the above-mentioned figures are only schematic illustrations of the processes involved in the methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
The following are embodiments of the disclosed apparatus that may be used to perform embodiments of the disclosed methods. For details not disclosed in the embodiments of the apparatus of the present disclosure, refer to the embodiments of the method of the present disclosure.
Fig. 9 schematically shows a block diagram for a database synchronization apparatus according to an example embodiment of the present disclosure.
As shown in fig. 9, the apparatus 900 for database synchronization according to an example embodiment of the present disclosure includes a source database reading module 910, a target repository definition information generating module 920, a target repository generating module 930, and a data synchronizing module 940.
In the database synchronization apparatus 900, the source database reading module 910 may be configured to obtain the database type and the source database definition information of each source database.
In an exemplary embodiment, the source database definition information may include at least one of the following characteristics: table information, primary key information, index information, field remark information and field type information.
The target repository definition information generation module 920 may be configured to determine target repository definition information from source repository definition information.
In an exemplary embodiment, the target repository definition information generation module 920 may include a field type generation unit, a creation sentence generation unit, and a definition information generation unit. The field type generating unit may be configured to process the field type information in the source database definition information based on the field type comparison dictionary and the target library type, and generate the target library field type information. The creation sentence generation unit may be configured to convert the source database definition information according to the target library type, and generate the target library creation sentence. The definition information generating unit may be configured to integrate the target library field type information and the target library creation statement into the target library definition information.
In an exemplary embodiment, the create sentence generating unit may include a configuration information acquiring subunit and a create sentence generating subunit. The configuration information obtaining subunit may be configured to obtain the table configuration information of each source database. The creation statement generation subunit may be configured to convert the source data definition information based on the table configuration information and the target repository type, and generate the target repository creation statement.
In an exemplary embodiment, the table configuration information includes at least one of the following features: source database table name, target database table name, synchronization mechanism, timestamp information.
The target repository generation module 930 may be configured to execute the command according to the target repository type and the target repository definition information to generate the target database.
The data synchronization module 940 is configured to synchronize data of each source database to the target database according to the field type against the dictionary in response to the data synchronization request.
In an exemplary embodiment, the data synchronization module 940 may include a target data reading unit, a data conversion unit, and a data synchronization unit. The target data reading unit may be configured to read the target data from each source database according to the table configuration information of each source database. The data conversion unit may be configured to convert the target data based on the field type against the dictionary. The data synchronization unit may be configured to write the converted target data to the target database in response to the data synchronization request.
In an exemplary embodiment, the database synchronization apparatus 900 may further include a dictionary generation module. The dictionary generation module may be configured to generate a field type collation dictionary based on correspondence between field types of the different types of databases.
According to the database synchronization device provided by the embodiment of the disclosure, the target database definition information can be automatically generated according to the source database definition information, the target database can be automatically generated according to the target database type and the target database definition information, and further, the analysis can be performed according to different source databases, and the target database can be adaptively created. And the data synchronization is carried out in response to the data synchronization request, so that the synchronization of the data of the multi-source database can be quickly and effectively finished, the labor and the time are saved, and the data synchronization method can be repeatedly used.
Those skilled in the art will appreciate that the modules described above may be distributed in the apparatus according to the description of the embodiments, or may be modified accordingly in one or more apparatuses unique from the embodiments. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
FIG. 10 shows a block diagram of an electronic device for database synchronization, according to an example embodiment.
An electronic device 1000 according to this embodiment of the disclosure is described below with reference to fig. 10. The electronic device 1000 shown in fig. 10 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 10, the computer system 1000 includes a Central Processing Unit (CPU)1001 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)1002 or a program loaded from a storage section 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for system operation are also stored. The CPU 1001, ROM 1002, and RAM 1003 are connected to each other via a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
The following components are connected to the I/O interface 1005: an input section 1006 including a touch screen, a keyboard, a mouse, and the like; an output section 1007 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage portion 1008 including a flash memory or the like; and a communication section 1009 such as a wireless network card, a high-speed network card, or the like. The communication section 1009 performs communication processing via a network such as the internet. The driver 1010 is also connected to the I/O interface 1005 as necessary. A removable medium 1011 such as a semiconductor memory, a magnetic disk, or the like is mounted on the drive 1010 as necessary, so that a computer program read out therefrom is mounted into the storage portion 1008 as necessary.
In particular, the processes described below with reference to the flowcharts may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication part 1009 and/or installed from the removable medium 1011. When the computer program is executed by a Central Processing Unit (CPU)1001, various functions defined in the system of the present application are executed.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A database synchronization method, comprising:
acquiring the database type and source database definition information of each source database;
determining target database definition information according to the source database definition information;
executing a command according to the type of the target library and the definition information of the target library to generate a target database;
and responding to a data synchronization request, and synchronizing the data of each source database to the target database according to the field type comparison dictionary.
2. The method of claim 1, wherein determining target library definition information from the source library definition information comprises:
processing field type information in the source database definition information based on the field type comparison dictionary and the target library type to generate target library field type information;
converting the source database definition information according to the target database type to generate a target database creation statement;
integrating the target library field type information and the target library creation statement into the target library definition information.
3. The method of claim 2, wherein transforming the source database definition information according to the target library type, generating a target library creation statement comprises:
acquiring table configuration information of each source database;
and converting the source data definition information based on the table configuration information and the target library type to generate a target library creating statement.
4. The method of claim 3, wherein the table configuration information includes at least one of the following features: source database table name, target database table name, synchronization mechanism, timestamp information.
5. The method of claim 1, wherein synchronizing data of the source databases against a dictionary according to field type to the target database in response to a data synchronization request comprises:
reading target data from each source database according to the table configuration information of each source database;
converting the target data based on the field type comparison dictionary;
and responding to the data synchronization request, and writing the converted target data into the target database.
6. The method of claim 1, wherein the source database definition information includes at least one of the following characteristics: table information, primary key information, index information, field remark information and field type information.
7. The method of claim 1, further comprising:
and generating the field type comparison dictionary according to the corresponding relation between the field types of the databases of different types.
8. A database synchronization apparatus, comprising:
the source database reading module is configured to acquire the database type and the source database definition information of each source database;
the target library definition information generating module is configured to determine target library definition information according to the source database definition information;
the target library generation module is configured to execute a command according to the type of the target library and the definition information of the target library to generate a target database;
and the data synchronization module is configured to respond to a data synchronization request and synchronize the data of each source database to the target database according to the field type comparison dictionary.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN201911340924.5A 2019-12-23 2019-12-23 Database synchronization method and device, electronic equipment and computer readable medium Pending CN111125254A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911340924.5A CN111125254A (en) 2019-12-23 2019-12-23 Database synchronization method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911340924.5A CN111125254A (en) 2019-12-23 2019-12-23 Database synchronization method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN111125254A true CN111125254A (en) 2020-05-08

Family

ID=70501278

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911340924.5A Pending CN111125254A (en) 2019-12-23 2019-12-23 Database synchronization method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN111125254A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930842A (en) * 2020-08-10 2020-11-13 中国工商银行股份有限公司 Data checking method and device
CN112306994A (en) * 2020-11-10 2021-02-02 北京沃东天骏信息技术有限公司 Database data migration method and device and storage medium
CN112667630A (en) * 2020-12-24 2021-04-16 平安科技(深圳)有限公司 Method, device, equipment and storage medium for integrating business report
CN112817934A (en) * 2021-01-21 2021-05-18 厦门熵基科技有限公司 Data migration method, device, equipment and computer readable storage medium
CN113297239A (en) * 2021-04-29 2021-08-24 上海淇玥信息技术有限公司 Data management platform and method and electronic equipment
CN113554029A (en) * 2021-09-17 2021-10-26 北京奇虎科技有限公司 Bill verification method, device, equipment and storage medium
CN115391459A (en) * 2022-08-24 2022-11-25 南京领行科技股份有限公司 Data synchronization method and device, electronic equipment and computer readable storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915377A (en) * 2012-11-14 2013-02-06 深圳市宏电技术股份有限公司 Method and system for converting or synchronizing databases
CN105069033A (en) * 2015-07-22 2015-11-18 北京京东尚科信息技术有限公司 Method and device for creating database table model
WO2016045285A1 (en) * 2014-09-25 2016-03-31 中兴通讯股份有限公司 Data synchronization method, device, and system for database
CN107967316A (en) * 2017-11-22 2018-04-27 平安科技(深圳)有限公司 A kind of method of data synchronization, equipment and computer-readable recording medium
CN109375910A (en) * 2018-11-16 2019-02-22 京东方科技集团股份有限公司 Class file generation method, device, electronic equipment and storage medium
CN109614446A (en) * 2018-11-23 2019-04-12 金色熊猫有限公司 Method of data synchronization, device, electronic equipment and storage medium
CN109829012A (en) * 2018-12-13 2019-05-31 山东亚华电子股份有限公司 The synchronous method and apparatus of data
CN109857809A (en) * 2019-01-31 2019-06-07 浙江小泰科技有限公司 A kind of raw data base data are synchronized to the synchronous method and system of target database
CN109885581A (en) * 2019-03-14 2019-06-14 苏州达家迎信息技术有限公司 Synchronous method, device, equipment and the storage medium of database
CN110147411A (en) * 2019-05-20 2019-08-20 平安科技(深圳)有限公司 Method of data synchronization, device, computer equipment and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915377A (en) * 2012-11-14 2013-02-06 深圳市宏电技术股份有限公司 Method and system for converting or synchronizing databases
WO2016045285A1 (en) * 2014-09-25 2016-03-31 中兴通讯股份有限公司 Data synchronization method, device, and system for database
CN105069033A (en) * 2015-07-22 2015-11-18 北京京东尚科信息技术有限公司 Method and device for creating database table model
CN107967316A (en) * 2017-11-22 2018-04-27 平安科技(深圳)有限公司 A kind of method of data synchronization, equipment and computer-readable recording medium
CN109375910A (en) * 2018-11-16 2019-02-22 京东方科技集团股份有限公司 Class file generation method, device, electronic equipment and storage medium
CN109614446A (en) * 2018-11-23 2019-04-12 金色熊猫有限公司 Method of data synchronization, device, electronic equipment and storage medium
CN109829012A (en) * 2018-12-13 2019-05-31 山东亚华电子股份有限公司 The synchronous method and apparatus of data
CN109857809A (en) * 2019-01-31 2019-06-07 浙江小泰科技有限公司 A kind of raw data base data are synchronized to the synchronous method and system of target database
CN109885581A (en) * 2019-03-14 2019-06-14 苏州达家迎信息技术有限公司 Synchronous method, device, equipment and the storage medium of database
CN110147411A (en) * 2019-05-20 2019-08-20 平安科技(深圳)有限公司 Method of data synchronization, device, computer equipment and storage medium

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930842A (en) * 2020-08-10 2020-11-13 中国工商银行股份有限公司 Data checking method and device
CN111930842B (en) * 2020-08-10 2024-02-09 中国工商银行股份有限公司 Data checking method and device
CN112306994A (en) * 2020-11-10 2021-02-02 北京沃东天骏信息技术有限公司 Database data migration method and device and storage medium
CN112667630A (en) * 2020-12-24 2021-04-16 平安科技(深圳)有限公司 Method, device, equipment and storage medium for integrating business report
CN112667630B (en) * 2020-12-24 2023-06-02 平安科技(深圳)有限公司 Method, device, equipment and storage medium for integrating business report
CN112817934A (en) * 2021-01-21 2021-05-18 厦门熵基科技有限公司 Data migration method, device, equipment and computer readable storage medium
CN113297239A (en) * 2021-04-29 2021-08-24 上海淇玥信息技术有限公司 Data management platform and method and electronic equipment
CN113554029A (en) * 2021-09-17 2021-10-26 北京奇虎科技有限公司 Bill verification method, device, equipment and storage medium
CN115391459A (en) * 2022-08-24 2022-11-25 南京领行科技股份有限公司 Data synchronization method and device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN111125254A (en) Database synchronization method and device, electronic equipment and computer readable medium
CN107832045B (en) Method and apparatus for cross programming language interface conversion
CN110019397B (en) Method and device for data processing
CN110321544B (en) Method and device for generating information
CN111125064B (en) Method and device for generating database schema definition statement
CN110674117A (en) Data modeling method and device, computer readable medium and electronic equipment
CN112948486A (en) Batch data synchronization method and system and electronic equipment
Deeba et al. Data transformation of UML diagram by using model driven architecture
CN113687825B (en) Method, device, equipment and storage medium for constructing software module
CN110222047A (en) A kind of dynamic list generation method and device
CN113297287A (en) User policy automatic deployment method and device and electronic equipment
CN115640279A (en) Method and device for constructing data blood relationship
CN112667202B (en) Software design method and device combining MDA and BPMN
CN113468258A (en) Heterogeneous data conversion method and device and storage medium
CN109783598B (en) Information resource cataloging method and device, electronic equipment and storage medium
CN110515653B (en) Document generation method and device, electronic equipment and computer readable storage medium
CN112905178A (en) Method, device, equipment and medium for generating business function page
CN111178014A (en) Method and device for processing business process
CN110532526A (en) Data method for transformation, electronic device and computer readable storage medium
CN116382703B (en) Software package generation method, code development method and device, electronic equipment and medium
Sophatsathit Complexity measure of software composition framework
CN116339733B (en) Application page generation method, system, electronic device and medium
CN111709118B (en) Nuclear power simulation data cooperation method and device
US20200334721A1 (en) Processing of pricing update documents
CN109857838B (en) Method and apparatus for generating information

Legal Events

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