Data synchronization method and device, electronic equipment and storage medium

By judging the connectivity state between devices and using mobile devices to migrate and synchronize data in abnormal connections, the problem of low data synchronization efficiency and reliability under network restrictions is solved, and data synchronization and updates can be carried out in a timely manner in any connected state.

CN119782418AActive Publication Date: 2025-04-08NAVAL UNIV OF ENG PLA

Patent Information

Application Number
CN202411806679.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-04-08
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

Under network restrictions, the devices cannot connect normally, resulting in the efficiency and reliability of data synchronization being affected.

Method used

By judging the connection status between the data importer and the data exporter, if it is in an abnormally connected state, the mobile device is mounted to the data exporter, information query is conducted and target migration data is generated, transmitted to the mobile device, and mounted to the data importer for import.

Benefits of technology

In abnormally connected state, data can be updated synchronously in a timely manner, improving the efficiency and reliability of data synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782418A_ABST
    Figure CN119782418A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data synchronization method and device, electronic equipment and a storage medium, and belongs to the technical field of data synchronization. The method comprises the following steps: if a data import end and a data export end are in an abnormal connection state, mounting a mobile device to the data export end, performing information query at the data export end according to a preset export rule, obtaining a query result, generating target migration data according to the query result, and transmitting the target migration data to the mobile device; and mounting the mobile device to a data import end, and importing the target migration data to the data import end through a preset import rule. According to the scheme provided by the invention, the data import end and the data export end synchronously update the data in time under the condition that the network is limited, so that the data synchronization efficiency and reliability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data synchronization, and in particular to a data synchronization method, device, electronic device and storage medium. Background Art

[0002] At present, when two sets of devices are able to achieve network communication, the two device systems can be updated synchronously to ensure that data can be synchronized and updated in a timely manner. However, if the devices cannot be connected normally due to network restrictions, it may affect the efficiency and reliability of data synchronization. Summary of the invention

[0003] In order to solve the above technical problems, the embodiments of the present application provide a data synchronization method, device, electronic device and storage medium.

[0004] In a first aspect, an embodiment of the present application provides a data synchronization method, the method comprising: Determine whether the data import end and the data export end are in a normal connected state; If the data import end and the data export end are in an abnormal connection state, the mobile device is mounted to the data export end, information query is performed on the data export end according to the preset export rule, and the query result is obtained, target migration data is generated according to the query result, and the target migration data is transmitted to the mobile device; The mobile device is mounted to the data import end, and the target migration data is imported to the data import end according to a preset import rule.

[0005] In one implementation, a unified storage directory for kettle scripts is specified, and basic component connection information is configured; A subsystem to be migrated is determined from a preset data service system, basic information to be migrated is determined according to the subsystem to be migrated, and the basic information to be migrated is entered into a target configuration table.

[0006] In one embodiment, target export parameters are determined according to the data export terminal, wherein the target export parameters include: an identification set of the subsystem to be migrated and a preset time range of the data to be exported; The target configuration table is queried according to the target export parameter to obtain a first query result, wherein the first query result includes: first basic configuration information of the preset data to be exported, the first basic configuration information includes first resource information and first data information; Substituting the first query result into a preset export information table for query to obtain a second query result, and writing the second query result into the unified storage directory, wherein the second query result includes: second basic configuration information, and the second basic configuration information includes second resource information and second data information; The target migration data is generated according to the second data information.

[0007] In one implementation, a data structure comparison is performed between the second basic configuration information and a preset import information table; If the data structures are consistent, importing the first query result into the intermediate library of the kettle script; Performing field conflict detection on the intermediate database and the target database of the data import end according to a preset conflict detection rule, and obtaining a conflict detection result, wherein the conflict detection result includes: conflict items; Determine a conflict strategy according to the conflict detection result, and perform a deletion operation or a retention operation on the conflicting item according to the conflict strategy; The conflict detection result is saved in the unified storage directory.

[0008] In one embodiment, field conflict detection is performed on the intermediate database and the target database of the data import end according to the preset conflict detection rule to obtain a preprocessing result of the field conflict detection; Substitute the first query result and the preprocessing result into each service subsystem in the preset data service system to perform conflict detection and obtain the conflict detection result.

