Detection system and method

By designing detection modules and control modules in the database real-time synchronization system, we ensure that data synchronization is not interrupted during detection, and the synchronization progress problem caused by the detection system in the existing technology needs to be detected offline, realizing the stability of data synchronization .

CN118069668BActive Publication Date: 2024-11-12BEIJING NATURAL NUMBER TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410178408.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-09
Publication Date
2024-11-12
Estimated Expiration
2044-02-09

AI Technical Summary

Technical Problem

The existing synchronization system data consistency detection system needs to be detected after offline, resulting in the synchronization progress of the source database and the target database being disrupted, and the source database data cannot be synchronized to the target database after changes.

Method used

A detection system is designed, including source database, target database, detection module, control module and data synchronization mechanism. By collecting data at the same time during detection for comparison, the data synchronization mechanism is controlled to ensure the continuity of data transmission. And restore data synchronization after detection is completed.

Benefits of technology

It realizes the data synchronization without interrupting during detection, avoiding the problem of inability to synchronize to the target database after the source database data changes, and maintaining the stability of the data synchronization progress.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118069668B_ABST
    Figure CN118069668B_ABST
Patent Text Reader

Abstract

The present invention provides a detection system and method. The detection system includes: a source database, a target database, a detection module, a control module and a data synchronization mechanism; the data synchronization mechanism is used to synchronize the data in the source database to the target database; the detection module is used to detect whether the data in the source database and the target database are consistent at the same time; the control module is used to control the operation of the data synchronization mechanism when the detection module detects. This achieves the purpose of avoiding the situation that the data in the source database cannot be synchronized to the target database after the data changes during the detection, so that the data synchronization progress is in a stable state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of database technology, and in particular relates to a detection system and method. Background Technology

[0002] With the rapid development of information technology, information systems have become crucial for enterprises to maintain business operations. Enterprises urgently need to improve the availability of their information systems to ensure business continuity and minimize losses caused by disasters or failures. On the other hand, diversified business types have led to increasingly complex data access needs, and the rapid increase in data volume has overwhelmed database servers. Enterprises also urgently need to improve the operational efficiency of their information systems. Real-time database synchronization systems, based on mature relational data models and standard interfaces, can achieve second-level real-time data synchronization with minimal system overhead. They can be widely used in emergency systems, disaster recovery backups, load balancing, data migration, online maintenance, and multi-business centers. Database synchronization requires checking the consistency of data between the source and target databases—a data consistency check—that is, whether the data in the tables on both sides is consistent. Because the data in the source database is constantly changing during the real-time synchronization process, the data in the target database is constantly being updated. However, due to network latency and other factors, the data in the target database may lag behind the data in the source database.

[0003] Existing synchronization system data consistency detection systems require offline testing, preventing data from being transmitted and processed again. This not only disrupts the synchronization progress between the source and target databases but also makes it impossible to synchronize changes in the source database to the target database. Summary of the Invention

[0004] To address the problems existing in the prior art, the present invention provides a detection system and method that at least partially solves the problem that existing synchronous system data consistency detection systems require offline detection, thus preventing data from being transmitted and processed again, which disrupts the synchronization progress of the source database and the target database, and makes it impossible to synchronize the source database data to the target database after changes.

[0005] In a first aspect, embodiments of this disclosure provide a detection system for detecting data consistency in a real-time database synchronization system, comprising: a source database, a target database, a detection module, a control module, and a data synchronization mechanism. The output of the source database is signal-connected to the input of the data synchronization mechanism, the output of the data synchronization mechanism is signal-connected to the input of the target database, the output of the target database is signal-connected to the input of the detection module, the output of the detection module is signal-connected to the input of the control module, and the output of the control module is signal-connected to the input of the data synchronization mechanism.

[0006] The data synchronization mechanism is used to synchronize data in the source database to the target database;

[0007] The detection module is used to detect whether the data in the source database and the target database are consistent at the same time.

[0008] The control module is used to control the operation of the data synchronization mechanism when the detection module is performing detection.

