WO2020215532A1 - 一种异构数据库之间数据同步的系统、方法、存储介质 - Google Patents

一种异构数据库之间数据同步的系统、方法、存储介质 Download PDF

Info

Publication number
WO2020215532A1
WO2020215532A1 PCT/CN2019/100029 CN2019100029W WO2020215532A1 WO 2020215532 A1 WO2020215532 A1 WO 2020215532A1 CN 2019100029 W CN2019100029 W CN 2019100029W WO 2020215532 A1 WO2020215532 A1 WO 2020215532A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
unit
format
synchronization
plug
Prior art date
Application number
PCT/CN2019/100029
Other languages
English (en)
French (fr)
Inventor
阮崇鹤
高爽
朱海勇
吴鸿伟
周成祖
鄢小征
Original Assignee
厦门市美亚柏科信息股份有限公司
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 厦门市美亚柏科信息股份有限公司 filed Critical 厦门市美亚柏科信息股份有限公司
Publication of WO2020215532A1 publication Critical patent/WO2020215532A1/zh

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/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • 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

Definitions

  • the invention relates to the technical field of data processing, in particular to a system, method and storage medium for data synchronization between heterogeneous databases.
  • the mainstream generally includes relational databases, distributed parallel databases, columnar databases, full-text search databases, graph databases, memory databases, document databases, distributed file storage, and streaming systems.
  • Conventional databases support import and export capabilities, but have different grammars. Although export and import and ETL technology complete data synchronization, they fail to meet the requirements of centralized data synchronization management, expansion capabilities, speed and performance.
  • Traditional mainstream database developers also have data synchronization solutions, but they generally target homogeneous databases and have limited support for heterogeneous databases.
  • GoldenGate mainly a synchronization tool around Oracle, captures the DML and DDL operations of the database through the Extract process running on the source side, and then uses the Replicat running on the target side to reconstruct the DML or DDL operations and apply them to On the target database. It is relatively intrusive to the source and target systems, requires corresponding permissions and deployment process processing, and lacks good expansion and customization capabilities. For DBlink technology, its configuration is highly coupled with the corresponding database. The synchronization tools used for these commonly used relational databases cannot effectively support database types other than relational databases, and have certain requirements for data forms, and lack centralized synchronization management.
  • the data task process lacks unified system management, has limited horizontal expansion capabilities, low efficiency and poor performance, and cannot adapt to large-scale data synchronization.
  • the present invention proposes the following technical solutions.
  • a system for data synchronization between heterogeneous databases includes a collection plug-in unit, a write plug-in unit, and a data processing center. Multiple databases are connected to the data processing center through the collection plug-in unit and the write plug-in unit;
  • the collection plug-in unit is used to read data from one of the multiple databases, and send the read data to a data processing center;
  • the data processing center is used to convert the received data into data in a predetermined format and then into data in the database data format to be written, and send the data converted into the data format to be written in the database to the write plug-in unit;
  • the writing plug-in unit is used for writing the received data converted into the data format to be written into the database into the corresponding database.
  • the predetermined format is CSV or XML format.
  • the multiple databases are connected in a star-shaped manner with the data processing center, and the data processing center includes a collection plug-in adapter, a first format conversion unit, a data processing unit, a second format unit, and a write plug-in adapter ,
  • the collection plug-in adapter is connected to the collection plug-in unit, and is used to receive the data collected by the collection plug-in unit from the database and send it to the first format conversion unit, and the first format conversion unit is used to format the received data The data in a predetermined format is sent to the data processing unit.
  • the data processing unit sends the processed data in the predetermined format to the second format conversion unit, and the second format conversion unit converts the data in the predetermined format again
  • the data in the database data format to be written is sent to the write plug-in adapter, and the write plug-in adapter sends the data in the database data format to be written to the write plug-in unit.
  • the data processing center is composed of at least one synchronization execution node.
  • the synchronization execution node performs data synchronization operations under the control of a synchronization task controller
  • the synchronization task controller includes a synchronization task management unit, an execution node management unit, a control unit, a log management unit, and a report warning unit ,
  • the synchronization task management unit specifies a control unit to activate the task according to the task information of the received task, and then allocates the activated task to at least one synchronization execution node to run;
  • the execution node management unit is used for Send execution commands and metadata to at least one synchronization execution node;
  • the log management unit is used to record the running status of each synchronization execution node;
  • the report warning unit provides alarms according to predetermined rules;
  • the service unit is used to provide customers with data service functions ;
  • the data persistence unit is used to persist data in the local database.
  • the synchronization execution node executes data synchronization operations in parallel in a multi-channel manner, and the channel packet data receiver, data segmentation module, multiple first data conversion modules, multiple data processing modules, multiple A second data conversion module, a data merging module and a data transmitter, the data receiver receives data from the collection plug-in adapter and sends it to the data segmentation module, and the data segmentation module splits the data and sends it to a plurality of first A data conversion module, a plurality of first data conversion modules convert the received data into a predetermined format and send it to the corresponding data processing module, the data processing module sends it to the corresponding second data conversion module after processing, and the second data conversion module
  • the data in the predetermined format is converted into the data in the database data format to be written and sent to the data merging module.
  • the data merging module merges the received data and sends it to the data transmitter, and the data transmitter sends the merged data to be written
  • the data in the database data format is sent to the write plug-in adapt
  • the present invention also proposes a data synchronization method based on the above-mentioned system of data synchronization between heterogeneous databases, and the method includes:
  • the setting step is to set each database in the multiple databases to be connected to the data processing center through the acquisition plug-in unit and the write plug-in unit;
  • data is read from one of the multiple databases through the acquisition plug-in unit, and the read data is sent to a data processing center;
  • the received data is first converted into data in a predetermined format through the data processing center and then converted into data in the database data format to be written, and the data converted into the data format to be written in the database is sent to Write the plug-in unit;
  • the received data converted into the data format to be written into the database is written into the corresponding database through the writing plug-in unit.
  • the predetermined format is CSV or XML format.
  • the multiple databases are connected in a star-shaped manner with the data processing center, and the data processing center includes a collection plug-in adapter, a first format conversion unit, a data processing unit, a second format unit, and a write plug-in adapter ,
  • the collection plug-in adapter is connected to the collection plug-in unit, and is used to receive the data collected by the collection plug-in unit from the database and send it to the first format conversion unit, and the first format conversion unit is used to format the received data The data in a predetermined format is sent to the data processing unit.
  • the data processing unit sends the processed data in the predetermined format to the second format conversion unit, and the second format conversion unit converts the data in the predetermined format again
  • the data in the database data format to be written is sent to the write plug-in adapter, and the write plug-in adapter sends the data in the database data format to be written to the write plug-in unit.
  • the data processing center is composed of at least one synchronization execution node.
  • the synchronization execution node performs data synchronization operations under the control of a synchronization task controller
  • the synchronization task controller includes a synchronization task management unit, an execution node management unit, a control unit, a log management unit, and a report warning unit ,
  • the synchronization task management unit specifies a control unit to activate the task according to the task information of the received task, and then allocates the activated task to at least one synchronization execution node to run;
  • the execution node management unit is used for Send execution commands and metadata to at least one synchronization execution node;
  • the log management unit is used to record the running status of each synchronization execution node;
  • the report warning unit provides alarms according to predetermined rules;
  • the service unit is used to provide customers with data service functions ;
  • the data persistence unit is used to persist data in the local database.
  • the synchronization execution node executes data synchronization operations in parallel in a multi-channel manner, and the channel packet data receiver, data segmentation module, multiple first data conversion modules, multiple data processing modules, multiple A second data conversion module, a data merging module and a data transmitter, the data receiver receives data from the collection plug-in adapter and sends it to the data segmentation module, and the data segmentation module splits the data and sends it to a plurality of first A data conversion module, a plurality of first data conversion modules convert the received data into a predetermined format and send it to the corresponding data processing module, the data processing module sends it to the corresponding second data conversion module after processing, and the second data conversion module
  • the data in the predetermined format is converted into the data in the database data format to be written and sent to the data merging module.
  • the data merging module merges the received data and sends it to the data transmitter, and the data transmitter sends the merged data to be written
  • the data in the database data format is sent to the write plug-in adapt
  • the present invention also provides a computer-readable storage medium with computer program code stored on the storage medium, and when the computer program code is executed by a computer, any one of the above methods is executed.
  • the technical effect of the present invention is: the present invention proposes a system, method, and storage medium for data synchronization between heterogeneous databases, which are applied to the process of data synchronization between heterogeneous databases.
  • the system includes a collection plug-in unit, a writing A plug-in unit and a data processing center. Multiple databases are connected to the data processing center in a star-shaped manner through a collection plug-in unit and a write plug-in unit.
  • the data processing center includes multiple synchronization execution nodes, and the multiple synchronization execution nodes are distributed The execution method is used for data synchronization.
  • the data acquisition and data writing plug-in adopts a plug-in structure, which is processed and transmitted in a unified intermediate data format, which simplifies the connection of different source and target databases, and adapts various heterogeneous databases by adapting For collection and writing, the present invention adopts a unified intermediate data format for transmission, which simplifies the connection of different source and target ends, improves the efficiency of data collection, and has strong scalability through plug-in connection, and adopts unified synchronization tasks
  • the controller realizes the reception, distribution, reception of synchronization tasks, management of collected logs, alarms, and data persistence. It also controls the load to achieve load balancing between synchronization execution nodes.
  • the synchronization execution nodes perform data synchronization in parallel through multiple channels. Operation to further improve execution efficiency.
  • Fig. 1 is a schematic diagram of a system for data synchronization between heterogeneous databases according to an embodiment of the present invention.
  • Fig. 2 is a structural diagram of a data processing center according to an embodiment of the present invention.
  • Fig. 3 is a structural diagram of a multi-channel according to an embodiment of the present invention.
  • Fig. 4 is a structural diagram of a synchronization task controller according to an embodiment of the present invention.
  • Fig. 5 is a flowchart of a data synchronization method of a system for data synchronization between heterogeneous databases according to an embodiment of the present invention.
  • Figure 1 shows a system for data synchronization between heterogeneous databases of the present invention.
  • the system includes a collection plug-in unit 101, a write plug-in unit 103, and a data processing center 102. Multiple databases pass through the collection plug-in unit 101 and write The plug-in unit 103 is connected to the data processing center 102.
  • the collection plug-in unit 101 is used to read data from one of the multiple databases and send the read data to the data processing center 102; the data processing center 102 is used to transfer the received data
  • the data is first converted into data in a predetermined format and then converted into data in the database data format to be written, and the data converted into the data format to be written in the database is sent to the writing plug-in unit 103; the writing plug-in unit 103 It is used to write the received data into the data format to be written into the database into the corresponding database.
  • Adopt plug-in type that is, set plug-in unit, write plug-in unit 103
  • each synchronization task executor also called synchronization task execution node
  • the system supports two common formats of CSV and XML as intermediate data formats.
  • CSV separates field values by separators, and its files are stored in plain text.
  • the header of the first row indicates the data fields of each column;
  • XML is a markup language used to mark electronic files to make them structured. Data fields.
  • the data collection and data writing plug-in of this system adopts a plug-in structure, processing and transmitting in a unified intermediate data format, which simplifies the connection of different source databases and target databases.
  • the system uses a unified intermediate data format for transmission, which simplifies The connection of different source and target ends improves the efficiency of data collection, and the plug-in connection has strong scalability, which is one of the important inventions of the present invention.
  • the multiple databases and the data processing center 102 are connected in a star-shaped manner.
  • the data processing center 102 includes a collection plug-in adapter, a first format conversion unit, a data processing unit, a second format unit, and a write plug-in adapter.
  • the collection plug-in adapter is corresponding to the collection plug-in unit 101.
  • the first format conversion unit is used to format the received data into data in a predetermined format and then send it to the data processing unit
  • the data processing unit sends the processed data in a predetermined format to a second format conversion unit
  • the second format conversion unit converts the data in the predetermined format into data in the database data format to be written and then sends it
  • the writing plug-in adapter sends the data in the database data format to be written to the writing plug-in unit 103.
  • the star connection mode is used to turn the complex meshed data synchronization link in the prior art into a star data link.
  • the data processing center 102 located in the middle of the star is responsible for connecting various heterogeneous databases and synchronizing different data Format is formatted.
  • a new type of database needs to be expanded and connected, it is only necessary to connect this database to the central data processing center 102 according to format requirements and transmission specifications, and seamless data connection with existing databases can be achieved. That is, the data synchronization system has strong scalability through plug-in connection, which is one of the important invention points of the present invention.
  • the data processing center 102 is composed of at least one synchronization execution node.
  • the synchronization execution node performs data synchronization operations under the control of the synchronization task controller.
  • the synchronization task controller includes a synchronization task management unit, an execution node management unit, a control unit, a log management unit, a report warning unit, a service unit, and a data persistence unit.
  • the task information of the task specifies the control unit to activate the task, and then allocates the activated task to at least one synchronization execution node to run;
  • the execution node management unit is used to send execution commands and metadata to at least one synchronization execution node;
  • the log management unit uses In order to record the running status of each synchronization execution node;
  • the report warning unit gives an alarm according to a predetermined rule;
  • the service unit is used to provide data service functions to customers;
  • the data persistence unit is used to persist data in the local database.
  • the system adopts a distributed execution mode.
  • the front end interacts with the synchronization task controller to complete the operation and management of data synchronization;
  • the synchronization task controller includes other functions such as synchronization task management, execution node management, log management and report alarms, and the data is persisted in the local mysql database , Communicate with nodes through the control unit and services. Control commands and metadata are issued by the controller to the execution node.
  • the execution node will return the heartbeat, status and collected logs to the controller.
  • the synchronization execution node is also the specific execution of the synchronization task. local.
  • Multiple execution nodes process data synchronization tasks in parallel according to task scheduling requirements, and maintain control and scheduling.
  • the synchronization task controller will specify the controller module according to the task information to start (ie activate) the task, and then assign the task to the specific synchronization execution node to run.
  • a custom RPC call method is adopted between the synchronous task controller and the synchronous execution node.
  • the RPC uses hessian for serialization and is transmitted at the HTTP layer.
  • the synchronization task controller can make judgments based on the heartbeat and status, and assign tasks to other normal nodes for execution. That is, the system adopts a unified synchronization task controller to realize the reception, distribution, reception of synchronization tasks, management of collected logs, alarms, data persistence and other processing, and also controls the load to achieve load balancing between synchronization execution nodes. This is the invention Another important invention point.
  • the synchronization execution node executes data synchronization operations in parallel in a multi-channel manner.
  • the channel packet data receiver, data segmentation module, multiple first data conversion modules, multiple data processing modules, multiple second data conversion modules, data merging module and data transmitter receives data from the collection plug-in adapter and sends it to the data splitting module.
  • the data splitting module splits the data and sends it to a plurality of first data conversion modules.
  • the data is converted into a predetermined format and sent to the corresponding data processing module, and the data processing module is processed and sent to the corresponding second data conversion module.
  • the second data conversion module converts the data in the predetermined format into the database data to be written
  • the data in the format is sent to the data merging module.
  • the data merging module merges the received data and sends it to the data transmitter.
  • the data transmitter sends the merged data in the database data format to be written to the write plug-in adapter.
  • Each synchronization execution node supports internal synchronization of data in the form of multiple channels when performing data synchronization tasks, so that the data between channels will not be coupled with each other.
  • Each channel runs in a thread of its own, which can prevent a busy channel from blocking, or a channel fails to stop, and will not affect the normal synchronization of other channels.
  • Each channel performs a data synchronization task. After the data is collected by the data acquisition plug-in, the task will be split through the adapter. The data is divided into multiple data blocks for processing in a multi-threaded parallel manner in the channel.
  • the processing process is mainly It is to unify the transmission format of the data, convert it into a standard csv or xml file format, and then perform the standard processing of the data content, including data cleaning, filtering, content conversion, etc. It also supports customized processing according to business scenarios, and only needs to add additional processing logic to the processing unit module. After the data is processed, the data generated by the multi-threaded parallel execution is merged, and then the second file format conversion is required.
  • the target format of the conversion is mainly different according to the target write plug-in, the purpose is to adapt to the write end Efficient writing requirements. Finally, it is pushed to a unified transmission channel, and sorted to the corresponding write plug-in according to the purpose of the data task, and the data is written to the target database. That is, the synchronization execution node of the system executes data synchronization operations in parallel through multiple channels to further improve execution efficiency. This is another important invention of the present invention.
  • FIG. 5 it is a data synchronization method between heterogeneous databases based on the above-mentioned system shown in FIG. 1. This method can be run on various electronic devices or multiple electronic devices connected via a network.
  • Figure 5 shows the data synchronization method of the present invention based on the above-mentioned system of data synchronization between heterogeneous databases, the method includes:
  • each of the multiple databases is set to be connected to the data processing center through the collection plug-in unit and the write plug-in unit.
  • step S502 data is read from one of the multiple databases through the acquisition plug-in unit, and the read data is sent to the data processing center.
  • the received data is first converted into data in a predetermined format through the data processing center, and then converted into data in the database data format to be written, and the data converted into the data format to be written in the database is sent To write to the plug-in unit.
  • the received data converted into the data format to be written into the database is written into the corresponding database through the writing plug-in unit.
  • the plug-in type (that is, the set plug-in unit 101, the write plug-in unit 103) is adopted, that is, each synchronization task executor (also called a synchronization task execution node) is processed by a database plug-in combined with a transmission processing center architecture, and uniform Data format transmission and standardized processing.
  • the system supports two common formats of CSV and XML as intermediate data formats.
  • CSV separates field values by separators, and its files are stored in plain text.
  • the header of the first row indicates the data fields of each column;
  • XML is a markup language used to mark electronic files to make them structured. Data fields.
  • the data collection and data writing plug-in of this system adopts a plug-in structure, processing and transmitting in a unified intermediate data format, which simplifies the connection of different source databases and target databases.
  • the system uses a unified intermediate data format for transmission, which simplifies The connection of different source and target ends improves the efficiency of data collection, and the plug-in connection has strong scalability, which is one of the important inventions of the present invention.
  • the multiple databases and the data processing center are connected in a star-shaped manner.
  • the data processing center includes a collection plug-in adapter, a first format conversion unit, a data processing unit, a second format unit, and a write plug-in adapter, the collection plug-in adapter is connected to the collection plug-in unit, It is used to receive the data collected by the collection plug-in unit from the database and send it to the first format conversion unit.
  • the first format conversion unit is used to format the received data into data in a predetermined format and then send it to the data processing unit.
  • the unit After processing, the unit sends the processed data in a predetermined format to the second format conversion unit, and the second format conversion unit converts the data in the predetermined format into data in the database data format to be written and sends it to the write
  • the plug-in adapter, the write plug-in adapter sends the data in the database data format to be written to the write plug-in unit.
  • the star connection mode is used to turn the complex meshed data synchronization link in the prior art into a star data link.
  • the data processing center located in the middle of the star is responsible for connecting various heterogeneous databases and synchronizing different data formats Format it.
  • the data synchronization system has strong scalability through plug-in connection, which is one of the important invention points of the present invention.
  • the data processing center is composed of at least one synchronization execution node.
  • the synchronization execution node performs data synchronization operations under the control of the synchronization task controller.
  • the synchronization task controller includes a synchronization task management unit, an execution node management unit, a control unit, a log management unit, a report warning unit, a service unit, and a data persistence unit.
  • the task information of the task specifies the control unit to activate the task, and then allocates the activated task to at least one synchronization execution node to run;
  • the execution node management unit is used to send execution commands and metadata to at least one synchronization execution node;
  • the log management unit uses In order to record the running status of each synchronization execution node;
  • the report warning unit gives an alarm according to a predetermined rule;
  • the service unit is used to provide data service functions to customers;
  • the data persistence unit is used to persist data in the local database.
  • the system adopts a distributed execution mode.
  • the front end interacts with the synchronization task controller to complete the operation and management of data synchronization;
  • the synchronization task controller includes other functions such as synchronization task management, execution node management, log management and report alarms, and the data is persisted in the local mysql database , Communicate with nodes through the control unit and services. Control commands and metadata are issued by the controller to the execution node.
  • the execution node will return the heartbeat, status and collected logs to the controller.
  • the synchronization execution node is also the specific execution of the synchronization task. local.
  • Multiple execution nodes process data synchronization tasks in parallel according to task scheduling requirements, and maintain control and scheduling.
  • the synchronization task controller will specify the controller module according to the task information to start (ie activate) the task, and then assign the task to the specific synchronization execution node to run.
  • a custom RPC call method is adopted between the synchronous task controller and the synchronous execution node.
  • the RPC uses hessian for serialization and is transmitted at the HTTP layer.
  • the synchronization task controller can make judgments based on the heartbeat and status, and assign tasks to other normal nodes for execution. That is, the system adopts a unified synchronization task controller to realize the reception, distribution, reception of synchronization tasks, management of collected logs, alarms, data persistence and other processing, and also controls the load to achieve load balancing between synchronization execution nodes. This is the invention Another important invention point.
  • the synchronization execution node executes data synchronization operations in parallel in a multi-channel manner.
  • the channel packet data receiver, data segmentation module, multiple first data conversion modules, multiple data processing modules, multiple second data conversion modules, data merging module and data transmitter receives data from the collection plug-in adapter and sends it to the data splitting module.
  • the data splitting module splits the data and sends it to a plurality of first data conversion modules.
  • the data is converted into a predetermined format and sent to the corresponding data processing module, and the data processing module is processed and sent to the corresponding second data conversion module.
  • the second data conversion module converts the data in the predetermined format into the database data to be written
  • the data in the format is sent to the data merging module.
  • the data merging module merges the received data and sends it to the data transmitter.
  • the data transmitter sends the merged data in the database data format to be written to the write plug-in adapter.
  • Each synchronization execution node supports internal synchronization of data in the form of multiple channels when performing data synchronization tasks, so that the data between channels will not be coupled with each other.
  • Each channel runs in a thread of its own, which can prevent a busy channel from blocking, or a channel fails to stop, and will not affect the normal synchronization of other channels.
  • Each channel performs a data synchronization task. After the data is collected by the data acquisition plug-in, the task will be split through the adapter. The data is divided into multiple data blocks for processing in a multi-threaded parallel manner in the channel.
  • the processing process is mainly It is to unify the transmission format of the data, convert it into a standard csv or xml file format, and then perform the standard processing of the data content, including data cleaning, filtering, content conversion, etc. It also supports customized processing according to business scenarios, and only needs to add additional processing logic to the processing unit module. After the data is processed, the data generated by the multi-threaded parallel execution is merged, and then the second file format conversion is required.
  • the target format of the conversion is mainly different according to the target write plug-in, the purpose is to adapt to the write end Efficient writing requirements. Finally, it is pushed to a unified transmission channel, and sorted to the corresponding write plug-in according to the purpose of the data task, and the data is written to the target database. That is, the synchronization execution node of the system executes data synchronization operations in parallel through multiple channels to further improve execution efficiency. This is another important invention of the present invention.
  • the technical effect of the present invention is to provide a system, method and storage medium for data synchronization between heterogeneous databases, which are applied to the process of data synchronization between heterogeneous databases.
  • the system includes a collection plug-in unit and a write plug-in unit.
  • multiple databases are connected to the data processing center in a star-shaped manner through a collection plug-in unit and a write plug-in unit.
  • the data processing center includes multiple synchronization execution nodes, and multiple synchronization execution nodes are executed in a distributed manner.
  • the data acquisition and data writing plug-in adopts a plug-in structure, which is processed and transmitted in a unified intermediate data format, which simplifies the connection of different source and target databases, and adopts adapters to adapt to the collection of various heterogeneous databases And write, the present invention adopts a unified intermediate data format transmission, simplifies the connection of different source and target ends, improves the efficiency of data collection, and has strong scalability through plug-in connection mode, and adopts a unified synchronization task controller Realize the reception, distribution, reception of synchronization tasks and the management of collected logs, alarms, and data persistence. It also controls the load to achieve load balancing between synchronous execution nodes. Synchronous execution nodes perform data synchronization operations in parallel through multiple channels. , To further improve execution efficiency.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种异构数据库之间数据同步的系统、方法、存储介质,应用于在异构数据库之间数据同步过程,所述系统包括采集插件单元(101)、写入插件单元(103)和数据处理中心(102),多个数据库通过采集插件单元和写入插件单元与所述数据处理中心以星型方式相连接,数据处理中心包括多个同步执行节点,多个同步执行节点以分布式执行的方式进行数据同步,采用适配器适配各种异构数据库的采集和写入,采用统一的中间数据格式传输,简化了不同源端和目标端的连接,提高了数据的采集效率,具有很强的扩展性,采用统一的同步任务控制器实现同步任务的接收、分配、接收以及负载均衡,通过多通道的方式并行执行数据同步的操作,以进一步提高执行效率。