[0009] In one embodiment, the mobile device is electrically connected to the data import terminal; Acquiring device information and initial mounting information through the mobile device; Fill the device information and the initial mounting information into a preset mounting configuration page, start the mounting button according to the preset mounting configuration page, and control the mobile device to mount to the data import end.

[0010] In one embodiment, if the data import end and the data export end are in the normal connected state, the target migration data is selected according to a preset export selection rule, wherein the preset export selection rule includes: an incremental export rule and / or a full export rule; The target migration data is imported into the data import end according to a preset conflict detection rule.

[0011] In a second aspect, an embodiment of the present application provides a data synchronization device, the data synchronization device comprising: A judgment module is used to judge whether the data import end and the data export end are in a normal connection state; A transmission module, configured to mount a mobile device to the data export end if the data import end and the data export end are in an abnormal connection state, perform information query on the data export end according to a preset export rule, obtain query results, generate target migration data according to the query results, and transmit the target migration data to the mobile device; The import module is used to mount the mobile device to the data import end, and import the target migration data to the data import end according to a preset import rule.

[0012] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the data synchronization method provided in the first aspect is executed.

[0013] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which executes the data synchronization method provided in the first aspect when running on a processor.

[0014] The data synchronization method, device, electronic device and storage medium provided by the present application include: determining whether the data import end and the data export end are in a normal connected state; if the data import end and the data export end are in an abnormal connected state, mounting the mobile device to the data export end, performing information query on the data export end according to the preset export rules, and obtaining the query results, generating target migration data according to the query results, and transmitting the target migration data to the mobile device; mounting the mobile device to the data import end, and importing the target migration data to the data import end according to the preset import rules. The data import end and the data export end can synchronize and update the data in a timely manner in the case of abnormal connected state, thereby improving the efficiency and reliability of data synchronization. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope of protection of the present application. In each of the drawings, similar components are numbered similarly.

[0016] Figure 1 A schematic diagram of a process of a data synchronization method provided by an embodiment of the present application is shown; Figure 2 Another schematic diagram of the data synchronization method provided by the embodiment of the present application is shown; Figure 3 A schematic diagram of the structure of a data synchronization device provided in an embodiment of the present application is shown; Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown.

[0017] Icons: 300 - data synchronization device, 301 - judgment module, 302 - transmission module, 303 - import module, 400 - electronic device, 401 - transceiver, 402 - processor, 403 - memory. DETAILED DESCRIPTION

[0018] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0019] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0020] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing items.

[0021] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.

[0022] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.

[0023] Example 1 At present, device communications under network restrictions often choose interface synchronization. However, when the amount of data is too large, synchronization through the interface puts too much pressure on the device server and cannot fully meet data synchronization consistency. Therefore, an embodiment of the present application provides a data synchronization method.

[0024] See also Figure 1 , data synchronization methods include: S101, determining whether the data import end and the data export end are in a normal connected state.

[0025] It should be noted that the service-related configuration files and databases are deployed on the server or cloud environment through server deployment. During the service deployment process, the network configuration is checked to determine the current network conditions. If the network conditions are good, the data import end and the data export end are configured in the same network. In this way, the target migration data to be exported can be directly determined through the data export end. When the export operation is completed, the migration system can see the operation record and data status, and the records to be imported can be automatically identified through the configured data import end.

[0026] According to the connectivity between the data import end and the data export end, the migration method of the target migration data is determined, and the data is further updated synchronously, thereby improving the migration efficiency.

[0027] In one embodiment, a unified storage directory for kettle scripts is specified, and basic component connection information is configured; a subsystem to be migrated is determined from a preset data service system, basic information to be migrated is determined based on the subsystem to be migrated, and the basic information to be migrated is entered into a target configuration table.

[0028] It can be understood that the present application uses Kettle to automatically create a migration task that reads the target migration data from the source database on the data export side and writes the target migration data to the target database on the data import side, thereby achieving data update synchronization through the migration task.

[0029] In this embodiment, by specifying a unified storage directory for kettle scripts, the scripts that need to be used later are stored here, and the basic component connection information (nacos, minio, database, etc.) in the migration system is ensured to be correctly configured; ensure that the target configuration table (kms_exchange_module_table) exists, perform detailed statistics and analysis on the basic information to be migrated of the system to be migrated, obtain statistical information, and enter the statistical information into the target configuration table, where the basic information to be migrated includes: the structure of the business table, main table, associated table and resource table of the system to be migrated, the data volume and data relationship and other basic information.