[0009] Optionally, the detection module includes a first acquisition module, a second acquisition module, and a data comparison module. The first acquisition module and the second acquisition module are used to acquire real-time data from the source database and the target database, respectively. The input terminal of the data comparison module is connected to the output terminal signals of the first acquisition module and the second acquisition module, respectively. The data comparison module is used to compare the real-time data acquired by the first acquisition module and the second acquisition module.

[0010] Optionally, the data synchronization mechanism includes an execution unit, a pre-storage unit, and a data synchronization unit.

[0011] The execution unit is used to receive instructions from the control module and perform execution operations;

[0012] The pre-storage unit is used to receive data transmitted from the source database;

[0013] The data synchronization unit is used to synchronize data in the source database to the target database.

[0014] Optionally, the output of the pre-storage unit is connected to the input of the data synchronization unit. The pre-storage unit may handle the following two scenarios when checking the consistency of the database system data:

[0015] When no database data consistency check is performed, the data synchronization mechanism receives data transmitted from the source database and passes it through the pre-storage unit. At this time, the pre-storage unit does not perform storage work and directly transmits the data to the data synchronization unit, which then synchronizes the data to the target database.

[0016] When database data consistency testing is performed, the signal connection between the pre-storage unit and the data synchronization unit is interrupted, and the pre-storage unit and the data synchronization unit work independently. That is, there is no data transmission between the pre-storage unit and the data synchronization unit when database data consistency testing is performed.

[0017] Secondly, this disclosure also provides a detection method for detecting data consistency in a real-time database synchronization system, including:

[0018] When performing database data consistency testing, the testing module collects data from the source database and the target database at the collection time points, respectively, to obtain the first source database collection data and the first target database collection data.

[0019] When performing database data consistency testing, the data synchronization agency synchronizes the data that has been transmitted from the source database before the collection time point to the target database;

[0020] The detection module collects data from the synchronized target database again to obtain data from the second target database.

[0021] The detection module compares the data collected from the first source database with the data collected from the second target database to complete the data consistency detection of the synchronization system.

[0022] Optionally, during the database data consistency check, the detection module collects data from the source database and the target database at the data collection time points, including:

[0023] The detection module sends a detection command to the first acquisition module and the second acquisition module. The first acquisition module and the second acquisition module respectively collect real-time data from the source database and the target database. The first acquisition module and the second acquisition module respectively collect data at the acquisition time points in the source database and the target database. When the detection module issues a stop command, the first acquisition module, the second acquisition module and the data synchronization mechanism operate simultaneously, causing the real-time data synchronization between the source database and the target database to be interrupted when the first acquisition module and the second acquisition module collect data. This ensures that after the acquisition time point is collected, the data in the source database will not continue to be transmitted to the target database. Then, the first acquisition module and the second acquisition module transmit the data at the acquisition time point to the data comparison module.

[0024] Optionally, during database data consistency testing, the data synchronization mechanism synchronizes the data transmitted from the source database before the data collection time point to the target database, including:

[0025] The control module sends a stop command to the data synchronization mechanism. The execution unit within the data synchronization mechanism then interrupts the signal connection between the pre-storage unit and the data synchronization unit. The pre-storage unit receives data transmitted from the source database, ensuring that data transmission continues uninterrupted even after changes occur in the source database. At this point, the pre-storage unit stores the data but does not transmit it to the data synchronization unit. This prevents data changes in the source database after the first acquisition module's acquisition time from being transmitted to the target database. The data synchronization unit then synchronizes the data that the first acquisition module had already sent from the source database before the acquisition time to the target database.

[0026] Optionally, the detection module compares the data collected from the first source database and the data collected from the second target database, including:

[0027] When the data collected by the first acquisition module is greater than the data collected by the second acquisition module, wait for a set time, and then the second acquisition module will collect data from the target database again.

[0028] When the data collected by the first acquisition module is consistent with the data collected by the second acquisition module, the data comparison module directly generates a comparison log.

[0029] When the data collected by the first acquisition module is less than the data collected by the second acquisition module, reconstruction detection is performed.

[0030] Optionally, when the data collected by the first acquisition module is less than the data collected by the second acquisition module, reconstruction detection is performed, including:

[0031] The pre-storage unit is connected to the data synchronization unit. The data synchronization unit will prioritize synchronizing the data stored in the pre-storage unit to the target database. When there are no stored files in the target database, the data synchronization unit will synchronize the data in the source database to the target database. At this time, the detection module will reissue the instruction and re-detect.

[0032] Optionally, after the detection module compares the data collected from the first source database and the data collected from the second target database to complete the data consistency detection step of the synchronization system, the following steps are also included:

[0033] While generating the comparison log, the data comparison module sends a completion command to the control module. The completion command is sent to the execution unit in the data synchronization mechanism. The execution unit does not disconnect the signal connection between the pre-storage unit and the data synchronization unit, so that the pre-storage unit and the data synchronization unit can operate normally. The data synchronization unit will prioritize synchronizing the data stored in the pre-storage unit to the target database. Then, the data synchronization unit will continue to complete the data synchronization between the source database and the target database.

[0034] The present invention provides a detection system and method. The detection system uses a detection module to collect data at the same time point from both a source database and a target database. Simultaneously, a drive control module sends a stop command to a data synchronization mechanism. During this process, the source database continues to transmit data to the data synchronization mechanism without stopping. After data collection is complete, the data transmitted from the source database is stored through the data synchronization mechanism without affecting the operation of the source database. This system ensures that the source database does not need to be paused during data synchronization detection, keeping it in a continuous transmission state. This prevents data changes in the source database from failing to synchronize with the target database, thus maintaining a stable data synchronization progress. Attached Figure Description

[0035] The above and other objects, features and advantages of this disclosure will become more apparent from the accompanying drawings, in which like reference numerals generally denote like parts.

[0036] Figure 1 This is a structural block diagram of the detection system provided in the embodiments of this disclosure;

[0037] Figure 2 This is a structural block diagram of the detection module in the detection system provided in the embodiments of this disclosure;

[0038] Figure 3 This is a structural block diagram of the data synchronization module in the detection system provided in the embodiments of this disclosure;

[0039] Figure 4 This is a flowchart of the detection method provided in the embodiments of this disclosure. Detailed Implementation

[0040] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0041] It should be understood that the following specific examples illustrate the implementation of this disclosure, and those skilled in the art can easily understand other advantages and effects of this disclosure from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. This disclosure can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this disclosure. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0042] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.

[0043] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this disclosure. The illustrations only show the components related to this disclosure and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0044] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the described aspects can be practiced without these specific details.

[0045] like Figure 1 As shown, the detection system disclosed in this embodiment is used for detecting the data consistency of a real-time database synchronization system. It includes a source database, a target database, a detection module, a control module, and a data synchronization mechanism. The output and receiving ends of the source database, the data synchronization mechanism, and the target database are sequentially signal-connected. The receiving end of the detection module is signal-connected to the output ends of both the source and target databases. The output end of the detection module is signal-connected to the receiving end of the control module. The output end of the control module is signal-connected to the receiving end of the data synchronization mechanism. The data synchronization mechanism is used to synchronize data from the source database to the target database. The detection module is used to detect whether the data in the source and target databases are consistent at the same time. The control module is used to control the operation of the data synchronization mechanism during detection. This system aims to solve the problem that existing synchronization system data consistency detection systems require offline detection, preventing data from being transmitted and processed again. This not only disrupts the synchronization progress between the source and target databases but also makes it impossible to synchronize data from the source database to the target database after changes occur.

[0046] like Figure 2 As shown, the detection module also includes a first acquisition module, a second acquisition module, and a data comparison module. The first acquisition module and the second acquisition module are used to acquire real-time data from the source database and the target database, respectively. The receiving end of the data comparison module is connected to the output end of the first acquisition module and the second acquisition module. The data comparison module is used to compare the real-time data from the source database and the target database.

[0047] The first and second acquisition modules are used to collect data from the source database and the target database at the same point in time. Since the source database and the target database are synchronized through a data synchronization mechanism, there will be a time difference in the data synchronization. When the data comparison module compares the data and a difference occurs, the second acquisition module will perform a second acquisition. At this time, the data comparison module will compare again and generate a comparison log, which makes the data comparison module more accurate in comparison.