Description

一种异构数据库之间数据同步的系统、方法、存储介质
相关申请
本申请要求保护在2019年4月26日提交的申请号为201910346104.0的中国专利申请的优先权,该申请的全部内容以引用的方式结合到本文中。
技术领域
本发明涉及数据处理技术领域,特别是一种异构数据库之间数据同步的系统、方法、存储介质。
背景技术
目前大数据技术迅速发展,各行各业产生的数据是愈来愈多,随着数据规模的扩大,数据种类和结构的多样性的增加,为了加强对数据的使用效率,各种不同数据结构类型的数据库也深入到了不同的应用和行业中,对这些异构数据库的配合使用已是常态。
对于那些地域分散而管理又相对集中的跨地域的公司企业或单位,为了提高数据的价值,需要对数据进行集中整合分析,这推动数据中心或数据平台的建设。目前数据存储的种类比较多,主流一般包括关系型数据库、分布式并行数据库、列式数据库、全文检索数据库、图数据库、内存数据库、文档数据库、分布式文件存储和流式系统等。常规的数据库支撑导入导出能力,但语法各异,导出导入和ETL技术虽然完成数据同步,但未能达到数据同步集中管理、扩展能力、速度和性能要求。传统的主流数据库开发商也有数据同步方案,但一般针对同构数据库,对异构数据库的支撑能力有限。
现有技术中针对不同数据库采用导出导入或ETL的方式,将数据从源端数据库抽出,再将数据加载到目标数据库,达到数据同步的目的。但随着场景逐渐复杂,使用的数据库种类越来越多了,同步需要适配各种异构数据库,造成系统高度复杂。
现有技术中另一种常见的数据同步复制是由数据库自身同构复制技术实现的,比如Oracle常见的RAC技术,RAC是采用了高缓存合并,集群节点共享存储,这种技术对于跨域的和非Oracle异构的数据库是不支持的。对于这种复杂方式,各数据库厂商一般都辅助工具完成数据同步复制,但是复制方案仍依赖于相应的数据库管理系统核心技术,不能保证完全与DBMS无关。
此外,现有技术中GoldenGate,主要是围绕Oracle的同步工具,是通过运行在源端的Extract进程抓取数据库的DML、DDL操作,然后通过运行在目标端的Replicat去重新构造DML或DDL操作并应用到目标端数据库上。其对源和目标系统侵入性比较强,需要相应的权限和部署进程处理,缺乏很好的扩展和定制能力。对于DBlink技术,其配置与对应数据库耦合度高。对于这些常用关系数据库采用的同步工具不能有效支撑除关系型数据库其他的数 据库类型,且对数据形式有一定要求,缺乏集中的同步管理。
且现有技术中,数据任务进程缺乏统一的系统管理,横向扩展能力有限,效率低且性能差,无法适应大规模数据的同步。
发明内容
本发明针对上述现有技术中的缺陷,提出了如下技术方案。
一种异构数据库之间数据同步的系统,该系统包括采集插件单元、写入插件单元和数据处理中心,多个数据库通过采集插件单元和写入插件单元与所述数据处理中心相连接;
所述采集插件单元用于从所述多个数据库中的一个数据库中读取数据,并将所读取的数据发送至数据处理中心;
所述数据处理中心用于将接收的数据先转换为预定的格式的数据再转换为拟写入的数据库数据格式的数据,并将转换为拟写入数据库的数据格式的数据发送至写入插件单元;
所述写入插件单元用于将接收的转换为拟写入数据库的数据格式的数据写入对应的数据库。
更进一步地,所述预定的格式为CSV或XML格式。
更进一步地,所述多个数据库与所述数据处理中心呈星型连接方式,所述数据处理中心包括采集插件适配器、第一格式转换单元、数据处理单元、第二格式单元和写入插件适配器,所述采集插件适配器与所述采集插件单元相连接,用于接收采集插件单元从数据库中所采集的数据并发送至第一格式转换单元,第一格式转换单元用于将接收的数据格式化为预定的格式的数据后发送至数据处理单元,数据处理单元进行处理后将处理后的预定格式的数据发送至第二格式转换单元,所述第二格式转换单元将预定的格式的数据再转换为拟写入的数据库数据格式的数据后发送至写入插件适配器,写入插件适配器将拟写入的数据库数据格式的数据发送至写入插件单元。
更进一步地,所述数据处理中心由至少一个同步执行节点组成。
更进一步地,所述同步执行节点在同步任务控制器的控制下执行数据同步的操作,所述同步任务控制器包括同步任务管理单元、执行节点管理单元、控制单元、日志管理单元、报表警告单元、服务单元和数据持久化单元,所述同步任务管理单元根据接收的任务的任务信息指定控制单元来激活任务,再将激活的任务分配到至少一个同步执行节点中运行;执行节点管理单元用于向至少一个同步执行节点发送执行命令和元数据;日志管理单元用于记录每一个同步执行节点的运行状态;所述报表警告单元根据预定的规则进行警报;服务单元用于 向客户提供数据服务功能;数据持久化单元用于将数据持久化在本地数据库中。
更进一步地,所述同步执行节点通过多通道的方式并行执行数据同步的操作,所述通道包数据接收器、数据切分模块、多个第一数据转换模块、多个数据处理模块、多个第二数据转换模块、数据合并模块和数据发送器,所述数据接收器从采集插件适配器接收数据并发送至所述数据切分模块,所述数据切分模块将数据切分后发送至多个第一数据转换模块,多个第一数据转换模块将接收的数据转换为预定的格式后发送至相应的数据处理模块,数据处理模块处理后发送至相应的第二数据转换模块,第二数据转换模块将预定的格式的数据再转换为拟写入的数据库数据格式的数据后发送至数据合并模块,数据合并模块将接收的数据合并后发送至数据发送器,数据发送器将合并后的拟写入的数据库数据格式的数据后发送至写入插件适配器。
本发明还提出了基于上述的异构数据库之间数据同步的系统的数据同步方法,该方法包括:
设置步骤,设置多个数据库中的每个数据库通过采集插件单元和写入插件单元与数据处理中心相连接;
采集步骤,通过所述采集插件单元从所述多个数据库中的一个数据库中读取数据,并将所读取的数据发送至数据处理中心;
格式化步骤,通过所述数据处理中心将接收的数据先转换为预定的格式的数据再转换为拟写入的数据库数据格式的数据,并将转换为拟写入数据库的数据格式的数据发送至写入插件单元;
写入步骤,通过所述写入插件单元将接收的转换为拟写入数据库的数据格式的数据写入对应的数据库。
更进一步地,所述预定的格式为CSV或XML格式。
更进一步地,所述多个数据库与所述数据处理中心呈星型连接方式,所述数据处理中心包括采集插件适配器、第一格式转换单元、数据处理单元、第二格式单元和写入插件适配器,所述采集插件适配器与所述采集插件单元相连接,用于接收采集插件单元从数据库中所采集的数据并发送至第一格式转换单元,第一格式转换单元用于将接收的数据格式化为预定的格式的数据后发送至数据处理单元,数据处理单元进行处理后将处理后的预定格式的数据发送至第二格式转换单元,所述第二格式转换单元将预定的格式的数据再转换为拟写入的数据库数据格式的数据后发送至写入插件适配器,写入插件适配器将拟写入的数据库数据格式的数 据发送至写入插件单元。
更进一步地,所述数据处理中心由至少一个同步执行节点组成。
更进一步地,所述同步执行节点在同步任务控制器的控制下执行数据同步的操作,所述同步任务控制器包括同步任务管理单元、执行节点管理单元、控制单元、日志管理单元、报表警告单元、服务单元和数据持久化单元,所述同步任务管理单元根据接收的任务的任务信息指定控制单元来激活任务,再将激活的任务分配到至少一个同步执行节点中运行;执行节点管理单元用于向至少一个同步执行节点发送执行命令和元数据;日志管理单元用于记录每一个同步执行节点的运行状态;所述报表警告单元根据预定的规则进行警报;服务单元用于向客户提供数据服务功能;数据持久化单元用于将数据持久化在本地数据库中。
更进一步地,所述同步执行节点通过多通道的方式并行执行数据同步的操作,所述通道包数据接收器、数据切分模块、多个第一数据转换模块、多个数据处理模块、多个第二数据转换模块、数据合并模块和数据发送器,所述数据接收器从采集插件适配器接收数据并发送至所述数据切分模块,所述数据切分模块将数据切分后发送至多个第一数据转换模块,多个第一数据转换模块将接收的数据转换为预定的格式后发送至相应的数据处理模块,数据处理模块处理后发送至相应的第二数据转换模块,第二数据转换模块将预定的格式的数据再转换为拟写入的数据库数据格式的数据后发送至数据合并模块,数据合并模块将接收的数据合并后发送至数据发送器,数据发送器将合并后的拟写入的数据库数据格式的数据后发送至写入插件适配器。
本发明还提出了一种计算机可读存储介质,所述存储介质上存储有计算机程序代码,当所述计算机程序代码被计算机执行时执行上述之任一的方法。
本发明的技术效果为:本发明提出了一种异构数据库之间数据同步的系统、方法、存储介质,应用于在异构数据库之间数据同步过程,所述系统包括采集插件单元、写入插件单元和数据处理中心,多个数据库通过采集插件单元和写入插件单元与所述数据处理中心以星型方式相连接,数据处理中心包括多个同步执行节点,多个同步执行节点以分布式执行的方式进行数据同步,数据采集与数据写入插件采用插件式结构,以统一的中间数据格式进行处理和传输,简化了不同源数据库和目标数据库的连接,采用适配器适配各种异构数据库的采集和写入,本发明采用统一的中间数据格式传输,简化了不同源端和目标端的连接,提高了数据的采集效率,且通过插件连接方式具有很强的扩展性,采用统一的同步任务控制器实现同步任务的接收、分配、接收以及采集日志的管理、报警,数据持久化等处理,还控制负载实 现同步执行节点之间的负载均衡,同步执行节点通过多通道的方式并行执行数据同步的操作,以进一步提高执行效率。
附图说明
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显。
图1是根据本发明的实施例的一种异构数据库之间数据同步的系统的示意图。
图2是根据本发明的实施例的数据处理中心的结构图。
图3是根据本发明的实施例的多通道的结构图。
图4是根据本发明的实施例的同步任务控制器的结构图。
图5是根据本发明的实施例的异构数据库之间数据同步的系统的数据同步方法的流程图。
具体实施方式
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。
图1示出了本发明的一种异构数据库之间数据同步的系统,该系统包括采集插件单元101、写入插件单元103和数据处理中心102,多个数据库通过采集插件单元101和写入插件单元103与所述数据处理中心102相连接。
其中,所述采集插件单元101用于从所述多个数据库中的一个数据库中读取数据,并将所读取的数据发送至数据处理中心102;所述数据处理中心102用于将接收的数据先转换为预定的格式的数据再转换为拟写入的数据库数据格式的数据,并将转换为拟写入数据库的数据格式的数据发送至写入插件单元103;所述写入插件单元103用于将接收的转换为拟写入数据库的数据格式的数据写入对应的数据库。
采用插件式(即集插件单元、写入插件单元103)即每个同步任务执行器(也称为同步任务执行节点)都是以数据库插件结合传输处理中心这种架构进行处理,中间使用统一的数据格式传输和标准化的处理,该系统支持以通用的CSV和XML两种格式作为中间数据格式。CSV通过分隔符分隔字段值,其文件以纯文本形式存储,第一行表头表明每列的数据字段;XML是一种用于标记电子文件使其具有结构性的标记语言,通过标签来表明每个数据字段。即本系统的数据采集与数据写入插件采用插件式结构,以统一的中间数据格式进行处理和传输,简化了不同源数据库和目标数据库的连接,本系统采用统一的中间数据格式传输,简化了不同源端和目标端的连接,提高了数据的采集效率,且通过插件连接方式具有很强的扩展 性,这是本发明的重要发明点之一。
在一个实施例中,所述多个数据库与所述数据处理中心102呈星型连接方式。如图2所示,所述数据处理中心102包括采集插件适配器、第一格式转换单元、数据处理单元、第二格式单元和写入插件适配器,所述采集插件适配器与所述采集插件单元101相连接,用于接收采集插件单元101从数据库中所采集的数据并发送至第一格式转换单元,第一格式转换单元用于将接收的数据格式化为预定的格式的数据后发送至数据处理单元,数据处理单元进行处理后将处理后的预定格式的数据发送至第二格式转换单元,所述第二格式转换单元将预定的格式的数据再转换为拟写入的数据库数据格式的数据后发送至写入插件适配器,写入插件适配器将拟写入的数据库数据格式的数据发送至写入插件单元103。采用星型连接方式将现有技术中复杂的网状的数据同步链路变成了星型数据链路,位于星型中间的数据处理中心102负责连接各种异构数据库并对同步的不同数据格式进行格式化。当需要扩展接入一个新的数据库种类的时候,只需要将此数据库按格式要求和传输规范,对接到中央的数据处理中心102,便能跟已有的数据库做到无缝数据对接。即通过插件连接方式使得数据同步系统具有很强的扩展性,这是本发明的重要发明点之一。
在一个实施例中,所述数据处理中心102由至少一个同步执行节点组成。所述同步执行节点在同步任务控制器的控制下执行数据同步的操作。如图3所示,所述同步任务控制器包括同步任务管理单元、执行节点管理单元、控制单元、日志管理单元、报表警告单元、服务单元和数据持久化单元,所述同步任务管理单元根据接收的任务的任务信息指定控制单元来激活任务,再将激活的任务分配到至少一个同步执行节点中运行;执行节点管理单元用于向至少一个同步执行节点发送执行命令和元数据;日志管理单元用于记录每一个同步执行节点的运行状态;所述报表警告单元根据预定的规则进行警报;服务单元用于向客户提供数据服务功能;数据持久化单元用于将数据持久化在本地数据库中。
为了满足同步系统的高效和高可用,满足支持大量任务和大规模数据的同步,本系统采用分布式执行方式。前端与同步任务控制器进行交互,完成对数据同步的操作和管理;同步任务控制器包括了同步任务管理、执行节点管理、日志管理和报表告警等其他功能,数据持久化在本地的mysql数据库中,通过控制单元和服务与节点进行通信。控制命令和元数据由控制器下达给执行节点,执行节点会将心跳、状态和收集的日志回传给控制器,同步执行节点除了完成与控制器的注册、通信,也是同步任务的具体执行的地方。
多个执行节点根据任务的调度要求并行地处理数据同步任务,维护控制和调度。同步任 务控制器会根据任务信息指定控制器模块来拉起(即激活)任务,再把任务分配到具体的同步执行节点中运行。同步任务控制器和同步执行节点之间采用了自定义的RPC调用方式来实现,该RPC使用hessian做序列化,在HTTP层传输。
分布式的方式可以大量任务根据负载的要求平均分配到多个执行的服务器节点上并行运行,提高效率和高可用。当某台节点失效时,同步任务控制器能根据心跳和状态进行判断,将任务分配给其他正常节点执行。即本系统采用统一的同步任务控制器实现同步任务的接收、分配、接收以及采集日志的管理、报警,数据持久化等处理,还控制负载实现同步执行节点之间的负载均衡,这是本发明的又一个重要发明点。
在一个实施例中,所述同步执行节点通过多通道的方式并行执行数据同步的操作。如图4所示,所述通道包数据接收器、数据切分模块、多个第一数据转换模块、多个数据处理模块、多个第二数据转换模块、数据合并模块和数据发送器,所述数据接收器从采集插件适配器接收数据并发送至所述数据切分模块,所述数据切分模块将数据切分后发送至多个第一数据转换模块,多个第一数据转换模块将接收的数据转换为预定的格式后发送至相应的数据处理模块,数据处理模块处理后发送至相应的第二数据转换模块,第二数据转换模块将预定的格式的数据再转换为拟写入的数据库数据格式的数据后发送至数据合并模块,数据合并模块将接收的数据合并后发送至数据发送器,数据发送器将合并后的拟写入的数据库数据格式的数据后发送至写入插件适配器。
每个同步执行节点在执行数据同步任务时,支持内部以多通道的形式进行同步数据,这样可以做到通道间的数据不会相互耦合。每个通道运行在自身的一个线程,这可以防止繁忙的通道阻塞,或者一个通道失败停止,不会影响其他通道的正常同步。
每一个通道执行一个数据同步任务,在数据采集插件采集到数据后,通过适配器,任务会进行拆分,在通道内以多线程并行的方式将数据划分为多个数据块进行处理,处理过程主要是对数据进行传输格式的统一,转换为标准csv或xml文件格式,然后进行数据内容的标准处理,包括数据的清洗、过滤、内容转换等。也支持根据业务场景的定制处理,只需要在处理单元模块中加入额外的处理逻辑。数据完成处理后,对多线程并行执行生成的数据进行合并,然后需要进行第二次文件格式转换,转换的目标格式主要是根据目标写入插件的不同而不同,目的是为了适配写入端的高效写入要求。最后推送至统一的传输通道,根据数据任务的目的系统分拣至对应的写入插件,完成数据写入目标数据库。即本系统同步执行节点通过多通道的方式并行执行数据同步的操作,以进一步提高执行效率,这是本发明的再一个重 要发明点。
进一步参考图5,是基于上述图1所示系统的异构数据库之间的数据同步方法,该方法可以运行于各种电子设备或通过网络连接的多个电子设备中。
图5示出了本发明的本发明的基于上述的异构数据库之间数据同步的系统的数据同步方法,该方法包括:
设置步骤S501,设置多个数据库中的每个数据库通过采集插件单元和写入插件单元与数据处理中心相连接。
采集步骤S502,通过所述采集插件单元从所述多个数据库中的一个数据库中读取数据,并将所读取的数据发送至数据处理中心。
格式化步骤S503,通过所述数据处理中心将接收的数据先转换为预定的格式的数据再转换为拟写入的数据库数据格式的数据,并将转换为拟写入数据库的数据格式的数据发送至写入插件单元。
写入步骤S504,通过所述写入插件单元将接收的转换为拟写入数据库的数据格式的数据写入对应的数据库。
采用插件式(即集插件单元101、写入插件单元103)即每个同步任务执行器(也称为同步任务执行节点)都是以数据库插件结合传输处理中心这种架构进行处理,中间使用统一的数据格式传输和标准化的处理,该系统支持以通用的CSV和XML两种格式作为中间数据格式。CSV通过分隔符分隔字段值,其文件以纯文本形式存储,第一行表头表明每列的数据字段;XML是一种用于标记电子文件使其具有结构性的标记语言,通过标签来表明每个数据字段。即本系统的数据采集与数据写入插件采用插件式结构,以统一的中间数据格式进行处理和传输,简化了不同源数据库和目标数据库的连接,本系统采用统一的中间数据格式传输,简化了不同源端和目标端的连接,提高了数据的采集效率,且通过插件连接方式具有很强的扩展性,这是本发明的重要发明点之一。
在一个实施例中,所述多个数据库与所述数据处理中心呈星型连接方式。如图2所示,所述数据处理中心包括采集插件适配器、第一格式转换单元、数据处理单元、第二格式单元和写入插件适配器,所述采集插件适配器与所述采集插件单元相连接,用于接收采集插件单元从数据库中所采集的数据并发送至第一格式转换单元,第一格式转换单元用于将接收的数据格式化为预定的格式的数据后发送至数据处理单元,数据处理单元进行处理后将处理后的预定格式的数据发送至第二格式转换单元,所述第二格式转换单元将预定的格式的数据再转 换为拟写入的数据库数据格式的数据后发送至写入插件适配器,写入插件适配器将拟写入的数据库数据格式的数据发送至写入插件单元。采用星型连接方式将现有技术中复杂的网状的数据同步链路变成了星型数据链路,位于星型中间的数据处理中心负责连接各种异构数据库并对同步的不同数据格式进行格式化。当需要扩展接入一个新的数据库种类的时候,只需要将此数据库按格式要求和传输规范,对接到中央的数据处理中心,便能跟已有的数据库做到无缝数据对接。即通过插件连接方式使得数据同步系统具有很强的扩展性,这是本发明的重要发明点之一。
在一个实施例中,所述数据处理中心由至少一个同步执行节点组成。所述同步执行节点在同步任务控制器的控制下执行数据同步的操作。如图3所示,所述同步任务控制器包括同步任务管理单元、执行节点管理单元、控制单元、日志管理单元、报表警告单元、服务单元和数据持久化单元,所述同步任务管理单元根据接收的任务的任务信息指定控制单元来激活任务,再将激活的任务分配到至少一个同步执行节点中运行;执行节点管理单元用于向至少一个同步执行节点发送执行命令和元数据;日志管理单元用于记录每一个同步执行节点的运行状态;所述报表警告单元根据预定的规则进行警报;服务单元用于向客户提供数据服务功能;数据持久化单元用于将数据持久化在本地数据库中。
为了满足同步系统的高效和高可用,满足支持大量任务和大规模数据的同步,本系统采用分布式执行方式。前端与同步任务控制器进行交互,完成对数据同步的操作和管理;同步任务控制器包括了同步任务管理、执行节点管理、日志管理和报表告警等其他功能,数据持久化在本地的mysql数据库中,通过控制单元和服务与节点进行通信。控制命令和元数据由控制器下达给执行节点,执行节点会将心跳、状态和收集的日志回传给控制器,同步执行节点除了完成与控制器的注册、通信,也是同步任务的具体执行的地方。
多个执行节点根据任务的调度要求并行地处理数据同步任务,维护控制和调度。同步任务控制器会根据任务信息指定控制器模块来拉起(即激活)任务,再把任务分配到具体的同步执行节点中运行。同步任务控制器和同步执行节点之间采用了自定义的RPC调用方式来实现,该RPC使用hessian做序列化,在HTTP层传输。
分布式的方式可以大量任务根据负载的要求平均分配到多个执行的服务器节点上并行运行,提高效率和高可用。当某台节点失效时,同步任务控制器能根据心跳和状态进行判断,将任务分配给其他正常节点执行。即本系统采用统一的同步任务控制器实现同步任务的接收、分配、接收以及采集日志的管理、报警,数据持久化等处理,还控制负载实现同步执行节点 之间的负载均衡,这是本发明的又一个重要发明点。
在一个实施例中,所述同步执行节点通过多通道的方式并行执行数据同步的操作。如图4所示,所述通道包数据接收器、数据切分模块、多个第一数据转换模块、多个数据处理模块、多个第二数据转换模块、数据合并模块和数据发送器,所述数据接收器从采集插件适配器接收数据并发送至所述数据切分模块,所述数据切分模块将数据切分后发送至多个第一数据转换模块,多个第一数据转换模块将接收的数据转换为预定的格式后发送至相应的数据处理模块,数据处理模块处理后发送至相应的第二数据转换模块,第二数据转换模块将预定的格式的数据再转换为拟写入的数据库数据格式的数据后发送至数据合并模块,数据合并模块将接收的数据合并后发送至数据发送器,数据发送器将合并后的拟写入的数据库数据格式的数据后发送至写入插件适配器。
每个同步执行节点在执行数据同步任务时,支持内部以多通道的形式进行同步数据,这样可以做到通道间的数据不会相互耦合。每个通道运行在自身的一个线程,这可以防止繁忙的通道阻塞,或者一个通道失败停止,不会影响其他通道的正常同步。
每一个通道执行一个数据同步任务,在数据采集插件采集到数据后,通过适配器,任务会进行拆分,在通道内以多线程并行的方式将数据划分为多个数据块进行处理,处理过程主要是对数据进行传输格式的统一,转换为标准csv或xml文件格式,然后进行数据内容的标准处理,包括数据的清洗、过滤、内容转换等。也支持根据业务场景的定制处理,只需要在处理单元模块中加入额外的处理逻辑。数据完成处理后,对多线程并行执行生成的数据进行合并,然后需要进行第二次文件格式转换,转换的目标格式主要是根据目标写入插件的不同而不同,目的是为了适配写入端的高效写入要求。最后推送至统一的传输通道,根据数据任务的目的系统分拣至对应的写入插件,完成数据写入目标数据库。即本系统同步执行节点通过多通道的方式并行执行数据同步的操作,以进一步提高执行效率,这是本发明的再一个重要发明点。
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以 是个人计算机,服务器,或者网络设备等)执行本申请各个实施例或者实施例的某些部分所述的方法。
本发明的技术效果为,提出了一种异构数据库之间数据同步的系统、方法、存储介质,应用于在异构数据库之间数据同步过程,所述系统包括采集插件单元、写入插件单元和数据处理中心,多个数据库通过采集插件单元和写入插件单元与所述数据处理中心以星型方式相连接,数据处理中心包括多个同步执行节点,多个同步执行节点以分布式执行的方式进行数据同步,数据采集与数据写入插件采用插件式结构,以统一的中间数据格式进行处理和传输,简化了不同源数据库和目标数据库的连接,采用适配器适配各种异构数据库的采集和写入,本发明采用统一的中间数据格式传输,简化了不同源端和目标端的连接,提高了数据的采集效率,且通过插件连接方式具有很强的扩展性,采用统一的同步任务控制器实现同步任务的接收、分配、接收以及采集日志的管理、报警,数据持久化等处理,还控制负载实现同步执行节点之间的负载均衡,同步执行节点通过多通道的方式并行执行数据同步的操作,以进一步提高执行效率。
最后所应说明的是:以上实施例仅以说明而非限制本发明的技术方案,尽管参照上述实施例对本发明进行了详细说明,本领域的普通技术人员应当理解:依然可以对本发明进行修改或者等同替换,而不脱离本发明的精神和范围的任何修改或局部替换,其均应涵盖在本发明的权利要求范围当中。