[0030] It is further understood that the preset data business system includes four business systems: procurement, knowledge base, situation and task flow. After the system to be migrated is determined in the above business systems, the basic information to be migrated of the system to be migrated must be entered into the target configuration table.

[0031] By storing each control script in a unified directory, it is convenient to manage each control script in a unified manner. By ensuring the correct configuration of the basic component connection information, the normal access to the migration system is further guaranteed. By entering the information to be migrated into the target configuration table, the accuracy and completeness of the data during the migration process are increased.

[0032] In one embodiment, if the data import end and the data export end are in the normal connectivity state, the target migration data is selected according to a preset export selection rule, wherein the preset export selection rule includes: an incremental export rule and / or a full export rule; and the target migration data is imported into the data import end according to a preset conflict detection rule.

[0033] It should be noted that when the data import end and the data export end are in the same network state with good network status, the mobile device can be saved from transmitting offline data to the storage medium, and the amount of target migration data can be determined by selecting the first preset rule, namely the export rule, wherein the export rule includes: incremental export rule, which allows the user to select a time node, and the background filters out the system data after this time according to the time node, or full export rule, by selecting all the data stored in the corresponding database of the system to be migrated. After selecting the target migration data to be exported, the background processes and packages the data.

[0034] When data import is performed on the data import end, the preset conflict detection rules are used to determine whether the target migration data has data conflicts with the target database of the data import end. The user end selects the conflicting data according to needs, where the operations that the user end can select include: deletion operation or retention operation.

[0035] This application provides two rules: incremental export and full export. Users can choose the most appropriate export method according to actual needs. Incremental export allows users to migrate only new data since a specific time point, reducing unnecessary data transfer; while full export is suitable for scenarios that require a complete data set. During the data import process, after discovering data conflicts through preset conflict detection rules, users can choose to delete conflicting data or keep the original data according to actual conditions. This flexibility ensures the smooth progress of data migration and meets the different needs of users.

[0036] S102, if the data import end and the data export end are in an abnormal connection state, the mobile device is mounted to the data export end, information query is performed on the data export end according to the preset export rules, and the query result is obtained, target migration data is generated according to the query result, and the target migration data is transmitted to the mobile device.

[0037] In this embodiment, by selecting the system to be migrated and the preset time range of the data to be exported, the page generates a waiting interface after confirmation, and the background substitutes the specified target export parameters to query the target configuration table to obtain the first query result. Among them, the target export parameters are the identification set of the subsystem to be migrated and the preset time range of the data to be exported. The first query result includes: the preset basic configuration information of the data to be exported, wherein the basic configuration information includes: the determination of the export method, and the export method includes: exporting the entire table, exporting according to the input start time, or exporting data by associating the main table.

[0038] The first query result is associated with the preset export information table (information_schema.columns) to obtain the second query result, that is, the business table and resource table configuration information, and the second query result is written to the unified storage directory (table_column_info_config.txt) of the mobile disk; then, according to the second query result, a data export script and a resource export script are generated, and the data export component (data-export.ktr) and the resource export component (resource-download.ktr) are respectively brought into the data export component to export the data and resources, and stored in the unified storage directory of the mobile disk; when all the data has been exported, the page cancels the waiting interface, and after confirming that the data export is complete, the user unplugs the mobile device.

[0039] In one embodiment, target export parameters are determined according to the data export end, wherein the target export parameters include: an identification set of the subsystem to be migrated and a preset time range of the data to be exported; the target configuration table is queried according to the target export parameters to obtain a first query result, wherein the first query result includes: first basic configuration information of the preset data to be exported, the first basic configuration information includes first resource information and first data information; the first query result is substituted into the preset export information table for query to obtain a second query result, and the second query result is written into the unified storage directory, wherein the second query result includes: second basic configuration information, the second basic configuration information includes second resource information and second data information; the target migration data is generated according to the second data information.

[0040] It should be noted that the second basic configuration information includes: business table and resource table configuration information. Business data is usually stored directly in the data table in text form, while resources (videos, etc. or other data) are stored on the file server (minio). The resource table information needs to be substituted into the file server data upload and download interface to obtain the actual resource information.

