WO2015024377A1 - Data synchronization method, apparatus and device, and computer storage medium - Google Patents

Data synchronization method, apparatus and device, and computer storage medium Download PDF

Info

Publication number
WO2015024377A1
WO2015024377A1 PCT/CN2014/073628 CN2014073628W WO2015024377A1 WO 2015024377 A1 WO2015024377 A1 WO 2015024377A1 CN 2014073628 W CN2014073628 W CN 2014073628W WO 2015024377 A1 WO2015024377 A1 WO 2015024377A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
data synchronization
synchronization
verification information
same
Prior art date
Application number
PCT/CN2014/073628
Other languages
French (fr)
Chinese (zh)
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 WO2015024377A1 publication Critical patent/WO2015024377A1/en

Links

Classifications

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

Definitions

  • the present invention relates to the field of communications, and in particular to a data synchronization method, apparatus, device, and computer storage medium.
  • Synchronization technology of an existing in-memory database uses a change table and a change record synchronization method in a master-slave mode and a multi-module (when a plurality of modules are distributed as reference data to other modules), when a table and a record occur. When changing, these changes are packaged and sent to the standby or other modules.
  • These synchronization mechanisms only trigger data synchronization when the data changes. The judgment mechanism of the data change is whether the table records are modified. If there is no data modification, Data synchronization will be triggered.
  • Embodiments of the present invention provide a data synchronization method, apparatus, device, and computer storage medium to solve at least the problem of synchronization data errors between devices.
  • a data synchronization method including: after the first device performs data synchronization with the second device, the first device receives the verification information sent by the second device, The verification information is used to determine whether the data synchronization is successful; the first device determines, according to the verification information, whether the data synchronization is successful; in the case that the data synchronization fails, the A device performs data synchronization with the second device.
  • the data synchronization method is started if the first device and/or the device resource that is idle locally of the second device exceeds a threshold; or the startup command is received, and the data synchronization method is started.
  • the device comprises at least one of the following: a processor resource, a memory resource, a bandwidth resource, and 10 resources.
  • determining, by the first device, whether the data synchronization is successful according to the verification information comprises: the first device determining, from the second device Whether the data version number is the same as the data version number of the first device. If they are the same, it is determined that the data synchronization is successful. If not, the data synchronization failure is determined.
  • the verification information includes: a checksum calculated by the second device to calculate some or all of the records in the predetermined table in the database, the first Determining, by the device, whether the data synchronization is successful according to the verification information, the first device calculating a record corresponding to the locally stored table corresponding to the predetermined table to obtain a checksum of the first device; The first device determines whether the checksum of the second device is the same as the checksum of the first device. If they are the same, it is determined that the data synchronization is successful. If not, the data synchronization is determined to be unsuccessful.
  • a data synchronization device which is located in a first device, and includes: a receiving module, configured to receive the second after the first device performs data synchronization to the second device The verification information sent by the device, where the verification information is used to determine whether the data synchronization is successful; the determining module is configured to determine, according to the verification information, whether the data synchronization is successful; the synchronization module is set to be In the case that the data synchronization fails, data synchronization is performed to the second device.
  • the data synchronization device further includes: a startup module, configured to start the data synchronization device if the device resource that is idle locally by the first device and/or the second device exceeds a threshold; or, set to Upon receiving the start command, the data synchronization device is activated.
  • the device resource includes at least one of the following: a processor resource, a memory resource, a bandwidth resource, and 10 resources.
  • the determining module is further configured to: if the verification information includes a data version number, determine whether the data version number from the second device is the same as the data version number of the first device, if the same , it is determined that the data synchronization is successful, if not the same, it is determined that the data synchronization fails.
  • the verification information includes: a checksum calculated by the second device to calculate some or all of the records in the predetermined table in the database, and the determining module And determining, by calculating a corresponding record in the table corresponding to the predetermined table that is locally stored, obtaining a checksum of the first device, determining a checksum of the second device, and a calibration of the first device If the checksums are the same, if they are the same, it is determined that the data synchronization is successful. If they are not the same, it is determined that the data synchronization fails.
  • FIG. 1 is a flow chart of a data synchronization method according to an embodiment of the present invention
  • FIG. 2 is a structural diagram of a data synchronization apparatus according to an embodiment of the present invention
  • FIG. 3 is an in-memory database data according to a preferred embodiment of the present invention.
  • FIG. 4 is a flow chart of data checking and synchronization according to a preferred embodiment of the present invention
  • FIG. 5 is a topological structural view of an in-memory database synchronous data verifying function module according to a preferred embodiment of the present invention.
  • FIG. 1 is a flowchart of a data synchronization method according to an embodiment of the present invention.
  • the method includes the following steps: Step S102, in a first device After the second device performs data synchronization, the first device receives the verification information sent by the second device, where the verification information is used to determine whether the data synchronization is successful.
  • Step S104 The first device determines the data according to at least the verification information. Whether the synchronization is successful;
  • Step S106 In the case that the data synchronization fails, the first device performs data synchronization with the second device.
  • the first device can determine whether the data synchronization is successful, thereby providing a possibility for finding synchronization data errors, and solving the problem of synchronization data errors between devices.
  • the data synchronization method may be started; or After receiving the start command, start the data synchronization method.
  • the resources involved in the execution process include CPU, memory, network port bandwidth, and disk 10. The user can configure the idle thresholds of the four types of resources.
  • the system is considered idle. .
  • the four resources can be required to idle more than the threshold at the same time, or the single resource can be idle to exceed the threshold to start the above method. For example, when the CPU resource is idle more than 50%, this data checking mechanism can be started. As another preferred manner, it is also possible to provide a user to manually trigger or configure a check point in time to initiate this check mechanism.
  • the verification information between the first device and the second device may be various. For example, if the verification information includes the data version number, the first device determines, according to the verification information, whether the data synchronization is successful. The first device determines whether the data version number from the second device is the same as the data version number of the first device.
  • the verification information may further include: a checksum calculated by the second device on a part or all of the records in the predetermined table in the database, and determining, by the first device, whether the data synchronization is successful according to the verification information, the first device pair
  • the locally stored record corresponding to the predetermined table is calculated to obtain a checksum of the first device; the first device determines whether the checksum of the second device is the same as the checksum of the first device, if the same , to determine the data synchronization success, if not the same, then determine the data synchronization failed.
  • these predetermined tables may be all the tables involved in the data synchronization, or some important tables involved in the data synchronization.
  • a data synchronization device is also provided, and the menu processing device is used to implement the foregoing method. It has been described in the above embodiments and preferred embodiments, and details are not described herein again. It should be noted that the name of the module in the following device does not constitute a practical limitation of the module.
  • the receiving module may be expressed as: “set to receive the data after the first device performs data synchronization with the second device.
  • the module of the verification information sent by the second device may be implemented in the processor, for example, the receiving module may be expressed as "a processor, configured to perform data synchronization on the first device to the second device.
  • the apparatus 20 includes: a receiving module 22, a judging module 24, and a synchronizing module 26. The apparatus will be described below.
  • the receiving module 22 is configured to receive, after the first device performs data synchronization with the second device, the verification information sent by the second device, where the verification information is used to determine whether the data synchronization is successful; the determining module 24 is configured to be at least Determining whether the data synchronization is successful according to the verification information; the synchronization module 26 is configured to perform data synchronization to the second device in the case that the data synchronization fails.
  • the data synchronization device further includes: a startup module, configured to start the data synchronization device if the device resource that is idle locally of the first device and/or the second device exceeds a threshold; or, set to Upon receiving the start command, the data synchronization device is started.
  • the device resource includes at least one of the following: a processor resource, a memory resource, a bandwidth resource, and an input/output 10 resource.
  • the determining module 24 is further configured to: if the verification information includes the data version number, determine whether the data version number from the second device is the same as the data version number of the first device, and if the same, determine the data. The synchronization is successful. If it is not the same, it determines that the data synchronization failed.
  • the verification information includes: a checksum calculated by the second device to calculate some or all of the records in the predetermined table in the database, and the determining module is further configured to Calculating a checksum of the first device in the locally stored record corresponding to the predetermined table, and determining whether the checksum of the second device is the same as the checksum of the first device, if the same , to determine the data synchronization success, if not the same, then determine the data synchronization failed.
  • a data synchronization device is further provided, including the data synchronization device in the above implementation.
  • a computer storage medium is further provided, and the computer storage medium may store an execution instruction for executing the method in the foregoing embodiment.
  • the invention will now be described in connection with preferred embodiments.
  • 3 is a structural diagram of in-memory database data check and synchronization according to a preferred embodiment of the present invention. As shown in FIG. 3, the method includes: a startup policy management module 32, a data inspection module 34, and a data distribution module 36. Description.
  • the startup policy management module 32 is responsible for ensuring that the inspection mechanism is started during the system idle time, mainly including the configuration of the CPU, the memory, the network port bandwidth, and the disk 10 idle threshold, the statistics of the four types of resource occupancy, and the execution of the human task trigger ( The function of the above startup module is implemented).
  • the data checking module 34 is responsible for managing the registration of the table to be checked, the checksum calculation of the data table record, the sending and receiving of the checksum data, and the check and check between the master and the backup, and the inter-module (implementing the function of the above-mentioned judging module 24)
  • the data distribution module 36 is responsible for distributing the records of the single table to the designated receiving end, the receiving end is responsible for receiving the data and updating to the memory table, and the sending end is responsible for transmitting the packed data from the table to the receiving end (the synchronization module 26 is implemented).
  • Features). 4 is a flow chart of data checking and synchronization according to a preferred embodiment of the present invention. As shown in FIG.
  • Step S402 Tx at power-on
  • the terminal and the Rx end respectively register all the tables that need to be periodically verified to the verification management module.
  • Step S404 the Tx terminal periodically performs the judgment of the startup policy, and notifies the Rx terminal to make the determination of the startup policy, when the policy is met or the user manually triggers When starting, sending a message to the Rx end, starting the data checking mechanism;
  • Step S406 the Rx end sends the database data version number of the local machine to the Tx end;
  • Step S408 the Tx end receives the data version number sent by the Rx end, and The data version number of the local device is compared.
  • Step S410 the Tx end traverses all the registered data. a checksum calculation is performed on the records of each table, and stored in the table record check data area; in step S412, the Rx end receives the data sent from the Tx end.
  • Step S414 the Tx end receives the check sent by the Rx end And the information and the table record check area data comparison, if the check is consistently ended, if the inconsistency, the table is packaged one by one to the Rx end;
  • Step S416 the Rx end receives the table record data and checksum information sent by the Tx end , perform data verification, if they are consistent, update to the memory table, and notify the Tx end to continue the transmission of the next table; if not, notify the Tx end to resend the table;
  • step S418 after the Tx end sends all the inconsistent table records, the Rx end is notified to end the check, and the current check process is ended.
  • FIG. 5 is a topological structural diagram of an in-memory database synchronization data verification function module according to a preferred embodiment of the present invention.
  • startup policy management is used to ensure that the data inspection mechanism is started when system resources are idle; It is set to check whether the data data of the data sender and the data receiver records the memory data. For the inconsistent data, it is distributed through the data distribution module to ensure the correctness of the data.
  • FIG. 6 is a diagram showing an in-memory database synchronization data verification interaction diagram according to a preferred embodiment of the present invention. As shown in FIG.
  • Step S602 Registering a table to be inspected, a configuration table whose main registration changes little, such a table If the user triggers the startup check mechanism or the current system resource meets the idle policy, the check mechanism is started.
  • Step S606 the receiver requests the verification data version number, if the version number is inconsistent. It indicates that the data has changed, triggering the regular synchronization process for data synchronization; if the data version numbers are the same, it indicates that the data of the receiving end and the transmitting end should be consistent, and the table record verification is performed; Step S608, if the data is verified If the agreement is the same, the current check is ended.
  • Step S610 After receiving the record, the receiving end performs data verification, and if the verification fails, the transmitting end is notified to resend, and when the verification is passed, the record is updated into the table memory.
  • the preferred embodiment provides a mechanism for periodically performing checksum checking using memory blocks between the active and standby modules to ensure the correctness of the data.
  • the checksum mechanism is used to check the database memory when the system resources are relatively idle: Since the in-memory database responds to data access quickly, all the records are stored in the memory, and the data is stored in a continuous memory data area. , the records of each table are also stored continuously.
  • the records of each table are checked and checked.
  • the standby machine and other modules periodically send the checksum data to the main side of module No. 1, and the main side judges the receiving end.
  • Checksum is consistent with the checksum of the local table record. If they are inconsistent, the trigger data is synchronized to the specified receiver.
  • the preferred embodiment is a protection mechanism for in-memory database synchronization, because the resource idle check policy and the user manually trigger the mechanism to ensure the correctness and reliability of the in-memory database data without affecting the service and rationally utilizing the system resources. .
  • modules or steps of the embodiments of the present invention can be implemented by a general computing device, which can be concentrated on a single computing device or distributed in multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device, or they may be separately fabricated into individual integrated circuit modules, or Multiple of these modules or steps are fabricated as a single integrated circuit module.
  • embodiments of the invention are not limited to any specific combination of hardware and software. The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc.
  • the present invention relates to the field of data communication, and provides a data synchronization method and device, which solves the problem of synchronization data error between devices and improves the reliability of data synchronization.