Claims (13)

  1. 一种异构数据库之间数据同步的系统,其特征在于,该系统包括采集插件单元、写入插件单元和数据处理中心,多个数据库通过采集插件单元和写入插件单元与所述数据处理中心相连接;
    所述采集插件单元用于从所述多个数据库中的一个数据库中读取数据,并将所读取的数据发送至数据处理中心;
    所述数据处理中心用于将接收的数据先转换为预定的格式的数据再转换为拟写入的数据库数据格式的数据,并将转换为拟写入数据库的数据格式的数据发送至写入插件单元;
    所述写入插件单元用于将接收的转换为拟写入数据库的数据格式的数据写入对应的数据库。
  2. 根据权利要求1所述的系统,其特征在于,所述预定的格式为CSV或XML格式。
  3. 根据权利要求2所述的系统,其特征在于,所述多个数据库与所述数据处理中心呈星型连接方式,所述数据处理中心包括采集插件适配器、第一格式转换单元、数据处理单元、第二格式单元和写入插件适配器,所述采集插件适配器与所述采集插件单元相连接,用于接收采集插件单元从数据库中所采集的数据并发送至第一格式转换单元,第一格式转换单元用于将接收的数据格式化为预定的格式的数据后发送至数据处理单元,数据处理单元进行处理后将处理后的预定格式的数据发送至第二格式转换单元,所述第二格式转换单元将预定的格式的数据再转换为拟写入的数据库数据格式的数据后发送至写入插件适配器,写入插件适配器将拟写入的数据库数据格式的数据发送至写入插件单元。
  4. 根据权利要求3所述的系统,其特征在于,所述数据处理中心由至少一个同步执行节点组成。
  5. 根据权利要求1-4任一项所述的系统,其特征在于,所述同步执行节点在同步任务控制器的控制下执行数据同步的操作,所述同步任务控制器包括同步任务管理单元、执行节点管理单元、控制单元、日志管理单元、报表警告单元、服务单元和数据持久化单元,所述同步任务管理单元根据接收的任务的任务信息指定控制单元来激活任务,再将激活的任务分配到至少一个同步执行节点中运行;执行节点管理单元用于向至少一个同步执行节点发送执行命令和元数据;日志管理单元用于记录每一个同步执行节点的运行状态;所述报表警告单元根据预定的规则进行警报;服务单元用于向客户提供数据服务功能;数据持久化单元用于将数据持久化在本地数据库中。
  6. 根据权利要求5所述的系统,其特征在于,所述同步执行节点通过多通道的方式并 行执行数据同步的操作,所述通道包数据接收器、数据切分模块、多个第一数据转换模块、多个数据处理模块、多个第二数据转换模块、数据合并模块和数据发送器,所述数据接收器从采集插件适配器接收数据并发送至所述数据切分模块,所述数据切分模块将数据切分后发送至多个第一数据转换模块,多个第一数据转换模块将接收的数据转换为预定的格式后发送至相应的数据处理模块,数据处理模块处理后发送至相应的第二数据转换模块,第二数据转换模块将预定的格式的数据再转换为拟写入的数据库数据格式的数据后发送至数据合并模块,数据合并模块将接收的数据合并后发送至数据发送器,数据发送器将合并后的拟写入的数据库数据格式的数据后发送至写入插件适配器。
  7. 一种基于权利1-6任一项所述的异构数据库之间数据同步的系统的数据同步方法,其特征在于,该方法包括:
    设置步骤,设置多个数据库中的每个数据库通过采集插件单元和写入插件单元与数据处理中心相连接;
    采集步骤,通过所述采集插件单元从所述多个数据库中的一个数据库中读取数据,并将所读取的数据发送至数据处理中心;
    格式化步骤,通过所述数据处理中心将接收的数据先转换为预定的格式的数据再转换为拟写入的数据库数据格式的数据,并将转换为拟写入数据库的数据格式的数据发送至写入插件单元;
    写入步骤,通过所述写入插件单元将接收的转换为拟写入数据库的数据格式的数据写入对应的数据库。
  8. 根据权利要求7所述的方法,其特征在于,所述预定的格式为CSV或XML格式。
  9. 根据权利要求8所述的方法,其特征在于,所述多个数据库与所述数据处理中心呈星型连接方式,所述数据处理中心包括采集插件适配器、第一格式转换单元、数据处理单元、第二格式单元和写入插件适配器,所述采集插件适配器与所述采集插件单元相连接,用于接收采集插件单元从数据库中所采集的数据并发送至第一格式转换单元,第一格式转换单元用于将接收的数据格式化为预定的格式的数据后发送至数据处理单元,数据处理单元进行处理后将处理后的预定格式的数据发送至第二格式转换单元,所述第二格式转换单元将预定的格式的数据再转换为拟写入的数据库数据格式的数据后发送至写入插件适配器,写入插件适配器将拟写入的数据库数据格式的数据发送至写入插件单元。
  10. 根据权利要求9所述的方法,其特征在于,所述数据处理中心由至少一个同步执行 节点组成。
  11. 根据权利要求7-10任一项所述的方法,其特征在于,所述同步执行节点在同步任务控制器的控制下执行数据同步的操作,所述同步任务控制器包括同步任务管理单元、执行节点管理单元、控制单元、日志管理单元、报表警告单元、服务单元和数据持久化单元,所述同步任务管理单元根据接收的任务的任务信息指定控制单元来激活任务,再将激活的任务分配到至少一个同步执行节点中运行;执行节点管理单元用于向至少一个同步执行节点发送执行命令和元数据;日志管理单元用于记录每一个同步执行节点的运行状态;所述报表警告单元根据预定的规则进行警报;服务单元用于向客户提供数据服务功能;数据持久化单元用于将数据持久化在本地数据库中。
  12. 根据权利要求11所述的方法,其特征在于,所述同步执行节点通过多通道的方式并行执行数据同步的操作,所述通道包数据接收器、数据切分模块、多个第一数据转换模块、多个数据处理模块、多个第二数据转换模块、数据合并模块和数据发送器,所述数据接收器从采集插件适配器接收数据并发送至所述数据切分模块,所述数据切分模块将数据切分后发送至多个第一数据转换模块,多个第一数据转换模块将接收的数据转换为预定的格式后发送至相应的数据处理模块,数据处理模块处理后发送至相应的第二数据转换模块,第二数据转换模块将预定的格式的数据再转换为拟写入的数据库数据格式的数据后发送至数据合并模块,数据合并模块将接收的数据合并后发送至数据发送器,数据发送器将合并后的拟写入的数据库数据格式的数据后发送至写入插件适配器。
  13. 一种计算机可读存储介质,其特征在于,所述存储介质上存储有计算机程序代码,当所述计算机程序代码被计算机执行时执行权利要求7-12之任一的方法。