[0041] Business tables and resource tables are distinguished by the content of the stored information. Business data and resource data (pictures, videos, and audio, etc.) are stored in sequence. It should be noted that the resource table does not store the resources themselves, but only stores resource information. The system to be migrated can obtain the actual resources from the server through the resource information.

[0042] S103, mounting the mobile device to the data import end, and importing the target migration data to the data import end according to a preset import rule.

[0043] It should be noted that the mobile device is a mobile hard disk, including: a USB flash drive, a memory card, a CD, a network disk or other devices containing a hard disk.

[0044] In one embodiment, the mobile device is electrically connected to the data import end; device information and initial mounting information are obtained through the mobile device; the device information and the initial mounting information are filled into a preset mounting configuration page, and a mounting button is started according to the preset mounting configuration page to control the mobile device to be mounted to the data import end.

[0045] It should be noted that the device information is the mount device path, and the initial mount information is the mounted path. When the mobile hard disk is inserted into the server host, the server will identify a string of unique path identifiers of the device. At this time, the path is unavailable and a mount operation is required. The mount operation requires the clear mount device path and the mounted path (mount point). After mounting, the user can operate the mobile hard disk through the mounted path.

[0046] In one embodiment, if Figure 2 As shown, Figure 2 This is another flowchart of a data synchronization method, the method comprising: S201, performing a data structure comparison between the second basic configuration information and a preset import information table.

[0047] It should be noted that by selecting the system to be imported, the page generates a waiting interface, the background loads the target migration data through the mobile device, obtains the second basic configuration information stored previously, and substitutes the basic configuration information of the target migration data into the preset import information table (information_schema.columns) for data structure comparison. If the data structure is consistent, data processing continues. If the data structure is inconsistent, the page pops up the table structure inconsistency information to terminate the conflict detection. In this case, you can contact the system administrator for corresponding processing.

[0048] S202: If the data structures are consistent, importing the first query result into the intermediate library of the kettle script.

[0049] It should be noted that Kettle is a data integration tool that implements the generation and verification rules of synchronization files. Other similar tools that can implement extraction, loading, and transformation tools (ELT), such as Apache NiFi and Apache Spark, can also implement the generation and verification rules of synchronization files, and there is no restriction here.

[0050] It is further explained that if the data structure is consistent, the target export parameter specified by the user is queried against the target configuration table to obtain a first query result, where the target export parameter is a set of identifiers of the subsystem to be migrated and a preset time range for the data to be exported. The first query result includes: the field name of the target export parameter and the type corresponding to the field. The first query result is sequentially substituted into the kettle intermediate library script (script-to-kettle.kjb), the field processing script (unique-key-log.ktr) and the pre-processing script (pre-resource-upload.ktr), and the target export parameter data is simultaneously subjected to field processing and pre-processing, and the target export parameter is format converted and stored in the intermediate library.

[0051] S203, performing field conflict detection on the intermediate database and the target database of the data import end according to preset conflict detection rules, and obtaining conflict detection results, wherein the conflict detection results include: conflict items.

[0052] In this embodiment, the target export parameters are processed and converted and stored in the intermediate library, and the intermediate library and the target library at the data import end are subjected to conflict detection of unique fields to determine whether there is a field conflict between the target migration data and the existing data in the target library, and the conflict results are stored in a special table (kms_exchange_unique_key_log) under the unified storage directory, and the conflict record overwrite operation is performed on the kettle to implement the data conflict detection logic between the kettle intermediate library and the target library resources, and the duplicate resource removal operation is performed on the kettle library. By performing conflict detection in the intermediate library, it can be ensured that the migrated data and the existing data in the target library do not repeat or conflict in the key fields, thereby ensuring the consistency and accuracy of the data. This is crucial for maintaining the integrity of the database and avoiding data redundancy.

[0053] At the same time, by determining the uniqueness of the database table and configuring the judgment and comparison rules through kettle scripts, it can solve the uncertainty of excessive applications. It is flexible, convenient and universal, and can complete data synchronization in most scenarios.

