WO2017050176A1 - 一种数据同步方法和装置 - Google Patents

一种数据同步方法和装置 Download PDF

Info

Publication number
WO2017050176A1
WO2017050176A1 PCT/CN2016/099054 CN2016099054W WO2017050176A1 WO 2017050176 A1 WO2017050176 A1 WO 2017050176A1 CN 2016099054 W CN2016099054 W CN 2016099054W WO 2017050176 A1 WO2017050176 A1 WO 2017050176A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
synchronization
dirty data
dirty
module
Prior art date
Application number
PCT/CN2016/099054
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 WO2017050176A1 publication Critical patent/WO2017050176A1/zh
Priority to US15/933,793 priority Critical patent/US20180210937A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • 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
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a data synchronization method and a data synchronization device.
  • a relational database such as Mysql, Oracle, Sqlserver, Postgresql, etc.
  • a relational database such as Mysql, Oracle, Sqlserver, Postgresql, etc.
  • Mysql Oracle
  • Sqlserver Postgresql
  • Postgresql Postgresql
  • Dirty data refers to data in which the source data and the target data in the target database are not consistent, such as the primary key conflict between the source data and the target data, the data type of the source data does not match the data type of the target data, and the like.
  • the synchronization process cannot be performed once the dirty data is encountered, and the cost of resource consumption is generally large due to the synchronization of the big data. Therefore, the above process will undoubtedly cause extreme damage to the resources of the machine. Great waste, not fault-tolerant, and increased the total time of synchronization.
  • a data synchronization method including:
  • the application also discloses a data synchronization device, including:
  • a source data obtaining module configured to obtain source data from a source database
  • a conversion module configured to convert the source data into synchronous data that matches a data element format of a target database
  • a synchronization judging module configured to synchronize the synchronization data to a target database one by one, and determine whether dirty data is present
  • the continuation module is used to synchronize the synchronized data after the dirty data if dirty data is present.
  • the faulty mechanism may be preset in the embodiment of the present application, and the fault tolerance mechanism may continue to synchronize the synchronization data after the dirty data when the dirty data occurs, thereby preventing the impact of the dirty data on the synchronization process. It is not necessary to exit the program when it encounters dirty data during the synchronization process, so that the synchronization can continue to be executed, thereby reducing the waste of the resources of the machine, without frequently restarting the synchronization program and reducing the synchronization time.
  • FIG. 1 is a flow chart showing the steps of an embodiment of a data synchronization method of the present application
  • FIG. 2 is a flow chart showing the steps of an embodiment of a data synchronization method of the present application
  • FIG. 3 is a flow chart showing the steps of an embodiment of a data synchronization method of the present application.
  • FIG. 3A is an example of a DataX framework of an embodiment of the present application.
  • FIG. 4 is a structural block diagram of an embodiment of a data synchronization apparatus of the present application.
  • FIG. 5 is a structural block diagram of an embodiment of a data synchronization apparatus of the present application.
  • FIG. 6 is a structural block diagram of an embodiment of a data synchronization apparatus of the present application.
  • a fault tolerance mechanism can be preset in advance, and the fault tolerance mechanism can avoid the influence of dirty data on the synchronization process, and does not need to exit the program when it encounters dirty data during the synchronization process. Synchronization can continue, which can reduce the waste of the machine resources, without having to restart the synchronization program frequently, reducing the synchronization time.
  • FIG. 1 a flow chart of steps of a data synchronization method embodiment of the present application is shown, which may specifically include the following steps:
  • Step 110 Obtain source data from a source database.
  • the source database mentioned in the embodiment of the present application may be any relational database, and any relational database of the source database that may be provided in the embodiment of the present application.
  • the source database and the target database in the embodiments of the present application may also be other types of databases, which are not limited in this application.
  • the relational database is Mysql, Oracle, Sqlserver, Postgresql, and so on.
  • DataX encapsulates the conversion rules between various types of databases, and is a tool for exchanging data between heterogeneous databases/file systems at high speed, and realizes arbitrary data. Handling data exchange between systems.
  • the user can first configure the synchronization job.
  • the user can input the /home/taobao/datax/bin/datax.py-e command to select the source database and target in the source database and target database interface.
  • Database such as the source database select Sqlserver, the target database select Oracle, and then configure the corresponding json format synchronization job configuration file job.json.
  • the job.json includes a range of source data that needs to be synchronized, and so on.
  • the synchronization process is started, and then the job.json can be loaded, so that the source data can be obtained from the source database according to the configuration in the job.json.
  • the method before the step 110, the method further includes:
  • step 101 the synchronization job task is decomposed into at least two subtasks.
  • the embodiment of the present application can decompose it into multiple subtasks for a synchronous job task, thereby increasing the parallel speed, thereby improving synchronization efficiency.
  • the synchronization job task when the synchronization job task is decomposed, it can be decomposed according to the table that needs to be synchronized, and each subtask processes one table; for example, the synchronization job task may be synchronization for multiple tables, then one subtask can process one piece. table. It can also be decomposed according to the total number of rows in synchronization.
  • Each subtask processes a certain proportion of rows; for example, it needs to synchronize 50000 rows of Table 1 of the source database, 30,000 rows of Table 2, and 10000 rows of Table 3, then each subtask can be responsible for Synchronizing 30000 rows, subtask 1 can synchronize the first 30000 rows of Table 1, subtask 2 can synchronize 30000 rows of Table 2, and subtask 3 can synchronize the remaining 20000 rows of Table 1 and 10000 rows of Table 3.
  • the decomposition of the synchronization job task can be decomposed as needed, and the application does not limit the decomposition strategy.
  • a MasterContainer module can be started.
  • the MasterContainer is the hub management node of a single DataX job. It can load the aforementioned configuration files, perform data cleaning, and convert a single synchronization job task into multiple subtasks. Therefore, the embodiment of the present application can decompose the synchronization job task into at least two subtasks by the MasterContainer module of dataX.
  • the step 110 includes:
  • each sub-task obtains source data processed by itself from the database.
  • each sub-task of the embodiment of the present application obtains the source data processed by itself from the database.
  • the Scheduler module is finally called, that is, the scheduling is started.
  • the scheduling task controls the operation of each subtask.
  • the scheduling task starts a plurality of SlaveContainer modules, and each SlaveContainer module loads a reader plug-in of a phase type according to the type of the source database, and the reader plug-in reads the source data of the synchronization sub-task requirement from the database according to the data element structure of the type database.
  • Step 120 Convert the source data into synchronization data that matches the data element format of the target database.
  • the source data in Oracle can be converted into a SQL statement adapted to Mysql.
  • the source data may be input into the data exchange module Storage, and the data exchange module converts the source data into the data element structure of the adaptation target database according to the source database type and the target database type. Synchronized data.
  • the method before step 130, the method further includes:
  • Step 121 Perform pre-detection on the synchronization data, and filter out dirty data in the synchronization data.
  • the embodiment of the present application can perform data pre-check processing on data before data synchronization to avoid dirty data.
  • pre-detected dirty data can also be recorded.
  • all data to be synchronized and the target database are matched, such as matching field type matching, primary key matching, etc., and the data to be synchronized is completely suitable for the target database.
  • the synchronization can be directly performed without performing the process of determining the dirty data, and the synchronization is directly completed. If it is not filtered, you can continue to judge the dirty data that appears during the synchronization process.
  • step 130 the synchronization data is synchronized to the target database, and it is determined whether dirty data is present.
  • the aforementioned synchronous data is gradually written into the target database, and when one piece of data written fails, the piece of data can be regarded as dirty data.
  • the target database determines whether the data written by the strip is dirty data. For example, when the data is written, it conflicts with the primary key of the table of the target database, assuming the target Table 1 in the database is as follows:
  • the data when the data is written, it does not match the type of the table in the target database.
  • the data type of column 3 in Table 1 is an integer, and in the data written, the corresponding column 3 is a floating point type, and two If the data type conflicts, then the data is dirty data.
  • the aforementioned SlaveContainer module may load a writer plug of a phase type according to the type of the target database, and the writer plugin synchronizes the synchronization data obtained by converting the source data to the target database.
  • the step 130 includes:
  • Sub-step A131 when the synchronization data is synchronized to the target database in the form of batch transmission, it is judged whether or not the dirty data is started to be encountered. If it begins to encounter dirty data, then proceeds to sub-step A132.
  • step A131 - step A135 may be performed by each subtask.
  • Sub-step A132 notifying the target database to roll back the synchronized data in the synchronization data.
  • a batch of source data that is synchronized is the first 10000 of the first table, and 10,000 pieces of synchronous data are converted.
  • a rollback instruction is sent to the target database, and the rollback instruction includes a rollback object, such as 10000 pieces of synchronization data of the foregoing Table 1.
  • the database can The data that has been synchronized in the 10000 pieces of data is rolled back until the data of any one of the 10000 pieces of data is not synchronized.
  • Sub-step A133 after determining that the target database rollback is completed, synchronizing the synchronization data to the target database in the form of a single transmission, and determining whether the current transmission is dirty data. If the dirty data is transmitted at the time, the sub-step A134 is entered; if the current transmission is not the dirty data, the process proceeds to sub-step A135.
  • the present application may store the synchronization data converted from the source data in a cache, and then, after determining that the target database is rolled back, extract the synchronization data one by one from the system cache, in the form of a single transmission.
  • the target database is synchronized. Thereby a process of synchronizing the synchronized data to the target database in the form of a single transmission is achieved.
  • the synchronization of the piece of data may be exited, and the sub-step 134 is entered to directly record the piece of dirty data. If the piece of data is not dirty data, the synchronization is successful, and the next piece of data is continuously extracted for synchronization.
  • Sub-step A134 the step of recording the dirty data is entered, and the process proceeds to step A140.
  • the record of the dirty data may be recorded in the form of the source data, or may be recorded in the form of the synchronous data converted from the source data.
  • the specific dirty data can be located through the process of sub-steps A132-A135, and then the dirty data can be recorded and the like.
  • Step 140 if dirty data occurs, continue to synchronize the synchronized data after the dirty data.
  • the synchronization program after the dirty data can be synchronized without exiting the synchronization program.
  • the method further includes:
  • Step 150 generating a dirty data list for all the dirty data that appears to be displayed.
  • the embodiment of the present application may preset a fault tolerance mechanism, which can avoid the influence of dirty data on the synchronization process, and does not need to exit the program when the dirty data is encountered during the synchronization process, so that the synchronization can continue to be performed. Thereby, the waste of resources of the machine can be reduced, and the synchronization time can be reduced.
  • the embodiment of the present application can record all the dirty data that appears, and improve the recognition capability of the dirty data.
  • the embodiment of the present application can implement the synchronization process by using the dataX framework, and the dataX framework can easily realize synchronization between any two relational databases, so the universality is high, the synchronization efficiency is high, and the maintenance cost is low.
  • FIG. 2 a flow chart of steps of a data synchronization method embodiment of the present application is shown, which may specifically include the following steps:
  • Step 210 Obtain source data from a source database.
  • the method further includes:
  • step 201 the synchronization job task is decomposed into at least two subtasks.
  • the step 210 includes:
  • each sub-task obtains source data processed by itself from the database.
  • Step 220 Convert the source data into synchronization data that matches a data element format of a target database
  • Step 230 Synchronize the synchronization data to the target database one by one, and determine whether dirty data is present; if dirty data occurs, proceed to step 240.
  • Step 240 counting the total number of dirty data
  • the embodiment of the present application can count the total number of all dirty data that occurs during the synchronization process.
  • the synchronization of the 1 million data is stepwise, then in the process, when dirty data appears, the total number of dirty data can be counted, such as the occurrence of dirty data. The quantity is accumulated.
  • step 240 includes:
  • Sub-step A241 calculates the total number of dirty data based on the dirty data found by each sub-task.
  • the embodiment of the present application can set a scheduling task to collect the dirty data found by each subtask, thereby calculating the total number of dirty data.
  • the sub-step 241 includes:
  • Sub-step A2411 periodically polling to collect dirty data of each sub-task record
  • each subtask is polled every 5 minutes, and the dirty data of the new record is obtained from these subtasks.
  • Sub-step A2412 summarizes the collected dirty data and calculates the total number of dirty data.
  • Step 250 Determine whether the total number of dirty data reaches a threshold; if the total number of dirty data does not reach the threshold, proceed to step 270 to continue synchronizing the synchronized data after the dirty data; if the total number of dirty data reaches the threshold, enter Step 260.
  • Step 260 Control the synchronization process according to a preset processing rule.
  • step 270 synchronization of the synchronized data after the dirty data is continued.
  • the synchronization process can be controlled according to preset processing rules.
  • the processing rule may be such that the synchronization process may be exited, or if the total number of current dirty data reaches the threshold, but the synchronization data is currently being synchronized, then the synchronization may be no longer allowed after the synchronization data is synchronized.
  • the method further includes:
  • Step 280 Generate a dirty data list for the summarized dirty data for display.
  • the collected dirty data generated dirty data list may be displayed in the client, so that the technician can see where the dirty data appears.
  • another fault tolerance mechanism may be set in the embodiment of the present application, which presets a dirty data threshold that has a low impact on subsequent processing. For example, if the amount of synchronous data is 10 million, the threshold may be set to 1000.
  • the threshold may be set to 1000.
  • FIG. 3 a flow chart of steps of a data synchronization method embodiment of the present application is shown, which may specifically include the following steps:
  • step 310 the synchronization job task is decomposed into at least two subtasks.
  • the user may first configure a synchronization job for the DataX framework. Then in the DataX framework, the synchronization job task is broken down into N subtasks. These tasks are controlled by the DataX Scheduler (the scheduled task of DataX) until the synchronization is complete.
  • Step 312 for each subtask, each subtask obtains source data that is responsible for it from the database respectively;
  • each subtask converts the source data that it is responsible for into synchronous data that matches the data element format of the target database.
  • Step 316 for each subtask, when the synchronization data is synchronized to the target database in the form of batch transmission, it is judged whether or not the dirty data is started to be encountered; if the dirty data is started, the process proceeds to step 318.
  • Step 318 notifying the target database to roll back the synchronized data in the synchronization data; go to step 320.
  • Step 320 after determining that the target database rollback is completed, the The synchronization data is synchronized to the target database, and it is determined whether the current transmission is dirty data; if the current transmission is dirty data, then the sub-step 322 is entered. If the current transmission is not dirty data, then sub-step 324 is entered.
  • the next synchronization data is continued to the target database in the form of a single transmission.
  • Step 322 recording the dirty data, and proceeding to steps 324 and 326.
  • step 324 the next synchronization data is synchronized, and the process proceeds to step 320.
  • This step 322 can be understood as continuing to synchronize the synchronized data after the dirty data.
  • steps 314-324 are performed by each subtask.
  • Step 326 scheduling the task to periodically poll to collect the dirty data of each subtask record
  • the DataX Scheduler periodically collects new dirty data recorded by subtask 1 - subtask N.
  • step 328 the collected dirty data is summarized, and the total number of dirty data is calculated.
  • the DataX Scheduler then summarizes the collected dirty data and calculates the total amount of dirty data that has been aggregated.
  • the collected dirty data may be stored, for example, at a specified location on a disk.
  • Step 330 Determine whether the total number of dirty data reaches a threshold; if the total number of dirty data does not reach the threshold, proceed to step 332; if the total number of dirty data reaches the threshold, proceed to step 334.
  • Step 332 allowing each subtask to continue synchronizing the synchronized data after the dirty data. Proceed to step 320 and step 336.
  • Step 334 according to the preset processing rules, the synchronization process of the subtasks is controlled; go to step 336;
  • each synchronization process can be controlled according to preset processing rules.
  • the processing rule is as follows: each subtask can be exited from the synchronization process, or if the total number of current dirty data reaches the threshold, but the synchronization data of the subtask is currently being synchronized, then the subtask can be waited for the current processing. After the synchronization data is synchronized, each subtask is no longer allowed to synchronize.
  • step 336 the scheduling task generates a dirty data list for the summarized dirty data for display.
  • the display of the dirty data list may be performed after the synchronization of FIG. 3A is completed, or may be performed after the synchronization process is terminated.
  • the purpose of data synchronization is to process and summarize data. It is necessary to ensure that the source data is consistent with the same target data. This requires effective identification of dirty data during the synchronization process and feedback to the user.
  • the embodiment of the present application first sets a dirty data fault tolerance mechanism, that is, it presets a dirty data threshold that has a low impact on subsequent processing. For example, if the synchronous data volume is 10 million, the threshold may be set to 1000.
  • a dirty data fault tolerance mechanism presets a dirty data threshold that has a low impact on subsequent processing. For example, if the synchronous data volume is 10 million, the threshold may be set to 1000.
  • the threshold For synchronizing the source data in the source database to the target database, if dirty data is encountered during the synchronization process, the total number of dirty data can be counted, and the dirty data is compared with a pre-established threshold. If the total number of dirty data does not reach the threshold, the synchronization can be continued without exiting the synchronization program, so that the synchronization can be continued, thereby reducing waste of the machine resources and reducing the synchronization time.
  • the embodiment of the present application can record various dirty data appearing in the synchronization process, thereby improving the recognition capability of the dirty data. Unlike the prior art, only this time can be identified. A dirty data in the batch submission process
  • the embodiment of the present application can adopt the DataX framework, and the dataX framework has a standardized transmission protocol, which can easily realize synchronization between any two relational databases, so the universality is high, the synchronization efficiency is high, and the maintenance cost is low. low.
  • FIG. 4 a structural block diagram of an embodiment of a data synchronization apparatus of the present application is shown, which may specifically include the following modules:
  • the source data obtaining module 410 is configured to obtain source data from the source database
  • a conversion module 420 configured to convert the source data into synchronization data that matches a data element format of a target database
  • the synchronization determining module 430 is configured to synchronize the synchronization data to the target database one by one, and determine whether dirty data is present;
  • the continuation module 440 is configured to continue synchronizing the synchronized data after the dirty data if dirty data occurs.
  • the method before continuing the module 440, the method further includes:
  • a dirty data statistics module for counting the total number of dirty data if dirty data is present
  • the dirty data amount judging module is configured to determine whether the total number of dirty data reaches a threshold; if the total number of dirty data does not reach the threshold, proceed to the continuation module 440;
  • the synchronization control module is configured to control the synchronization process according to a preset processing rule if the total number of dirty data reaches a threshold.
  • the synchronization determining module 430 includes:
  • a batch data synchronization sub-module configured to determine whether to start encountering dirty data when the synchronization data is synchronized to the target database in the form of batch transmission; if the dirty data is started, the rollback notification sub-module is entered;
  • a rollback notification submodule configured to notify the target database to roll back the synchronized data in the synchronization data
  • a single data synchronization sub-module is configured to synchronize the synchronization data to the target database in the form of a single transmission after determining that the target database rollback is completed, and determine whether the current transmission is dirty data.
  • the data If the data is originally transmitted as dirty data, it enters the dirty data recording module.
  • the method before continuing the module 440, the method further includes:
  • a dirty data recording module for recording dirty data if dirty data is present.
  • the method before the source data obtaining module 410, the method further includes:
  • a task decomposition module for decomposing a synchronization job task into at least two subtasks.
  • the source data obtaining module 410 includes:
  • the source data acquisition sub-module is used for each sub-task to obtain source data processed by itself from the database.
  • the dirty data statistics module includes:
  • the dirty data statistics sub-module is used to calculate the total number of dirty data according to the dirty data found by each sub-task.
  • the dirty data statistics submodule includes:
  • Polling collection sub-module for periodic polling to collect dirty data for each sub-task record
  • a summary submodule that summarizes the collected dirty data and calculates the total amount of dirty data.
  • the method further includes:
  • a display module for generating a dirty data list for the aggregated dirty data for display.
  • the method before continuing the module, the method further includes:
  • a pre-detection module configured to perform pre-detection on the synchronization data, and filter out the synchronization data Dirty data.
  • the source database is any type of relational database
  • the target database is any one of relational databases
  • the embodiment of the present application may preset a fault tolerance mechanism, which can avoid the influence of dirty data on the synchronization process, and does not need to exit the program when the dirty data is encountered during the synchronization process, so that the synchronization can continue to be performed. Thereby, the waste of resources of the machine can be reduced, and the synchronization time can be reduced.
  • the embodiment of the present application can record all the dirty data that appears, and improve the recognition capability of the dirty data.
  • the embodiment of the present application can implement the synchronization process by using the dataX framework, and the dataX framework can easily realize synchronization between any two relational databases, so the universality is high, the synchronization efficiency is high, and the maintenance cost is low.
  • FIG. 5 a structural block diagram of an embodiment of a data synchronization apparatus of the present application is shown, which may specifically include the following modules:
  • the source data obtaining module 510 is configured to obtain source data from a source database
  • a conversion module 520 configured to convert the source data into synchronization data that matches a data element format of a target database
  • the synchronization judging module 530 is configured to synchronize the synchronization data to the target database one by one, and determine whether dirty data is present;
  • the dirty data statistics module 540 is configured to count the total number of dirty data if dirty data occurs
  • the dirty data amount determining module 550 is configured to determine whether the total number of dirty data reaches a threshold; if the total number of dirty data does not reach the threshold, enter the continuation module 570; if the total number of dirty data reaches the threshold, enter the synchronization control module 560 .
  • the synchronization control module 560 is configured to control the synchronization process according to preset processing rules.
  • the continuation module 570 is configured to continue to synchronize the synchronization data after the dirty data.
  • another fault tolerance mechanism may be set in the embodiment of the present application, which presets a dirty data threshold that has a low impact on subsequent processing. For example, if the amount of synchronous data is 10 million, the threshold may be set to 1000. Synchronize source data from the source database to the target database If you encounter dirty data during the synchronization process, you can count the total number of dirty data, compare the dirty data with a pre-defined threshold, and if the total number of dirty data does not reach the threshold, you can continue to synchronize.
  • FIG. 6 a structural block diagram of an embodiment of a data synchronization apparatus of the present application is shown, which may specifically include the following modules:
  • the task decomposition module 610 is configured to decompose the synchronization job task into at least two subtasks.
  • the source data obtaining module 612 specifically includes:
  • the source data obtaining sub-module 6121 is configured to acquire source data processed by itself from the database for each sub-task.
  • a conversion module 614 configured to convert the source data into synchronization data that matches a data element format of a target database
  • the synchronization judging module 616 specifically includes:
  • the batch data synchronization sub-module 6161 is configured to determine whether to start encountering dirty data when the synchronization data is synchronized to the target database in the form of batch transmission; if the dirty data is started, the rollback notification sub-module is entered;
  • a rollback notification sub-module 6162 configured to notify the target database to roll back the synchronized data in the synchronization data
  • the single data synchronization sub-module 6163 is configured to synchronize the synchronization data to the target database in the form of a single transmission after determining that the target database rollback is completed, and determine whether the current transmission is dirty data. If dirty data occurs, the dirty data logging module 618 is entered. If dirty data does not appear, the next sync data is synchronized.
  • the dirty data recording module 618 is configured to record the dirty data; enter a single data synchronization sub-module 6163 and a polling collection sub-module 6201. If dirty data does not appear, the single data synchronization sub-module 6163 continues to synchronize the next synchronization data.
  • the dirty data statistics module 620 specifically includes:
  • Polling collection sub-module 6201 for periodic polling to collect the number of dirty records for each subtask record according to
  • the summary sub-module 6202 is configured to summarize the collected dirty data and calculate the total number of dirty data.
  • the dirty data amount determining module 622 is configured to determine whether the total number of dirty data reaches a threshold; if the total number of dirty data does not reach the threshold, the sub-tasks are allowed to continue to synchronize the synchronous data after the dirty data, and enter a single data synchronizer. Module 6163; if the total number of dirty data reaches the threshold, then enter the synchronization control module 624;
  • the synchronization control module 624 is configured to control the synchronization process according to preset processing rules.
  • the display module 626 is configured to generate a dirty data list for the summarized dirty data for display.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • the embodiment of the present application first sets a dirty data fault tolerance mechanism, that is, it presets a dirty data threshold that has a low impact on subsequent processing. For example, if the amount of synchronous data is 10 million, the threshold may be set to 1000, for the source to be When the source data in the database is synchronized to the target database, if dirty data is encountered during the synchronization process, the total number of dirty data can be counted, and the dirty data is compared with a predetermined threshold, if the total amount of dirty data is not When the threshold is reached, the synchronization can be continued without exiting the synchronization program, so that the synchronization can be continued, thereby reducing waste of the machine resources and reducing the synchronization time.
  • the embodiment of the present application can record various dirty data appearing in the synchronization process, thereby improving the recognition capability of the dirty data. Instead of prior art, only one dirty data in this batch submission process can be identified.
  • the embodiment of the present application can adopt the DataX framework, and the dataX framework has a standardized transmission protocol, which can easily realize synchronization between any two relational databases, so the universality is high, the synchronization efficiency is high, and the maintenance cost is low. low.
  • embodiments of the embodiments of the present application can be provided as a method, apparatus, or computer program product. Therefore, the embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, embodiments of the present application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology. The information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include non-persistent computer readable media, such as modulated data signals and carrier waves.
  • Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
  • These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing terminal device Generate a box for implementing a process or multiple processes and/or block diagrams in a flowchart or A device that has multiple functions specified in the box.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the instruction device implements the functions specified in one or more blocks of the flowchart or in a flow or block of the flowchart.

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)