[0048] like Figure 3 As shown, the data synchronization mechanism includes an execution unit, a pre-storage unit, and a data synchronization unit. The execution unit is used to receive instructions from the control module and perform operations. The pre-storage unit is used to receive data transmitted from the source database. The data synchronization unit is used to synchronize the data in the source database to the target database.

[0049] When the control module issues a command, the execution unit performs the corresponding operation steps. Specifically, the pre-storage unit's output is connected to the data synchronization unit's receiver. When the control module does not issue a detection command, the pre-storage unit is in a non-working state, only circulating data. When the control module receives a detection command from the detection module, it sends a stop command to the execution unit. At this time, the execution unit disconnects the pre-storage unit's data synchronization unit's signal connection, resulting in the following two scenarios when the pre-storage unit checks the database system's data consistency:

[0050] A: When no database data consistency check is performed, the data synchronization mechanism receives data transmitted from the source database and passes it through the pre-storage unit. At this time, the pre-storage unit does not perform storage work and directly transmits the data to the data synchronization unit, which then synchronizes the data to the target database.

[0051] B: When performing database data consistency detection, the signal connection between the pre-storage unit and the data synchronization unit is interrupted, and the pre-storage unit and the data synchronization unit work independently.

[0052] A detection method includes the following steps:

[0053] Step S1: When performing database data consistency detection, the detection module sends a detection command to the first acquisition module and the second acquisition module. The first acquisition module and the second acquisition module collect real-time data from the source database and the target database, respectively. The detection module sends a stop command to the control module. Then, the first acquisition module and the second acquisition module transmit the data to the data comparison module.

[0054] Step S2: At this time, the control module sends a stop command to the data synchronization mechanism and executes it through the execution unit in the data synchronization mechanism. The execution unit interrupts the signal connection between the pre-storage unit and the data synchronization unit. The pre-storage unit receives the data transmitted from the source database, and the data synchronization unit synchronizes the data that has been transmitted to the data synchronization mechanism to the target database.

[0055] Step S3: At this time, the data comparison module receives the data transmitted by the first acquisition module and the second acquisition module, compares them, and generates a comparison log;

[0056] Step S4: After the data comparison is completed, that is, after the detection is completed, the control module controls the execution unit to run. The execution unit enables the data synchronization unit and the pre-storage unit to run normally and continue to complete the data synchronization from the source database to the target database.

[0057] In step S1, when the detection command and stop command issued by the detection module are transmitted to the first acquisition module, the second acquisition module and the control module respectively, the first acquisition module, the second acquisition module and the data synchronization mechanism operate simultaneously, causing the real-time data synchronization between the source database and the target database to be interrupted when the first acquisition module and the second acquisition module acquire data.

[0058] In step S3, when the data comparison module performs data comparison, if the data comparison is correct, it proceeds to step S4; if the data collected by the second acquisition module is more than the data collected by the first acquisition module during data comparison, it returns to step S1 to collect data again.

[0059] In step S4, after the data synchronization unit and the pre-storage unit are operating normally, the pre-storage unit transmits the stored data to the target database through the data synchronization unit, making the continuity of data transmission less likely to be interrupted.

[0060] In a specific embodiment, such as Figure 4 As shown, a detection method includes the following steps:

[0061] Step S1: During database data consistency testing, the testing module sends a testing command to the first acquisition module and the second acquisition module. The first acquisition module and the second acquisition module respectively collect real-time data from the source database and the target database. The first acquisition module and the second acquisition module collect data from the source database and the target database at the same time point to ensure the accuracy of data transmission. The testing module sends a stop command to the control module. When the testing command and the stop command issued by the testing module are transmitted to the first acquisition module, the second acquisition module and the control module respectively, the first acquisition module, the second acquisition module and the data synchronization mechanism run simultaneously. This interrupts the real-time data synchronization between the source database and the target database when the first acquisition module and the second acquisition module collect data. This makes it difficult for data in the source database to continue to be transmitted to the target database after being collected at the same time point, resulting in higher consistency during data testing. Then, the first acquisition module and the second acquisition module transmit the data at the same time point to the data comparison module.