[0054] In one embodiment, field conflict detection is performed on the intermediate database and the target database of the data import end according to the preset conflict detection rules to obtain a preprocessing result of the field conflict detection; the first query result and the preprocessing result of the conflict detection are substituted into each business subsystem in the preset data business system to perform conflict detection and obtain the conflict detection result.

[0055] By substituting the first query result and the preprocessing result into the conflict detection scripts of each business system (kms-detect.ktr, zsk-detect.ktr, ts-detect.ktr and taskflow-detect.ktr), and storing the conflict detection results in the record table (kms_exchange_record) in the unified storage directory, cancel the waiting page and jump to the conflict detection result page.

[0056] By checking the data through the conflict detection scripts of each business system, it can be ensured that no duplicate or conflicting data will appear during the data migration process, thereby enhancing the consistency and accuracy of the data.

[0057] S204: Determine a conflict strategy according to the conflict detection result, and perform a deletion operation or a retention operation on the conflicting item according to the conflict strategy.

[0058] It should be noted that the conflict detection results are composed of conflicting items and newly added items. The default conflict strategy for conflicting items is to delete duplicate data. Users can manually delete duplicate data for conflicting items or retain two versions to adjust the conflict strategy. The background will synchronize the user-specified conflict strategy to the record table in the unified storage directory (kms_exchange_record). After confirming that the conflict strategy is completed, click the OK button on the conflict detection result page to end the conflict detection selection.

[0059] S205: Save the conflict detection result to the unified storage directory.

[0060] In this embodiment, the backup generated by the import is cleaned up by calling the cleanup script (exec-sql-statement.ktr); the database is called to back up the basic information of the target migration data, and the target library is designated as overwriting policy data and its related data deletion, and the target library is designated as retaining two versions of policy data and its related data primary key or foreign key record update, and all data except conflicting policies in the kettle intermediate library are migrated to the target library to achieve data backup.

[0061] It should be noted that in order to solve the problem caused by users being dissatisfied with the data import processing results or operational errors, the system provides a data restoration function. Select any record backed up before or after import, click the restore button, and restore the backup data of the most recent import operation.

[0062] It should be further explained that in order to solve the problem of disk space being occupied by too many exported and imported files in the later stage, the system provides a function for cleaning up exported and imported files. The user selects any mobile disk file data and clicks the delete button. The program will call the file operation API provided by the system to clean up the specified file data on the mobile disk.

[0063] The data synchronization method provided in this embodiment determines whether the data import end and the data export end are in a normal connection state; if the data import end and the data export end are in an abnormal connection state, the mobile device is mounted to the data export end, and information query is performed on the data export end according to the preset export rules, and the query results are obtained, and the target migration data is generated according to the query results, and the target migration data is transmitted to the mobile device; the mobile device is mounted to the data import end, and the target migration data is imported into the data import end according to the preset import rules. The data import end and the data export end are synchronized and updated in time when they are in an abnormal connection state, which improves the efficiency and reliability of data synchronization.

[0064] Example 2 In addition, an embodiment of the present application provides a data synchronization device.

[0065] like Figure 3 As shown, the data synchronization device 300 includes: The judging module 301 is used to judge whether the data import end and the data export end are in a normal connection state; The transmission module 302 is used to mount the mobile device to the data export end if the data import end and the data export end are in an abnormal connection state, perform information query on the data export end according to a preset export rule, obtain the query result, generate target migration data according to the query result, and transmit the target migration data to the mobile device; The import module 303 is used to mount the mobile device to the data import end, and import the target migration data to the data import end according to a preset import rule.

[0066] The data synchronization device 300 provided in this embodiment can implement the data synchronization method provided in Embodiment 1, and will not be described again here to avoid repetition.

[0067] The data synchronization device provided in this embodiment determines whether the data import end and the data export end are in a normal connection state; if the data import end and the data export end are in an abnormal connection state, the mobile device is mounted to the data export end, and information query is performed on the data export end according to the preset export rules, and the query results are obtained, and the target migration data is generated according to the query results, and the target migration data is transmitted to the mobile device; the mobile device is mounted to the data import end, and the target migration data is imported into the data import end according to the preset import rules. The dual devices can synchronize and update the data in a timely manner in the normal connection state or the abnormal connection state, thereby improving the efficiency and reliability of data synchronization.