Abstract

Disclosed are a data synchronization method, apparatus and device, and a computer storage medium. The method comprises: after a first device carries out data synchronization on a second device, the first device receiving check information sent by the second device, wherein the check information is used for determining whether the data synchronization succeeds or not; the first device judging whether the data synchronization succeeds or not at least according to the check information; and in the case where the data synchronization fails, the first device carrying out data synchronization on the second device. The present invention solves the problem of making errors in synchronizing data between devices, and improves the reliability of data synchronization.

Description

数据同步方法、 装置、 设备及计算机存储介质 技术领域 本发明涉及通信领域, 具体而言, 涉及一种数据同步方法、 装置、 设备及计算机 存储介质。 背景技术 现有内存数据库的同步技术在主备和多模块 (当多个模块时 1号模块数据作为基 准数据向其它模块分发) 间多采用变化表和变化记录同步的方式, 当表和记录发生变 化时, 把这些变化数据打包发送到备机或者其它模块, 这些同步机制只是在数据发生 变化时才会触发数据同步, 而数据变化的判断机制是表记录是否发生修改, 如果没有 数据修改就不会触发数据同步。 由于网络环境复杂, 主备和多模块间数据都是跨板消息, 消息难免出现丢失或者 同步过程中接收端出现异常的现象, 尤其是同步完成后, 接收端出现记录存放的区域 内存被踩的情况, 这种情况一般难以发现, 而此时 1号模块数据如果没有发生修改也 就不会触发数据同步, 这种情况备机和其它模块的数据就会出现错误。 如果这种情况 下进行了主备倒换, 则系统会发生未知的灾难。 针对相关技术中设备之间同步数据出错的问题, 目前尚未提出有效的解决方案。 发明内容 本发明实施例提供了一种数据同步方法、 装置、 设备及计算机存储介质, 以至少 解决设备之间同步数据出错的问题。 根据本发明实施例的一个方面, 提供了一种数据同步方法, 包括: 在第一设备向 第二设备进行数据同步完成后, 所述第一设备接收所述第二设备发送的校验信息, 其 中, 所述校验信息用于确定所述数据同步是否成功; 所述第一设备至少根据所述校验 信息判断所述数据同步是否成功; 在所述数据同步失败的情况下, 所述第一设备向所 述第二设备进行数据同步。 优选地, 在所述第一设备和 /或所述第二设备本地空闲的设备资源超过阈值的情况 下, 启动所述数据同步方法; 或者, 接收到启动命令, 启动所述数据同步方法。 优选地, 所述设备包括以下至少之一: 处理器资源、 内存资源、 带宽资源、 10资 源。 优选地, 在所述校验信息包括数据版本号的情况下, 所述第一设备根据所述校验 信息判断所述数据同步是否成功包括: 所述第一设备判断来自所述第二设备的数据版 本号与所述第一设备的数据版本号是否相同, 如果相同, 则确定数据同步成功, 如果 不相同, 则确定数据同步失败。 优选地, 在数据同步的是数据库数据的情况下, 所述校验信息包括: 所述第二设 备对数据库中的预定表中的部分或全部记录进行计算得到的校验和, 所述第一设备根 据所述校验信息判断所述数据同步是否成功包括: 所述第一设备对本地存储的与所述 预定表对应的表中对应的记录进行计算得到所述第一设备的校验和; 所述第一设备判 断所述第二设备的校验和与所述第一设备的校验和是否相同, 如果相同, 确定数据同 步成功, 如果不相同, 则确定数据同步失败。 根据本发明实施例的另一方面, 提供了一种数据同步装置, 位于第一设备中, 包 括: 接收模块, 设置为在第一设备向第二设备进行数据同步完成后, 接收所述第二设 备发送的校验信息, 其中, 所述校验信息用于确定所述数据同步是否成功; 判断模块, 设置为至少根据所述校验信息判断所述数据同步是否成功; 同步模块, 设置为在所述 数据同步失败的情况下, 向所述第二设备进行数据同步。 优选地, 数据同步装置还包括: 启动模块, 设置为在所述第一设备和 /或所述第二 设备本地空闲的设备资源超过阈值的情况下, 启动所述数据同步装置; 或者, 设置为 接收到启动命令, 启动所述数据同步装置。 优选地, 所述设备资源包括以下至少之一: 处理器资源、 内存资源、 带宽资源、 10资源。 优选地, 所述判断模块还设置为在所述校验信息包括数据版本号的情况下, 判断 来自所述第二设备的数据版本号与所述第一设备的数据版本号是否相同, 如果相同, 则确定数据同步成功, 如果不相同, 则确定数据同步失败。 优选地, 在数据同步的是数据库数据的情况下, 所述校验信息包括: 所述第二设 备对数据库中的预定表中的部分或全部记录进行计算得到的校验和, 所述判断模块还 设置为对本地存储的与所述预定表对应的表中对应的记录进行计算得到所述第一设备 的校验和,判断所述第二设备的校验和与所述第一设备的校验和是否相同, 如果相同, 确定数据同步成功, 如果不相同, 则确定数据同步失败。 通过本发明实施例, 采用在第一设备向第二设备进行数据同步完成后, 第一设备 接收第二设备发送的校验信息, 其中, 校验信息用于确定数据同步是否成功; 第一设 备至少根据该校验信息判断数据同步是否成功; 在数据同步失败的情况下, 第一设备 向第二设备进行数据同步, 解决了设备之间同步数据出错的问题, 提高了数据同步的 可靠性。 附图说明 构成本申请的一部分的附图用来提供对本发明的进一步理解, 本发明的示意性实 施例及其说明用于解释本发明, 并不构成对本发明的不当限定。 在附图中: 图 1是根据本发明实施例的数据同步方法的流程图; 图 2是根据本发明实施例的数据同步装置的结构图; 图 3是根据本发明优选实施例的内存数据库数据检查和同步的结构图; 图 4是根据本发明优选实施例的数据检查和同步的流程图; 图 5是根据本发明优选实施例的内存数据库同步数据校验功能模块拓扑结构图; 图 6是根据本发明优选实施例的内存数据库同步数据校验交互图。 具体实施方式 需要说明的是, 在不冲突的情况下, 本申请中的实施例及实施例中的特征可以相 互组合。 下面将参考附图并结合实施例来详细说明本发明。 本实施例中提供了一种数据同步方法, 图 1是根据本发明实施例的数据同步方法 的流程图, 如图 1所示, 该方法包括如下的步骤: 步骤 S102, 在第一设备向第二设备进行数据同步完成后, 第一设备接收第二设备 发送的校验信息, 其中, 该校验信息用于确定所述数据同步是否成功; 步骤 S104, 第一设备至少根据校验信息判断数据同步是否成功; 步骤 S106, 在数据同步失败的情况下, 第一设备向第二设备进行数据同步。 通过上述步骤, 增加了根据校验信息来进行判断的机制, 从而可以使第一设备判 断出数据同步是否成功, 从而为发现同步数据出错提供了可能, 解决了设备之间同步 数据出错的问题, 提高了设备之间数据同步的可靠性。 优选的, 上述图 1中所示出的方法, 在本实施例中, 在第一设备和 /或第二设备本 地空闲的设备资源超过阈值的情况下, 可以启动数据同步方法; 或者, 可以在接收到 启动命令后, 启动数据同步方法。 例如, 在执行过程中主要涉及到的资源包括 CPU、 内存、 网口带宽以及磁盘 10, 用户可以配置这四类资源的空闲阈值, 当这四类资源空 闲率超过这四个阈值时认为系统空闲。 可以同时要求这四个资源均空闲超过阈值, 也 可以要求单个资源空闲超过阈值就可以启动上述方法。 例如, 当 CPU 资源空闲超过 50%时, 则可以启动此数据检查机制。 作为另一个优选的方式, 还可以提供用户手工 触发或配置检查时间点来启动此检查机制。 在本实施例中, 第一设备和第二设备之间检验信息可以有很多种, 例如, 在校验 信息包括数据版本号的情况下,第一设备根据该校验信息判断数据同步是否成功包括: 第一设备判断来自第二设备的数据版本号与第一设备的数据版本号是否相同, 如果相 同, 确定数据同步成功, 如果不相同, 则确定数据同步失败。 检验信息还可以包括: 第二设备对数据库中的预定表中的部分或全部记录进行计 算得到的校验和, 第一设备根据该校验信息判断所述数据同步是否成功包括: 第一设 备对本地存储的与所述预定表对应的表中对应的记录进行计算得到第一设备的校验 和; 第一设备判断第二设备的校验和与第一设备的校验和是否相同, 如果相同, 确定 数据同步成功, 如果不相同, 则确定数据同步失败。 优选的, 这些预定表可以是此次数据同步中涉及到的全部表, 也可以是数据同步 中涉及到的某些重要的表。 作为另一个较优的实施例, 在检测到数据同步失败之后, 还可以检测出是哪部分 数据同步失败了, 然后只再次同步失败的数据。 在本实施例中, 还提供了一种数据同步装置, 该菜单处理装置用于实现上述的方 法, 在上述实施例及优选实施方式中已经进行说明, 在此不再赘述。 需要说明的是, 下述装置中的模块的名称并不构成对该模块的实际限定, 例如, 接收模块可以表述为 "设置为在第一设备向第二设备进行数据同步完成后,接收所述第二设备发送的校验信 息的模块", 以下的模块均可以在处理器中实现, 例如, 接收模块可以表述为"一种处 理器, 设置为在第一设备向第二设备进行数据同步完成后, 接收所述第二设备发送的 校验信息", 或者, "一种处理器, 包括接收模块 "等。 图 2是根据本发明实施例的数据同步装置的结构图,如图 2所示,该装置 20包括: 接收模块 22, 判断模块 24和同步模块 26, 下面对该装置进行说明。 接收模块 22, 设置为在第一设备向第二设备进行数据同步完成后, 接收第二设备 发送的校验信息, 其中, 校验信息用于确定数据同步是否成功; 判断模块 24, 设置为 至少根据校验信息判断数据同步是否成功; 同步模块 26, 设置为在数据同步失败的情 况下, 向第二设备进行数据同步。 优选的, 在本实施例中, 数据同步装置还包括: 启动模块, 设置为在第一设备和 / 或第二设备本地空闲的设备资源超过阈值的情况下, 启动数据同步装置; 或者, 设置 为接收到启动命令, 启动数据同步装置。 优选的, 设备资源包括以下至少之一: 处理器资源、 内存资源、 带宽资源、 输入 输出 10资源。 优选的,判断模块 24还设置为在该校验信息包括数据版本号的情况下,判断来自 该第二设备的数据版本号与该第一设备的数据版本号是否相同, 如果相同, 则确定数 据同步成功, 如果不相同, 则确定数据同步失败。 优选的, 在数据同步的是数据库数据的情况下, 该校验信息包括: 该第二设备对 数据库中的预定表中的部分或全部记录进行计算得到的校验和, 该判断模块还设置为 对本地存储的与该预定表对应的表中对应的记录进行计算得到该第一设备的校验和, 判断该第二设备的校验和与该第一设备的校验和是否相同, 如果相同, 确定数据同步 成功, 如果不相同, 则确定数据同步失败。 在本发明实施例中, 还提供了一种数据同步设备, 包括上述实施中的数据同步装 置。 在本发明实施例中, 还提供了一种计算机存储介质, 该计算机存储介质可以存储 有执行指令, 该执行指令用于执行上述实施例中的方法。 下面结合优选实施例来对本 发明进行说明。 图 3是根据本发明优选实施例的内存数据库数据检查和同步的结构图, 如图 3所 示, 包括: 启动策略管理模块 32, 数据检查模块 34, 数据分发模块 36, 下面对各个 模块进行说明。 启动策略管理模块 32:负责确保此检查机制在系统空闲时间启动,主要包括 CPU、 内存、 网口带宽以及磁盘 10空闲阈值的配置, 这四类资源占用率的统计, 以及人工任 务触发的执行 (实现了上述启动模块的功能)。 数据检查模块 34: 负责管理待检查表的注册, 数据表记录的校验和计算, 校验和 数据的收发以及主备间、 多模块间校验和检查 (实现了上述判断模块 24的功能); 数据分发模块 36: 负责把单个表的记录分发到指定接收端, 接收端负责接收数据 并更新到内存表中, 发送端负责从表中打包数据发送到接收端 (实现了上述同步模块 26的功能)。 图 4是根据本发明优选实施例的数据检查和同步的流程图, 如图 4所示, 数据接 收端用 Rx端表示, 数据发送端用 Tx表示, 包括步骤如下: 步骤 S402,上电时 Tx端和 Rx端分别把所有需要做定时校验的表注册到校验管理 模块; 步骤 S404, Tx端定时执行启动策略的判断, 并通知 Rx端做启动策略的判断, 当 符合策略或者用户手工触发启动时, 发消息到 Rx端, 启动此数据检查机制; 步骤 S406, Rx端把本机的数据库数据版本号发往 Tx端; 步骤 S408, Tx端收到 Rx端发来的数据版本号, 与本机的数据版本号比较, 如果 版本号不一致, 则触发数据常规同步流程进行数据同步, 如果版本号一致, 则发给 Rx 端开始进行数据检查的消息; 步骤 S410, Tx端遍历所有已注册的表, 对每个表的记录做校验和计算, 并存储 在表记录校验数据区; 步骤 S412, Rx端收到 Tx端发来的进行数据检查的消息,开始遍历所有已注册表, 对每个表的记录做校验和计算, 并把表以及校验和信息发往 Tx端; 步骤 S414, Tx端收到 Rx端发来的校验和信息与表记录校验区数据比较, 如果一 致结束本次检查, 如果不一致则将表逐个打包发往 Rx端; 步骤 S416, Rx端收到 Tx端发来的表记录数据和校验和信息, 进行数据校验, 如 果一致, 则更新到内存表中, 并通知 Tx端继续下一个表的发送; 如果不一致则通知 Tx端重发该表; 步骤 S418, Tx端发完所有不一致的表记录后通知 Rx端本次检查结束, 结束本次 检查流程。 图 5是根据本发明优选实施例的内存数据库同步数据校验功能模块拓扑结构图, 如图 5所示, 启动策略管理用于确保在系统资源空闲的情况下启动该数据检查机制; 数据检查模块设置为检查数据发送端和数据接收端相关数据表记录内存数据是否一 致, 对于不一致的数据, 通过数据分发模块进行分发, 确保数据的正确性。 图 6是根据本发明优选实施例的内存数据库同步数据校验交互图, 如图 6所示, 包括如下步骤: 步骤 S602, 注册待检查的表, 主要注册变化不大的配置表, 这类表长期不变, 如 果出现错误不易发现; 步骤 S604, 当用户触发启动检查机制或者当前系统资源符合空闲的策略, 则启动 此检查机制; 步骤 S606, 接收端请求校验数据版本号, 如果版本号不一致则说明数据发生了变 化, 触发常规同步流程进行数据同步; 如果数据版本号一致, 则说明目前接收端和发 送端的数据应该是一致的, 此时做表记录校验; 步骤 S608, 如果校验数据是一致的则结束本次检查, 如果不一致, 则把不一致的 表记录发送到接收端, 发送表记录时带上该表的校验和数据用于接收端校验。 步骤 S610, 接收端收到记录后进行数据校验, 校验不通过则通知发送端重发, 校 验通过则把该记录更新到表内存中。 本优选实施例提供了一种利用主备和多模块间内存块定期做校验和检查的机制来 确保数据的正确性。 在系统资源比较空闲的情况下利用校验和机制对数据库内存进行 检查: 由于内存数据库为了快速响应数据访问, 把所有记录都存放在内存中, 而且这 些数据集中存放在一个连续的内存数据区域中, 每个表的记录也是连续存放。 每个表 的记录做校验和检查, 在主备和多模块间数据同步完成的情况下, 备机和其它模块定 时发送校验和数据到 1号模块主用侧, 主用侧判断接收端的校验和与本机表记录校验 和是否一致, 如果不一致则触发数据向指定接收端同步。 本优选实施例是一种内存数据库同步的保护机制, 因为有资源空闲检查策略和用 户手工触发的机制, 在不影响业务且合理利用系统资源的情况下保证了内存数据库数 据的正确性和可靠性。 显然, 本领域的技术人员应该明白, 上述的本发明实施例的各模块或各步骤可以 用通用的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布在多个计算 装置所组成的网络上, 可选地, 它们可以用计算装置可执行的程序代码来实现, 从而, 可以将它们存储在存储装置中由计算装置来执行, 或者将它们分别制作成各个集成电 路模块, 或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。 这样, 本 发明实施例不限制于任何特定的硬件和软件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领域的技 术人员来说, 本发明可以有各种更改和变化。 凡在本发明的精神和原则之内, 所作的 任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。 工业实用性: 本发明涉及数据通信领域, 提供了一种数据同步方法及装置, 解决了设备之间同 步数据出错的问题, 提高了数据同步的可靠性。 TECHNICAL FIELD The present invention relates to the field of communications, and in particular to a data synchronization method, apparatus, device, and computer storage medium. BACKGROUND OF THE INVENTION Synchronization technology of an existing in-memory database uses a change table and a change record synchronization method in a master-slave mode and a multi-module (when a plurality of modules are distributed as reference data to other modules), when a table and a record occur. When changing, these changes are packaged and sent to the standby or other modules. These synchronization mechanisms only trigger data synchronization when the data changes. The judgment mechanism of the data change is whether the table records are modified. If there is no data modification, Data synchronization will be triggered. Due to the complex network environment, the data between the active and standby modules and the multi-module are cross-board messages. The message is inevitably lost or abnormal at the receiving end during the synchronization process. Especially after the synchronization is completed, the memory in the area where the recording is stored at the receiving end is stepped on. In this case, this situation is generally difficult to find. At this time, if the No. 1 module data is not modified, it will not trigger data synchronization. In this case, the data of the standby machine and other modules will be wrong. If an active/standby switchover occurs in this situation, an unknown disaster occurs in the system. In view of the problem of synchronization data error between devices in the related art, an effective solution has not been proposed yet. SUMMARY OF THE INVENTION Embodiments of the present invention provide a data synchronization method, apparatus, device, and computer storage medium to solve at least the problem of synchronization data errors between devices. According to an aspect of the present invention, a data synchronization method is provided, including: after the first device performs data synchronization with the second device, the first device receives the verification information sent by the second device, The verification information is used to determine whether the data synchronization is successful; the first device determines, according to the verification information, whether the data synchronization is successful; in the case that the data synchronization fails, the A device performs data synchronization with the second device. Preferably, the data synchronization method is started if the first device and/or the device resource that is idle locally of the second device exceeds a threshold; or the startup command is received, and the data synchronization method is started. Preferably, the device comprises at least one of the following: a processor resource, a memory resource, a bandwidth resource, and 10 resources. Preferably, in the case that the verification information includes a data version number, determining, by the first device, whether the data synchronization is successful according to the verification information comprises: the first device determining, from the second device Whether the data version number is the same as the data version number of the first device. If they are the same, it is determined that the data synchronization is successful. If not, the data synchronization failure is determined. Preferably, in the case that the data is synchronized with the database data, the verification information includes: a checksum calculated by the second device to calculate some or all of the records in the predetermined table in the database, the first Determining, by the device, whether the data synchronization is successful according to the verification information, the first device calculating a record corresponding to the locally stored table corresponding to the predetermined table to obtain a checksum of the first device; The first device determines whether the checksum of the second device is the same as the checksum of the first device. If they are the same, it is determined that the data synchronization is successful. If not, the data synchronization is determined to be unsuccessful. According to another aspect of the present invention, a data synchronization device is provided, which is located in a first device, and includes: a receiving module, configured to receive the second after the first device performs data synchronization to the second device The verification information sent by the device, where the verification information is used to determine whether the data synchronization is successful; the determining module is configured to determine, according to the verification information, whether the data synchronization is successful; the synchronization module is set to be In the case that the data synchronization fails, data synchronization is performed to the second device. Preferably, the data synchronization device further includes: a startup module, configured to start the data synchronization device if the device resource that is idle locally by the first device and/or the second device exceeds a threshold; or, set to Upon receiving the start command, the data synchronization device is activated. Preferably, the device resource includes at least one of the following: a processor resource, a memory resource, a bandwidth resource, and 10 resources. Preferably, the determining module is further configured to: if the verification information includes a data version number, determine whether the data version number from the second device is the same as the data version number of the first device, if the same , it is determined that the data synchronization is successful, if not the same, it is determined that the data synchronization fails. Preferably, in the case that the data is synchronized with the database data, the verification information includes: a checksum calculated by the second device to calculate some or all of the records in the predetermined table in the database, and the determining module And determining, by calculating a corresponding record in the table corresponding to the predetermined table that is locally stored, obtaining a checksum of the first device, determining a checksum of the second device, and a calibration of the first device If the checksums are the same, if they are the same, it is determined that the data synchronization is successful. If they are not the same, it is determined that the data synchronization fails. According to the embodiment of the present invention, after the data synchronization of the first device to the second device is completed, the first device receives the verification information sent by the second device, where the verification information is used to determine whether the data synchronization is successful; Determining whether the data synchronization is successful according to the verification information. In the case that the data synchronization fails, the first device performs data synchronization with the second device, which solves the problem of synchronization data error between the devices, and improves the reliability of data synchronization. BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings, which are incorporated in FIG. In the drawings: FIG. 1 is a flow chart of a data synchronization method according to an embodiment of the present invention; FIG. 2 is a structural diagram of a data synchronization apparatus according to an embodiment of the present invention; FIG. 3 is an in-memory database data according to a preferred embodiment of the present invention. FIG. 4 is a flow chart of data checking and synchronization according to a preferred embodiment of the present invention; FIG. 5 is a topological structural view of an in-memory database synchronous data verifying function module according to a preferred embodiment of the present invention; An in-memory database synchronization data verification interaction diagram in accordance with a preferred embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict. The invention will be described in detail below with reference to the drawings in conjunction with the embodiments. In this embodiment, a data synchronization method is provided. FIG. 1 is a flowchart of a data synchronization method according to an embodiment of the present invention. As shown in FIG. 1, the method includes the following steps: Step S102, in a first device After the second device performs data synchronization, the first device receives the verification information sent by the second device, where the verification information is used to determine whether the data synchronization is successful. Step S104: The first device determines the data according to at least the verification information. Whether the synchronization is successful; Step S106: In the case that the data synchronization fails, the first device performs data synchronization with the second device. Through the above steps, a mechanism for determining according to the verification information is added, so that the first device can determine whether the data synchronization is successful, thereby providing a possibility for finding synchronization data errors, and solving the problem of synchronization data errors between devices. Improves the reliability of data synchronization between devices. Preferably, in the foregoing method, in the embodiment, in a case where the device resource that is idle locally of the first device and/or the second device exceeds a threshold, the data synchronization method may be started; or After receiving the start command, start the data synchronization method. For example, the resources involved in the execution process include CPU, memory, network port bandwidth, and disk 10. The user can configure the idle thresholds of the four types of resources. When the four types of resource idle rates exceed the four thresholds, the system is considered idle. . The four resources can be required to idle more than the threshold at the same time, or the single resource can be idle to exceed the threshold to start the above method. For example, when the CPU resource is idle more than 50%, this data checking mechanism can be started. As another preferred manner, it is also possible to provide a user to manually trigger or configure a check point in time to initiate this check mechanism. In this embodiment, the verification information between the first device and the second device may be various. For example, if the verification information includes the data version number, the first device determines, according to the verification information, whether the data synchronization is successful. The first device determines whether the data version number from the second device is the same as the data version number of the first device. If they are the same, it is determined that the data synchronization is successful. If not, the data synchronization failure is determined. The verification information may further include: a checksum calculated by the second device on a part or all of the records in the predetermined table in the database, and determining, by the first device, whether the data synchronization is successful according to the verification information, the first device pair The locally stored record corresponding to the predetermined table is calculated to obtain a checksum of the first device; the first device determines whether the checksum of the second device is the same as the checksum of the first device, if the same , to determine the data synchronization success, if not the same, then determine the data synchronization failed. Preferably, these predetermined tables may be all the tables involved in the data synchronization, or some important tables involved in the data synchronization. As another preferred embodiment, after detecting the data synchronization failure, it is also possible to detect which part of the data synchronization has failed, and then only synchronize the failed data again. In this embodiment, a data synchronization device is also provided, and the menu processing device is used to implement the foregoing method. It has been described in the above embodiments and preferred embodiments, and details are not described herein again. It should be noted that the name of the module in the following device does not constitute a practical limitation of the module. For example, the receiving module may be expressed as: “set to receive the data after the first device performs data synchronization with the second device. The module of the verification information sent by the second device, the following modules may be implemented in the processor, for example, the receiving module may be expressed as "a processor, configured to perform data synchronization on the first device to the second device. After receiving the verification information sent by the second device, or "a processor, including a receiving module" or the like. 2 is a block diagram of a data synchronizing apparatus according to an embodiment of the present invention. As shown in FIG. 2, the apparatus 20 includes: a receiving module 22, a judging module 24, and a synchronizing module 26. The apparatus will be described below. The receiving module 22 is configured to receive, after the first device performs data synchronization with the second device, the verification information sent by the second device, where the verification information is used to determine whether the data synchronization is successful; the determining module 24 is configured to be at least Determining whether the data synchronization is successful according to the verification information; the synchronization module 26 is configured to perform data synchronization to the second device in the case that the data synchronization fails. Preferably, in this embodiment, the data synchronization device further includes: a startup module, configured to start the data synchronization device if the device resource that is idle locally of the first device and/or the second device exceeds a threshold; or, set to Upon receiving the start command, the data synchronization device is started. Preferably, the device resource includes at least one of the following: a processor resource, a memory resource, a bandwidth resource, and an input/output 10 resource. Preferably, the determining module 24 is further configured to: if the verification information includes the data version number, determine whether the data version number from the second device is the same as the data version number of the first device, and if the same, determine the data. The synchronization is successful. If it is not the same, it determines that the data synchronization failed. Preferably, in the case that the data is synchronized with the database data, the verification information includes: a checksum calculated by the second device to calculate some or all of the records in the predetermined table in the database, and the determining module is further configured to Calculating a checksum of the first device in the locally stored record corresponding to the predetermined table, and determining whether the checksum of the second device is the same as the checksum of the first device, if the same , to determine the data synchronization success, if not the same, then determine the data synchronization failed. In the embodiment of the present invention, a data synchronization device is further provided, including the data synchronization device in the above implementation. In the embodiment of the present invention, a computer storage medium is further provided, and the computer storage medium may store an execution instruction for executing the method in the foregoing embodiment. The invention will now be described in connection with preferred embodiments. 3 is a structural diagram of in-memory database data check and synchronization according to a preferred embodiment of the present invention. As shown in FIG. 3, the method includes: a startup policy management module 32, a data inspection module 34, and a data distribution module 36. Description. The startup policy management module 32 is responsible for ensuring that the inspection mechanism is started during the system idle time, mainly including the configuration of the CPU, the memory, the network port bandwidth, and the disk 10 idle threshold, the statistics of the four types of resource occupancy, and the execution of the human task trigger ( The function of the above startup module is implemented). The data checking module 34 is responsible for managing the registration of the table to be checked, the checksum calculation of the data table record, the sending and receiving of the checksum data, and the check and check between the master and the backup, and the inter-module (implementing the function of the above-mentioned judging module 24) The data distribution module 36 is responsible for distributing the records of the single table to the designated receiving end, the receiving end is responsible for receiving the data and updating to the memory table, and the sending end is responsible for transmitting the packed data from the table to the receiving end (the synchronization module 26 is implemented). Features). 4 is a flow chart of data checking and synchronization according to a preferred embodiment of the present invention. As shown in FIG. 4, the data receiving end is represented by the Rx end, and the data transmitting end is represented by Tx, and the steps are as follows: Step S402, Tx at power-on The terminal and the Rx end respectively register all the tables that need to be periodically verified to the verification management module. Step S404, the Tx terminal periodically performs the judgment of the startup policy, and notifies the Rx terminal to make the determination of the startup policy, when the policy is met or the user manually triggers When starting, sending a message to the Rx end, starting the data checking mechanism; Step S406, the Rx end sends the database data version number of the local machine to the Tx end; Step S408, the Tx end receives the data version number sent by the Rx end, and The data version number of the local device is compared. If the version numbers are inconsistent, the data normal synchronization process is triggered to perform data synchronization. If the version numbers are the same, the message is sent to the Rx end to start the data check. Step S410, the Tx end traverses all the registered data. a checksum calculation is performed on the records of each table, and stored in the table record check data area; in step S412, the Rx end receives the data sent from the Tx end. Check the message, start traversing all the registry, perform checksum calculation on each table record, and send the table and checksum information to the Tx end; Step S414, the Tx end receives the check sent by the Rx end And the information and the table record check area data comparison, if the check is consistently ended, if the inconsistency, the table is packaged one by one to the Rx end; Step S416, the Rx end receives the table record data and checksum information sent by the Tx end , perform data verification, if they are consistent, update to the memory table, and notify the Tx end to continue the transmission of the next table; if not, notify the Tx end to resend the table; In step S418, after the Tx end sends all the inconsistent table records, the Rx end is notified to end the check, and the current check process is ended. 5 is a topological structural diagram of an in-memory database synchronization data verification function module according to a preferred embodiment of the present invention. As shown in FIG. 5, startup policy management is used to ensure that the data inspection mechanism is started when system resources are idle; It is set to check whether the data data of the data sender and the data receiver records the memory data. For the inconsistent data, it is distributed through the data distribution module to ensure the correctness of the data. FIG. 6 is a diagram showing an in-memory database synchronization data verification interaction diagram according to a preferred embodiment of the present invention. As shown in FIG. 6, the method includes the following steps: Step S602: Registering a table to be inspected, a configuration table whose main registration changes little, such a table If the user triggers the startup check mechanism or the current system resource meets the idle policy, the check mechanism is started. Step S606, the receiver requests the verification data version number, if the version number is inconsistent. It indicates that the data has changed, triggering the regular synchronization process for data synchronization; if the data version numbers are the same, it indicates that the data of the receiving end and the transmitting end should be consistent, and the table record verification is performed; Step S608, if the data is verified If the agreement is the same, the current check is ended. If the check is inconsistent, the inconsistent table record is sent to the receiving end, and the check list data of the table is sent for the receiving end check when the table record is sent. Step S610: After receiving the record, the receiving end performs data verification, and if the verification fails, the transmitting end is notified to resend, and when the verification is passed, the record is updated into the table memory. The preferred embodiment provides a mechanism for periodically performing checksum checking using memory blocks between the active and standby modules to ensure the correctness of the data. The checksum mechanism is used to check the database memory when the system resources are relatively idle: Since the in-memory database responds to data access quickly, all the records are stored in the memory, and the data is stored in a continuous memory data area. , the records of each table are also stored continuously. The records of each table are checked and checked. In the case that the data synchronization between the active and standby modules is completed, the standby machine and other modules periodically send the checksum data to the main side of module No. 1, and the main side judges the receiving end. Checksum is consistent with the checksum of the local table record. If they are inconsistent, the trigger data is synchronized to the specified receiver. The preferred embodiment is a protection mechanism for in-memory database synchronization, because the resource idle check policy and the user manually trigger the mechanism to ensure the correctness and reliability of the in-memory database data without affecting the service and rationally utilizing the system resources. . Obviously, those skilled in the art should understand that the above modules or steps of the embodiments of the present invention can be implemented by a general computing device, which can be concentrated on a single computing device or distributed in multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device, or they may be separately fabricated into individual integrated circuit modules, or Multiple of these modules or steps are fabricated as a single integrated circuit module. Thus, embodiments of the invention are not limited to any specific combination of hardware and software. The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention. Industrial Applicability: The present invention relates to the field of data communication, and provides a data synchronization method and device, which solves the problem of synchronization data error between devices and improves the reliability of data synchronization.