[0062] Step S2: At this time, the control module sends a stop command to the data synchronization mechanism, which is executed by the execution unit within the data synchronization mechanism. The execution unit interrupts the signal connection between the pre-storage unit and the data synchronization unit. The pre-storage unit receives data transmitted from the source database, ensuring that data transmission continues even after changes occur in the source database without interruption. However, the pre-storage unit stores the data but does not transmit it to the data synchronization unit. This prevents data changes in the source database after the first acquisition module's acquisition time from being transmitted to the target database, making it less likely for the data in the target database to differ from that in the source database. At this time, the data synchronization unit operates normally. Since data synchronization takes time, data before the acquisition time of the first acquisition module has already been sent from the source database and is now located in the data synchronization unit. The data synchronization unit normally synchronizes the data transmitted from the source database before the acquisition time to the target database, resulting in higher data consistency between the source and target databases.

[0063] Step S3: When the data comparison module receives and compares the data transmitted by the first and second acquisition modules, if the data acquired by the first acquisition module is greater than the data acquired by the second acquisition module, a 1-second wait is performed. Then, the second acquisition module acquires data from the target database again. Because time differences can easily occur during data synchronization, if the first and second acquisition modules acquire data at the same time, some remaining data in the data synchronization unit may not be synchronized. Therefore, the second acquisition module re-acquires data, further updating the data in the target database and comparing it with the data in the source database acquired by the first acquisition module. The comparison module generates a comparison log; when the data collected by the first acquisition module is consistent with the data collected by the second acquisition module, the comparison module directly generates a comparison log; when the data collected by the first acquisition module is less than the data collected by the second acquisition module, the process returns to step S1. At the same time, the connection between the pre-storage unit and the data synchronization unit is smooth, and the process waits. The data synchronization unit will prioritize synchronizing the data stored in the pre-storage unit to the target database. When there are no stored files in the target database, the data synchronization unit will normally synchronize the data in the source database to the target database. At this time, step S1 will restart, and the detection module will reissue the detection command and stop command to re-detect.

[0064] Step S4: After the data comparison is completed, i.e., the detection is complete, the data comparison module generates a comparison log and sends a completion command to the control module. The control module sends the command to the execution unit in the data synchronization mechanism and makes it run. The execution unit does not disconnect the signal connection between the pre-storage unit and the data synchronization unit, so that the pre-storage unit and the data synchronization unit operate normally. At this time, the data synchronization unit will prioritize synchronizing the data stored in the pre-storage unit to the target database. Then, the data synchronization unit will continue to complete the data synchronization between the source database and the target database. This system allows the source database to remain in a transmission state without interruption during data synchronization detection. It is less likely that the data in the source database will change during detection and cannot be synchronized to the target database. This makes the data synchronization progress less likely to be disrupted and keeps it in a stable state, making it highly applicable.

[0065] In this embodiment, after the detection module issues a detection command, the first and second acquisition modules collect data at the same time point from the source database and the target database, respectively. Simultaneously, the drive control module issues a stop command to the data synchronization mechanism. At this time, the pre-storage unit and the data synchronization unit within the data synchronization mechanism operate separately. The source database continues to transmit data to the data synchronization mechanism without stopping. After the first acquisition module completes its acquisition, the data transmitted from the source database is stored in the pre-storage unit, without affecting the operation of the source database, but the data is not transmitted to the data synchronization unit. The data synchronization unit operates normally until the data before the acquisition time point of the first acquisition module is synchronized. At this point, the data comparison module compares the data collected by the first and second acquisition modules and generates a log. After the comparison is completed, the data comparison module sends a start command to the control module. The data synchronization unit then prioritizes synchronizing the data stored in the pre-storage unit to the target database. After synchronization is complete, it normally synchronizes the data in the source database. This system ensures that the source database does not need to be paused during data synchronization detection, keeping it in a continuous transmission state. It is less likely that changes in the source database during detection will prevent synchronization to the target database, thus ensuring that the data synchronization progress is not easily disrupted and remains stable.

[0066] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.

[0067] In this disclosure, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The block diagrams of devices, apparatuses, devices, and systems involved in this disclosure are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as "comprising," "including," "having," etc., are open-ended terms meaning "including but not limited to," and are used interchangeably with them. The terms "or" and "and" as used herein refer to the terms "and / or," and are used interchangeably with them unless the context clearly indicates otherwise. The term "such as" as used herein refers to the phrase "such as but not limited to," and is used interchangeably with it.