PCT/CN2019/100029 2019-04-26 2019-08-09 一种异构数据库之间数据同步的系统、方法、存储介质 WO2020215532A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910346104.0 2019-04-26
CN201910346104.0A CN110162571A (zh) 2019-04-26 2019-04-26 一种异构数据库之间数据同步的系统、方法、存储介质

Publications (1)

Publication Number Publication Date
WO2020215532A1 true WO2020215532A1 (zh) 2020-10-29

Family

ID=67638790

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/100029 WO2020215532A1 (zh) 2019-04-26 2019-08-09 一种异构数据库之间数据同步的系统、方法、存储介质

Country Status (2)

Country Link
CN (1) CN110162571A (zh)
WO (1) WO2020215532A1 (zh)

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110489491B (zh) * 2019-08-26 2023-07-04 湖南中车时代通信信号有限公司 一种适用于a/b网双集群的全量数据同步装置
CN110502583B (zh) * 2019-08-27 2024-05-17 深圳前海微众银行股份有限公司 分布式数据同步方法、装置、设备及可读存储介质
CN110750592B (zh) * 2019-09-06 2023-10-20 中国平安财产保险股份有限公司 数据同步的方法、装置和终端设备
CN110795499B (zh) * 2019-09-17 2024-04-16 中国平安人寿保险股份有限公司 基于大数据的集群数据同步方法、装置、设备及存储介质
CN110765206A (zh) * 2019-10-21 2020-02-07 广东小天才科技有限公司 一种数据同步系统、方法、装置、设备及存储介质
CN111090760A (zh) * 2019-11-25 2020-05-01 贝壳技术有限公司 数据存储方法和装置、计算机可读存储介质、电子设备
CN112988860B (zh) * 2019-12-18 2023-09-26 菜鸟智能物流控股有限公司 数据加速处理方法、装置及电子设备
CN111198917A (zh) * 2020-01-06 2020-05-26 中国建设银行股份有限公司 数据处理方法、装置、设备及存储介质
CN111405035A (zh) * 2020-03-13 2020-07-10 北京旷视科技有限公司 数据的传输方法及数据通道系统
CN112116467A (zh) * 2020-06-16 2020-12-22 上海金融期货信息技术有限公司 一种异构柜台并行运行方法和系统
CN111858630B (zh) * 2020-07-10 2022-06-17 山东云海国创云计算装备产业创新中心有限公司 一种数据处理方法、装置、设备及可读存储介质
CN111858610A (zh) * 2020-07-28 2020-10-30 贝壳技术有限公司 数据行号分配方法和装置、存储介质、电子设备
CN112153108B (zh) * 2020-08-14 2021-10-08 中国科学院电子学研究所苏州研究院 一种面向微服务架构的消息传输系统及其方法
CN112307128A (zh) * 2020-11-26 2021-02-02 中国—东盟信息港股份有限公司 一种基于分布式的异构数据同步系统及方法
CN112434111A (zh) * 2020-11-26 2021-03-02 平安普惠企业管理有限公司 基础数据同步方法、装置、设备及存储介质
CN112565042A (zh) * 2020-12-24 2021-03-26 航天科工网络信息发展有限公司 一种星形结构数据交换的方法
CN112600943B (zh) * 2021-03-01 2021-06-01 上海洋漪信息技术有限公司 高并发数据状态下异构系统的消息同步方法
CN113901141B (zh) * 2021-10-11 2022-08-05 京信数据科技有限公司 一种分布式数据同步方法及系统
CN114500563A (zh) * 2021-12-27 2022-05-13 四川华西集采电子商务有限公司 一种高效数据共享的方法及系统
CN114780643B (zh) * 2022-06-16 2022-10-21 恒生电子股份有限公司 数据同步处理方法、装置、电子设备及可读存储介质
CN116628066B (zh) * 2023-07-20 2024-01-09 腾讯科技(深圳)有限公司 数据传输方法、装置、计算机设备和存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043837A (zh) * 2010-12-01 2011-05-04 北京迅捷英翔网络科技有限公司 数据整合系统和方法
US20120030172A1 (en) * 2010-07-27 2012-02-02 Oracle International Corporation Mysql database heterogeneous log based replication
CN103092980A (zh) * 2013-01-31 2013-05-08 中国科学院自动化研究所 一种数据自动转换与存储的方法及系统
CN104111983A (zh) * 2014-06-30 2014-10-22 中国科学院信息工程研究所 一种开放式的多源数据采集系统及方法
CN106250444A (zh) * 2016-07-27 2016-12-21 北京集奥聚合科技有限公司 一种异构数据源的实时入库系统及方法
CN108563665A (zh) * 2018-01-05 2018-09-21 成都兴政电子政务运营服务有限公司 一种基于大数据技术的数据处理系统及方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108399256B (zh) * 2018-03-06 2020-08-04 北京慧萌信安软件技术有限公司 异构数据库内容同步方法、装置及中间件
CN109582722A (zh) * 2018-11-30 2019-04-05 珠海市新德汇信息技术有限公司 公安资源数据服务系统

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120030172A1 (en) * 2010-07-27 2012-02-02 Oracle International Corporation Mysql database heterogeneous log based replication
CN102043837A (zh) * 2010-12-01 2011-05-04 北京迅捷英翔网络科技有限公司 数据整合系统和方法
CN103092980A (zh) * 2013-01-31 2013-05-08 中国科学院自动化研究所 一种数据自动转换与存储的方法及系统
CN104111983A (zh) * 2014-06-30 2014-10-22 中国科学院信息工程研究所 一种开放式的多源数据采集系统及方法
CN106250444A (zh) * 2016-07-27 2016-12-21 北京集奥聚合科技有限公司 一种异构数据源的实时入库系统及方法
CN108563665A (zh) * 2018-01-05 2018-09-21 成都兴政电子政务运营服务有限公司 一种基于大数据技术的数据处理系统及方法