Claims

权 利 要 求 书 Claim
1. 一种数据同步方法, 包括: 在第一设备向第二设备进行数据同步完成后, 所述第一设备接收所述第二 设备发送的校验信息, 其中, 所述校验信息用于确定所述数据同步是否成功; 所述第一设备至少根据所述校验信息判断所述数据同步是否成功; 在所述数据同步失败的情况下, 所述第一设备向所述第二设备进行数据同 少。 A data synchronization method, comprising: after the first device performs data synchronization with the second device, the first device receives the verification information sent by the second device, where the verification information is used for Determining whether the data synchronization is successful; the first device determining, according to the verification information, whether the data synchronization is successful; in the case that the data synchronization fails, the first device performs the second device The data is the same.
2. 根据权利要求 1所述的方法, 其中, 2. The method according to claim 1, wherein
在所述第一设备和 /或所述第二设备本地空闲的设备资源超过阈值的情况 下, 启动所述数据同步方法; 或者,  Initiating the data synchronization method if the first device and/or the second device's locally idle device resource exceeds a threshold; or
接收到启动命令, 启动所述数据同步方法。  The data synchronization method is initiated by receiving a startup command.
3. 根据权利要求 2所述的方法, 其中, 所述设备包括以下至少之一: 处理器资源、 内存资源、 带宽资源、 10资源。 The method according to claim 2, wherein the device comprises at least one of the following: a processor resource, a memory resource, a bandwidth resource, and 10 resources.
4. 根据权利要求 1至 3中任一项所述的方法, 其中, 在所述校验信息包括数据版本号的情况下, 所述第一设备根据所述校验信 息判断所述数据同步是否成功包括: The method according to any one of claims 1 to 3, wherein, in a case where the verification information includes a data version number, the first device determines, according to the verification information, whether the data synchronization is Success includes:
所述第一设备判断来自所述第二设备的数据版本号与所述第一设备的数据 版本号是否相同, 如果相同, 则确定数据同步成功, 如果不相同, 则确定数据 同步失败。  The first device determines whether the data version number from the second device is the same as the data version number of the first device. If they are the same, it determines that the data synchronization is successful. If not, it determines that the data synchronization fails.
5. 根据权利要求 1至 3中任一项所述的方法, 其中, 在数据同步的是数据库数据的情况下, 所述校验信息包括: 所述第二设备 对数据库中的预定表中的部分或全部记录进行计算得到的校验和, 所述第一设 备根据所述校验信息判断所述数据同步是否成功包括: 所述第一设备对本地存储的与所述预定表对应的表中对应的记录进行计算 得到所述第一设备的校验和; 所述第一设备判断所述第二设备的校验和与所述第一设备的校验和是否相 同, 如果相同, 确定数据同步成功, 如果不相同, 则确定数据同步失败。 The method according to any one of claims 1 to 3, wherein, in the case that the data is synchronized with the database data, the verification information comprises: the second device in the predetermined table in the database And determining, by the first device, whether the data synchronization is successful according to the verification information, where the first device records the locally stored table corresponding to the predetermined table. Calculating a checksum of the first device by using a corresponding record; determining, by the first device, whether a checksum of the second device is the same as a checksum of the first device, and if the same, determining data synchronization Success, if not the same, then determine that the data synchronization failed.
6. 一种数据同步装置, 包括: 接收模块, 设置为在第一设备向第二设备进行数据同步完成后, 接收所述 第二设备发送的校验信息, 其中, 所述校验信息用于确定所述数据同步是否成 功; A data synchronization device, comprising: a receiving module, configured to: after the first device performs data synchronization to the second device, receive verification information sent by the second device, where the verification information is used Determining whether the data synchronization is successful;
判断模块, 设置为至少根据所述校验信息判断所述数据同步是否成功; 同步模块, 设置为在所述数据同步失败的情况下, 向所述第二设备进行数 据同步。  The determining module is configured to determine whether the data synchronization is successful according to at least the verification information; and the synchronization module is configured to perform data synchronization to the second device if the data synchronization fails.
7. 根据权利要求 6所述的装置, 其中, 还包括: 启动模块,设置为在所述第一设备和 /或所述第二设备本地空闲的设备资源 超过阈值的情况下, 启动所述数据同步装置; 或者, 设置为接收到启动命令, 启动所述数据同步装置。 The device according to claim 6, further comprising: a startup module, configured to start the data if a device resource that is locally idle by the first device and/or the second device exceeds a threshold The synchronization device; or, configured to receive the startup command, to activate the data synchronization device.
8. 根据权利要求 7所述的装置, 其中, 所述设备资源包括以下至少之一: 处理器 资源、 内存资源、 带宽资源、 输入输出 10资源。 The device according to claim 7, wherein the device resource comprises at least one of the following: a processor resource, a memory resource, a bandwidth resource, and an input/output 10 resource.
9. 根据权利要求 6至 8中任一项所述的装置, 其中, 所述判断模块还设置为在所述校验信息包括数据版本号的情况下, 判断来 自所述第二设备的数据版本号与所述第一设备的数据版本号是否相同, 如果相 同, 则确定数据同步成功, 如果不相同, 则确定数据同步失败。 The device according to any one of claims 6 to 8, wherein the determining module is further configured to determine a data version from the second device if the verification information includes a data version number Whether the number is the same as the data version number of the first device. If they are the same, it is determined that the data synchronization is successful. If not, it is determined that the data synchronization fails.
10. 根据权利要求 6至 8中任一项所述的装置, 其中, 在数据同步的是数据库数据的情况下, 所述校验信息包括: 所述第二设备 对数据库中的预定表中的部分或全部记录进行计算得到的校验和, 所述判断模 块还设置为对本地存储的与所述预定表对应的表中对应的记录进行计算得到所 述第一设备的校验和, 判断所述第二设备的校验和与所述第一设备的校验和是 否相同, 如果相同, 在确定数据同步成功, 如果不相同, 则确定数据同步失败。 The apparatus according to any one of claims 6 to 8, wherein, in the case that the data is synchronized with the database data, the verification information comprises: the second device in the predetermined table in the database The checksum is calculated by the calculation, and the determining module is further configured to calculate, according to the locally stored record corresponding to the predetermined table, a checksum of the first device, and determine the Whether the checksum of the second device is the same as the checksum of the first device. If they are the same, it is determined that the data synchronization is successful. If not, the data synchronization is determined to be unsuccessful.
11. 一种数据同步设备, 包括权利要求 6至 10中任一项所述的装置。 A data synchronization device comprising the apparatus of any one of claims 6 to 10.
12. 一种计算机存储介质, 所述计算机存储介质存储有执行指令, 所述执行指令用 于执行权利要求 1至 5中任一项所述的方法。 A computer storage medium storing an execution instruction for performing the method of any one of claims 1 to 5.
PCT/CN2014/073628 2013-08-21 2014-03-18 Data synchronization method, apparatus and device, and computer storage medium WO2015024377A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310367360.0A CN104426923A (en) 2013-08-21 2013-08-21 Data synchronization method and apparatus
CN201310367360.0 2013-08-21

