Database synchronization method capable of efficiently supporting multiple database types

By designing a database synchronization method that efficiently supports multi-database types, the shortcomings of existing tools in multi-database type support, configuration complexity and data consistency guarantees are solved, and efficient synchronization and data consistency across databases are achieved.

CN119807295APending Publication Date: 2025-04-11YONYOU FINANCIAL INFORMATION TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411784231.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The existing database synchronization tools have shortcomings in support of multiple database types, configuration complexity and data consistency guarantees, which cannot meet the diversified needs of enterprises, increasing the difficulty of use and maintenance costs.

Method used

Design a database synchronization method that efficiently supports multi-database types, and achieve efficient synchronization across databases through steps such as data source information collection, synchronization object construction and transformation, metadata processing and execution, data synchronization and task tracking and logging.

Benefits of technology

It realizes flexible adaptation of multiple database types, reduces the complexity of cross-database metadata management, improves the efficiency and consistency of data synchronization, and is suitable for scenarios with high concurrency and real-time requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807295A_ABST
    Figure CN119807295A_ABST
Patent Text Reader

Abstract

The invention discloses a database synchronization method capable of efficiently supporting multiple database types, which has the following beneficial effects that a tool is compatible with a mainstream database, metadata processors of different databases are managed through a configuration file, a user can easily adjust a synchronization mode according to service requirements, the method adapts to the characteristics of different databases, and the user experience is improved. According to the method, efficient cross-database synchronization is realized, a pluggable design is adopted, and a user can dynamically register and switch different metadata processors according to requirements, so that customization processing is performed according to characteristics of different databases, the complexity of cross-database metadata management is greatly reduced, and the user experience is improved. A built-in optimized read-write module ensures high performance and safety of a data synchronization process, is suitable for scenes with high concurrency and high real-time performance requirements, and ensures that data consistency and real-time performance are realized in a multi-database environment through dynamic adjustment and efficient data stream processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data synchronization, and in particular to a database synchronization method that efficiently supports multiple database types. Background Art

[0002] With the acceleration of digital transformation, more and more companies are using a variety of relational databases to manage and store data. These databases include MySQL, PostgreSQL, SQL Server, and Oracle. Although there are many database synchronization tools on the market, they generally have problems in supporting multiple database types, configuration complexity, and ensuring data consistency. Many tools only support specific databases and cannot meet the diverse needs of enterprises; at the same time, users often need to perform tedious manual settings during the configuration process, which increases the difficulty of use and maintenance costs. In addition, data synchronization may cause data inconsistency due to structural differences, affecting the stability of the system. These shortcomings make enterprises face greater challenges in database synchronization and management, and they are in urgent need of a solution that can efficiently and flexibly support multiple database types.

[0003] Therefore, it is necessary to design an efficient database synchronization method that supports multiple database types. Summary of the invention

[0004] The object of the present invention is to provide a database synchronization method that efficiently supports multiple database types, so as to solve the problems raised in the above background technology.

[0005] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0006] A database synchronization method that efficiently supports multiple database types includes the following steps:

[0007] S100, data source information collection: obtaining metadata of key information of the main table from the data source, including table structure and data volume;

[0008] S200, construction and conversion of synchronization objects: converting the acquired data table information into standardized synchronization objects, the conversion process includes unified processing of information of the source table and the target table;

[0009] S300, metadata processing and execution: the metadata is read and processed by the metadata processor, and asynchronous tasks are executed in batches to achieve data writing;

[0010] S400, data synchronization: The synchronization strategy is dynamically determined according to the data volume through intelligent paging technology. For small-scale data, a single batch synchronization is adopted, and for large-scale data, an asynchronous paging synchronization method is adopted;

[0011] S500, task tracking and logging: Through the task tracker, the execution information, synchronization status information, and data volume information of each task are recorded in real time.

[0012] According to the above technical solution, the specific operation method of S200 is:

[0013] Based on the feature differences of the source database, the target database, and the configured metadata processors, synchronous conversion is performed. The converted information includes the table structure, type, constraint, field type, default value, and compatibility of the table structure. The steps are as follows:

[0014] S201, configuring the source database, the target database and the metadata processor;

[0015] S202, build a synchronization task and define the information to be synchronized, that is, the table structure, type, constraint, field type, default value, and compatibility of the table structure;

[0016] S203, integrating the tasks to generate a synchronization solution including source data, target database, and processor rules;

[0017] S204, the tool automatically detects whether there are special rule requirements in the synchronization task, and if so, provides additional configuration options to adapt to the differences;

[0018] S205. Perform synchronous conversion through the metaprocessor.

[0019] According to the above technical solution, the specific operation method of S300 is:

[0020] S301, metadata reading: construct a metadata reader to obtain the table structure information and other metadata required for synchronization from the source database. It establishes a stable connection with the source database through a preset connection configuration and selects an adaptive metadata processor according to the source database type.

[0021] S302, metadata processing: the metadata processor adapts the different data types, default values, and constraints in different databases;

[0022] S303, data writing: The processed DML statements are executed through the data insertion processor, and batch data insertion is supported by the batch processor based on the system. In scenarios where real-time or incremental synchronization is required, the incremental processor monitors data changes in the source database and updates them to the target database in real time.

[0023] According to the above technical solution, the reading method and type of the S301 data are as follows:

[0024] Reading method: read the source database information by querying the system table or metadata dictionary of the source database;

[0025] Type: table structure information, namely table name, field name, field type, constraints, indexes, primary keys, foreign keys and foreign key constraints.

[0026] According to the above technical solution, the specific processing method of the metadata processor in S302 is as follows:

[0027] The metadata processor defines inconsistent data types in different databases. It converts the field types of the source database into the corresponding types of the target database through mapping rules. It also adapts the default values, primary keys, foreign keys, and constraints according to the characteristics of the target database.

[0028] According to the above technical solution, the data writing in S303 is performed asynchronously, that is, the writing task is managed through the task queue and thread pool mechanism of the asynchronous processor.

[0029] According to the above technical solution, the log information obtained in S500 is displayed through a log page to provide data support for the user's analysis and optimization of the synchronization strategy.

[0030] According to the above technical solution, the tool in S204 is a composite database interface, which performs a unified abstract design on the database management system through an adaptation layer, supports relational databases and distributed databases, and the composite database interface identifies the types and characteristics of the source and target databases during the execution of the synchronization task through a dynamic adaptation mechanism based on metadata, shields the differences in protocols and data models between different databases, and realizes efficient and seamless data synchronization.

[0031] According to the above technical solution, the data insertion processor in S303 is a universal pluggable metadata processor, which is based on a plug-in design and supports dynamic loading of different metadata parsing modules to adapt to the characteristics of different databases.

[0032] Compared with the prior art, the beneficial effects achieved by the present invention are:

[0033] 1) Support flexible adaptation of multiple database types: The tool is compatible with mainstream databases and manages metadata processors of different databases through configuration files. Users can easily adjust the synchronization method according to business needs, adapt to the characteristics of different databases, and achieve efficient cross-database synchronization;

[0034] 2) Pluggable metadata management and processing: With a pluggable design, users can dynamically register and switch different metadata processors according to their needs, thereby customizing the processing for the characteristics of different databases and greatly reducing the complexity of cross-database metadata management;

[0035] 3) Efficient data reading and writing mechanism: The built-in optimized reading and writing modules ensure the high performance and security of the data synchronization process. It is suitable for scenarios with high concurrency and high real-time requirements. Through dynamic adjustment and efficient data stream processing, it ensures data consistency and real-time performance in a multi-database environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a flowchart of the present invention;

[0037] Figure 2 It is a flowchart of S200 of the present invention;

[0038] Figure 3 It is a flowchart of S300 of the present invention. DETAILED DESCRIPTION

