Data synchronization methods, devices, storage media and electronic equipment
By using an intermediate table and a synchronization strategy configuration table in the local system, data synchronization between the local system and the downstream system is decoupled, solving the problem of poor scalability in existing technologies, achieving flexible data synchronization and interface adaptability, and reducing the impact on the local system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2026-03-13
Smart Images

Figure CN115203335B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a data synchronization method, a data synchronization device, a computer-readable storage medium, an electronic device, and a computer program product. Background Technology
[0002] Currently, the main method for synchronizing data from a local system to downstream systems involves simultaneously calling the downstream system's data synchronization interface while the local system updates its local data using local services. This method couples the local system's data update logic with the data synchronization logic for downstream systems, meaning changes to the downstream system's data synchronization interface will impact the local system's operations. Furthermore, synchronizing data with multiple downstream systems requires calling each system's data synchronization interface separately. If a new downstream system needs data synchronization, existing business code must be modified to accommodate the new external interface calls. Therefore, this method has poor scalability and is not suitable for simultaneously synchronizing data with multiple downstream systems. Summary of the Invention
[0003] To address one of the aforementioned technical deficiencies, embodiments of this application provide a data synchronization method and a data synchronization device.
[0004] The first aspect of this application provides a data synchronization method, including:
[0005] When the local system completes the data update, the data query information of the updated data in the local system is written into the intermediate table;
[0006] Poll the intermediate table to obtain data query information from the intermediate table;
[0007] The synchronization strategy is queried based on the data query information in the intermediate table.
[0008] According to the synchronization strategy, obtain the corresponding local system update data, and call the synchronization interface of the downstream system to synchronize the obtained local system update data to the downstream system.
[0009] In this embodiment of the application, the step of writing the data query information of the local system updated data into the intermediate table when the local system completes the data update includes: when the local system completes the data update, calling a public method to write the data classification identifier and data query conditions of the local system updated data into the intermediate table.
[0010] In this embodiment of the application, querying the synchronization strategy based on the data query information of the intermediate table includes: querying the synchronization interface request parameter query conditions and synchronization interface path of the downstream system corresponding to the data classification identifier based on the data classification identifier in the intermediate table.
[0011] In this embodiment of the application, the data synchronization method further includes: combining the synchronization interface request parameter query conditions of the downstream system with the data query conditions in the intermediate table to form a synchronization interface request parameter query script.
[0012] In this embodiment of the application, the step of obtaining the corresponding local system update data according to the synchronization strategy and calling the synchronization interface of the downstream system to synchronize the obtained local system update data to the downstream system includes: querying the local system database through the synchronization interface request parameter query script to obtain the corresponding local system update data; and calling the synchronization interface of the downstream system according to the synchronization interface path of the downstream system to synchronize the obtained local system update data to the downstream system.
[0013] In this embodiment of the application, polling the intermediate table to obtain the data query information of the intermediate table includes: polling the intermediate table through a scheduled task and cyclically reading the data category identifier and data query conditions in the intermediate table.
[0014] A second aspect of this application provides a data synchronization device, comprising:
[0015] The intermediate table module is used to write the data query information of the updated data in the local system into the intermediate table when the local system completes the data update.
[0016] The scheduled task module is used to poll the intermediate table to obtain data query information from the intermediate table;
[0017] The synchronization task module is used to query the synchronization strategy based on the data query information obtained by the scheduled task module, obtain the corresponding local system update data according to the synchronization strategy, and call the synchronization interface of the downstream system to synchronize the obtained local system update data to the downstream system.
[0018] In this embodiment of the application, when the local system completes the data update, the intermediate table module calls a public method to write the data classification identifier and data query conditions of the updated local system data into the intermediate table.
[0019] In this embodiment of the application, the data synchronization device further includes: a synchronization strategy module;
[0020] The synchronization strategy module is configured with data classification, query conditions for synchronization interface request parameters of downstream systems, and synchronization interface paths. The data classification of the synchronization strategy module and the data classification of the intermediate table are in the same data dictionary.
[0021] In this embodiment, the scheduled task module polls the intermediate table to obtain the data category identifier and data query conditions in the intermediate table; the synchronization task module queries the synchronization interface request parameter query conditions and synchronization interface path of the downstream system corresponding to the data category identifier based on the data category identifier obtained by the scheduled task module.
[0022] In this embodiment, the synchronization task module is further configured to combine the synchronization interface request parameter query conditions of the downstream system with the data query conditions obtained by the timed task module to form a synchronization interface request parameter query script; query the local system database through the synchronization interface request parameter query script to obtain the corresponding local system update data; and call the synchronization interface of the downstream system according to the synchronization interface path of the downstream system to synchronize the obtained local system update data to the downstream system.
[0023] A third aspect of this application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the aforementioned data synchronization method.
[0024] A fourth aspect of this application provides a machine-readable storage medium storing computer-executable instructions, which, when executed, are used to implement the data synchronization method described above.
[0025] The fifth aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described data synchronization method.
[0026] This application provides a data synchronization method based on an intermediate table. When the local system calls a local service to update local business data, it does not directly call the downstream system interface to synchronize data downstream. Instead, it writes the query information for the data to be updated into an intermediate table, obtains the query conditions by polling the intermediate table, retrieves the updated data, and synchronizes the updated data to the downstream system. This application decouples the local system's data updates from the synchronization of data to downstream systems through an intermediate table, enhancing the scalability of data synchronization to downstream systems. When a new downstream system needs to synchronize data from the local system, or when the synchronization interface of a downstream system changes, data synchronization can be achieved simply by adding or modifying the synchronization strategy of the downstream system interface, without modifying the local system's business code and without affecting the local system's business.
[0027] Other features and advantages of the embodiments of this application will be described in detail in the following detailed description section. Attached Figure Description
[0028] The accompanying drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the following detailed description to explain the embodiments of this application, but do not constitute a limitation on the embodiments of this application. In the drawings:
[0029] Figure 1 A flowchart illustrating a data synchronization method according to an embodiment of this application is shown schematically.
[0030] Figure 2 A flowchart illustrating a preferred example of a data synchronization method according to this application is shown schematically.
[0031] Figure 3 This schematic diagram illustrates a structural block diagram of a data synchronization apparatus according to an embodiment of the present application;
[0032] Figure 4 The diagram schematically illustrates the internal structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for illustration and explanation of the embodiments of this application and are not intended to limit the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0034] It should be noted that the terms "comprising," "including," or any other variations thereof used herein are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0035] Figure 1 A flowchart illustrating a data synchronization method according to an embodiment of this application is shown schematically. Figure 1 As shown in one embodiment of this application, a data synchronization method is provided, including the following steps:
[0036] Step 102: When the local system completes the data update, write the data query information of the updated data in the local system into the intermediate table.
[0037] Step 104: Poll the intermediate table to obtain data query information for the intermediate table.
[0038] Step 106: Query the synchronization strategy based on the data query information in the intermediate table.
[0039] Step 108: Obtain the corresponding local system update data according to the synchronization strategy, and call the synchronization interface of the downstream system to synchronize the obtained local system update data to the downstream system.
[0040] Intermediate tables can be implemented in various ways, including but not limited to database tables, temporary files, message queues, and cached data. The data stored in intermediate tables can include actual data, data query conditions, or synchronization strategies.
[0041] This application provides a data synchronization method based on an intermediate table. When the local system calls a local service to update local business data, it does not directly call the downstream system interface to synchronize data downstream. Instead, it writes the query information for the data to be updated into an intermediate table, obtains the query conditions by polling the intermediate table, retrieves the updated data, and synchronizes the updated data to the downstream system. This application decouples the local system's data updates from the synchronization of data to downstream systems through an intermediate table, enhancing the scalability of data synchronization to downstream systems. When a new downstream system needs to synchronize data from the local system, or when the synchronization interface of a downstream system changes, data synchronization can be achieved simply by adding or modifying the synchronization strategy of the downstream system interface, without modifying the local system's business code and without affecting the local system's business.
[0042] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0043] In step 102 above, when the local system completes the data update, a public method is called to write the data category identifier and data query conditions of the updated local system data into the intermediate table.
[0044] In step 104 above, a timed task polls the intermediate table and reads the data category identifiers and data query conditions from the intermediate table in a loop.
[0045] In step 106 above, the query conditions and synchronization interface path of the downstream system corresponding to the data classification identifier are queried based on the data classification identifier in the intermediate table.
[0046] In one embodiment, after step 106 above, the query conditions for the synchronization interface request parameters of the downstream system are combined with the data query conditions in the intermediate table to form a synchronization interface request parameter query script.
[0047] In step 108 above, the local system database is queried through the synchronization interface request parameter query script to obtain the corresponding local system update data. The synchronization interface of the downstream system is called according to the synchronization interface path of the downstream system to synchronize the obtained local system update data to the downstream system.
[0048] like Figure 2 As shown, in a preferred example, a data synchronization method is provided, including: Step 201, maintaining a synchronization strategy configuration table in the local system. The synchronization strategy configuration table is configured with initialization data such as interface parameter information of the downstream system, including data category identifiers, synchronization interface request parameter query conditions, and synchronization interface paths. The data category identifier is a predefined dictionary value representing a category identifier of data to be synchronized to the downstream system. The synchronization interface request parameter query condition can be an SQL script fragment. The local system can query the data corresponding to the data category identifier from its own database based on the complete SQL script, and encapsulate it as the interface request parameter to provide the data to the downstream system.
[0049] Step 202: In the local system data update service, call the public method (utility class method) to write the data query conditions for the current update data into the intermediate table and set the data category identifier for the current data. The data category identifier in the intermediate table and the data category identifier used by the synchronization strategy configuration table to mark the current synchronization strategy are from the same data dictionary. In business scenarios where the local system needs to synchronize data with downstream systems, call the public method to write the data category identifiers involved in the synchronization data in the current scenario and the SQL conditions for querying the updated data in the current business (i.e., data query conditions) into the intermediate table. If multiple business scenarios involve updating different attribute fields of the same type of data corresponding to the same data category identifier, the same public method should be called in these business scenarios to write the information of the data to be synchronized into the intermediate table. Their data category identifiers are the same, but the query conditions for updating the data can be different. The SQL conditions for querying the updated data in the current business can be expressed in various ways: they can be the primary key value of the data record corresponding to the data category identifier, or they can be time conditions or other SQL statement fragments that can query the current updated data from the local system database.
[0050] Step 203: A scheduled task polls the intermediate table, repeatedly reading a fixed number of data query messages. The retrieved data is then parsed to obtain data classification identifiers and query conditions. The execution interval of the scheduled task can be set according to the data synchronization frequency; shorter intervals result in higher real-time data synchronization. The number of data query messages retrieved each time can be set based on system performance.
[0051] Step 204: Based on the data category identifier in the intermediate table, query the relevant records in the synchronization strategy configuration to obtain the synchronization interface path and synchronization interface request parameter query conditions of the downstream system. Specifically, based on the data category identifier obtained in step 203, query the synchronization strategy configuration table initialized in step 201 to obtain a list of all downstream system interfaces corresponding to that data category identifier and their corresponding request parameter query conditions.
[0052] Step 205: Combine the synchronization interface request parameter query conditions obtained in Step 204 with the data query conditions obtained in Step 203. For example, combine the synchronization interface request parameter query SQL script fragment from the synchronization strategy configuration table with the query SQL statement fragment from the intermediate table to form a complete query SQL script. Call this query SQL script to query the local system database (updated data from the local system) to obtain the query result data. Convert the query result data into request parameters for the downstream system interface (i.e., the synchronization data required by the downstream system interface). This method of combining the synchronization interface request parameter query conditions in the synchronization strategy configuration table with the data query conditions in the intermediate table allows for different synchronization strategies to be implemented by defining different data query conditions, such as time-incremental synchronization, data primary key synchronization, and full synchronization (i.e., without conditions). By defining different data query SQL statements in the synchronization strategy configuration table, the need to synchronize different field attributes of the same data object to different downstream systems can be met.
[0053] Step 206: Combine the downstream system interface request parameters obtained in step 205 with the downstream system's synchronization interface path from step 204, and call the downstream system's synchronization interface to synchronize the downstream system interface request parameters obtained from the downstream system. This achieves asynchronous synchronization between local system data updates and the downstream system.
[0054] In the preferred example above, the downstream system interfaces requiring data synchronization are located in the synchronization strategy configuration table using the data classification identifiers in the intermediate table. A complete query SQL script is obtained by combining the query conditions from the intermediate table with the query SQL script fragments from the configuration table. The complete query SQL script then retrieves the complete synchronization interface request parameters from the local system database. Because the data definitions in the synchronization strategy configuration table are flexible, different downstream system interface parameters can be obtained by adjusting the synchronization strategy configuration. Therefore, it can adapt to changes in downstream system interfaces and can call the synchronization interfaces of multiple downstream systems, generating request parameters in different formats to meet the need to synchronize the same data to multiple different downstream systems simultaneously.
[0055] Figure 3 A schematic block diagram of a data synchronization device according to an embodiment of this application is shown. Figure 3 As shown, in one embodiment, a data synchronization device 300 is provided, including an intermediate table module 302, a scheduled task module 304, and a synchronization task module 306. The intermediate table module 302 is used to write data query information of the updated local system data into the intermediate table when the local system completes data updates. The scheduled task module 304 is used to poll the intermediate table to obtain data query information. The synchronization task module 306 is used to query a synchronization strategy based on the data query information obtained by the scheduled task module, obtain the corresponding updated local system data according to the synchronization strategy, and call the synchronization interface of the downstream system to synchronize the obtained updated local system data to the downstream system.
[0056] In one embodiment, when the intermediate table module 302 completes data updates in the local system, it calls a public method to write the data category identifier and data query conditions of the updated data in the local system to the intermediate table. In business scenarios where the local system needs to synchronize data with downstream systems, the public method is called to write the data category identifier of the data to be synchronized in the current scenario and the SQL conditions (i.e., data query conditions) for querying the updated data in the current business to the intermediate table. If multiple business scenarios involve updating different attribute fields of the same type of data corresponding to the same data category identifier, the same public method needs to be called in these business scenarios to write the information of the data to be synchronized to the intermediate table. Their data category identifiers are the same, but the query conditions for updating the data can be different. The SQL conditions for querying the updated data in the current business can be expressed in various ways: they can be the primary key value of the data record corresponding to the data category identifier, or they can be time conditions or other SQL statement fragments that can retrieve the currently updated data from the local system database.
[0057] In one embodiment, the data synchronization device further includes a synchronization strategy module 308. This module is configured with data classification, downstream system synchronization interface request parameter query conditions, and synchronization interface paths. The data classification identifier is a predefined dictionary value representing a category of data to be synchronized to the downstream system. The data classification in the synchronization strategy module uses the same data dictionary as the data classification in the intermediate table. The synchronization interface request parameter query conditions can be an SQL script fragment. The local system can retrieve the data corresponding to the data classification identifier from its own database based on the complete SQL script and encapsulate it as the interface request parameters to provide the data to the downstream system.
[0058] In one embodiment, the scheduled task module 304 polls the intermediate table to obtain the data category identifier and data query conditions from the intermediate table. The synchronization task module 306 queries the synchronization interface request parameter query conditions and synchronization interface path of the downstream system corresponding to the data category identifier based on the data category identifier obtained by the scheduled task module.
[0059] In one embodiment, the synchronization task module 306 is further configured to combine the query conditions of the synchronization interface request parameters of the downstream system with the data query conditions obtained by the scheduled task module to form a synchronization interface request parameter query script; query the local system database through the synchronization interface request parameter query script to obtain the corresponding local system update data; and call the synchronization interface of the downstream system according to the synchronization interface path of the downstream system to synchronize the obtained local system update data to the downstream system. For example, the synchronization interface request parameter query SQL script fragment in the synchronization strategy configuration table and the query SQL statement fragment in the intermediate table are assembled into a complete query SQL script. The query SQL script is called to query the local system database (local system update data) to obtain query result data, the query result data is converted into request parameters of the downstream system interface (i.e., the synchronization data required by the downstream system interface), and finally the synchronization interface of the downstream system is called to transmit the request parameters of the downstream system interface, thereby realizing the asynchronous synchronization between local system data updates and the downstream system. This approach, which combines the query conditions of the synchronization interface request parameters in the synchronization strategy configuration table with the data query conditions in the intermediate table, allows for different synchronization strategies to be implemented by defining different data query conditions. These strategies include time-incremental synchronization, data primary key synchronization, and full synchronization (i.e., without conditions). By defining different data query SQL statements in the synchronization strategy configuration table, the need to synchronize different field attributes of the same data object to different downstream systems can be met.
[0060] In the above embodiments, the downstream system interfaces requiring data synchronization are located in the synchronization strategy configuration table using the data classification identifier in the intermediate table. A complete query SQL script is obtained by combining the data query conditions in the intermediate table with the query SQL script fragments in the configuration table. The complete query SQL script is then used to retrieve the complete synchronization interface request parameters from the local system database. Because the data definition in the synchronization strategy configuration table can be flexibly adjusted, different downstream system interface parameters can be obtained by adjusting the synchronization strategy configuration. Therefore, it can adapt to changes in downstream system interfaces and can call the synchronization interfaces of multiple downstream systems, generating request parameters in different formats to meet the need to synchronize the same data to multiple different downstream systems simultaneously.
[0061] Figure 4 A schematic diagram illustrating the internal structure of an electronic device according to an embodiment of this application is provided. Figure 4 As shown, an electronic device is provided in one embodiment of this application. The electronic device includes: a processor A01, a network interface A02, a memory (not shown), and a database (not shown) connected via a system bus. The processor A01 provides computing and control capabilities. The memory includes internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02, and a database (not shown). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A04. The database of the electronic device stores local system update data. The network interface A02 of the electronic device communicates with an external terminal via a network connection. When the computer program B02 is executed by the processor A01, it implements the data synchronization method of the above embodiment. The processor A01 executing the computer program B02 can at least implement the following method steps:
[0062] Step 102: When the local system completes the data update, write the data query information of the updated data in the local system into the intermediate table;
[0063] Step 104: Poll the intermediate table to obtain data query information for the intermediate table;
[0064] Step 106: Query the synchronization strategy based on the data query information in the intermediate table;
[0065] Step 108: Obtain the corresponding local system update data according to the synchronization strategy, and call the synchronization interface of the downstream system to synchronize the obtained local system update data to the downstream system.
[0066] This application also provides a computer-readable storage medium storing computer instructions. When these computer instructions are executed on a computer, the computer performs the data synchronization method described in the above embodiments. The computer-readable storage medium includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device.
[0067] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, it can implement the technical solution of the data synchronization method described in the above embodiments. The method steps implemented by the processor executing the computer program are as follows:
[0068] Step 102: When the local system completes the data update, write the data query information of the updated data in the local system into the intermediate table;
[0069] Step 104: Poll the intermediate table to obtain data query information for the intermediate table;
[0070] Step 106: Query the synchronization strategy based on the data query information in the intermediate table;
[0071] Step 108: Obtain the corresponding local system update data according to the synchronization strategy, and call the synchronization interface of the downstream system to synchronize the obtained local system update data to the downstream system.
[0072] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0073] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0074] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0075] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A data synchronization method, characterized by, The application comprises the following steps: writing data query information of local system update data into an intermediate table when the local system completes data update, wherein the data query information comprises data classification identification and data query condition; the local system has a synchronization strategy configuration table, and the synchronization strategy configuration table is configured with interface parameter information of a downstream system, wherein the interface parameter information of the downstream system comprises data classification identification, synchronization interface request parameter query condition and synchronization interface path; polling the intermediate table to obtain data classification identification and data query condition in the intermediate table; querying the synchronization strategy configuration table of the local system according to the data classification identification in the intermediate table to obtain the synchronization interface path and the synchronization interface request parameter query condition of the downstream system, combining the synchronization interface request parameter query condition of the downstream system with the data query condition in the intermediate table to form a synchronization interface request parameter query script; querying the local system database according to the synchronization interface request parameter query script to obtain corresponding local system update data, and calling the synchronization interface of the downstream system according to the synchronization interface path of the downstream system to synchronously obtain the local system update data to the downstream system.
2. The data synchronization method of claim 1, wherein, The step of writing data query information of local system update data into an intermediate table when the local system completes data update comprises the following steps: when the local system completes data update, calling a public method to write data classification identification and data query condition of local system update data into the intermediate table.
3. The data synchronization method of claim 1, wherein, The step of polling the intermediate table to obtain data classification identification and data query condition in the intermediate table comprises the following steps: polling the intermediate table through a timing task to cyclically read data classification identification and data query condition in the intermediate table.
4. A data synchronization apparatus, characterized by comprising: The application comprises the following steps: a synchronization strategy module, comprising a synchronization strategy configuration table deployed in a local system, wherein the synchronization strategy configuration table is configured with interface parameter information of a downstream system, and the interface parameter information of the downstream system comprises data classification identification, synchronization interface request parameter query condition and synchronization interface path; an intermediate table module, configured to write data query information of local system update data into an intermediate table when the local system completes data update, wherein the data query information comprises data classification identification and data query condition; a timing task module, configured to poll the intermediate table to obtain data classification identification and data query condition in the intermediate table; a synchronization task module, configured to query the synchronization strategy configuration table of the local system according to the data classification identification obtained by the timing task module to obtain the synchronization interface path and the synchronization interface request parameter query condition of the downstream system, combine the synchronization interface request parameter query condition of the downstream system with the data query condition in the intermediate table to form a synchronization interface request parameter query script, query the local system database according to the synchronization interface request parameter query script to obtain corresponding local system update data, call the synchronization interface of the downstream system according to the synchronization interface path of the downstream system to synchronously obtain the local system update data to the downstream system.
5. The data synchronization apparatus according to claim 4, wherein The intermediate table module calls a public method to write data classification identification and data query condition of local system update data into the intermediate table when the local system completes data update.
6. The data synchronization apparatus according to claim 5, wherein The data classification identifier configured in the synchronization policy configuration table and the data classification identifier in the intermediate table are the same data dictionary.
7. An electronic device, comprising: Comprise: A processor, and a memory connected with the processor in communication; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to realize the data synchronization method in any one of claims 1-3.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed to realize the data synchronization method in any one of claims 1-3.
9. A computer program product, characterised in that, Comprise a computer program, and the computer program is executed by the processor to realize the data synchronization method in any one of claims 1-3.
Citation Information
Patent Citations
Data synchronization method and device, isolation gatekeeper and data synchronization system
CN112667745A
Data synchronization method and device, electronic equipment and computer readable medium
CN113486116A