WO2021120880A1 - 数据复制处理方法、装置、容灾系统、设备及存储介质 - Google Patents

数据复制处理方法、装置、容灾系统、设备及存储介质 Download PDF

Info

Publication number
WO2021120880A1
WO2021120880A1 PCT/CN2020/124941 CN2020124941W WO2021120880A1 WO 2021120880 A1 WO2021120880 A1 WO 2021120880A1 CN 2020124941 W CN2020124941 W CN 2020124941W WO 2021120880 A1 WO2021120880 A1 WO 2021120880A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
log
time stamp
error message
replication
Prior art date
Application number
PCT/CN2020/124941
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 WO2021120880A1 publication Critical patent/WO2021120880A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1471Saving, restoring, recovering or retrying involving logging of persistent data for recovery

Definitions

  • This application belongs to the field of data processing, and in particular relates to a data replication processing method, device, disaster recovery system, equipment, and storage medium.
  • business system disaster recovery backup technology and active-active deployment technology can be used to store the same data in multiple devices.
  • Data replication is one of the important foundations in business system disaster recovery and backup technology and active-active deployment technology.
  • data in multiple devices may have replication conflicts.
  • an alarm can be issued and data replication can be interrupted.
  • interrupting data replication will reduce the efficiency and availability of disaster recovery backup or active-active deployment.
  • a method of forcibly overwriting data can be adopted, that is, using the data of one device to forcibly overwrite the data of the other device.
  • the embodiments of the present application provide a data replication processing method, device, disaster recovery system, equipment, and storage medium, which can ensure the correctness of the business.
  • an embodiment of the present application provides a data copy processing method for a first device, and data copy between the first device and the second device.
  • the method includes: receiving and responding to a data copy instruction transmitted by the second device , Perform the same data operation as the second device; if an error message corresponding to the data operation is detected, perform a consistent operation on the target data according to the error message, so that the target data in the first device after the consistent operation is executed with the second device.
  • the target data after the data operation is consistent, and the target data includes the data indicated by the data operation; according to the consistency operation, the data operation log is recorded so that the data operation log of the first device is consistent with the data operation log of the second device.
  • an embodiment of the present application provides a data copy processing device, including: a first execution module, configured to receive and respond to a data copy instruction transmitted by a second device, and execute the same data operation as the second device; second The execution module, if an error message corresponding to the data operation is detected, performs a consistency operation on the target data according to the error message, so that the target data in the first device after the consistency operation is consistent with the target data after the second device performs the data operation, The target data includes the data indicated by the data operation; the log recording module is used to record the data operation log according to the consistency operation, so that the data operation log of the first device is consistent with the data operation log of the second device.
  • an embodiment of the present application provides a disaster tolerance system, including at least two data devices, and the data devices are used to execute the data replication processing method of the first aspect.
  • an embodiment of the present application provides a data device including a processor, a memory, and a computer program stored in the memory and running on the processor.
  • the computer program is executed by the processor to realize the data copy processing of the first aspect. method.
  • an embodiment of the present application provides a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to implement the data copy processing method of the first aspect.
  • the embodiments of the present application provide a data replication processing method, device, disaster recovery system, device, and storage medium.
  • the first device can execute the same data replication instruction as the second device upon receiving the data replication instruction transmitted from the second device. Data manipulation.
  • the first device may have a replication conflict during the process of performing the data operation. If an error message indicating a replication conflict error is detected, it can perform a consistent operation on the target data according to the error message to ensure that the first device after the consistent operation
  • the target data of is consistent with the target data after performing the data operation in the second device, so as to ensure that all the data in the first device and the second device are consistent.
  • the data operation log is recorded, so that the data operation log of the first device is consistent with the data operation log of the second device.
  • the service is switched between the first device and the second device, since the data and data operation log of the first device are consistent with the data and data operation log of the second device, the service is between the first device and the second device. In the case of switching between the two devices, the correctness of the service can be guaranteed.
  • FIG. 1 is a schematic structural diagram of an example of a disaster recovery system including two data devices provided by this application;
  • FIG. 2 is a flowchart of an embodiment of the data copy processing method provided by this application.
  • FIG. 3 is a schematic structural diagram of an embodiment of a disaster tolerance system provided by this application.
  • FIG. 4 is a schematic structural diagram of an embodiment of a disaster tolerance system provided by this application.
  • FIG. 5 is a schematic structural diagram of an embodiment of a data replication processing device provided by this application.
  • FIG. 6 is a schematic structural diagram of an embodiment of a data device provided by this application.
  • the embodiments of the present application provide a data replication processing method, device, disaster recovery system, equipment, and storage medium, which can be applied to scenarios of disaster recovery backup or active-active deployment.
  • the disaster recovery backup system or the active-active deployment system may include at least two data devices, and data can be replicated between the at least two data devices.
  • the data device may be installed with a database, and the data are all stored in the database, which is not limited here.
  • FIG. 1 is a schematic structural diagram of an example of a disaster recovery system including two data devices provided by this application. As shown in Figure 1, the disaster recovery system includes two data devices, namely data device A and data device B.
  • Data device A can be used as the master (Master) device, and data device B can be used as the slave (Slave) device.
  • the data device A may receive the input data operation, and the data operation may be the data operation input by the user.
  • the data device B can receive the data copy instruction transmitted by the data device A, and the data copy instruction is used to instruct the data device B and the data device A to maintain data synchronization.
  • At least part of the data devices in the disaster-tolerant backup system or active-active deployment system can execute the data replication processing method in the embodiment of this application, so that the data devices in the disaster-tolerant backup system or active-active deployment system are In the event of a conflict in the data replication process, the conflict can be resolved to ensure that the data in each data device is consistent.
  • the embodiment of the present application provides a data replication processing method.
  • the data replication processing method is applied to a first device, such as a data device in a disaster recovery system. Wherein, data replication is performed between the first device and the second device.
  • the second device may be the master device, and the first device may be the slave device.
  • the first device and the second device can also copy data to each other regardless of the primary and secondary devices.
  • the first device and the second device are not limited here.
  • FIG. 2 is a flowchart of an embodiment of the data copy processing method provided by this application.
  • the data copy processing method can be used in the first device. As shown in FIG. 2, the data copy processing method may include step S101 to step S103.
  • step S101 receiving and responding to the data copy instruction transmitted from the second device, and performing the same data operation as the second device.
  • the second device When the data in the second device is operated, that is, when the second device performs a data operation, the second device transmits a data copy instruction to the first device to prompt the first device to perform the same data operation as the second device to ensure that the first device performs the same data operation as the second device.
  • the data in one device is consistent with the data in the second device.
  • the first device performs the same data operations as the second device.
  • the data operation may be performed normally, or a data replication conflict may occur during the data operation. If a data replication conflict occurs, the first device will generate an error message.
  • the error message can be the return value of the database replication error, such as HA_ERR_FOUND_DUPP_KEY, HA_ERR_KEY_NOT_FOUND, HA_ERR_END_OF_FILE, etc., which are not limited here.
  • the foregoing data operations may include data insertion operations, data update operations, etc., which are not limited herein.
  • step S102 if an error message corresponding to the data operation is detected, a consistency operation is performed on the target data according to the error message, so that the target data in the first device after the consistency operation and the target data after the second device performs the data operation Unanimous.
  • the target data may include data indicated by the data operation.
  • the data indicated by the data operation may include data that already exists in the first device, and may also include data that requires a new operation for the data operation.
  • the data indicated by the data operation may include the data that the data insertion operation requires to be inserted.
  • the data indicated by the data operation includes the data that already exists in the first device and the data required to be inserted by the data insertion operation. The same data and data insertion operation requires the inserted data.
  • the data indicated by the data operation may include the data that the data update operation requires to be updated and the data that the data update operation requires to be updated.
  • Error messages can be used to characterize replication conflict errors.
  • different error messages may correspond to different consistent operations.
  • a consistency operation corresponding to the replication conflict error can be performed according to the replication conflict error represented by the error message.
  • the purpose of the consistency operation is that the target data in the first device after the consistency operation is consistent with the target data in the second device after the data operation is performed, so as to ensure that the data in the first device is consistent with the data in the second device.
  • step S103 the data operation log is recorded according to the consistency operation, so that the data operation log of the first device is consistent with the data operation log of the second device.
  • the consistency operation may include one operation, or two or more operations, which is not limited here.
  • determine the operation recorded in the data operation log According to the specific operation of the consistency operation, determine the operation recorded in the data operation log.
  • the specific operations of the consistency operation can be recorded in the data operation log, and parts of the specific operations in the consistency operation can be recorded in the data operation log to ensure the data operation log of the first device and the data operation log of the second device Unanimous.
  • the data operation log of the first device is consistent with the data operation log of the second device, which may mean that the operation recorded in the data operation log of the first device is consistent with the effect of the operation recorded in the data operation log of the second device.
  • the essential actions of the operations recorded in the data operation log of the first device are the same as the essential actions of the operations recorded in the data operation log of the second device, such as insert operations and write operations.
  • the data after the execution of the operation recorded in the data operation log of the first device is the same as the data after the execution of the operation recorded in the data operation log of the second device.
  • the data operation log may be binlog, etc., which is not limited herein.
  • the data operation log of the first device may be consistent with the data operation log of the second device.
  • the first device can perform the same data operation as the second device when receiving the data copy instruction transmitted from the second device.
  • the first device may have a replication conflict during the process of performing the data operation. If an error message indicating a replication conflict error is detected, it can perform a consistent operation on the target data according to the error message to ensure that the first device after the consistent operation
  • the target data is consistent with the target data after the consistency operation in the second device, thereby ensuring that all data in the first device and the second device are consistent.
  • the data operation log is recorded, so that the data operation log of the first device is consistent with the data operation log of the second device.
  • the service is switched between the first device and the second device, since the data and data operation log of the first device are consistent with the data and data operation log of the second device, the service is between the first device and the second device. In the case of switching between the two devices, the correctness of the service can be guaranteed.
  • data operations may include data insertion operations.
  • the error message may indicate that the first device already has data that is the same as the primary key or index of the data required to be inserted by the data insertion operation.
  • the error message may specifically be HA_ERR_FOUND_DUPP_KEY.
  • the data operation performed by the second device is a data insertion operation, and the first device receives the data copy instruction transmitted from the second device and needs to perform the same data insertion operation as the second device.
  • the first device can perform the first data deletion operation to delete the existing data that has the same primary key or index as the data required to be inserted by the data insertion operation.
  • the first device performs the data insertion operation, and inserts the data that the data insertion operation requires to be inserted, so that the data inserted in the first device is the same as the data inserted in the second device.
  • the instruction corresponding to the data insertion operation is "insert_row(new_record)".
  • new_record is the data required to be inserted in the data insertion operation.
  • the first device detects the error message "HA_ERR_FOUND_DUPP_KEY”, the first device automatically executes the first data deletion operation, and the instruction corresponding to the first data deletion operation is "delete_row(old_record)".
  • old_record is the same data as the primary key or index of new_record that already exists in the first device.
  • the first device performs the data insertion operation again, and the instruction corresponding to the data insertion operation is "insert_row(new_record)".
  • the playback strategy of the first device can be "delete_row(old_record)" and "insert_row(new_record)".
  • the first device In order to ensure that the data operation log of the first device is consistent with the data operation log of the second device, the first device records the aforementioned data insertion operation in the data operation log, and does not record the first data deletion operation in the data operation log.
  • insert_row(new_record) is recorded in the data operation log of the second device.
  • the data operation log of the first device records “insert_row(new_record)", but does not record "delete_row(old_record)”.
  • data operations may include data insertion operations.
  • the error message may indicate that the first device already has data that is the same as the primary key or index of the data required to be inserted by the data insertion operation. See the previous example for the scene.
  • each data in the first device is configured with a time stamp, and the storage location of the time stamp is not limited here.
  • the storage locations of the time stamps corresponding to different data may be the same or different.
  • a timestamp field can be configured in the transfer data table, and the timestamp field can be used to record the timestamp.
  • the first device compares the first time stamp of the data required to be inserted by the data insertion operation with the second time stamp of the data in the first device that is the same as the primary key or index of the data required to be inserted in the data insertion operation. If the first timestamp is later than the second timestamp, perform the second data deletion operation, delete the data in the first device with the same primary key or index of the data that is required to be inserted by the data insertion operation, and then perform the first data write operation, The data to be inserted is required for the write data insertion operation.
  • the data retention operation is performed, and the data in the first device that is the same as the primary key or index of the data required to be inserted by the data insertion operation is retained. That is, the first device selects the data updated by the timestamp as the data stored in the first device. It should be noted that the first time stamp of the inserted data required by the data insertion operation can be written in the data operation log.
  • the instruction corresponding to the data insertion operation is "insert_row(new_record)".
  • new_record is the data required to be inserted in the data insertion operation.
  • the data that is the same as the primary key or index of new_record in the first device is old_record.
  • the first device compares the time stamp T1 of new_record with the time stamp T2 of old_record.
  • T1>T2 that is, the time indicated by the timestamp T1 is later than the time indicated by the timestamp T2
  • the first device performs the second data deletion operation, and the instruction corresponding to the second data deletion operation is "delete_row(old_record)";
  • the device then executes the first data writing operation, and the instruction corresponding to the first data writing operation is "write_row(new_record)".
  • T1 ⁇ T2 that is, the time indicated by the timestamp T1 is earlier than the time indicated by the timestamp T2
  • the first device performs the data retention operation, and the instruction for the data retention operation is "keep_row(old_record)".
  • the playback strategy of the first device may be "delete_row(old_record)" and “write_row(new_record)"; If the first time stamp is earlier than the second time stamp, the playback policy of the first device may be "keep_row(old_record)".
  • the first time stamp is later than the second time stamp, the first data writing operation is recorded in the data operation log, and the second data deletion operation is not recorded in the data operation log. If the first time stamp is earlier than the second time stamp, the data retention operation is not recorded in the data operation log.
  • the insert instruction and the write instruction can be equivalent.
  • the data operation log in the first device does not record "keep_row(old_record)" and can record the first One device performs "insert_row(new_record)" corresponding to the data insertion operation, or the data operation log in the first device does not record "keep_row(old_record)", nor does it record "insert_row(new_record)" corresponding to the data insertion operation.
  • the corresponding data in the first device is new_record
  • the corresponding data in the second device after the operation of the data operation log in the first device is executed is also new_record.
  • the consistency of the data operation log in the first device and the data operation log in the second device can be guaranteed.
  • data operations may include data update operations.
  • the error message may indicate that there is no data required to be updated in the data update operation of the first device.
  • the error message may specifically be HA_ERR_KEY_NOT_FOUND or HA_ERR_END_OF_FILE.
  • the data operation performed by the second device is a data update operation, and the first device receives the data copy instruction transmitted from the second device and needs to perform the same data update operation as the second device.
  • it is determined that the data that the data update operation requires to be updated does not exist in the first device.
  • the first device performs the second data write operation, and writes the data that the data update operation requires to update.
  • the first device performs a data update operation, and updates the data that the written data update operation requires to be updated, specifically, updates the data that the written data update operation requires to be updated to the data after the data update operation requires the update.
  • the instruction corresponding to the data update operation is "update_row(old_record, new_record)".
  • old_record is the data that the data update operation requires to be updated
  • new_record is the data that the data update operation requires to be updated.
  • the first device records the data update operation in the data operation log, and does not record the second data writing operation in the data operation log.
  • update_row(old_record, new_record) is recorded in the data operation log of the second device.
  • the data operation log of the first device records “update_row(old_record, new_record)", and does not record "write_row(old_record)".
  • the data operation may include a data update operation.
  • the error message may indicate that the same data as the primary key or index of the updated data required by the data update operation already exists in the first device.
  • the error message may specifically be HA_ERR_FOUND_DUPP_KEY.
  • the data operation performed by the second device is a data update operation, and the first device receives the data copy instruction transmitted from the second device and needs to perform the same data update operation as the second device.
  • each data in the first device is configured with a time stamp.
  • a timestamp field can be configured in the transfer data table, and the timestamp field can be used to record the timestamp.
  • the first device compares the third timestamp of the updated data required by the data update operation with the fourth timestamp of the data in the first device that has the same primary key or index as the updated data required by the data update operation. If the third timestamp is later than the fourth timestamp, perform the third data delete operation, delete the data in the first device that has the same primary key or index as the updated data required by the data update operation, and then perform the third data write operation , Write data update operation requires updated data. If the third timestamp is earlier than the fourth timestamp, the data retention operation is performed, and the data in the first device that is the same as the primary key or index of the updated data required by the data update operation is reserved.
  • the instruction corresponding to the data update operation is "update_row(old_record1, new_record)".
  • old_record1 is the data that the data update operation requires to be updated
  • new_record is the data that the data update operation requires to be updated.
  • the data old_record2 that is the same as the primary key or index of new_record already exists in the first device.
  • the first device compares the timestamp T3 of the updated data required by the data update operation with the timestamp T4 of the data having the same primary key or index as the updated data required by the data update operation in the first device.
  • the third data deletion operation is executed, and the instruction corresponding to the third data deletion operation is "delete_row(old_record2)"; the first device executes it again For the third data writing operation, the instruction corresponding to the third data writing operation is "write_row(new_record)".
  • the third time stamp is later than the fourth time stamp, the third data write operation and the third data delete operation are not recorded in the data operation log. If the third time stamp is earlier than the fourth time stamp, the data retention operation is not recorded in the data operation log.
  • the data operation log in the second device records "update_row(old_record, new_record)".
  • the data operation log in the first device does not record “delete_row(old_record2)" and “write_row(new_record)", but can record the "update_row(old_record, new_record)" corresponding to the data update operation performed by the first device, or, in the first device
  • the data operation log does not record "delete_row(old_record2)” and “write_row(new_record)", nor does it record the data update operation corresponding to "update_row(old_record, new_record).
  • the operation recorded in the data operation log in the second device is the first after the operation is executed.
  • the corresponding data in the device is new_record
  • the corresponding data in the second device after the operation recorded in the data operation log in the first device is executed is also new_record.
  • data operations can also be other operations, such as data deletion operations.
  • the data operation is a data deletion operation, if there is no data required to be deleted by the data deletion operation in the first device, the first device may ignore the replication conflict, which will not be repeated here.
  • the first device and the second device involved can be any two devices with a one-way data replication relationship among multiple devices in cascade replication, or can be devices in a replication loop. Two devices with a two-way data replication relationship. The following will take a disaster recovery system as an example to illustrate the relationship between multiple data devices.
  • the embodiment of the present application also provides a disaster tolerance system.
  • the disaster tolerance system may include at least two data devices, and the data devices can execute the data replication processing method for the first device in the above-mentioned embodiment.
  • Each data device in the disaster recovery system can be used as the first device and can execute the data replication processing method in the above embodiment, or some data devices in the disaster recovery system can be used as the first device and can execute the data in the above embodiment Copy processing method. This does not limit the data devices in the disaster recovery system.
  • the disaster recovery system is a cascade replication type disaster recovery system.
  • FIG. 3 is a schematic structural diagram of an embodiment of the disaster tolerance system provided by this application. As shown in FIG. 3, the disaster recovery system specifically includes a first data device E1 to an Nth data device EN, where N is an integer greater than 1.
  • the i-1th data device Ei-1 is used to transmit a data copy instruction to the ith data device Ei.
  • the i-th data device Ei is used to execute the data copy processing method for the first device in the foregoing embodiment.
  • i is a positive integer, and 1 ⁇ i ⁇ N.
  • the first data device E1 can receive a data operation input by the user, the first data device E1 can transmit a data copy instruction to the second data device E2; the second data device E2 performs the same data operation as the first data device E1, And the data copy processing method for the first device in the above embodiment can be executed, the second data device E2 transmits the data copy instruction to the third data device E3; the third data device E3 performs the same data operation as the second data device E2 , And can execute the data copy processing method for the first device in the above embodiment; and so on; the Nth data device EN performs the same data operation as the N-1th data device EN-1, and can execute the above embodiment The data copy processing method used in the first device.
  • Using the data replication processing method provided by the embodiments of the present application can ensure the consistency of the data and data operation logs of the data equipment at each level in the cascaded replication disaster recovery system, and will not be caused by the cascading replication of the disaster recovery system.
  • the complex data replication relationship between data devices causes inconsistencies in the data and data operation logs of different data devices in the cascaded replication disaster recovery system.
  • the correctness of the service can also be ensured when the service is switched between all levels of data equipment in the cascaded replication disaster recovery system.
  • the disaster recovery system is a replication loop type disaster recovery system
  • the disaster recovery system may specifically include at least two data devices.
  • one data device is used to receive data operations input by the user, perform data operations, and transmit data copy instructions to the other data device
  • the other data device is used to execute the first device in the above embodiment
  • another data device is used to receive a data operation input by a user, execute the data operation, and transmit a data copy instruction to a data device
  • one data device is used to execute the application in the above-mentioned embodiment Data copy processing method in the first device.
  • FIG. 4 is a schematic structural diagram of another embodiment of the disaster tolerance system provided by this application. As shown in Figure 4, the disaster recovery system includes two data devices, namely data device A1 and data device A2.
  • the data device A1 can receive the data operation input by the user, execute the data operation, and transmit the data copy instruction to the data device A2.
  • the data device A2 can execute the data copy processing method applied to the first device in the above embodiment.
  • the data device A2 can also receive data operations input by the user, perform data operations, and transmit data copy instructions to the data device A1.
  • the data device A1 can execute the data copy processing method applied to the first device in the above embodiment.
  • Using the data replication processing method provided by the embodiments of the present application can ensure the consistency of the data and data operation logs of the data devices in the replication loop disaster recovery system, and will not be caused by the bidirectional replication between the data devices in the loop disaster recovery system.
  • the replication relationship leads to inconsistencies in the data and data operation logs of different data devices in the replication loop disaster recovery system.
  • the correctness of the business can be guaranteed when the business is switched in the case of the data equipment at all levels in the replication loop disaster recovery system.
  • the data required for the data insertion operation is [1, 2019-09-26 15:30:00.0000].
  • the data device A2 receives the data copy instruction transmitted by the data device A1, and executes the data insertion operation. Data already exists in data device A2 [1, 2019-09-26 15:30:01.0000].
  • the primary key of the data [1,2019-09-26 15:30:00.0000] required by data device A1 to be inserted is the same as the primary key of the data [1,2019-09-26 15:30:01.0000] that already exists in data device A2, both 1.
  • the time stamp of the data [1,2019-09-26 15:30:00.0000] required to be inserted by data device A1 is "2019-09-26 15:30:00", and the existing data of data device A2 [1,2019- 09-26 15:30:01.0000]
  • the timestamp is "2019-09-26 15:30:01". Comparing the timestamp, the data device A2 retains the data [1, 2019-09-26 15:30:01.0000], which is equivalent to inserting the data [1, 2019-09-26 15:30:01.0000] in the data A2.
  • Data device A2 sends a data copy instruction to data device A1, and data device A compares the time stamp and data of data [1,2019-09-26 15:30:01.0000] with data [1,2019-09-26 15:30:00.0000] Timestamp, the data device inserts data [1, 2019-09-26 15:30:01.0000].
  • the data operation input by the user mentioned in the above embodiments may be the data operation of the user directly inputting the data device, or the data operation of the user inputting the data device through an application (Application, APP) or the like.
  • FIG. 5 is a schematic structural diagram of an embodiment of a data replication processing device provided by this application.
  • the data replication processing device 200 may include a first execution module 201, a second execution module 202, and a log recording module 203.
  • the first execution module 201 is configured to receive and respond to the data copy instruction transmitted from the second device, and execute the same data operation as the second device.
  • the second execution module 202 if an error message corresponding to the data operation is detected, performs a consistency operation on the target data according to the error message, so that the target data in the first device after the consistency operation and the target after the second device performs the data operation The data is consistent.
  • the target data includes data indicated by the data operation.
  • the log recording module 203 is configured to record a data operation log according to the consistency operation, so that the data operation log of the first device is consistent with the data operation log of the second device.
  • the first device can perform the same data operation as the second device when receiving the data copy instruction transmitted from the second device.
  • the first device may have a replication conflict during the process of performing the data operation. If an error message indicating a replication conflict error is detected, it can perform a consistent operation on the target data according to the error message to ensure that the first device after the consistent operation
  • the target data of is consistent with the target data after performing the data operation in the second device, so as to ensure that all the data in the first device and the second device are consistent.
  • the data operation log is recorded, so that the data operation log of the first device is consistent with the data operation log of the second device.
  • the service is switched between the first device and the second device, since the data and data operation log of the first device are consistent with the data and data operation log of the second device, the service is between the first device and the second device. In the case of switching between the two devices, the correctness of the service can be guaranteed.
  • data operations may include data insertion operations.
  • the error message may indicate that the first device already has data that is the same as the primary key or index of the data required to be inserted by the data insertion operation.
  • the second execution module 202 may be specifically configured to: execute the first data deletion operation, delete existing data that has the same primary key or index as the data required to be inserted by the data insertion operation; execute the data insertion operation, insert the data required to be inserted by the data insertion operation.
  • the log recording module 203 may be specifically configured to: record the data insertion operation in the data operation log, and not record the first data deletion operation in the data operation log.
  • data operations may include data insertion operations.
  • the error message can indicate that the first device already has the same data as the primary key or index of the data required to be inserted by the data insertion operation.
  • the data is configured with a time stamp.
  • the second execution module 202 may be specifically configured to: compare the first time stamp of the data required to be inserted by the data insertion operation with the second time stamp of the data in the first device that has the same primary key or index as the data required to be inserted in the data insertion operation; if The first time stamp is later than the second time stamp, the second data deletion operation is executed, the data in the first device that has the same primary key or index as the data inserted by the data insertion operation is deleted, the first data writing operation is executed, and the data is written
  • the insert operation requires the inserted data; if the first timestamp is earlier than the second timestamp, the data retention operation is performed, and the data in the first device that is the same as the primary key or index of the data required to be inserted by the data insert operation is reserved.
  • the log recording module 203 may be specifically configured to: if the first time stamp is later than the second time stamp, record the first data write operation in the data operation log, and not record the second data delete operation in the data operation log ; If the first time stamp is earlier than the second time stamp, the data retention operation is not recorded in the data operation log.
  • data operations may include data update operations.
  • the error message may indicate that there is no data required to be updated in the data update operation of the first device.
  • the second execution module 202 may be specifically configured to: perform a second data write operation, write data that is required to be updated by the data update operation; perform a data update operation, and update the data that is required to be updated by the written data update operation.
  • the log recording module 203 may be specifically configured to: record the data update operation into the data operation log, and not record the second data writing operation into the data operation log.
  • the data operation may include a data update operation.
  • the error message may indicate that the same data as the primary key or index of the updated data required by the data update operation already exists in the first device.
  • the data is configured with a time stamp.
  • the second execution module 202 may be specifically configured to compare the third timestamp of the updated data required by the data update operation with the fourth timestamp of the data in the first device that has the same primary key or index as the updated data required by the data update operation. ; If the third timestamp is later than the fourth timestamp, perform the third data delete operation, delete the same data in the first device as the primary key or index of the updated data required by the data update operation, and then perform the third data write Operation, write data update operation requires updated data; if the third timestamp is earlier than the fourth timestamp, the data retention operation is performed, and the primary key or index of the updated data required by the data update operation in the first device is kept the same The data.
  • the log recording module 203 can be specifically configured to: if the third time stamp is later than the fourth time stamp, not record the third data write operation and the third data delete operation in the data operation log; if the third time stamp is Earlier than the fourth timestamp, the data retention operation is not recorded in the data operation log.
  • FIG. 6 is a schematic structural diagram of an embodiment of a data device provided by this application.
  • the data device 300 includes a memory 301, a processor 302, and a computer program stored on the memory 301 and running on the processor 302.
  • the foregoing processor 302 may include a central processing unit (Central Processing Unit, CPU), or a specific integrated circuit (Application Specific Integrated Circuit, ASIC), or may be configured to implement one or more of the embodiments of the present application integrated circuit.
  • CPU Central Processing Unit
  • ASIC Application Specific Integrated Circuit
  • the memory 301 may include a large-capacity memory for data or instructions.
  • the memory 301 may include a hard disk drive (Hard Disk Drive, HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a Universal Serial Bus (USB) drive, or two or more Multiple combinations of these.
  • the storage 301 may include removable or non-removable (or fixed) media.
  • the memory 301 may be inside or outside the integrated gateway disaster recovery device.
  • the memory 301 is a non-volatile solid state memory.
  • the memory 301 includes a read-only memory (Read-Only Memory, ROM).
  • the ROM can be mask-programmed ROM, programmable ROM (Programmable Read-Only Memory, PROM), erasable PROM (Erasable Programmable Read-Only Memory, EPROM), and electrically erasable PROM ( Electrically Erasable Programmable Read-Only Memory, EEPROM), Electrically Alterable Read-Only Memory (EAROM), or flash memory, or a combination of two or more of these.
  • PROM Programmable ROM
  • EPROM Erasable Programmable Read-Only Memory
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • EAROM Electrically Alterable Read-Only Memory
  • flash memory or a combination of two or more of these.
  • the processor 302 runs the computer program corresponding to the executable program code by reading the executable program code stored in the memory 301, so as to implement any embodiment of the foregoing data copy processing method.
  • the data device 300 may further include a communication interface 303 and a bus 304.
  • a communication interface 303 and a bus 304.
  • the memory 301, the processor 302, and the communication interface 303 are connected through the bus 304 and complete mutual communication.
  • the communication interface 303 is mainly used to implement communication between various modules, devices, units and/or devices in the embodiments of the present application.
  • the input device and/or output device can also be accessed through the communication interface 303.
  • the bus 304 includes hardware, software, or both, and couples the components of the device to each other.
  • the bus may include Accelerated Graphics Port (AGP) or other graphics buses, Enhanced Industry Standard Architecture (EISA) bus, Front Side Bus (FSB), Ultra HyperTransport (HT) interconnection, Industrial Standard Architecture (ISA) bus, unlimited bandwidth interconnection, Low pin count (LPC) bus, memory bus, Micro Channel Architecture (Micro Channel Architecture) , MCA) bus, Peripheral Component Interconnect (PCI) bus, PCI-Express (PCI-X) bus, Serial Advanced Technology Attachment (SATA) bus, Video Electronics Standard Association (Video) Electronics Standards Association Local Bus (VLB) bus or other suitable bus or a combination of two or more of these.
  • the bus 304 may include one or more buses.
  • An embodiment of the present application also provides a computer-readable storage medium having a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, any embodiment of the data copy processing method described above can be implemented.
  • An example of the computer-readable storage medium may be a non-transitory computer-readable storage medium, including ROM, random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
  • Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic array. It can also be understood that each block in the block diagram and/or flowchart and the combination of the blocks in the block diagram and/or flowchart can also be implemented by dedicated hardware that performs specified functions or actions, or can be implemented by dedicated hardware and A combination of computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请提供了一种数据复制处理方法、装置、容灾系统、设备及存储介质,涉及数据处理领域。该数据复制处理方法,包括:接收并响应第二设备传输来的数据复制指令,执行与第二设备相同的数据操作;若检测到与数据操作对应的报错消息,根据报错消息对目标数据执行一致性操作,使得一致性操作后的第一设备中目标数据与第二设备执行数据操作后的目标数据一致,目标数据包括数据操作指示的数据;根据一致性操作,记录数据操作日志,使得第一设备的数据操作日志与第二设备的数据操作日志一致。根据本申请能够保证业务的正确性。