[0068] Example 3 In addition, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, the data synchronization method provided in Embodiment 1 is executed.

[0069] For details, see Figure 4The electronic device 400 includes: a transceiver 401, a bus interface and a processor 402, wherein the processor 402 is used to: determine whether the data import end and the data export end are in a normal connection state; if the data import end and the data export end are in an abnormal connection state, mount the mobile device to the data export end, perform information query on the data export end according to the preset export rule, and obtain the query result, generate target migration data according to the query result, and transmit the target migration data to the mobile device; mount the mobile device to the data import end, and import the target migration data to the data import end according to the preset import rule.

[0070] In one embodiment, the processor 402 is also used to: specify a unified storage directory for kettle scripts and configure basic component connection information; determine the subsystem to be migrated from the preset data service system, determine the basic information to be migrated based on the subsystem to be migrated, and enter the basic information to be migrated into the target configuration table.

[0071] In one embodiment, the processor 402 is also used to: determine target export parameters according to the data export end, wherein the target export parameters include: an identification set of the subsystem to be migrated and a preset time range of the data to be exported; query the target configuration table according to the target export parameters to obtain a first query result, wherein the first query result includes: first basic configuration information of the preset data to be exported, the first basic configuration information includes first resource information and first data information; substitute the first query result into the preset export information table for query to obtain a second query result, and write the second query result into the unified storage directory, wherein the second query result includes: second basic configuration information, the second basic configuration information includes second resource information and second data information; generate the target migration data according to the second data information.

[0072] In one embodiment, the processor 402 is also used to: compare the data structure of the second basic configuration information with the preset import information table; if the data structures are consistent, import the first query result into the intermediate library of the kettle script; perform field conflict detection on the intermediate library and the target database of the data import end according to preset conflict detection rules, and obtain conflict detection results, wherein the conflict detection results include: conflict items; determine the conflict strategy based on the conflict detection results, and perform a deletion operation or a retention operation on the conflict items according to the conflict strategy; save the conflict detection results to the unified storage directory.

[0073] In one embodiment, the processor 402 is also used to: perform field conflict detection on the intermediate library and the target database of the data import end according to the preset conflict detection rules, and obtain the preprocessing results of the field conflict detection; substitute the first query result and the preprocessing result into each business subsystem in the preset data business system for conflict detection, and obtain the conflict detection result.

[0074] In one embodiment, the processor 402 is also used to: electrically connect the mobile device to the data import end; obtain device information and initial mounting information through the mobile device; fill the device information and the initial mounting information into a preset mounting configuration page, start the mount button according to the preset mounting configuration page, and control the mobile device to mount to the data import end.

[0075] In one embodiment, the processor 402 is also used for: if the data import end and the data export end are in the normal connectivity state, selecting the target migration data according to a preset export selection rule, wherein the preset export selection rule includes: an incremental export rule and / or a full export rule; importing the target migration data to the data import end according to a preset conflict detection rule.

[0076] In the embodiment of the present application, the electronic device 400 further includes a memory 403. Figure 4 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 402 and memory represented by memory 403. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 401 may be a plurality of components, namely including a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission computer storage medium. The processor 402 is responsible for managing the bus architecture and general processing, and the memory 403 may store data used by the processor 402 when performing operations.

[0077] The electronic device 400 provided in the embodiment of the present application can execute the steps of the data synchronization method provided in the above method embodiment 1, and will not be described again here to avoid repetition.

[0078] The electronic device provided in this embodiment enables the two devices to synchronously update data in a timely manner in a normal connection state or an abnormal connection state, thereby improving the efficiency and reliability of data synchronization.

[0079] Example 4 The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the data synchronization method provided in Example 1 is implemented.

[0080] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0081] The computer-readable storage medium provided in this embodiment can implement the data synchronization method provided in Embodiment 1, and will not be described again here to avoid repetition.

[0082] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or terminal including the element.

[0083] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage computer storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal (which can be a mobile phone, computer, server, air conditioner, or network equipment, etc.) to execute the methods described in each embodiment of the present application.

[0084] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A data synchronization method, characterized in that: The method comprises: Determine whether the data import end and the data export end are in a normal connected state; If the data import end and the data export end are in an abnormal connection state, the mobile device is mounted to the data export end, information query is performed on the data export end according to the preset export rule, and the query result is obtained, target migration data is generated according to the query result, and the target migration data is transmitted to the mobile device; The mobile device is mounted to the data import end, and the target migration data is imported to the data import end according to a preset import rule.