[0068] Additionally, as used herein, the “or” used in a list of items beginning with “at least one” indicates a separate list, such that a list of, for example, “at least one of A, B, or C” means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word “exemplary” does not imply that the described example is preferred or better than other examples.

[0069] It should also be noted that in the systems and methods of this disclosure, the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions to this disclosure.

[0070] Various changes, substitutions, and modifications can be made to the technology described herein without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, events, means, methods, and actions described above. Currently existing or later-developed processes, machines, manufactures, events, means, methods, or actions that perform substantially the same function or achieve substantially the same result as the corresponding aspects described herein can be utilized. Therefore, the appended claims include such processes, machines, manufactures, events, means, methods, or actions within their scope.

[0071] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.

[0072] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.

Claims

1. A detection system for detecting data consistency of a database real-time synchronization system, characterized in that: include: A source database, a target database, a detection module, a control module and a data synchronization mechanism, wherein the output end of the source database is signal-connected to the input end of the data synchronization mechanism, the output end of the data synchronization mechanism is signal-connected to the input end of the target database, the output end of the target database is signal-connected to the input end of the detection module, the output end of the detection module is signal-connected to the input end of the control module, and the output end of the control module is signal-connected to the input end of the data synchronization mechanism; The data synchronization mechanism is used to synchronize the data in the source database to the target database; The detection module is used to detect whether the data in the source database and the target database are consistent within the same time period; The control module is used to control the operation of the data synchronization mechanism when the detection module detects; The data synchronization mechanism is provided with an execution unit, a pre-storage unit and a data synchronization unit; The execution unit is used to receive instructions issued by the control module and perform execution operations; The pre-storage unit is used to receive data transmitted by the source database; The data synchronization unit is used to synchronize the data in the source database to the target database; The output end of the pre-storage unit is connected to the input end of the data synchronization unit by signal. The pre-storage unit may include the following two situations when detecting whether to detect the consistency of the database system data: When no database data consistency check is performed, the data synchronization mechanism receives data transmitted from the source database through the pre-storage unit. At this time, the pre-storage unit does not perform storage work, but directly transmits the data to the data synchronization unit, and the data is synchronized to the target database through the data synchronization unit; When the database data consistency check is performed, the signal connection between the pre-storage unit and the data synchronization unit is interrupted, and the pre-storage unit receives the data transmitted by the source database, so that the data in the source database can continue to be transmitted without interruption after the data changes. At this time, the pre-storage unit does not transmit the data to the data synchronization unit after storing the data. The pre-storage unit and the data synchronization unit work independently, that is, no data is transmitted between the pre-storage unit and the data synchronization unit when the database data consistency check is performed; The detection module includes a first acquisition module, a second acquisition module and a data comparison module, wherein the first acquisition module and the second acquisition module are respectively used to acquire real-time data in a source database and a target database, the input end of the data comparison module is respectively connected to the output end signals of the first acquisition module and the second acquisition module, and the data comparison module is used to compare the real-time data acquired by the first acquisition module and the second acquisition module; The detection module sends a detection instruction to the first acquisition module and the second acquisition module, the first acquisition module and the second acquisition module respectively collect real-time data of the source database and the target database, the first acquisition module and the second acquisition module respectively collect data at the acquisition time point in the source database and the target database, when the detection module sends a stop instruction, the first acquisition module, the second acquisition module and the data synchronization mechanism are operated simultaneously, so that the real-time data synchronization between the source database and the target database is interrupted when the first acquisition module and the second acquisition module collect data, so that after the acquisition at the acquisition time point, the data in the source database is not continuously transmitted to the target database, and then the first acquisition module and the second acquisition module transmit the data at the acquisition time point to the data comparison module; When performing database data consistency detection, the detection module collects data from the source database and the target database at the collection time point, respectively, to obtain first source database collection data and first target database collection data; When performing database data consistency detection, the data synchronization mechanism synchronizes the data that has been transmitted from the source database before the collection time point to the target database; The detection module collects data from the synchronized target database again to obtain collected data from the second target database; The detection module compares the data collected by the first source database with the data collected by the second target database to complete the data consistency detection of the synchronization system; When the detection module compares the data collected by the first source database with the data collected by the second target database, after completing the step of synchronization system data consistency detection, the following further includes: The data comparison module generates a comparison log and sends a completion instruction to the control module at the same time. The completion instruction is sent to the execution unit in the data synchronization mechanism. The execution unit does not cut off the signal connection between the pre-storage unit and the data synchronization unit, so that the pre-storage unit and the data synchronization unit operate normally. The data synchronization unit synchronizes the data stored in the pre-storage unit at this time to the target database first, and then the data synchronization unit continues to complete the data synchronization between the source database and the target database.