Description

数据复制处理方法、装置、容灾系统、设备及存储介质
相关申请的交叉引用
本申请要求享有于2019年12月18日提交的名称为“数据复制处理方法、装置、容灾系统、设备及存储介质”的中国专利申请201911305588.0的优先权,该申请的全部内容通过引用并入本文中。
技术领域
本申请属于数据处理领域,尤其涉及一种数据复制处理方法、装置、容灾系统、设备及存储介质。
背景技术
为了防范信息系统数据损失、业务暂停的情况,可采用业务系统容灾备份技术以及双活部署技术在多个设备中存储相同的数据。数据复制是业务系统容灾备份技术以及双活部署技术中的重要基础之一。
在数据复制过程中,多个设备中的数据可能会发生复制冲突。现阶段,若发现复制冲突,则可发出警报并中断数据复制。但中断数据复制会降低容灾备份或双活部署的效率和可用性。为了保证容灾备份或双活部署的效率和可用性,可采用强制覆盖数据的方法,即利用其中一个设备的数据强制覆盖另一设备的数据。但在多个设备关系较为复杂的情况下,如多个设备级联或两个设备双向同步数据的情况下,数据覆盖设备以及数据被覆盖设备的选取不当仍然会造成复制冲突,导致多个设备中的数据出现差异,在业务从一个设备切换至另一个设备的情况下,无法保证业务的正确性。
发明内容
本申请实施例提供了一种数据复制处理方法、装置、容灾系统、设备及存储介质,能够保证业务的正确性。
第一方面,本申请实施例提供一种数据复制处理方法,用于第一设备,第一设备与第二设备之间进行数据复制,方法包括:接收并响应第二设备传输来的数据复制指令,执行与第二设备相同的数据操作;若检测到与数据操作对应的报错消息,根据报错消息对目标数据执行一致性操作,使得一致性操作后的第一设备中目标数据与第二设备执行数据操作后的目标数据一致,目标数据包括数据操作指示的数据;根据一致性操作,记录数据操作日志,使得第一设备的数据操作日志与第二设备的数据操作日志一致。
第二方面,本申请实施例提供一种数据复制处理装置,包括:第一执行模块,用于接收并响应第二设备传输来的数据复制指令,执行与第二设备相同的数据操作;第二执行模块,若检测到与数据操作对应的报错消息,根据报错消息对目标数据执行一致性操作,使得一致性操作后的第一设备中目标数据与第二设备执行数据操作后的目标数据一致,目标数据包括数据操作指示的数据;日志记录模块,用于根据一致性操作,记录数据操作日志,使得第一设备的数据操作日志与第二设备的数据操作日志一致。
第三方面,本申请实施例提供一种容灾系统,包括至少两个数据设备,数据设备用于执行第一方面的数据复制处理方法。
第四方面,本申请实施例提供一种数据设备,包括处理器、存储器及存储在存储器上并可在处理器上运行的计算机程序,计算机程序被处理器执行时实现第一方面的数据复制处理方法。
第五方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质上存储计算机程序,计算机程序被处理器执行时实现第一方面的数据复制处理方法。
本申请实施例提供一种数据复制处理方法、装置、容灾系统、设备及存储介质,第一设备在接收到第二设备传输来的数据复制指令的情况下,可执行与第二设备相同的数据操作。第一设备在执行该数据操作的过程中可能发生复制冲突,若检测到表征复制冲突错误的报错消息,则可根据报错消息对目标数据执行一致性操作,保证一致性操作后的第一设备中的目 标数据与第二设备中执行数据操作后的目标数据一致,从而保证第一设备和第二设备中的所有数据一致。而且,根据一致性操作,记录数据操作日志,使得第一设备的数据操作日志与第二设备的数据操作日志一致。在业务在第一设备和第二设备之间进行切换的情况下,由于第一设备的数据及数据操作日志与第二设备的数据及数据操作日志一致,因此,在业务在第一设备和第二设备之间进行切换的情况下,可以保证业务的正确性。
附图说明
从下面结合附图对本申请的具体实施方式的描述中可以更好地理解本申请其中,相同或相似的附图标记表示相同或相似的特征。
图1为本申请提供的包括两个数据设备的容灾系统的示例的结构示意图;
图2为本申请提供的数据复制处理方法的实施例的流程图;
图3为本申请提供的容灾系统的实施例的结构示意图;
图4为本申请提供的容灾系统的实施例的结构示意图;
图5为本申请提供的数据复制处理装置的实施例的结构示意图;
图6为本申请提供的数据设备的实施例的结构示意图。
具体实施方式
下面将详细描述本申请的各个方面的特征和示例性实施例。在下面的详细描述中,提出了许多具体细节,以便提供对本申请的全面理解。但是,对于本领域技术人员来说很明显的是,本申请可以在不需要这些具体细节中的一些细节的情况下实施。下面对实施例的描述仅仅是为了通过示出本申请的示例来提供对本申请的更好的理解。本申请决不限于下面所提出的任何具体配置和算法,而是在不脱离本申请的构思的前提下覆盖了元素、部件和算法的任何修改、替换和改进。在附图和下面的描述中,没有示出公知的结构和技术,以便避免对本申请造成不必要的模糊。
本申请实施例提供一种数据复制处理方法、装置、容灾系统、设备及存储介质,可应用于容灾备份或双活部署的场景中。在容灾备份系统或双 活部署系统中可包括至少两个数据设备,这至少两个数据设备之间可进行数据复制。具体地,数据设备具体可安装有数据库,数据均存储于数据库中,在此并不限定。比如,图1为本申请提供的包括两个数据设备的容灾系统的示例的结构示意图。如图1所示,该容灾系统包括两个数据设备,分别为数据设备A和数据设备B。
数据设备A可作为主(即Master)设备,数据设备B可作为副(即Slave)设备。数据设备A可接收输入的数据操作,该数据操作可以为用户输入的数据操作。数据设备B可接收数据设备A传输来的数据复制指令,该数据复制指令用于指示数据设备B与数据设备A保持数据同步。
需要说明的是,容灾备份系统或双活部署系统中的至少部分数据设备均可执行本申请实施例中的数据复制处理方法,以使得容灾备份系统或双活部署系统中的数据设备在数据复制过程发生冲突的情况下,可解决该冲突,保证各个数据设备中的数据一致。
本申请实施例提供一种数据复制处理方法。该数据复制处理方法应用于第一设备,例如容灾系统中的数据设备。其中,第一设备与第二设备之间进行数据复制。在一些示例中,第二设备可为主设备,第一设备可为副设备。在另一些示例中,第一设备和第二设备也可不分主、副,彼此对对方均可进行数据复制。在此并不对第一设备与第二设备进行限定。
图2为本申请提供的数据复制处理方法的实施例的流程图。该数据复制处理方法可用于第一设备。如图2所示,该数据复制处理方法可包括步骤S101至步骤S103。
在步骤S101中,接收并响应第二设备传输来的数据复制指令,执行与第二设备相同的数据操作。
在第二设备中的数据被操作,即第二设备进行数据操作的情况下,第二设备向第一设备传输数据复制指令,以提示第一设备进行与第二设备相同的数据操作,保证第一设备中的数据与第二设备中的数据一致。第一设备执行与第二设备相同的数据操作。在第一设备执行该数据操作的情况下,可能正常进行数据操作,也可能在数据操作过程中发生数据复制的冲突。若发生数据复制的冲突,第一设备会生成报错消息。报错消息具体可 为数据库的复制错误返回值,如HA_ERR_FOUND_DUPP_KEY、HA_ERR_KEY_NOT_FOUND、HA_ERR_END_OF_FILE等,在此并不限定。
上述数据操作可包括数据插入操作、数据更新操作等等,在此并不限定。
在步骤S102中,若检测到与数据操作对应的报错消息,根据报错消息对目标数据执行一致性操作,使得一致性操作后的第一设备中目标数据与第二设备执行数据操作后的目标数据一致。
目标数据可包括数据操作指示的数据。数据操作指示的数据可包括第一设备中已存在的数据,也可包括数据操作要求新操作的数据。
例如,若数据操作为数据插入操作,则数据操作指示的数据可包括数据插入操作要求插入的数据。在数据复制发生冲突,若在第一设备中已经存在与数据插入操作要求插入的数据相同的数据的情况下,数据操作指示的数据包括第一设备中已经存在的与数据插入操作要求插入的数据相同的数据和数据插入操作要求插入的数据。
又例如,若数据操作为数据更新操作,则数据操作指示的数据可包括数据更新操作要求被更新的数据和数据更新操作要求更新后的数据。
报错消息可用于表征复制冲突错误。在一些示例中,不同的报错消息可对应不同的一致性操作。具体地,可根据报错消息表征的复制冲突错误,执行与该复制冲突错误对应的一致性操作。一致性操作的目的为一致性操作后的第一设备中的目标数据与第二设备中执行数据操作后的目标数据一致,从而保证第一设备中的数据与第二设备中的数据一致。
在步骤S103中,根据一致性操作,记录数据操作日志,使得第一设备的数据操作日志与第二设备的数据操作日志一致。
一致性操作可包括一个操作,也可包括两个或两个以上的操作,在此并不限定。根据一致性操作的具体操作,确定记录入数据操作日志中的操作。可将一致性操作的具体操作均记录入数据操作日志,也可将一致性操作中的具体操作中的部分记录入数据操作日志,保证第一设备的数据操作日志与第二设备的数据操作日志一致。
第一设备的数据操作日志与第二设备的数据操作日志一致,可指第一设备的数据操作日志中记录的操作与第二设备的数据操作日志中记录的操作的效果一致。例如,第一设备的数据操作日志中记录的操作的实质动作与第二设备的数据操作日志中记录的操作的实质动作相同,例如insert操作和write操作。又例如,第一设备的数据操作日志中记录的操作执行后的数据与第二设备的数据操作日志中记录的操作执行后的数据相同。
在一些示例中,数据操作日志可为binlog等,在此并不限定。在本申请实施例中,第一设备的数据操作日志可与第二设备的数据操作日志保持一致。
在本申请实施例中,第一设备在接收到第二设备传输来的数据复制指令的情况下,可执行与第二设备相同的数据操作。第一设备在执行该数据操作的过程中可能发生复制冲突,若检测到表征复制冲突错误的报错消息,则可根据报错消息对目标数据执行一致性操作,保证一致性操作后的第一设备中目标数据与第二设备中一致性操作后的目标数据一致,从而保证第一设备和第二设备中的所有数据一致。而且,根据一致性操作,记录数据操作日志,使得第一设备的数据操作日志与第二设备的数据操作日志一致。在业务在第一设备和第二设备之间进行切换的情况下,由于第一设备的数据及数据操作日志与第二设备的数据及数据操作日志一致,因此,在业务在第一设备和第二设备之间进行切换的情况下,可以保证业务的正确性。
为了便于说明,下面将以几种具体的复制冲突场景为例对本申请实施例提供的数据复制处理方法进行说明。
在一些示例中,数据操作可包括数据插入操作。报错消息可表征第一设备已存在与数据插入操作要求插入的数据的主键或索引相同的数据。例如,报错消息具体可为HA_ERR_FOUND_DUPP_KEY。也就是说,第二设备执行的数据操作为数据插入操作,第一设备接收第二设备传输来的数据复制指令,需要进行与第二设备相同的数据插入操作。但在执行该数据插入操作的过程中,确定第一设备中已经存在与该数据插入操作要求插入的数据的主键或索引相同的数据。在这种情况下,第一设备可执行第一数 据删除操作,删除已存在的与数据插入操作要求插入的数据主键或索引相同的数据。第一设备执行该数据插入操作,插入该数据插入操作要求插入的数据,使得第一设备中插入的数据与第二设备中插入的数据相同。
例如,数据插入操作对应的指令为“insert_row(new_record)”。其中,new_record即为数据插入操作要求插入的数据。第一设备检测到错误消息“HA_ERR_FOUND_DUPP_KEY”,第一设备自动执行第一数据删除操作,第一数据删除操作对应的指令为“delete_row(old_record)”。其中,old_record即为第一设备中已存在的与new_record主键或索引相同的数据。第一设备再执行数据插入操作,数据插入操作对应的指令为“insert_row(new_record)”。在第一设备发生本示例中的复制冲突的情况下,第一设备的回放策略即可为“delete_row(old_record)”和“insert_row(new_record)”。
为了保证第一设备的数据操作日志和第二设备的数据操作日志一致,第一设备将上述数据插入操作记录入数据操作日志,并不将第一数据删除操作记录入数据操作日志。
例如,第二设备的数据操作日志中记录的是“insert_row(new_record)”。第一设备的数据操作日志中记录的是“insert_row(new_record)”,并不记录“delete_row(old_record)”。
在另一些示例中,数据操作可包括数据插入操作。报错消息可表征第一设备已存在与数据插入操作要求插入的数据的主键或索引相同的数据。场景可参见上一示例。在本示例中,第一设备中每个数据均配置有时间戳,在此并不限定时间戳的存储位置。例如,不同数据对应的时间戳的存储位置可以相同,也可以不同。
具体地,可在转移数据表配置时间戳字段,利用时间戳字段记录时间戳。在这种情况下,第一设备比较数据插入操作要求插入的数据的第一时间戳与第一设备中与数据插入操作要求插入的数据的主键或索引相同的数据的第二时间戳。若第一时间戳晚于第二时间戳,则执行第二数据删除操作,删除第一设备中与数据插入操作要求插入的数据的主键或索引相同的数据,再执行第一数据写入操作,写入数据插入操作要求插入的数据。若 第一时间戳早于第二时间戳,则执行数据保留操作,保留第一设备中与数据插入操作要求插入的数据的主键或索引相同的数据。也就是说,第一设备选择时间戳更新的数据作为存储在第一设备中的数据。需要说明的是,数据插入操作要求插入的数据的第一时间戳可写入在数据操作日志中。
例如,数据插入操作对应的指令为“insert_row(new_record)”。其中,new_record即为数据插入操作要求插入的数据。第一设备中存在的与new_record主键或索引相同的数据为old_record。第一设备比较new_record的时间戳T1和old_record的时间戳T2。若T1>T2,即时间戳T1指示的时间晚于时间戳T2指示的时间,则第一设备执行第二数据删除操作,第二数据删除操作对应的指令为“delete_row(old_record)”;第一设备再执行第一数据写入操作,第一数据写入操作对应的指令为“write_row(new_record)”。若T1<T2,即时间戳T1指示的时间早于时间戳T2指示的时间,则第一设备执行数据保留操作,数据保留操作的指令为“keep_row(old_record)”。
在第一设备发生本示例中的复制冲突的情况下,若第一时间戳晚于第二时间戳,则第一设备的回放策略可为“delete_row(old_record)”和“write_row(new_record)”;若第一时间戳早于第二时间戳,则第一设备的回放策略可为“keep_row(old_record)”。
相应地,若第一时间戳晚于第二时间戳,则将第一数据写入操作记录入数据操作日志,并不将第二数据删除操作记录入数据操作日志。若第一时间戳早于第二时间戳,则不将数据保留操作记录入数据操作日志。
例如,若第一时间戳晚于第二时间戳,第二设备中数据操作日志记录的是“insert_row(new_record)”,则第一设备中数据操作日志记录的是“write_row(new_record)”,并不记录“delete_row(old_record)”。在这里,insert指令和write指令可以等同。若第一时间戳早于第二时间戳,第二设备中数据操作日志记录的是“insert_row(new_record)”,则第一设备中数据操作日志并不记录“keep_row(old_record)”,可记录第一设备执行数据插入操作对应的“insert_row(new_record)”,或者,第一设备中数据操作日志并不记录“keep_row(old_record)”,也不记录数据插入操作对应 的“insert_row(new_record)”。第二设备中数据操作日志记录的操作执行后第一设备中对应的数据为new_record,则第一设备中数据操作日志记录的操作执行后的第二设备中对应的数据也为new_record。上述示例中均可保证第一设备中数据操作日志与第二设备中数据操作日志的一致性。
在又一些示例中,数据操作可包括数据更新操作。报错消息可表征第一设备不存在数据更新操作要求被更新的数据。例如,报错消息具体可为HA_ERR_KEY_NOT_FOUND或HA_ERR_END_OF_FILE。也就是说,第二设备执行的数据操作为数据更新操作,第一设备接收第二设备传输来的数据复制指令,需要进行与第二设备相同的数据更新操作。但在执行该数据插入操作的过程中,确定第一设备中不存在该数据更新操作要求被更新的数据。
在上述情况下,第一设备执行第二数据写入操作,写入数据更新操作要求更新的数据。第一设备执行数据更新操作,更新写入的数据更新操作要求被更新的数据,具体地,将写入的数据更新操作要求被更新的数据更新为该数据更新操作要求更新后的数据。
例如,数据更新操作对应的指令为“update_row(old_record,new_record)”。其中,old_record为数据更新操作要求被更新的数据,new_record为数据更新操作要求更新后的数据。第一设备检测到错误消息“HA_ERR_KEY_NOT_FOUND”或“HA_ERR_END_OF_FILE”之后,第一设备自动执行第二数据写入操作,第二数据写入操作对应的指令为“write_row(old_record)”,第一设备再执行数据更新操作,数据更新操作对应的指令为“update_row(old_record,new_record)”。
相应地,为了保证第一设备的数据操作日志和第二设备的数据操作日志一致,第一设备将数据更新操作记录入数据操作日志,并不将第二数据写入操作记录入数据操作日志。
例如,第二设备的数据操作日志中记录的是“update_row(old_record,new_record)”。第一设备的数据操作日志中记录的是“update_row(old_record,new_record)”,并不记录“write_row(old_record)”。
在再一些示例中,数据操作可包括数据更新操作。报错消息可表征第一设备中已存在与数据更新操作要求更新后的数据的主键或索引相同的数据。例如,报错信息具体可为HA_ERR_FOUND_DUPP_KEY。也就是说,第二设备执行的数据操作为数据更新操作,第一设备接收第二设备传输来的数据复制指令,需要进行与第二设备相同的数据更新操作。但在执行该数据更新操作的过程中,确定第一设备中已经存在与该数据更新操作要求更新后的数据的主键或索引相同的数据。在本示例中,第一设备中每个数据均配置有时间戳。
具体地,可在转移数据表配置时间戳字段,利用时间戳字段记录时间戳。在这种情况下,第一设备比较数据更新操作要求更新后的数据的第三时间戳与第一设备中与数据更新操作要求更新后的数据的主键或索引相同的数据的第四时间戳。若第三时间戳晚于第四时间戳,则执行第三数据删除操作,删除第一设备中与数据更新操作要求更新后的数据的主键或索引相同的数据,再执行第三数据写入操作,写入数据更新操作要求更新后的数据。若第三时间戳早于第四时间戳,则执行数据保留操作,保留第一设备中与数据更新操作要求更新后的数据的主键或索引相同的数据。
例如,数据更新操作对应的指令为“update_row(old_record1,new_record)”。其中,old_record1为数据更新操作要求被更新的数据,new_record为数据更新操作要求更新后的数据。第一设备中已存在与new_record的主键或索引相同的数据old_record2。第一设备比较数据更新操作要求更新后的数据的时间戳T3和第一设备中已存在与数据更新操作要求更新后的数据的主键或索引相同的数据的时间戳T4。若T3>T4,即时间戳T3指示的时间晚于时间戳T4指示的时间,则执行第三数据删除操作,第三数据删除操作对应的指令为“delete_row(old_record2)”;第一设备再执行第三数据写入操作,第三数据写入操作对应的指令为“write_row(new_record)”。
相应地,若第三时间戳晚于第四时间戳,则不将第三数据写入操作和第三数据删除操作记录入数据操作日志。若第三时间戳早于第四时间戳,则不将数据保留操作记录入数据操作日志。
例如,若第三时间戳晚于第四时间戳,第二设备中数据操作日志记录的是“update_row(old_record,new_record)”。第一设备中数据操作日志并不记录“delete_row(old_record2)”和“write_row(new_record)”,可记录第一设备执行数据更新操作对应的“update_row(old_record,new_record)”,或者,第一设备中数据操作日志并不记录“delete_row(old_record2)”和“write_row(new_record)”,也不记录数据更新操作对应的“update_row(old_record,new_record)。第二设备中数据操作日志记录的操作执行后第一设备中对应的数据为new_record,第一设备中数据操作日志记录的操作执行后的第二设备中对应的数据也为new_record。上述示例中均可保证第一设备中数据操作日志与第二设备中数据操作日志的一致。
需要说明的是,数据操作还可为其他操作,如数据删除操作。在数据操作为数据删除操作的情况下,若第一设备中不存在数据删除操作要求删除的数据,则第一设备可忽略该复制冲突,在此不再赘述。
本申请实施例提供的数据复制处理方法,涉及到的第一设备与第二设备可为级联复制的多个设备中任意两个具有单向数据复制关系的设备,也可为复制回环中的两个具有双向数据复制关系的设备。下面将以容灾系统为例进行多个数据设备之间关系的说明。
本申请实施例还提供了一种容灾系统。该容灾系统可包括至少两个数据设备,数据设备可执行上述实施例中用于第一设备的数据复制处理方法。容灾系统中的各个数据设备均可作为第一设备,能够执行上述实施例中的数据复制处理方法,或者,容灾系统中部分数据设备可作为第一设备,能够执行上述实施例中的数据复制处理方法。在此并不对容灾系统中的数据设备进行限定。
在一些示例中,容灾系统为级联复制类型的容灾系统。图3为本申请提供的容灾系统的实施例的结构示意图。如图3所示,该容灾系统具体包括第一数据设备E1至第N数据设备EN,N为大于1的整数。
第i-1数据设备Ei-1用于向第i数据设备Ei传输数据复制指令。第i数据设备Ei用于执行上述实施例中用于第一设备的数据复制处理方法。i 为正整数,且1<i≤N。
具体地,第一数据设备E1可接收用户输入的数据操作,第一数据设备E1可向第二数据设备E2传输数据复制指令;第二数据设备E2执行与第一数据设备E1相同的数据操作,且可执行上述实施例中用于第一设备的数据复制处理方法,第二数据设备E2向第三数据设备E3传输数据复制指令;第三数据设备E3执行与第二数据设备E2相同的数据操作,且可执行上述实施例中用于第一设备的数据复制处理方法;以此类推;第N数据设备EN执行与第N-1数据设备EN-1相同的数据操作,且可执行上述实施例中用于第一设备的数据复制处理方法。
采用本申请实施例提供的数据复制处理方法,可保证级联复制容灾系统中的每一级的数据设备的数据以及数据操作日志的一致性,并不会因为级联复制容灾系统中的数据设备之间的复杂数据复制关系,导致级联复制容灾系统中不同数据设备中的数据以及数据操作日志出现不一致的情况。从而使得当业务在级联复制容灾系统中的各级数据设备切换的情况下,也可保证业务的正确性。
在另一些示例中,容灾系统为复制回环类型的容灾系统,该容灾系统可具体包括至少两个数据设备。至少两个数据设备中,一个数据设备用于接收用户输入的数据操作,执行数据操作,并向另一个数据设备传输数据复制指令,另一个数据设备用于执行上述实施例中应用于第一设备的数据复制处理方法;和/或,另一个数据设备用于接收用户输入的数据操作,执行所述数据操作,并向一个数据设备传输数据复制指令,一个数据设备用于执行上述实施例中应用于第一设备的数据复制处理方法。
下面以复制回环类型的容灾系统包括两个数据设备为例进行说明。图4为本申请提供的容灾系统的另一实施例的结构示意图。如图4所示,该容灾系统包括两个数据设备,分别为数据设备A1和数据设备A2。
数据设备A1可接收用户输入的数据操作,执行数据操作,向数据设备A2传输数据复制指令。数据设备A2可执行上述实施例中应用于第一设备的数据复制处理方法。
数据设备A2也可接收用户输入的数据操作,执行数据操作,向数据 设备A1传输数据复制指令。数据设备A1可执行上述实施例中应用于第一设备的数据复制处理方法。
采用本申请实施例提供的数据复制处理方法,可保证复制回环容灾系统中的数据设备的数据以及数据操作日志的一致性,并不会因为复制回环容灾系统中的数据设备之间的双向复制关系,导致复制回环容灾系统中不同数据设备中的数据以及数据操作日志出现不一致的情况。从而使得当业务在复制回环容灾系统中的各级数据设备切换的情况下,可保证业务的正确性。
例如,若数据设备A1接收到的数据操作为数据插入操作,数据插入操作要求插入的数据为[1,2019-09-26 15:30:00.0000]。数据设备A2接收数据设备A1传输的数据复制指令,执行数据插入操作。数据设备A2中已存在数据[1,2019-09-26 15:30:01.0000]。数据设备A1要求插入的数据[1,2019-09-26 15:30:00.0000]与数据设备A2中已存在的数据[1,2019-09-26 15:30:01.0000]的主键相同,均为1。数据设备A1要求插入的数据[1,2019-09-26 15:30:00.0000]的时间戳为“2019-09-26 15:30:00”,数据设备A2已存在的数据[1,2019-09-26 15:30:01.0000]的时间戳为“2019-09-26 15:30:01”。对比时间戳,则数据设备A2保留数据[1,2019-09-26 15:30:01.0000],相当于在数据A2中插入了数据[1,2019-09-26 15:30:01.0000]。数据设备A2向数据设备A1发送数据复制指令,数据设备A对比数据[1,2019-09-26 15:30:01.0000]的时间戳和数据[1,2019-09-26 15:30:00.0000]的时间戳,则数据设备插入数据[1,2019-09-26 15:30:01.0000]。
由此可见,复制回环中数据复制的冲突可有效得到解决,保证复制回环中的数据设备的数据即数据操作日志的一致。
需要说明的是,上述实施例中提到的用户输入的数据操作可以为用户直接输入数据设备的数据操作,也可为用户通过应用程序(Application,APP)等输入数据设备的数据操作。
本申请实施例还提供了一种数据复制处理装置。图5为本申请提供的数据复制处理装置的实施例的结构示意图。如图5所示,该数据复制处理 装置200可包括第一执行模块201、第二执行模块202和日志记录模块203。
第一执行模块201,用于接收并响应第二设备传输来的数据复制指令,执行与第二设备相同的数据操作。
第二执行模块202,若检测到与数据操作对应的报错消息,根据报错消息对目标数据执行一致性操作,使得一致性操作后的第一设备中目标数据与第二设备执行数据操作后的目标数据一致。
其中,目标数据包括数据操作指示的数据。
日志记录模块203,用于根据一致性操作,记录数据操作日志,使得第一设备的数据操作日志与第二设备的数据操作日志一致。
在本申请实施例中,第一设备在接收到第二设备传输来的数据复制指令的情况下,可执行与第二设备相同的数据操作。第一设备在执行该数据操作的过程中可能发生复制冲突,若检测到表征复制冲突错误的报错消息,则可根据报错消息对目标数据执行一致性操作,保证一致性操作后的第一设备中的目标数据与第二设备中执行数据操作后的目标数据一致,从而保证第一设备和第二设备中的所有数据一致。而且,根据一致性操作,记录数据操作日志,使得第一设备的数据操作日志与第二设备的数据操作日志一致。在业务在第一设备和第二设备之间进行切换的情况下,由于第一设备的数据及数据操作日志与第二设备的数据及数据操作日志一致,因此,在业务在第一设备和第二设备之间进行切换的情况下,可以保证业务的正确性。
在一些示例中,数据操作可包括数据插入操作。报错消息可表征第一设备已存在与数据插入操作要求插入的数据的主键或索引相同的数据。
第二执行模块202可具体用于:执行第一数据删除操作,删除已存在的与数据插入操作要求插入的数据主键或索引相同的数据;执行数据插入操作,插入数据插入操作要求插入的数据。
相应地,日志记录模块203可具体用于:将数据插入操作记录入数据操作日志,并不将第一数据删除操作记录入数据操作日志。
在另一些示例中,数据操作可包括数据插入操作。报错消息可表征第 一设备已存在与数据插入操作要求插入的数据的主键或索引相同的数据。数据均配置有时间戳。
第二执行模块202可具体用于:比较数据插入操作要求插入的数据的第一时间戳与第一设备中与数据插入操作要求插入的数据的主键或索引相同的数据的第二时间戳;若第一时间戳晚于第二时间戳,执行第二数据删除操作,删除第一设备中与数据插入操作要求插入的数据的主键或索引相同的数据,执行第一数据写入操作,写入数据插入操作要求插入的数据;若第一时间戳早于第二时间戳,执行数据保留操作,保留第一设备中与数据插入操作要求插入的数据的主键或索引相同的数据。
对应地,日志记录模块203可具体用于:若第一时间戳晚于第二时间戳,则将第一数据写入操作记录入数据操作日志,不将第二数据删除操作记录入数据操作日志;若第一时间戳早于第二时间戳,则不将数据保留操作记录入数据操作日志。
在又一些示例中,数据操作可包括数据更新操作。报错消息可表征第一设备不存在数据更新操作要求被更新的数据。
第二执行模块202可具体用于:执行第二数据写入操作,写入数据更新操作要求更新的数据;执行数据更新操作,更新写入的数据更新操作要求被更新的数据。
相应地,日志记录模块203可具体用于:将数据更新操作记录入数据操作日志,并不将第二数据写入操作记录入数据操作日志。
在再一些示例中,数据操作可包括数据更新操作。报错消息可表征第一设备中已存在与数据更新操作要求更新后的数据的主键或索引相同的数据。数据均配置有时间戳。
第二执行模块202可具体用于:比较数据更新操作要求更新后的数据的第三时间戳与第一设备中与数据更新操作要求更新后的数据的主键或索引相同的数据的第四时间戳;若第三时间戳晚于第四时间戳,则执行第三数据删除操作,删除第一设备中与数据更新操作要求更新后的数据的主键或索引相同的数据,再执行第三数据写入操作,写入数据更新操作要求更新后的数据;若第三时间戳早于第四时间戳,则执行数据保留操作,保留 第一设备中与数据更新操作要求更新后的数据的主键或索引相同的数据。
相应地,日志记录模块203可具体用于:若第三时间戳晚于第四时间戳,则不将第三数据写入操作和第三数据删除操作记录入数据操作日志;若第三时间戳早于第四时间戳,则不将数据保留操作记录入数据操作日志。
图6为本申请提供的数据设备的实施例的结构示意图。如图6所示,数据设备300包括存储器301、处理器302及存储在存储器301上并可在处理器302上运行的计算机程序。
在一个示例中,上述处理器302可以包括中央处理器(Central Processing Unit,CPU),或者特定集成电路(Application Specific Integrated Circuit,ASIC),或者可以被配置成实施本申请实施例的一个或多个集成电路。
存储器301可以包括用于数据或指令的大容量存储器。举例来说而非限制,存储器301可包括硬盘驱动器(Hard Disk Drive,HDD)、软盘驱动器、闪存、光盘、磁光盘、磁带或通用串行总线(Universal Serial Bus,USB)驱动器或者两个或更多个以上这些的组合。在合适的情况下,存储器301可包括可移除或不可移除(或固定)的介质。在合适的情况下,存储器301可在综合网关容灾设备的内部或外部。在特定实施例中,存储器301是非易失性固态存储器。在特定实施例中,存储器301包括只读存储器(Read-Only Memory,ROM)。在合适的情况下,该ROM可以是掩模编程的ROM、可编程ROM(Programmable Read-Only Memory,PROM)、可擦除PROM(Erasable Programmable Read-Only Memory,EPROM)、电可擦除PROM(Electrically Erasable Programmable Read-Only Memory,EEPROM)、电可改写ROM(Electrically Alterable Read-Only Memory,EAROM)或闪存或者两个或更多个以上这些的组合。
处理器302通过读取存储器301中存储的可执行程序代码来运行与可执行程序代码对应的计算机程序,以用于实现上述数据复制处理方法的任一实施例。
在一个示例中,数据设备300还可包括通信接口303和总线304。其 中,如图6所示,存储器301、处理器302、通信接口303通过总线304连接并完成相互间的通信。
通信接口303,主要用于实现本申请实施例中各模块、装置、单元和/或设备之间的通信。也可通过通信接口303接入输入设备和/或输出设备。
总线304包括硬件、软件或两者,将设备的部件彼此耦接在一起。举例来说而非限制,总线可包括加速图形端口(Accelerated Graphics Port,AGP)或其他图形总线、增强工业标准架构(Enhanced Industry Standard Architecture,EISA)总线、前端总线(Front Side Bus,FSB)、超传输(Hyper Transport,HT)互连、工业标准架构(Industrial Standard Architecture,ISA)总线、无限带宽互连、低引脚数(Low pin count,LPC)总线、存储器总线、微信道架构(Micro Channel Architecture,MCA)总线、外围组件互连(Peripheral Component Interconnect,PCI)总线、PCI-Express(PCI-X)总线、串行高级技术附件(Serial Advanced Technology Attachment,SATA)总线、视频电子标准协会局部(Video Electronics Standards Association Local Bus,VLB)总线或其他合适的总线或者两个或更多个以上这些的组合。在合适的情况下,总线304可包括一个或多个总线。尽管本申请实施例描述和示出了特定的总线,但本申请考虑任何合适的总线或互连。
本申请一实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时可实现上述数据复制处理方法的任一实施例。计算机可读存储介质的示例可以是非暂态计算机可读存储介质,包括ROM、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。
上面参考根据本申请的实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本申请的各方面。应当理解,流程图和/或框图中的每个方框以及流程图和/或框图中各方框的组合可以由计算机程序指令实现。这些计算机程序指令可被提供给通用计算机、专用计算机、或其它可编程数据处理装置的处理器,以产生一种机器,使得经由计算机或其它可编程数据处理装置的处理器执行的这些指令使能对流程图和/或框图的 一个或多个方框中指定的功能/动作的实现。这种处理器可以是但不限于是通用处理器、专用处理器、特殊应用处理器或者现场可编程逻辑阵列。还可理解,框图和/或流程图中的每个方框以及框图和/或流程图中的方框的组合,也可以由执行指定的功能或动作的专用硬件来实现,或可由专用硬件和计算机指令的组合来实现。
需要明确的是,本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同或相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。对于系统实施例、装置实施例、数据设备实施例和计算机可读存储介质实施例而言,相关之处可以参见方法实施例的说明部分。本申请并不局限于上文所描述并在图中示出的特定步骤和结构。本领域的技术人员可以在领会本申请的构思之后,作出各种改变、修改和添加,或者改变步骤之间的顺序。并且,为了简明起见,这里省略对已知方法技术的详细描述。
本领域技术人员应能理解,上述实施例均是示例性而非限制性的。在不同实施例中出现的不同技术特征可以进行组合,以取得有益效果。本领域技术人员在研究附图、说明书及权利要求书的基础上,应能理解并实现所揭示的实施例的其他变化的实施例。在权利要求书中,术语“包括”并不排除其他装置或步骤;不定冠词“一个”不排除多个;术语“第一”、“第二”用于标示名称而非用于表示任何特定的顺序。权利要求中的任何附图标记均不应被理解为对保护范围的限制。权利要求中出现的多个部分的功能可以由一个单独的硬件或软件模块来实现。某些技术特征出现在不同的从属权利要求中并不意味着不能将这些技术特征进行组合以取得有益效果。