[0039] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0040] like Figure 1-3 As shown, the present invention provides a technical solution: a database synchronization method that efficiently supports multiple database types, comprising the following steps:

[0041] S100, data source information collection: obtaining metadata of key information of the main table from the data source, including table structure and data volume;

[0042] S200, construction and conversion of synchronization objects: converting the acquired data table information into standardized synchronization objects, the conversion process includes unified processing of information of the source table and the target table;

[0043] S300, metadata processing and execution: the metadata is read and processed by the metadata processor, and asynchronous tasks are executed in batches to achieve data writing;

[0044] S400, data synchronization: The synchronization strategy is dynamically determined according to the data volume through intelligent paging technology. For small-scale data, a single batch synchronization is adopted, and for large-scale data, an asynchronous paging synchronization method is adopted;

[0045] S500, task tracking and logging: Through the task tracker, the execution information, synchronization status information, and data volume information of each task are recorded in real time.

[0046] Specifically, the specific operation method of S200 is:

[0047] Based on the feature differences of the source database, the target database, and the configured metadata processors, synchronous conversion is performed. The converted information includes the table structure, type, constraint, field type, default value, and compatibility of the table structure. The steps are as follows:

[0048] S201, configuring the source database, the target database and the metadata processor;

[0049] S202, build a synchronization task and define the information to be synchronized, that is, the table structure, type, constraint, field type, default value, and compatibility of the table structure;

[0050] S203, integrating the tasks to generate a synchronization solution including source data, target database, and processor rules;

[0051] S204, the tool automatically detects whether there are special rule requirements in the synchronization task, and if so, provides additional configuration options to adapt to the differences;

[0052] S205. Perform synchronous conversion through the metaprocessor.

[0053] Specifically, the specific operation method of S300 is:

[0054] S301, metadata reading: construct a metadata reader to obtain the table structure information and other metadata required for synchronization from the source database. It establishes a stable connection with the source database through a preset connection configuration and selects an adaptive metadata processor according to the source database type.

[0055] S302, metadata processing: the metadata processor adapts the different data types, default values, and constraints in different databases;

[0056] S303, data writing: The processed DML statements are executed through the data insertion processor, and batch data insertion is supported by the batch processor based on the system. In scenarios where real-time or incremental synchronization is required, the incremental processor monitors data changes in the source database and updates them to the target database in real time.

[0057] Specifically, the reading method and type of the S301 data are as follows:

[0058] Reading method: read the source database information by querying the system table or metadata dictionary of the source database;

[0059] Type: table structure information, namely table name, field name, field type, constraints, indexes, primary keys, foreign keys and foreign key constraints.

[0060] Specifically, the specific processing method of the metadata processor in S302 is as follows:

[0061] The metadata processor defines inconsistent data types in different databases. It converts the field types of the source database into the corresponding types of the target database through mapping rules. It also adapts the default values, primary keys, foreign keys, and constraints according to the characteristics of the target database.

[0062] Specifically, the data writing method in S303 is asynchronous execution, that is, the writing task is managed through the task queue and thread pool mechanism of the asynchronous processor.

[0063] Specifically, the log information obtained in S500 is displayed through a log page to provide data support for the user's analysis and optimization of the synchronization strategy.

[0064] Specifically, the tool in S204 is a composite database interface, which performs a unified abstract design of the database management system through an adaptation layer, supports relational databases and distributed databases, and identifies the types and characteristics of the source and target databases during the execution of the synchronization task through a metadata-based dynamic adaptation mechanism, shields the differences in protocols and data models between different databases, and achieves efficient and seamless data synchronization.

[0065] Specifically, the data insertion processor in S303 is a universal pluggable metadata processor, which is based on a plug-in design and supports dynamic loading of different metadata parsing modules to adapt to the characteristics of different databases.