Publications (1)

Publication Number Publication Date
WO2015024377A1 true WO2015024377A1 (en) 2015-02-26

Family

ID=52483020

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/073628 WO2015024377A1 (en) 2013-08-21 2014-03-18 Data synchronization method, apparatus and device, and computer storage medium

Country Status (2)

Country Link
CN (1) CN104426923A (en)
WO (1) WO2015024377A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112019610B (en) * 2020-08-21 2023-05-02 广东德圳智能技术有限公司 Cloud edge cooperation method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1818881A (en) * 2006-03-10 2006-08-16 四川大学 Fault controlling method in long-distance data backup
CN1866961A (en) * 2006-03-13 2006-11-22 华为技术有限公司 Client system and service system data synchronizing method and system
CN101984717A (en) * 2010-11-19 2011-03-09 中兴通讯股份有限公司 Data synchronization method, mobile terminal and data synchronization system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7496607B2 (en) * 2003-08-29 2009-02-24 Yahoo! Inc. Method and system for maintaining synchronization between a local data cache and a data store
CN1816039A (en) * 2005-02-01 2006-08-09 华为技术有限公司 Method for checking data coherence and data synchronization, and distribution type system
CN101193001A (en) * 2006-11-23 2008-06-04 中兴通讯股份有限公司 Method for judging the master/slave computer consistent via static data or dynamic data
CN101582920B (en) * 2009-06-09 2012-09-05 中兴通讯股份有限公司 Method and device for verifying and synchronizing data blocks in distributed file system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1818881A (en) * 2006-03-10 2006-08-16 四川大学 Fault controlling method in long-distance data backup
CN1866961A (en) * 2006-03-13 2006-11-22 华为技术有限公司 Client system and service system data synchronizing method and system
CN101984717A (en) * 2010-11-19 2011-03-09 中兴通讯股份有限公司 Data synchronization method, mobile terminal and data synchronization system