Claims (16)

  1. 一种数据复制处理方法,用于第一设备,所述第一设备与第二设备之间进行数据复制,所述方法包括:
    接收并响应所述第二设备传输来的数据复制指令,执行与所述第二设备相同的数据操作;
    若检测到与所述数据操作对应的报错消息,根据所述报错消息对目标数据执行一致性操作,使得一致性操作后的所述第一设备中所述目标数据与第二设备执行所述数据操作后的所述目标数据一致,所述目标数据包括所述数据操作指示的数据;
    根据所述一致性操作,记录数据操作日志,使得所述第一设备的数据操作日志与所述第二设备的数据操作日志一致。
  2. 根据权利要求1所述的方法,其中,所述数据操作包括数据插入操作,所述报错消息表征所述第一设备已存在与数据插入操作要求插入的数据的主键或索引相同的数据,
    所述根据所述报错消息对目标数据执行一致性操作,包括:
    执行第一数据删除操作,删除已存在的与数据插入操作要求插入的数据主键或索引相同的数据;
    执行所述数据插入操作,插入所述数据插入操作要求插入的数据。
  3. 根据权利要求2所述的方法,其中,所述根据所述一致性操作,记录数据操作日志,包括:
    将所述数据插入操作记录入所述数据操作日志,不将所述第一数据删除操作记录入所述数据操作日志。
  4. 根据权利要求1所述的方法,其中,所述数据操作包括数据插入操作,所述报错消息表征所述第一设备已存在与数据插入操作要求插入的数据的主键或索引相同的数据,数据均配置有时间戳,
    所述根据所述报错消息所述对目标数据执行一致性操作,包括:
    比较所述数据插入操作要求插入的数据的第一时间戳与所述第一设备中与所述数据插入操作要求插入的数据的主键或索引相同的数据的第二时间戳;
    若所述第一时间戳晚于所述第二时间戳,执行第二数据删除操作,删除所述第一设备中与所述数据插入操作要求插入的数据的主键或索引相同的数据,执行第一数据写入操作,写入所述数据插入操作要求插入的数据;
    若所述第一时间戳早于所述第二时间戳,执行数据保留操作,保留所述第一设备中与所述数据插入操作要求插入的数据的主键或索引相同的数据。
  5. 根据权利要求4所述的方法,其中,所述根据所述一致性操作,记录数据操作日志,包括:
    若所述第一时间戳晚于所述第二时间戳,将所述第一数据写入操作记录入所述数据操作日志,不将所述第二数据删除操作记录入所述数据操作日志;
    若所述第一时间戳早于所述第二时间戳,不将所述数据保留操作记录入所述数据操作日志。
  6. 根据权利要求1所述的方法,其中,所述数据操作包括数据更新操作,所述报错消息表征所述第一设备不存在数据更新操作要求被更新的数据,
    所述根据所述报错消息所述对目标数据执行一致性操作,包括:
    执行第二数据写入操作,写入所述数据更新操作要求更新的数据;
    执行所述数据更新操作,更新写入的所述数据更新操作要求被更新的数据。
  7. 根据权利要求6所述的方法,其中,所述根据所述一致性操作,记录数据操作日志,包括:
    将所述数据更新操作记录入所述数据操作日志,不将所述第二数据写入操作记录入所述数据操作日志。
  8. 根据权利要求1所述的方法,其中,所述数据操作包括数据更新操作,所述报错消息表征所述第一设备中已存在与所述数据更新操作要求更新后的数据的主键或索引相同的数据,数据均配置有时间戳,
    所述根据所述报错消息所述对目标数据执行一致性操作,包括:
    比较所述数据更新操作要求更新后的数据的第三时间戳与所述第一设备中与所述数据更新操作要求更新后的数据的主键或索引相同的数据的第四时间戳;
    若所述第三时间戳晚于所述第四时间戳,执行第三数据删除操作,删除所述第一设备中与所述数据更新操作要求更新后的数据的主键或索引相同的数据,执行第三数据写入操作,写入所述数据更新操作要求更新后的数据;
    若所述第三时间戳早于所述第四时间戳,执行数据保留操作,保留所述第一设备中与所述数据更新操作要求更新后的数据的主键或索引相同的数据。
  9. 根据权利要求8所述的方法,其中,所述根据所述一致性操作,记录数据操作日志,包括:
    若所述第三时间戳晚于所述第四时间戳,不将所述第三数据写入操作和所述第三数据删除操作记录入所述数据操作日志;
    若所述第三时间戳早于所述第四时间戳,不将所述数据保留操作记录入所述数据操作日志。
  10. 根据权利要求1至9中任意一项所述的方法,其中,
    所述第一设备与所述第二设备为级联复制的多个设备中任意两个具有数据复制关系的设备;或者
    所述第一设备与所述第二设备为复制回环中的两个相互进行数据复制的设备。
  11. 一种数据复制处理装置,包括:
    第一执行模块,用于接收并响应第二设备传输来的数据复制指令,执行与所述第二设备相同的数据操作;
    第二执行模块,若检测到与所述数据操作对应的报错消息,根据所述报错消息对目标数据执行一致性操作,使得一致性操作后的第一设备中所述目标数据与所述第二设备执行所述数据操作后的所述目标数据一致,所述目标数据包括所述数据操作指示的数据;
    日志记录模块,用于根据所述一致性操作,记录数据操作日志,使得 所述第一设备的数据操作日志与所述第二设备的数据操作日志一致。
  12. 一种容灾系统,包括至少两个数据设备,所述数据设备用于执行如权利要求1至10中任意一项所述的数据复制处理方法。
  13. 根据权利要求12所述的容灾系统,其中,所述至少两个数据设备包括第一数据设备至第N数据设备,N为大于1的整数,
    其中,第i-1数据设备用于向第i数据设备传输数据复制指令;所述第i数据设备用于执行如权利要求1至10中任意一项所述的数据复制处理方法,i为正整数且1<i≤N。
  14. 根据权利要求12所述的容灾系统,其中,
    所述至少两个数据设备中一个数据设备用于接收用户输入的数据操作,执行所述数据操作,向另一个数据设备传输数据复制指令;所述另一个数据设备用于执行如权利要求1至10中任意一项所述的数据复制处理方法;和/或
    所述另一个数据设备用于接收用户输入的数据操作,执行所述数据操作,向所述一个数据设备传输数据复制指令;所述一个数据设备用于执行如权利要求1至10中任意一项所述的数据复制处理方法。
  15. 一种数据设备,包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1至10中任意一项所述的数据复制处理方法。
  16. 一种计算机可读存储介质,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现如权利要求1至10中任意一项所述的数据复制处理方法。