Abstract

一种数据同步方法和装置,涉及计算机技术领域。所述方法包括:从源数据库获取源数据(110);将所述源数据转换为与目标数据库的数据元格式匹配的同步数据(120);逐个将所述同步数据向目标数据库进行同步,并判断是否出现脏数据(130);如果出现脏数据,则继续对脏数据之后的同步数据进行同步(140)。其可以预先设置一个容错机制,该容错机制在出现脏数据时,可以实现继续对脏数据之后的同步数据进行同步的过程,从而可以避免脏数据对同步过程的影响,不用在同步过程中碰到脏数据就退出程序,使同步可以继续执行,从而可以降低对机器的资源的浪费,不用频繁重启同步程序,降低同步时间。

Description

一种数据同步方法和装置 技术领域
本申请涉及计算机技术领域,特别是涉及一种数据同步方法和一种数据同步装置。
背景技术
大数据环境下越来越多的企业意识到,大数据是一个有待发掘的、重要的信息宝藏。然而,企业的各个设备、各种业务存储的数据元结构不尽相同,也可以理解为采用的数据库不同,如Mysql、Oracle、Sqlserver、Postgresql、DRDS、OceanBase、ODPS、Hbase等各种类型的数据库之间的数据元结构都不尽相同。
为汇集、处理、分析上述异构环境数据,就需要建立异构数据源环境下的数据同步,实现所有数据的互联,也即将源数据库的数据同步到一个目标数据库中。
现有技术中,大都使用同步工具实现源数据的同步,以关系型数据库为例,如Mysql、Oracle、Sqlserver、Postgresql等数据库,一般将源数据同步至关系型数据库的步骤为:
1.将源数据转换为标准的sql语句;
2.将标准的sql语句插入到目标数据库;
3.同步过程中遇到脏数据,程序报错退出。
脏数据是指源数据和目标数据库中的目标数据不具有一致性的数据,比如源数据与目标数据的主键冲突、源数据的数据类型与目标数据的数据类型不匹配等。
上述过程中,对于源数据,一旦遇到脏数据,同步过程则无法进行,而由于对大数据的同步,资源消耗的代价一般是比较大的,因此,上述过程无疑会对机器的资源造成极大浪费,不能容错,并且增加了同步的总时间。
发明内容
鉴于上述问题,提出了本申请实施例以便提供一种克服上述问题或者至 少部分地解决上述问题的一种数据同步方法和相应的一种数据同步装置。
为了解决上述问题,本申请公开了一种数据同步方法,包括:
从源数据库获取源数据;
将所述源数据转换为与目标数据库的数据元格式匹配的同步数据;
逐个将所述同步数据向目标数据库进行同步,并判断是否出现脏数据;
如果出现脏数据,则继续对脏数据之后的同步数据进行同步。
本申请还公开了一种数据同步装置,包括:
源数据获取模块,用于从源数据库获取源数据;
转换模块,用于将所述源数据转换为与目标数据库的数据元格式匹配的同步数据;
同步判断模块,用于逐个将所述同步数据向目标数据库进行同步,并判断是否出现脏数据;
继续模块,用于如果出现脏数据,则继续对脏数据之后的同步数据进行同步。
本申请实施例包括以下优点:
本申请实施例,本申请实施例可以预先设置一个容错机制,该容错机制在出现脏数据时,可以实现继续对脏数据之后的同步数据进行同步的过程,从而可以避免脏数据对同步过程的影响,不用在同步过程中碰到脏数据就退出程序,使同步可以继续执行,从而可以降低对机器的资源的浪费,不用频繁重启同步程序,降低同步时间。
附图说明
图1是本申请的一种数据同步方法实施例的步骤流程图;
图2是本申请的一种数据同步方法实施例的步骤流程图;
图3是本申请的一种数据同步方法实施例的步骤流程图;
图3A是本申请实施例的DataX框架示例;
图4是本申请的一种数据同步装置实施例的结构框图;
图5是本申请的一种数据同步装置实施例的结构框图;
图6是本申请的一种数据同步装置实施例的结构框图。
具体实施方式
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。
本申请实施例的核心构思之一在于,因此本申请实施例可以预先设置一个容错机制,该容错机制可以避免脏数据对同步过程的影响,不用在同步过程中碰到脏数据就退出程序,使同步可以继续执行,从而可以降低对机器的资源的浪费,不用频繁重启同步程序,降低同步时间。
参照图1,示出了本申请的一种数据同步方法实施例的步骤流程图,具体可以包括如下步骤:
步骤110,从源数据库获取源数据。
本申请实施例所提及的源数据库可以为任意一种关系型数据库,本申请实施例所提可以为的源数据库任意一种关系型数据库。当然,本申请实施例的源数据库和目标数据库也可以为其他类型的数据库,本申请不对其加以限制。该关系型数据库如Mysql、Oracle、Sqlserver、Postgresql等。
当然,本申请实施例可以应用于DataX框架,DataX封装了各种类型的数据库之间的转换规则,是一个在异构的数据库/文件系统之间高速交换数据的工具,实现了在任意的数据处理系统之间的数据交换。
在实际应用中,用户可以首先配置同步作业,比如在dataX框架中,用户可以输入/home/taobao/datax/bin/datax.py–e命令,在源数据库和目标数据库界面选定源数据库和目标数据库,比如源数据库选择Sqlserver,目标数据库选择Oracle,然后去配置相应的具体的json格式的同步作业的配置文件job.json。在该job.json包括了需要同步的源数据范围等。
可以理解,用户在配置作业之后,启动同步过程,然后即可加载该job.json,从而可以根据job.json中的配置去源数据库中获取源数据。
当然,本申请实施例还可以采用其他同步工具,本申请不对其加以限制。
在本申请另一个优选的实施例中,所述步骤110之前,还包括:
步骤101,将同步作业任务分解为至少两个子任务。
本申请实施例对于一个同步作业任务,可以将其分解为多个子任务,如此提高并行速度,从而可以提高同步效率。
可以理解,在将同步作业任务分解时,可以根据需要同步的表进行分解,每个子任务处理一张表;比如,同步作业任务可能是针对多张表的同步,那么可以一个子任务处理一张表。也可以根据同步的总行数进行分解,每个子任务处理一定比例的行;比如,需要同步源数据库的表1的50000行、表2的30000行、表3的10000行,那么可以每个子任务负责同步30000行,那么子任务1可同步表1的前30000行,子任务2可同步表2的30000行,子任务3可同步表1的剩余的20000行和表3的10000行。
需要说明的是,对于同步作业任务的分解,可以根据需要进行分解,本申请不对其分解策略加以限制。
在实际应用中,对于DataX框架,可以启动一个MasterContainer模块,MasterContainer是单个DataX作业的中枢管理节点,其可以加载前述配置文件,可以执行数据清理、将单一同步作业任务转化为多个子任务等功能。因此,本申请实施例可以由dataX的MasterContainer模块将同步作业任务分解为至少两个子任务。
在步骤101的基础上,在本申请另外一种优选实施例中,所述步骤110包括:
子步骤A111,每个子任务分别从数据库获取由自己处理的源数据。
可以理解的是,由于同步作业任务被分为了多个子任务,而每个子任务则有自己处理的目标,本申请实施例每个子任务分别从数据库获取由自己处理的源数据。
在DataX框架中,由于先启动的是MasterContainer模块,其在将同步作业任务分解为了多个子任务后,最终调用Scheduler模块,即启动调度任 务,该调度任务控制每个子任务的运行。该调度任务启动多个SlaveContainer模块,每个SlaveContainer模块根据源数据库的类型去加载相类型的reader插件,该reader插件按照该类型数据库的数据元结构从数据库中读取同步子任务需求的源数据。
步骤120,将所述源数据转换为与目标数据库的数据元格式匹配的同步数据。
比如,对于为Oracle的源数据库中提取的源数据,同步的目标数据库为Mysql,那么可以将Oracle中的源数据转换为适配Mysql的sql语句。
在实际应用中,对于dataX框架,可以将源数据输入到其中的数据交换模块Storage中,由该数据交换模块根据源数据库类型和目标数据库类型,将源数据转换为适配目标数据库的数据元结构的同步数据。
当然,
在本申请另外一个优选实施例中,在步骤130之前,还包括:
步骤121,将所述同步数据进行预检测,过滤掉所述同步数据中的脏数据。
本申请实施例可以数据同步前对数据进行数据预检查处理,避免出现脏数据。当然,还可以将预检测的脏数据进行记录。比如在同步前对所有要同步数据与目标数据库进行数据匹配,如包括对应字段类型匹配,主键匹配等),将要同步的数据完全适合目标数据库的要求。
执行该步骤之后,如果同步数据中没有脏数据,则可以直接进行同步而不用执行判断脏数据的流程,直接完成同步。如果没有过滤干净,则可以继续对同步过程中出现的脏数据进行判断。
步骤130,将所述同步数据向目标数据库进行同步,并判断是否出现脏数据。
在实际写入过程中,是将前述同步数据逐步写入目标数据库的,当写入的一条数据失败,则该条数据可以认为其为脏数据。
在实际写入过程中可以根据目标数据库的报错确定该条写入的数据是否为脏数据。比如该条数据写入时与目标数据库的表的主键冲突,假设目标 数据库中表1的如下:
ID City_ID
1 2
2 3
5 4
4 5
表1
假设该表1中ID列不可重复,那么如果有一条同步数据要将第三行的ID值修改为4,那么因为ID列已经有4,而ID不可重复,则会出现主键冲突。
又比如该条数据写入时与目标数据库的表的类型不匹配,比如表1中的列3的数据类型为整型,而写入的一条数据中,对应该列3为浮点型,两者的数据类型冲突,那么该条数据为脏数据。
在本申请实施例中,在DataX中,可以由前述SlaveContainer模块根据目标数据库的类型加载相类型的writer插件,该writer插件将由源数据转换后得到的同步数据,向目标数据库进行同步。
在本申请另外一种优选实施例中,所述步骤130包括:
子步骤A131,当以批量传输的形式将所述同步数据向目标数据库进行同步时,判断是否开始遇到脏数据。如果开始遇到脏数据,则进入子步骤A132。
需要说明的是,在步骤101的基础上,步骤A131-步骤A135可以是各个子任务执行。
子步骤A132,通知所述目标数据库将所述同步数据中的已同步的数据进行回滚。
比如同步的一批源数据是表1的前10000条,转换得到10000条同步数据,本申请实施例发现脏数据之后,向目标数据库发送回滚指令,该回滚指令包括回滚的对象,如前述表1的10000条同步数据。然后数据库则可以将 该10000条数据中已经同步的数据进行回滚,直至未同步该10000条数据任意一条数据时的情况。
子步骤A133,在确定目标数据库回滚完成之后,以单条传输的形式将所述同步数据向目标数据库进行同步,并判断当次传输的是否为脏数据。如果当次传输的是脏数据,则进入子步骤A134;如果当次传输的不是脏数据,则进入,子步骤A135。
在本申请实施例中,本申请可以将由源数据转换得到的同步数据,存储在缓存中,然后在确定目标数据库回滚完成之后,从该系统缓存中逐条提取同步数据,以单条传输的形式向目标数据库进行同步。从而实现以单条传输的形式将所述同步数据向目标数据库进行同步的过程。
那么,每次向目标数据库进行单条传输的过程之后,如果该条数据是脏数据,则可以退出对该条数据的同步,进入子步骤134,直接记录该条脏数据。如果该条数据不是脏数据,则同步成功,继续提取下一条数据进行同步。
子步骤A134,进入对所述脏数据进行记录的步骤,进入步骤A140。
当然,本申请实施例中,对脏数据的记录,可以记录其源数据的形式,也可以记录其由源数据转换得到的同步数据的形式。
如此循环,直到该批次的同步数据执行完毕。
在实际应用中,由于可以获取的源数据可能有很多条,比如10000条,将该源数据转换为适配目标数据库的数据元结构的同步数据后,为了加快同步效率,则会先将这一批同步数据以批量传输的形式向目标数据库进行同步。因为该种方式只与目标数据库交互一次即可将该批量数据写入目标数据库,资源耗用小,耗时间短,而如果以单条传输的形式向目标数据库同步,则每次写入都需要与目标数据库进行交互,其资源占用多,耗时长。
那么,本申请实施例则可在批量传输的过程中,如果判断出现脏数据,如目标数据库返回前述错误,由于是批量传输,出现错误之后,批量传输则会终止,无法继续同步,那么本申请实施例则可以通过子步骤A132-A135的过程,定位具体的脏数据,然后即可对该脏数据进行记录等操作。
步骤140,如果出现脏数据,则继续对脏数据之后的同步数据进行同步。
本申请实施例,可以在脏数据出现后,不退出同步程序,而继续对该脏数据之后的同步数据进行同步。
当然,在本申请实施例的另外一种优选实施例中,还包括:
步骤150,将所有出现的脏数据生成脏数据列表以进行展示。
本申请实施例中,因此本申请实施例可以预先设置一个容错机制,该容错机制可以避免脏数据对同步过程的影响,不用在同步过程中碰到脏数据就退出程序,使同步可以继续执行,从而可以降低对机器的资源的浪费,降低同步时间。
另外,本申请实施例可以对所有出现的脏数据进行记录,提高了脏数据的识别能力。
再者,本申请实施例可以采用dataX框架实现同步过程,而dataX框架可以很容易的实现任意两个关系型数据库之间的同步,所以普适性高,同步效率高、维护成本低。
参照图2,其示出了本申请的一种数据同步方法实施例的步骤流程图,具体可以包括如下步骤:
步骤210,从源数据库获取源数据;
类似图1实施例,在本申请实施例的步骤210之前,还包括:
步骤201,将同步作业任务分解为至少两个子任务。
同理,在步骤101的基础上,在本申请另外一种优选实施例中,所述步骤210包括:
子步骤A211,每个子任务分别从数据库获取由自己处理的源数据。
步骤220,将所述源数据转换为与目标数据库的数据元格式匹配的同步数据;
步骤230,逐个将所述同步数据向目标数据库进行同步,并判断是否出现脏数据;如果出现脏数据,则进入步骤240
步骤240,统计脏数据的总数量;
对于同步时出现的脏数据,本申请实施例则可以统计同步过程中出现的所有脏数据的总数量。
比如,要同步了100万条源数据,对该100万条数据的同步是逐步进行的,那么在该过程中,出现了脏数据,则可以统计脏数据的总数量,比如对脏数据出现的数量进行累计。
在本申请另外一种优选的实施例中,在子步骤A211的基础上,步骤240包括:
子步骤A241,根据各个子任务发现的脏数据,计算脏数据的总数量。
由于各个子任务是独立对自己获取的源数据进行同步,因而,本申请实施例则可以设置一个调度任务,收集各个子任务发现的脏数据,从而计算脏数据的总数量。
在本申请另外一种优选的实施例中,所述子步骤241包括:
子步骤A2411,定期轮询以收集各个子任务记录的脏数据;
比如每隔5分钟轮询一次各个子任务,从这些子任务中获取新记录的脏数据。
子步骤A2412,对收集到的脏数据进行汇总,并计算脏数据的总数量。
然后即可对收集到的所有脏数据进行汇总,从而可以获得脏数据的总数量。
步骤250,判断脏数据的总数量是否达到阈值;如果脏数据的总数量未达到阈值,则进入步骤270,继续对脏数据之后的同步数据进行同步;如果脏数据的总数量达到阈值,则进入步骤260。
步骤260,按照预置的处理规则对同步过程进行控制。
步骤270,继续对脏数据之后的同步数据进行同步。
如果脏数据的总数量达到阈值,则可以根据预置的处理规则对同步过程进行控制。所述处理规则如:可以退出同步过程,或者如果当前的脏数据的总数量达到阈值,但是当前还有同步数据正在同步,那么则可等待这些同步数据同步完毕之后,不再允许进行同步。
在本申请另外一种优选的实施例中,在对收集到的脏数据进行汇总的步骤之后,还包括:
步骤280,针对汇总后的脏数据生成脏数据列表进行展示。
本申请实施例可以将汇总后的脏数据生成脏数据列表展示在客户端中,方便技术人员查看哪里出现了脏数据。
本申请实施例,本申请实施例可以设置另一个容错机制,其预先设置一个对后续处理影响较低的脏数据阈值,比如同步数据量为1000万,则该阈值可以设置为1000条,对于将对源数据库中的源数据同步到目标数据库中时,如果在同步过程中遇到脏数据,则可以统计脏数据的总数量,将搞脏数据与预先制定的阈值进行比较,如果脏数据的总数量未达到该阈值,则可以继续同步,而不用退出同步程序,使同步可以继续执行,从而可以降低对机器的资源的浪费,降低同步时间,并且可以及时对脏数据数量过多的情况进行限制,可以使技术人员重新配置转换规则。
为了更清楚方便的说明申请实施例,结合本发明的多任务处理架构,下面以图3优选地实施例对本申请实施例进行描述:
参照图3,示出了本申请的一种数据同步方法实施例的步骤流程图,具体可以包括如下步骤:
步骤310,将同步作业任务分解为至少两个子任务。
结合图3A,本申请实施例,用户可以首先针对DataX框架配置同步作业。然后在DataX框架中,将同步作业任务分解为N个子任务。这些任务由DataX Scheduler(DataX的调度任务)控制,直到同步完成。
步骤312,对于每个子任务,各个子任务分别从数据库获取自己负责的源数据;
步骤314,各个子任务将自己负责的源数据,转换为与目标数据库的数据元格式匹配的同步数据。
步骤316,对于每个子任务,当以批量传输的形式将所述同步数据向目标数据库进行同步时,判断是否开始遇到脏数据;如果开始遇到脏数据,则进入步骤318。
步骤318,通知所述目标数据库将所述同步数据中的已同步的数据进行回滚;进入步骤320。
步骤320,在确定目标数据库回滚完成之后,以单条传输的形式将所述 同步数据向目标数据库进行同步,并判断当次传输的是否为脏数据;如果当次传输的是脏数据,则进入子步骤322。如果当次传输的不是是脏数据,则进入子步骤324。
如果当次传输的不是脏数据,则继续以单条传输的形式下一条同步数据至目标数据库。
步骤322,对所述脏数据进行记录,进入步骤324以及326。
步骤324,对下一条同步数据进行同步,进入步骤320。
该步骤322可以理解为继续对脏数据之后的同步数据进行同步。
在本申请实施例中,步骤314-324由各个子任务执行。
步骤326,调度任务定期轮询以收集各个子任务记录的脏数据;
如图3A,DataX Scheduler定期收集子任务1-子任务N记录的新的脏数据。
步骤328,对收集到的脏数据进行汇总,并计算脏数据的总数量。
然后DataX Scheduler即可对收集到的脏数据进行汇总,并计算汇总后的脏数据的总数量。
在本申请实施例中,可以对汇总后的得到的脏数据进行存储,比如存储在磁盘指定位置。
步骤330,判断脏数据的总数量是否达到阈值;如果脏数据的总数量未达到阈值,则进入步骤332;如果脏数据的总数量达到阈值,则进入步骤334。
步骤332,允许各子任务继续对脏数据之后的同步数据进行同步。进入步骤320以及步骤336。
步骤334,按照预置的处理规则对个子任务的同步过程进行控制;进入步骤336;
如果脏数据的总数量达到阈值,则可以根据预置的处理规则对各个同步过程进行控制。所述处理规则如:可以将各个子任务退出同步过程,或者如果当前的脏数据的总数量达到阈值,但是当前还有子任务的同步数据正在同步,那么则可等待各个子任务对当前的处理的同步数据同步完毕之后,不再允许各子任务进行同步。
步骤336,调度任务针对汇总后的脏数据生成脏数据列表进行展示。
当然,本申请实施例中,对脏数据列表的展示可以在图3A的同步完成之后进行,也可以在同步过程终止后进行。
当然,本申请实施例中,某些步骤之间可以根据实际需要进行调换,本申请信息不对其加以限制。
对于实现异构数据源之间的相互同步,主要需要考虑如下几个问题:
1.标准化数据传输协议
异构数据环境下,不同的数据存储的数据类型是不同的、有限的,如何制定一套标准化的数据传输协议实现异构存储结构的数据类型互转,如果没有统一的数据传输协议,当数据源于目的端的数据类型不一致时,就会造成同步作业失败。
2.保证数据的一致性
数据同步的目的在于数据的加工和汇总,必须保证源数据和同步同的目标数据具有一致性。这就需要在同步过程中能够有效识别出脏数据,并反馈给用户。
3.具有容错机制
对大数据的同步,资源消耗的代价一般是比较大的,必须建立对脏数据的容错机制。如果一旦遇到脏数据就导致同步失败,无疑会对用户的资源造成极大浪费。
基于上述几点考虑,本申请实施例首先设置了一个脏数据容错机制,即其预先设置一个对后续处理影响较低的脏数据阈值,比如同步数据量为1000万,则该阈值可以设置为1000条,对于将对源数据库中的源数据同步到目标数据库中时,如果在同步过程中遇到脏数据,则可以统计脏数据的总数量,将搞脏数据与预先制定的阈值进行比较,如果脏数据的总数量未达到该阈值,则可以继续同步,而不用退出同步程序,使同步可以继续执行,从而可以降低对机器的资源的浪费,降低同步时间。
再者,基于该容错机制,本申请实施例可以对同步过程中出现的各种脏数据进行记录,提高了脏数据的识别能力。而不像在先技术只能识别出本次 批量提交过程中的一条脏数据
最后,本申请实施例可以采用DataX框架,而dataX框架具备一套标准化的传输协议,可以很容易的实现任意两个关系型数据库之间的同步,所以普适性高,同步效率高、维护成本低。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本申请实施例所必须的。
参照图4,示出了本申请的一种数据同步装置实施例的结构框图,具体可以包括如下模块:
源数据获取模块410,用于从源数据库获取源数据;
转换模块420,用于将所述源数据转换为与目标数据库的数据元格式匹配的同步数据;
同步判断模块430,用于逐个将所述同步数据向目标数据库进行同步,并判断是否出现脏数据;
继续模块440,用于如果出现脏数据,则继续对脏数据之后的同步数据进行同步。
在本申请另外一种优选的实施例中,在继续模块440之前还包括:
脏数据统计模块,用于如果出现脏数据,则统计脏数据的总数量;
脏数据量判断模块,用于判断脏数据的总数量是否达到阈值;如果脏数据的总数量未达到阈值,则进入继续模块440;
同步控制模块,用于如果脏数据的总数量达到阈值,则按照预置的处理规则对同步过程进行控制。
在本申请另外一种优选的实施例中,所述同步判断模块430包括:
批量数据同步子模块,用于当以批量传输的形式将所述同步数据向目标数据库进行同步时,判断是否开始遇到脏数据;如果开始遇到脏数据,则进入回滚通知子模块;
回滚通知子模块,用于通知所述目标数据库将所述同步数据中的已同步的数据进行回滚;
单条数据同步子模块,用于在确定目标数据库回滚完成之后,以单条传输的形式将所述同步数据向目标数据库进行同步,并判断当次传输的是否为脏数据。
如果当初传输为脏数据,则进入脏数据记录模块。
进一步的,在本申请另外一种优选的实施例中,在继续模块440之前,还包括:
脏数据记录模块,用于如果出现脏数据,对所述脏数据进行记录。
在本申请另外一种优选的实施例中,所述源数据获取模块410之前,还包括:
任务分解模块,用于将同步作业任务分解为至少两个子任务。
进一步的,在本申请另外一种优选的实施例中,所述源数据获取模块410包括:
源数据获取子模块,用于每个子任务分别从数据库获取由自己处理的源数据。
进一步的,在本申请另外一种优选的实施例中,所述脏数据统计模块包括:
脏数据统计子模块,用于根据各个子任务发现的脏数据,计算脏数据的总数量。
进一步的,在本申请另外一种优选的实施例中,所述脏数据统计子模块包括:
轮询收集子模块,用于定期轮询以收集各个子任务记录的脏数据;
汇总子模块,用于对收集到的脏数据进行汇总,并计算脏数据的总数量。
在本申请另外一种优选的实施例中,在汇总子模块之后,还包括:
展示模块,用于针对汇总后的脏数据生成脏数据列表进行展示。
在本申请另外一种优选的实施例中,在继续模块之前,还包括:
预检测模块,用于将所述同步数据进行预检测,过滤掉所述同步数据中 的脏数据。
在本申请另外一种优选的实施例中,所述源数据库为任意一种关系型数据库,所述目标数据库为任意一种关系型数据库。
本申请实施例中,因此本申请实施例可以预先设置一个容错机制,该容错机制可以避免脏数据对同步过程的影响,不用在同步过程中碰到脏数据就退出程序,使同步可以继续执行,从而可以降低对机器的资源的浪费,降低同步时间。
另外,本申请实施例可以对所有出现的脏数据进行记录,提高了脏数据的识别能力。
再者,本申请实施例可以采用dataX框架实现同步过程,而dataX框架可以很容易的实现任意两个关系型数据库之间的同步,所以普适性高,同步效率高、维护成本低。
参照图5,示出了本申请的一种数据同步装置实施例的结构框图,具体可以包括如下模块:
源数据获取模块510,用于从源数据库获取源数据;
转换模块520,用于将所述源数据转换为与目标数据库的数据元格式匹配的同步数据;
同步判断模块530,用于逐个将所述同步数据向目标数据库进行同步,并判断是否出现脏数据;
脏数据统计模块540,用于如果出现脏数据,则统计脏数据的总数量;
脏数据量判断模块550,用于判断脏数据的总数量是否达到阈值;如果脏数据的总数量未达到阈值,则进入继续模块570;如果脏数据的总数量达到阈值,则进入同步控制模块560。
同步控制模块560,用于按照预置的处理规则对同步过程进行控制。
继续模块570,用于继续对脏数据之后的同步数据进行同步。
本申请实施例,本申请实施例可以设置另一个容错机制,其预先设置一个对后续处理影响较低的脏数据阈值,比如同步数据量为1000万,则该阈值可以设置为1000条,对于将对源数据库中的源数据同步到目标数据库中 时,如果在同步过程中遇到脏数据,则可以统计脏数据的总数量,将搞脏数据与预先制定的阈值进行比较,如果脏数据的总数量未达到该阈值,则可以继续同步,而不用退出同步程序,使同步可以继续执行,从而可以降低对机器的资源的浪费,降低同步时间,并且可以及时对脏数据数量过多的情况进行限制,可以使技术人员重新配置转换规则。
参照图6,示出了本申请的一种数据同步装置实施例的结构框图,具体可以包括如下模块:
任务分解模块610,用于将同步作业任务分解为至少两个子任务。
源数据获取模块612,具体包括:
源数据获取子模块6121,用于每个子任务分别从数据库获取由自己处理的源数据。
转换模块614,用于将所述源数据转换为与目标数据库的数据元格式匹配的同步数据;
同步判断模块616,具体包括:
批量数据同步子模块6161,用于当以批量传输的形式将所述同步数据向目标数据库进行同步时,判断是否开始遇到脏数据;如果开始遇到脏数据,则进入回滚通知子模块;
回滚通知子模块6162,用于通知所述目标数据库将所述同步数据中的已同步的数据进行回滚;
单条数据同步子模块6163,用于在确定目标数据库回滚完成之后,以单条传输的形式将所述同步数据向目标数据库进行同步,并判断当次传输的是否为脏数据。如果出现脏数据,进入脏数据记录模块618。如果未出现脏数据,则对下一条同步数据进行同步。
脏数据记录模块618,用于对所述脏数据进行记录;进入单条数据同步子模块6163以及轮询收集子模块6201。如果未出现脏数据,则单条数据同步子模块6163继续对下一条同步数据进行同步。
脏数据统计模块620,具体包括:
轮询收集子模块6201,用于定期轮询以收集各个子任务记录的脏数 据;
汇总子模块6202,用于对收集到的脏数据进行汇总,并计算脏数据的总数量。
脏数据量判断模块622,用于判断脏数据的总数量是否达到阈值;如果脏数据的总数量未达到阈值,则允许各子任务继续对脏数据之后的同步数据进行同步,进入单条数据同步子模块6163;如果脏数据的总数量达到阈值,则进入同步控制模块624;
同步控制模块624,用于按照预置的处理规则对同步过程进行控制。
展示模块626,用于针对汇总后的脏数据生成脏数据列表进行展示。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本申请实施例首先设置了一个脏数据容错机制,即其预先设置一个对后续处理影响较低的脏数据阈值,比如同步数据量为1000万,则该阈值可以设置为1000条,对于将对源数据库中的源数据同步到目标数据库中时,如果在同步过程中遇到脏数据,则可以统计脏数据的总数量,将搞脏数据与预先制定的阈值进行比较,如果脏数据的总数量未达到该阈值,则可以继续同步,而不用退出同步程序,使同步可以继续执行,从而可以降低对机器的资源的浪费,降低同步时间。
再者,基于该容错机制,本申请实施例可以对同步过程中出现的各种脏数据进行记录,提高了脏数据的识别能力。而不像在先技术只能识别出本次批量提交过程中的一条脏数据
最后,本申请实施例可以采用DataX框架,而dataX框架具备一套标准化的传输协议,可以很容易的实现任意两个关系型数据库之间的同步,所以普适性高,同步效率高、维护成本低。
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见 即可。
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
在一个典型的配置中,所述计算机设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非持续性的电脑可读媒体(transitory media),如调制的数据信号和载波。
本申请实施例是参照根据本申请实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或 多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。
以上对本申请所提供的一种数据同步方法和一种数据同步装置,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (22)

  1. 一种数据同步方法,其特征在于,包括:
    从源数据库获取源数据;
    将所述源数据转换为与目标数据库的数据元格式匹配的同步数据;
    逐个将所述同步数据向目标数据库进行同步,并判断是否出现脏数据;
    如果出现脏数据,则继续对脏数据之后的同步数据进行同步。
  2. 根据权利要求1所述的方法,其特征在于,在继续对脏数据之后的同步数据进行同步之前,还包括:
    统计脏数据的总数量;
    判断脏数据的总数量是否达到阈值;
    如果脏数据的总数量未达到阈值,则继续对脏数据之后的同步数据进行同步;
    如果脏数据的总数量达到阈值,则按照预置的处理规则对同步过程进行控制。
  3. 根据权利要求1所述的方法,其特征在于,所述将所述同步数据向目标数据库进行同步,并判断是否出现脏数据包括:
    当以批量传输的形式将所述同步数据向目标数据库进行同步时,判断是否开始遇到脏数据;
    如果开始遇到脏数据,则通知所述目标数据库将所述同步数据中的已同步的数据进行回滚;
    在确定目标数据库回滚完成之后,以单条传输的形式将所述同步数据向目标数据库进行同步,并判断当次传输的是否为脏数据。
  4. 根据权利要求3的所述的方法,其特征在于,在继续对脏数据之后的同步数据进行同步之前,还包括:
    对所述脏数据进行记录。
  5. 根据权利要求2所述的方法,其特征在于,所述从源数据库获取源数据的步骤之前,还包括:
    将同步作业任务分解为至少两个子任务。
  6. 根据权利要求5所述的方法,其特征在于,所述从源数据库获取源数据的步骤包括:
    每个子任务分别从数据库获取由自己处理的源数据。
  7. 根据权利要求5所述的方法,其特征在于,所述统计脏数据的总数量的步骤包括:
    根据各个子任务发现的脏数据,计算脏数据的总数量。
  8. 根据权利要求7所述的方法,其特征在于,所述根据各个子任务发现的脏数据,计算脏数据的总数量的步骤包括:
    定期轮询以收集各个子任务记录的脏数据;
    对收集到的脏数据进行汇总,并计算脏数据的总数量。
  9. 根据权利要求8所述的方法,其特征在于,在对收集到的脏数据进行汇总的步骤之后,还包括:
    针对汇总后的脏数据生成脏数据列表进行展示。
  10. 根据权利要求1所述的方法,其特征在于,在逐个将所述同步数据向目标数据库进行同步,并判断是否出现脏数据的步骤之前,还包括:
    将所述同步数据进行预检测,过滤掉所述同步数据中的脏数据。
  11. 根据权利要求1所述的方法,其特征在于,所述源数据库为任意一种关系型数据库,所述目标数据库为任意一种关系型数据库。
  12. 一种数据同步装置,其特征在于,包括:
    源数据获取模块,用于从源数据库获取源数据;
    转换模块,用于将所述源数据转换为与目标数据库的数据元格式匹配的同步数据;
    同步判断模块,用于逐个将所述同步数据向目标数据库进行同步,并判断是否出现脏数据;
    继续模块,用于如果出现脏数据,则继续对脏数据之后的同步数据进行同步。
  13. 根据权利要求12所述的装置,其特征在于,在继续模块之前,还包括:
    脏数据统计模块,用于如果出现脏数据,则统计脏数据的总数量;
    脏数据量判断模块,用于判断脏数据的总数量是否达到阈值;如果脏数据的总数量未达到阈值,则进入继续模块;
    同步控制模块,用于如果脏数据的总数量达到阈值,则按照预置的处理规则对同步过程进行控制。
  14. 根据权利要求12所述的装置,其特征在于,所述同步判断模块包括:
    批量数据同步子模块,用于当以批量传输的形式将所述同步数据向目标数据库进行同步时,判断是否开始遇到脏数据;如果开始遇到脏数据,则进入回滚通知子模块;
    回滚通知子模块,用于通知所述目标数据库将所述同步数据中的已同步的数据进行回滚;
    单条数据同步子模块,用于在确定目标数据库回滚完成之后,以单条传输的形式将所述同步数据向目标数据库进行同步,并判断当次传输的是否为脏数据。
  15. 根据权利要求12-14其中之一所述的装置,其特征在于,在继续模块之前,还包括:
    脏数据记录模块,用于如果出现脏数据,对所述脏数据进行记录。
  16. 根据权利要求13所述的装置,其特征在于,所述源数据获取模块之前,还包括:
    任务分解模块,用于将同步作业任务分解为至少两个子任务。
  17. 根据权利要求16所述的装置,其特征在于,所述源数据获取模块包括:
    源数据获取子模块,用于每个子任务分别从数据库获取由自己处理的源数据。
  18. 根据权利要求16所述的装置,其特征在于,所述脏数据统计模块包括:
    脏数据统计子模块,用于根据各个子任务发现的脏数据,计算脏数据的 总数量。
  19. 根据权利要求17所述的装置,其特征在于,所述脏数据统计子模块包括:
    轮询收集子模块,用于定期轮询以收集各个子任务记录的脏数据;
    汇总子模块,用于对收集到的脏数据进行汇总,并计算脏数据的总数量。
  20. 根据权利要求19所述的装置,其特征在于,在汇总子模块之后,还包括:
    展示模块,用于针对汇总后的脏数据生成脏数据列表进行展示。
  21. 根据权利要求12所述的装置,其特征在于,在继续模块之前,还包括:
    预检测模块,用于将所述同步数据进行预检测,过滤掉所述同步数据中的脏数据。
  22. 根据权利要求12所述的装置,其特征在于,所述源数据库为任意一种关系型数据库,所述目标数据库为任意一种关系型数据库。