2. A detection method for detecting data consistency of a database real-time synchronization system, characterized in that: include: When performing database data consistency detection, the detection module collects data from the source database and the target database at the collection time point, respectively, to obtain first source database collection data and first target database collection data; When performing database data consistency detection, the data synchronization mechanism synchronizes the data that has been transmitted from the source database before the collection time point to the target database; The detection module collects data from the synchronized target database again to obtain collected data from the second target database; The detection module compares the data collected by the first source database with the data collected by the second target database to complete the data consistency detection of the synchronization system; When performing database data consistency detection, the data synchronization mechanism synchronizes the data that has been transmitted from the source database before the collection time point to the target database, including: The control module sends a stop instruction to the data synchronization mechanism, which is executed by the execution unit in the data synchronization mechanism so that the signal connection between the pre-storage unit and the data synchronization unit is interrupted, and the pre-storage unit receives the data transmitted by the source database, so that the data in the source database can continue to be transmitted without interruption after the data changes. At this time, the pre-storage unit does not transmit the data to the data synchronization unit after storing the data, so that the data changed in the source database after the collection time point by the first acquisition module cannot be transmitted to the target database, and the data synchronization unit synchronizes the data sent from the source database by the first acquisition module before the collection time point to the target database; The detection module collects data from the source database and the target database at the collection time point respectively, including: the detection module sends a detection instruction to the first collection module and the second collection module, the first collection module and the second collection module collect real-time data from the source database and the target database respectively, the first collection module and the second collection module collect data at the collection time point in the source database and the target database respectively, when the detection module sends a stop instruction, the first collection module, the second collection module and the data synchronization mechanism are operated simultaneously, so that the real-time data synchronization between the source database and the target database is interrupted when the first collection module and the second collection module collect data, so that after the collection time point is collected, the data in the source database is not continuously transmitted to the target database, and then the first collection module and the second collection module transmit the data at the collection time point to the data comparison module; When the detection module compares the data collected by the first source database with the data collected by the second target database, after completing the step of synchronization system data consistency detection, the following further includes: The data comparison module generates a comparison log and sends a completion instruction to the control module at the same time. The completion instruction is sent to the execution unit in the data synchronization mechanism. The execution unit does not cut off the signal connection between the pre-storage unit and the data synchronization unit, so that the pre-storage unit and the data synchronization unit operate normally. The data synchronization unit synchronizes the data stored in the pre-storage unit at this time to the target database first, and then the data synchronization unit continues to complete the data synchronization between the source database and the target database.

3. The detection method according to claim 2, characterized in that: The detection module compares the data collected from the first source database with the data collected from the second target database, including: When the data collected by the first collection module is greater than the data collected by the second collection module, wait for a set time, and then the second collection module collects data in the target database again; When the data collected by the first collection module is consistent with the data collected by the second collection module, the data comparison module directly generates a comparison log; When the data collected by the first collection module is smaller than the data collected by the second collection module, the detection is reconstructed.

4. The detection method according to claim 3, characterized in that: When the data collected by the first collection module is smaller than the data collected by the second collection module, reconstruction detection includes: The pre-storage unit is connected to the data synchronization unit. The data synchronization unit synchronizes the data stored in the pre-storage unit to the target database first. When there is no storage file in the target database, the data synchronization unit synchronizes the data in the source database to the target database. The detection module re-issues instructions and re-detects.