[0066] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0067] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A database synchronization method that efficiently supports multiple database types, characterized in that: The steps include: S100, data source information collection: obtaining metadata of key information of the main table from the data source, including table structure and data volume; S200, construction and conversion of synchronization objects: converting the acquired data table information into standardized synchronization objects, the conversion process includes unified processing of information of the source table and the target table; S300, metadata processing and execution: the metadata is read and processed by the metadata processor, and asynchronous tasks are executed in batches to achieve data writing; S400, data synchronization: The synchronization strategy is dynamically determined according to the data volume through intelligent paging technology. For small-scale data, a single batch synchronization is adopted, and for large-scale data, an asynchronous paging synchronization method is adopted; S500, task tracking and logging: Through the task tracker, the execution information, synchronization status information, and data volume information of each task are recorded in real time.

2. The method for efficiently synchronizing multiple database types according to claim 1, characterized in that: The specific operation method of S200 is as follows: Based on the feature differences of the source database, the target database, and the configured metadata processors, synchronous conversion is performed. The converted information includes the table structure, type, constraint, field type, default value, and compatibility of the table structure. The steps are as follows: S201, configuring the source database, the target database and the metadata processor; S202, build a synchronization task and define the information to be synchronized, that is, the table structure, type, constraint, field type, default value, and compatibility of the table structure; S203, integrating the tasks to generate a synchronization solution including source data, target database, and processor rules; S204, the tool automatically detects whether there are special rule requirements in the synchronization task, and if so, provides additional configuration options to adapt to the differences; S205. Perform synchronous conversion through the metaprocessor.

3. The method for efficiently synchronizing multiple database types according to claim 1, characterized in that: The specific operation method of S300 is as follows: S301, metadata reading: construct a metadata reader to obtain the table structure information and other metadata required for synchronization from the source database. It establishes a stable connection with the source database through a preset connection configuration and selects an adaptive metadata processor according to the source database type. S302, metadata processing: the metadata processor adapts the different data types, default values, and constraints in different databases; S303, data writing: The processed DML statements are executed through the data insertion processor, and batch data insertion is supported by the batch processor based on the system. In scenarios where real-time or incremental synchronization is required, the incremental processor monitors data changes in the source database and updates them to the target database in real time.

4. The method for efficiently synchronizing multiple database types according to claim 3, characterized in that: The reading method and type of the S301 data are as follows: Reading method: read the source database information by querying the system table or metadata dictionary of the source database; Type: table structure information, namely table name, field name, field type, constraints, indexes, primary keys, foreign keys and foreign key constraints.

5. The method for efficiently synchronizing multiple database types according to claim 3, characterized in that: The specific processing method of the metadata processor in S302 is as follows: The metadata processor defines inconsistent data types in different databases. It converts the field types of the source database into the corresponding types of the target database through mapping rules. It also adapts the default values, primary keys, foreign keys, and constraints according to the characteristics of the target database.

6. The method for efficiently synchronizing multiple database types according to claim 3, characterized in that: The data writing method in S303 is asynchronous execution, that is, the writing task is managed through the task queue and thread pool mechanism of the asynchronous processor.

7. The method for efficiently synchronizing multiple database types according to claim 1, characterized in that: The log information obtained in S500 is displayed through a log page to provide data support for the user's analysis and optimization of the synchronization strategy.

8. The method for efficiently synchronizing multiple database types according to claim 2, characterized in that: The tool in S204 is a composite database interface, which performs a unified abstract design of the database management system through an adaptation layer, supports relational databases and distributed databases, and identifies the types and characteristics of the source and target databases during the execution of the synchronization task through a dynamic adaptation mechanism based on metadata, shields the differences in protocols and data models between different databases, and realizes efficient and seamless data synchronization.

9. The method for efficiently synchronizing multiple database types according to claim 3, characterized in that: The data insertion processor in S303 is a universal pluggable metadata processor, which is based on a plug-in design and supports dynamic loading of different metadata parsing modules to adapt to the characteristics of different databases.

Citation Information

Cited By

  • Multi-tenant database updating method and system

    CN121764901A