Also Published As

Publication number Publication date
CN110162571A (zh) 2019-08-23

Similar Documents

Publication Publication Date Title
WO2020215532A1 (zh) 一种异构数据库之间数据同步的系统、方法、存储介质
CN109492040B (zh) 一种适用于数据中心海量短报文数据处理的系统
CN108337320B (zh) 用于可扩展的结构化数据分布的系统和方法
WO2017008657A1 (zh) 一种数据快照获取的方法及系统
CN102937964B (zh) 基于分布式系统的智能数据服务方法
EP2954424B1 (en) Method, device, and system for peer-to-peer data replication and method, device, and system for master node switching
CN109388481B (zh) 一种事务信息的传输方法、系统、装置、计算设备和介质
CN104361031B (zh) 一种政务大数据预处理系统及处理方法
CN108334557B (zh) 一种聚合数据分析方法、装置、存储介质及电子设备
CN103345502A (zh) 分布式数据库的事务处理方法和系统
CN112231402A (zh) 一种异构数据实时同步方法、装置、设备和存储介质
US20170262508A1 (en) Infrastructure management system having scalable storage architecture
US11553023B2 (en) Abstraction layer for streaming data sources
CN112765272A (zh) 多源数据同步方法、系统及其应用的模型中枢
CN111026709B (zh) 基于集群访问的数据处理方法及装置
WO2022156542A1 (zh) 数据访问方法、系统和存储介质
CN108629016B (zh) 支持实时流计算面向大数据数据库控制系统、计算机程序
CN117056303B (zh) 适用于军事行动大数据的数据存储方法及装置
CN106354870A (zh) 一种数据加载的方法和设备
CN110874290B (zh) 分布式内存数据库的事务分析混合处理方法及数据库
WO2023138213A1 (zh) 一种基于地铁车站系统的数仓数据查询方法及装置
CN106502842A (zh) 数据恢复方法及系统
CN110427393B (zh) 一种对客户端访问请求进行调度的方法和系统
JP2005284520A (ja) ログ収集方法/プログラム/プログラム記録媒体/装置/システム
CN113872814A (zh) 内容分发网络的信息处理方法、装置和系统

Legal Events

Date Code Title Description
DPE2 Request for preliminary examination filed before expiration of 19th month from priority date (pct application filed from 20040101)
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19926653

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19926653

Country of ref document: EP

Kind code of ref document: A1