PCT/CN2016/099054 2015-09-25 2016-09-14 一种数据同步方法和装置 WO2017050176A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/933,793 US20180210937A1 (en) 2015-09-25 2018-03-23 Data synchronization method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510625059.4A CN106557497A (zh) 2015-09-25 2015-09-25 一种数据同步方法和装置
CN201510625059.4 2015-09-25

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/933,793 Continuation US20180210937A1 (en) 2015-09-25 2018-03-23 Data synchronization method and apparatus

Publications (1)

Publication Number Publication Date
WO2017050176A1 true WO2017050176A1 (zh) 2017-03-30

Family

ID=58385695

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/099054 WO2017050176A1 (zh) 2015-09-25 2016-09-14 一种数据同步方法和装置

Country Status (3)

Country Link
US (1) US20180210937A1 (zh)
CN (1) CN106557497A (zh)
WO (1) WO2017050176A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110765166A (zh) * 2019-10-23 2020-02-07 山东浪潮通软信息科技有限公司 一种管理数据的方法、设备及介质
CN112199443A (zh) * 2020-09-30 2021-01-08 苏州达家迎信息技术有限公司 数据同步方法、装置、计算机设备和存储介质
CN113434598A (zh) * 2021-06-28 2021-09-24 青岛海尔科技有限公司 实现数据双写的方法、装置与电子装置
CN114760319A (zh) * 2020-12-28 2022-07-15 武汉联影智融医疗科技有限公司 Hbc数据同步方法、计算机设备和存储介质
CN116401319A (zh) * 2023-06-09 2023-07-07 建信金融科技有限责任公司 数据同步方法及装置、电子设备和计算机可读存储介质

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109241175B (zh) * 2018-06-28 2021-06-04 东软集团股份有限公司 数据同步方法、装置、存储介质及电子设备
CN109165200B (zh) * 2018-08-10 2022-04-01 北京奇虎科技有限公司 数据同步方法、装置、计算设备及计算机存储介质
CN110704458B (zh) * 2019-08-15 2023-04-18 平安科技(深圳)有限公司 数据同步方法、装置、计算机设备及存储介质
CN112749227A (zh) * 2019-10-30 2021-05-04 北京国双科技有限公司 数据同步方法及装置
CN111177456B (zh) * 2019-11-27 2022-12-23 视联动力信息技术股份有限公司 一种并行同步数据的方法、装置、设备及存储介质
CN111177128B (zh) * 2019-12-11 2023-10-27 国网天津市电力公司电力科学研究院 基于改进的离群点检测算法的计量大数据批量处理方法及系统
CN111061798B (zh) * 2019-12-23 2024-03-08 杭州雷数科技有限公司 可配置化数据传输及监控方法、设备及介质
CN111241044B (zh) * 2020-01-08 2023-09-19 中国联合网络通信集团有限公司 搭建异构数据库的方法、装置、设备及可读存储介质
CN113722392A (zh) * 2020-05-26 2021-11-30 北京达佳互联信息技术有限公司 数据同步方法和装置、数据同步系统、服务器、存储介质
CN112633206A (zh) * 2020-12-28 2021-04-09 上海眼控科技股份有限公司 脏数据处理方法、装置、设备及存储介质
CN113641652A (zh) * 2021-08-09 2021-11-12 挂号网(杭州)科技有限公司 一种数据同步方法、装置、系统和服务器
CN113590719B (zh) * 2021-09-27 2022-03-22 北京奇虎科技有限公司 数据同步方法、装置、设备及存储介质
CN116567007B (zh) * 2023-07-10 2023-10-13 长江信达软件技术(武汉)有限责任公司 一种基于任务切分的微服务水利数据共享交换方法
CN117076574B (zh) * 2023-10-16 2024-01-23 北京持安科技有限公司 一种可编排多数据源数据同步聚合方法及装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102346775A (zh) * 2011-09-26 2012-02-08 苏州博远容天信息科技有限公司 一种基于日志的异构多源数据库同步方法
CN102360357A (zh) * 2011-09-29 2012-02-22 南京国电南自轨道交通工程有限公司 Scada系统网状关系数据库节点的数据同步组件
CN102915377A (zh) * 2012-11-14 2013-02-06 深圳市宏电技术股份有限公司 数据库转换或同步方法及系统
CN103825930A (zh) * 2013-11-12 2014-05-28 浙江省水文局 一种分布式环境下的实时数据同步方法
CN104113571A (zh) * 2013-04-18 2014-10-22 北京恒华伟业科技股份有限公司 数据冲突处理方法和装置
CN104679841A (zh) * 2015-02-11 2015-06-03 北京京东尚科信息技术有限公司 一种消费端数据流复制方法及系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8332433B2 (en) * 2010-10-18 2012-12-11 Verisign, Inc. Database synchronization and validation
US9600504B2 (en) * 2014-09-08 2017-03-21 International Business Machines Corporation Data quality analysis and cleansing of source data with respect to a target system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102346775A (zh) * 2011-09-26 2012-02-08 苏州博远容天信息科技有限公司 一种基于日志的异构多源数据库同步方法
CN102360357A (zh) * 2011-09-29 2012-02-22 南京国电南自轨道交通工程有限公司 Scada系统网状关系数据库节点的数据同步组件
CN102915377A (zh) * 2012-11-14 2013-02-06 深圳市宏电技术股份有限公司 数据库转换或同步方法及系统
CN104113571A (zh) * 2013-04-18 2014-10-22 北京恒华伟业科技股份有限公司 数据冲突处理方法和装置
CN103825930A (zh) * 2013-11-12 2014-05-28 浙江省水文局 一种分布式环境下的实时数据同步方法
CN104679841A (zh) * 2015-02-11 2015-06-03 北京京东尚科信息技术有限公司 一种消费端数据流复制方法及系统

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110765166A (zh) * 2019-10-23 2020-02-07 山东浪潮通软信息科技有限公司 一种管理数据的方法、设备及介质
CN112199443A (zh) * 2020-09-30 2021-01-08 苏州达家迎信息技术有限公司 数据同步方法、装置、计算机设备和存储介质
CN112199443B (zh) * 2020-09-30 2022-11-04 苏州达家迎信息技术有限公司 数据同步方法、装置、计算机设备和存储介质
CN114760319A (zh) * 2020-12-28 2022-07-15 武汉联影智融医疗科技有限公司 Hbc数据同步方法、计算机设备和存储介质
CN114760319B (zh) * 2020-12-28 2023-05-30 武汉联影智融医疗科技有限公司 Hbc数据同步方法、计算机设备和存储介质
CN113434598A (zh) * 2021-06-28 2021-09-24 青岛海尔科技有限公司 实现数据双写的方法、装置与电子装置
CN113434598B (zh) * 2021-06-28 2024-03-22 青岛海尔科技有限公司 实现数据双写的方法、装置与电子装置
CN116401319A (zh) * 2023-06-09 2023-07-07 建信金融科技有限责任公司 数据同步方法及装置、电子设备和计算机可读存储介质
CN116401319B (zh) * 2023-06-09 2023-09-12 建信金融科技有限责任公司 数据同步方法及装置、电子设备和计算机可读存储介质