2. The data synchronization method according to claim 1, characterized in that: Before determining whether the data import end and the data export end are in a normal connected state, the method further includes: Specify the unified storage directory for kettle scripts and configure basic component connection information; A subsystem to be migrated is determined from a preset data service system, basic information to be migrated is determined according to the subsystem to be migrated, and the basic information to be migrated is entered into a target configuration table.

3. The data synchronization method according to claim 2, characterized in that: The performing information query at the data export end according to the preset export rule, obtaining the query result, and generating the target migration data according to the query result includes: Determining target export parameters according to the data export terminal, wherein the target export parameters include: an identification set of the subsystem to be migrated and a preset time range of the data to be exported; The target configuration table is queried according to the target export parameter to obtain a first query result, wherein the first query result includes: first basic configuration information of the preset data to be exported, the first basic configuration information includes first resource information and first data information; Substituting the first query result into a preset export information table for query to obtain a second query result, and writing the second query result into the unified storage directory, wherein the second query result includes: second basic configuration information, and the second basic configuration information includes second resource information and second data information; The target migration data is generated according to the second data information.

4. The data synchronization method according to claim 3, characterized in that: The method further comprises: Compare the data structure of the second basic configuration information with the preset import information table; If the data structures are consistent, importing the first query result into the intermediate library of the kettle script; Performing field conflict detection on the intermediate database and the target database of the data import end according to preset conflict detection rules, and obtaining conflict detection results, wherein the conflict detection results include: conflict items; Determine a conflict strategy according to the conflict detection result, and perform a deletion operation or a retention operation on the conflicting item according to the conflict strategy; The conflict detection result is saved in the unified storage directory.

5. The data synchronization method according to claim 4, characterized in that: The performing field conflict detection on the intermediate database and the target database of the data import end according to the preset conflict detection rule includes: Performing field conflict detection on the intermediate database and the target database of the data import end according to the preset conflict detection rule, and obtaining a preprocessing result of the field conflict detection; Substitute the first query result and the preprocessing result into each service subsystem in the preset data service system to perform conflict detection and obtain the conflict detection result.

6. The data synchronization method according to claim 1, characterized in that: The step of mounting the mobile device to the data import end includes: Connecting the mobile device to the data import terminal; Acquiring device information and initial mounting information through the mobile device; Fill the device information and the initial mounting information into a preset mounting configuration page, start the mounting button according to the preset mounting configuration page, and control the mobile device to mount to the data import end.

7. The data synchronization method according to claim 1, characterized in that: After determining whether the data import end and the data export end are in a normal connected state, the method further includes: If the data import end and the data export end are in the normal connected state, the target migration data is selected according to a preset export selection rule, wherein the preset export selection rule includes: an incremental export rule and / or a full export rule; The target migration data is imported into the data import end according to a preset conflict detection rule.

8. A data synchronization device, characterized in that: The device comprises: A judgment module is used to judge whether the data import end and the data export end are in a normal connection state; A transmission module, configured to mount a mobile device to the data export end if the data import end and the data export end are in an abnormal connection state, perform information query on the data export end according to a preset export rule, obtain query results, generate target migration data according to the query results, and transmit the target migration data to the mobile device; The import module is used to mount the mobile device to the data import end, and import the target migration data to the data import end according to a preset import rule.

9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the data synchronization method according to any one of claims 1 to 7 is executed.

10. A computer-readable storage medium, characterized in that: The computer program stores a computer program, which executes the data synchronization method according to any one of claims 1 to 7 when running on a processor.

Citation Information

Patent Citations

  • Civil aviation data synchronization method and device based on DataX

    CN114519199A

  • System for custom verification and scripting of mobile applications

    CN115136126A

  • Data migration method, system, equipment and medium

    CN116244272A

  • Systems and methods for transactional applications in an unreliable wireless network

    US20170031661A1

  • Data migration methods and apparatuses, electronic device, and storage medium

    WO2023134627A1

Cited By

  • Personnel file data synchronization method and device and computer equipment

    CN120631858A