Also Published As

Publication number Publication date
CN104426923A (en) 2015-03-18

Similar Documents

Publication Publication Date Title
CN107087033B (en) Message pushing method and device, storage medium and computer equipment
WO2017124938A1 (en) Method, device, and system for data synchronization
WO2016192408A1 (en) Fault detection method and apparatus for node in cluster system
US20140032173A1 (en) Information processing apparatus, and monitoring method
TW201944236A (en) Task processing method, apparatus, and system
US11330071B2 (en) Inter-process communication fault detection and recovery system
US9608753B2 (en) Time synchronization system, management node, and time synchronization method
US20130139178A1 (en) Cluster management system and method
WO2022142153A1 (en) Electricity meter upgrading method and system, smart meter, and storage medium
TWI429232B (en) Backup server, system and method for recovering client devices register at primary server
KR101028298B1 (en) Method and system for distributing data processing units in a communication network
WO2015070564A1 (en) Service guide synchronization method and system
KR20160042933A (en) Managing data feeds
CN110351122B (en) Disaster recovery method, device, system and electronic equipment
WO2015024377A1 (en) Data synchronization method, apparatus and device, and computer storage medium
US10101987B2 (en) Method and system of processing an image upgrade
CN111371598A (en) Configuration method and system
CN116010174A (en) Method and device for switching servers, storage medium and electronic device
CN111327447A (en) Distributed system, arbitration method, node device and storage medium
WO2014169547A1 (en) Method and apparatus for processing operation on endpoint peripheral
US20120191645A1 (en) Information processing apparatus and database system
JP2006285453A (en) Information processor, information processing method, and information processing program
WO2020037607A1 (en) Data transmission method and apparatus
CN113596195A (en) Public IP address management method, device, main node and storage medium
CN113821334A (en) Method, device and system for configuring edge side equipment

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

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

Country of ref document: EP

Kind code of ref document: A1