Also Published As

Publication number Publication date
CN106557497A (zh) 2017-04-05
US20180210937A1 (en) 2018-07-26

Similar Documents

Publication Publication Date Title
WO2017050176A1 (zh) 一种数据同步方法和装置
CN106202235B (zh) 一种数据处理方法及装置
WO2017148293A1 (zh) 一种基于云平台的客户端应用的信息统计方法和装置
WO2017016421A1 (zh) 一种集群中的任务执行方法及装置
WO2019019400A1 (zh) 任务分布式处理方法、装置、存储介质和服务器
CN106325984B (zh) 一种大数据任务调度装置
US8626765B2 (en) Processing database operation requests
CN109144783B (zh) 一种分布式海量非结构化数据备份方法及系统
US11954133B2 (en) Method and apparatus for managing and controlling resource, device and storage medium
WO2017028690A1 (zh) 一种基于etl的文件处理方法及系统
CN111400288A (zh) 数据质量检查方法及系统
WO2020216077A1 (zh) 一种区块链事件去重方法、装置、计算机设备及存储介质
WO2019057193A1 (zh) 数据删除方法及分布式存储系统
WO2017005115A1 (zh) 分布式dag系统的自适应优化方法和装置
CN111857981A (zh) 一种数据处理方法以及装置
WO2024088078A1 (zh) 一种带宽调节方法、系统、设备及存储介质
WO2016197853A1 (zh) 一种基于复杂度的业务处理方法和装置
CN109962936B (zh) 异构数据同步方法及系统
CN115858499A (zh) 一种数据库分区处理方法、装置、计算机设备和存储介质
Feng et al. A memory capacity model for high performing data-filtering applications in samza framework
CN115221116A (zh) 一种数据写入方法、装置、设备及可读存储介质
CN115220887A (zh) 调度信息的处理方法、任务处理系统、处理器和电子设备
KR101725192B1 (ko) 자원 템플릿 관리를 통한 자원 정보 관리 및 데이터 저장 시스템
CN109902067B (zh) 文件处理方法、装置、存储介质及计算机设备
EP4066117B1 (en) Managing provenance information for data processing pipelines

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16848058

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: 16848058

Country of ref document: EP

Kind code of ref document: A1