PCT/CN2020/124941 2019-12-18 2020-10-29 数据复制处理方法、装置、容灾系统、设备及存储介质 WO2021120880A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911305588.0 2019-12-18
CN201911305588.0A CN110727550B (zh) 2019-12-18 2019-12-18 数据复制处理方法、装置、容灾系统、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021120880A1 true WO2021120880A1 (zh) 2021-06-24

Family

ID=69226055

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/124941 WO2021120880A1 (zh) 2019-12-18 2020-10-29 数据复制处理方法、装置、容灾系统、设备及存储介质

Country Status (2)

Country Link
CN (1) CN110727550B (zh)
WO (1) WO2021120880A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110727550B (zh) * 2019-12-18 2020-06-12 中国银联股份有限公司 数据复制处理方法、装置、容灾系统、设备及存储介质
CN114157674A (zh) * 2020-08-17 2022-03-08 中移(上海)信息通信科技有限公司 无线通信方法、装置、系统、服务器以及介质
CN112506700B (zh) * 2020-11-30 2024-05-14 北京达佳互联信息技术有限公司 冲突处理方法、装置、电子设备及存储介质
CN113190536B (zh) * 2021-03-02 2023-01-17 上海英方软件股份有限公司 一种对双活数据库管理复制系统的快速修复方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050177617A1 (en) * 2003-12-23 2005-08-11 Intel Corporation Conflict resolution during data synchronization
CN103077242A (zh) * 2013-01-11 2013-05-01 北京佳讯飞鸿电气股份有限公司 一种实现数据库服务器双机热备的方法
CN110727550A (zh) * 2019-12-18 2020-01-24 中国银联股份有限公司 数据复制处理方法、装置、容灾系统、设备及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7613749B2 (en) * 2006-04-12 2009-11-03 International Business Machines Corporation System and method for application fault tolerance and recovery using topologically remotely located computing devices
CN103646111B (zh) * 2013-12-25 2017-02-15 普元信息技术股份有限公司 大数据环境下实现实时数据关联的系统及方法
CN106802892B (zh) * 2015-11-26 2021-12-28 阿里巴巴集团控股有限公司 用于主备数据一致性校验的方法和设备
CN110119329B (zh) * 2019-02-27 2024-02-23 咪咕音乐有限公司 数据复制容灾方法及容灾系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050177617A1 (en) * 2003-12-23 2005-08-11 Intel Corporation Conflict resolution during data synchronization
CN103077242A (zh) * 2013-01-11 2013-05-01 北京佳讯飞鸿电气股份有限公司 一种实现数据库服务器双机热备的方法
CN110727550A (zh) * 2019-12-18 2020-01-24 中国银联股份有限公司 数据复制处理方法、装置、容灾系统、设备及存储介质

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
IBM: "Time stamp conflict resolution rule", HOME > INFORMIX SERVERS 11.7 > ADMINISTERING > REPLICATION > ENTERPRISE REPLICATION > PLANNING AND DESIGNING FOR ENTERPRISE REPLICATION > REPLICATION SYSTEM DESIGN > CONFLICT RESOLUTION > CONFLICT RESOLUTION RULE, BAIDU, CN, CN, pages 1, XP009529330, Retrieved from the Internet <URL:https://www.ibm.com/support/knowledgecenter/en/SSGU8G_11.70.0/com.ibm.erep.doc/ids_erp_096.htm> *
ORACLE : "Oracle® TimesTen In-Memory Database Replication Guide 11g Release 2 (11.2.2)", REPLICATION GUIDE, vol. E21635-11, 31 October 2014 (2014-10-31), pages 1 - 310, XP009528607 *

Also Published As

Publication number Publication date
CN110727550B (zh) 2020-06-12
CN110727550A (zh) 2020-01-24

Similar Documents

Publication Publication Date Title
WO2021120880A1 (zh) 数据复制处理方法、装置、容灾系统、设备及存储介质
CN113396407A (zh) 用于利用区块链技术扩充数据库应用的系统和方法
JP4940730B2 (ja) データベースシステム運用方法,データベースシステム,データベース装置及びバックアッププログラム
CN106202365B (zh) 数据库更新同步的方法、系统及数据库集群
US10609141B2 (en) Methods and apparatuses for cluster switching
CN102323930B (zh) 对数据库系统中的数据变更进行镜像
US20130132340A1 (en) File synchronization method, electronic device and synchronization system
CN103780638A (zh) 数据同步方法及系统
CN112182001A (zh) 数据库增量同步至动态es索引库的方法、装置和介质
CN104750755A (zh) 一种数据库主备切换后的数据回补方法及系统
WO2016177075A1 (zh) 一种业务数据关联关系校验方法、装置及可读存储介质
CN111309799A (zh) 数据合并的实现方法、装置、系统及存储介质
CN107621994B (zh) 一种数据快照创建的方法及装置
CN113157670A (zh) 数据库的数据迁移方法及系统
US10620872B2 (en) Replicating data in a data storage system
CN116303789A (zh) 多分片多副本数据库并行同步方法、装置及可读介质
CN110121712B (zh) 一种日志管理方法、服务器和数据库系统
CN105760456A (zh) 一种保持数据一致性的方法和装置
CN111541747B (zh) 一种数据的检查点设置方法及装置
JP2008158570A (ja) ストレージシステム、論理ボリュームのレプリケーション方法・プログラム
CN113778331A (zh) 一种数据处理方法、主节点及存储介质
CN111026764B (zh) 一种数据存储方法、装置、电子产品及存储介质
CN114116768A (zh) 一种对数据库集群进行读写分离的方法
US9843636B2 (en) Computer-readable medium storing data editing program
CN111078467A (zh) 一种实现远程复制一致性的方法和装置

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

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

Country of ref document: EP

Kind code of ref document: A1