Server data synchronization method and system

By building three transmission channels between servers and using Git repository to generate synchronization marks, the problem that users cannot determine the latest data during data synchronization is solved, efficient emergency synchronization and resource conservation are achieved, and user experience and system performance are improved.

CN120353865BActive Publication Date: 2025-08-12CHENGDU POLYTECHNIC +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510838117.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-08-12
Estimated Expiration
2045-06-23

AI Technical Summary

Technical Problem

The existing data synchronization method lacks an effective mechanism when dealing with users' temporary modification and emergency synchronization requirements for files, resulting in the remote server being unable to obtain modification information in time, and other users cannot determine whether the accessed data is the latest data.

Method used

Three transmission channels (first, second and third-level transmission channels) are used for data synchronization, and Git warehouse and hook scripts are used to generate modification tracking information and synchronization mark stamps. Modification marks are inserted into the remote server, and emergency synchronization is performed through the secondary transmission channel, supporting automatic and demand-based emergency synchronization.

Benefits of technology

Improve user experience, ensure real-time and consistency of data, reduce network bandwidth and server resource consumption, and improve system performance and business continuity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353865B_ABST
    Figure CN120353865B_ABST
Patent Text Reader

Abstract

The present invention is applicable to the field of data synchronization technology and provides a server data synchronization method and system, comprising the following steps: receiving file update information sent by a user end, a near-end server updating a corresponding file according to the file update information, and generating modification tracking information; generating data synchronization information and a synchronization mark stamp based on the file update information and the modification tracking information, wherein the synchronization mark stamp includes a data storage location and modification tracking information; sending the synchronization mark stamp to a remote server via a primary transmission channel, and sending the data synchronization information to the remote server via a tertiary transmission channel; receiving the modification tracking information, inserting a modification mark into a corresponding file on the remote server; receiving a file access instruction, accessing the corresponding file, receiving an emergency synchronization confirmation instruction, and sending the corresponding data synchronization information via a secondary transmission channel. By inserting the modification mark, the present invention enables other users to clearly know whether the data they are accessing is the latest data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data synchronization, and in particular to a server data synchronization method and system. Background Art

[0002] In today's digital age, server data synchronization plays a vital role in many fields, such as corporate office, cloud computing services, distributed systems, etc. With the continuous expansion and globalization of corporate business, data needs to be frequently synchronized between servers in different geographical locations to ensure data consistency and availability. At the same time, users have increasingly higher requirements for the real-time and accuracy of data. Any data inconsistency may lead to serious consequences such as business interruption and wrong decision-making. Existing data synchronization methods lack an effective mechanism when dealing with users' temporary modifications and urgent synchronization needs for files. When a user modifies a file on a local server, the remote server may not be able to obtain the modification information in time, and other users cannot know which data has been modified, and thus cannot know whether the data they are accessing is the latest data. Therefore, it is necessary to provide a server data synchronization method and system to solve the above problems. Summary of the Invention

[0003] In view of the deficiencies in the prior art, the present invention aims to provide a server data synchronization method and system to solve the problems existing in the above-mentioned background technology.

[0004] The present invention is implemented as follows: a server data synchronization method, the method comprising the following steps:

[0005] Receive file update information sent by the user end, and the local server updates the corresponding file according to the file update information and generates modification tracking information;

[0006] Generate data synchronization information and a synchronization marker based on the file update information and the modification tracking information, wherein the data synchronization information and the synchronization marker correspond to each other one-to-one, and the synchronization marker includes a data storage location and modification tracking information;

[0007] Send the synchronization mark stamp to the remote server through the first-level transmission channel, and send the data synchronization information to the remote server through the third-level transmission channel;

[0008] Receive modification tracking information and insert modification markers into the corresponding files on the remote server;

[0009] Receive file access instructions, access the corresponding files, receive modification mark click instructions, and generate a pop-up window to determine whether urgent synchronization is required;

[0010] Receive the emergency synchronization confirmation instruction, so that the corresponding data synchronization information is sent to the remote server through the secondary transmission channel;

[0011] Receive data synchronization information, so that the corresponding files in the remote server are updated synchronously. After the synchronization update, the corresponding synchronization mark stamp is deleted.

[0012] As a further solution of the present invention: the step of generating modification tracking information specifically includes:

[0013] Initialize a Git repository on the server for the directory where the file is located, add the file to the repository and commit the last version;

[0014] Set up a post-commit hook script in the Git repository, and the script will be automatically executed when the file is updated;

[0015] In the hook script, use Git commands to obtain the difference file between the current version and the previous version, parse the difference file, extract the modified file name and modification range information, and determine the modification tracking information.

[0016] As a further solution of the present invention, the step of inserting a modification mark into the corresponding file in the remote server specifically includes:

[0017] Receive modification tracking information, and determine all data modification areas in the corresponding file based on the modification tracking information;

[0018] A modification mark is inserted in each data modification area, wherein the modification mark has a link pop-up window triggering function, and each modification mark corresponds to a synchronization mark stamp.

[0019] As a further solution of the present invention, the steps of receiving a file access instruction, accessing a corresponding file, receiving a modification mark click instruction, and generating a pop-up window indicating whether emergency synchronization is required specifically include:

[0020] Receive a file access instruction, retrieve synchronization setting information of the accessing user, access the corresponding file, and determine whether there is a modification mark in the file;

[0021] When there is a modification mark and the synchronization setting information is automatic emergency synchronization, the corresponding data synchronization information is sent to the remote server through the secondary transmission channel;

[0022] When there is a modification mark and the synchronization setting information is required urgent synchronization, a modification mark click instruction is received and a pop-up window is generated to ask whether urgent synchronization is required.

[0023] As a further solution of the present invention: the method also includes: before generating data synchronization information and synchronization mark stamp, the network bandwidth occupancy rate of the three-level transmission channel is also measured. When the network bandwidth occupancy rate is lower than the occupancy threshold, only data synchronization information is generated, and no synchronization mark stamp is generated.

[0024] As a further solution of the present invention: the method also includes: the first-level transmission channel is used for metadata transmission, the UDP protocol is used to implement lightweight broadcast, and a 128-bit transmission sequence number is set to ensure sequential consistency; the second-level transmission channel is used for emergency data synchronization, a bandwidth guarantee mechanism is reserved, and TLS1.3 encrypted transmission is implemented; the third-level transmission channel is used for regular data synchronization, using breakpoint resume technology, setting every 2MB as a transmission unit, and enabling incremental compression technology.

[0025] Another object of the present invention is to provide a server data synchronization system, the system comprising:

[0026] The local server update module is used to receive file update information sent by the user end, and the local server updates the corresponding file according to the file update information and generates modification tracking information;

[0027] A synchronization mark stamp generating module is used to generate data synchronization information and a synchronization mark stamp based on the file update information and the modification tracking information. The data synchronization information and the synchronization mark stamp have a one-to-one correspondence, and the synchronization mark stamp includes a data storage location and modification tracking information;

[0028] The data separation and transmission module is used to send the synchronization mark stamp to the remote server through the primary transmission channel and send the data synchronization information to the remote server through the tertiary transmission channel;

[0029] A modification mark insertion module is used to receive modification tracking information and insert modification marks into corresponding files in the remote server;

[0030] The emergency synchronization selection module is used to receive file access instructions, access the corresponding files, receive modification mark click instructions, and generate a pop-up window to determine whether emergency synchronization is required;

[0031] An emergency synchronization transmission module is used to receive an emergency synchronization confirmation instruction, so that the corresponding data synchronization information is sent to the remote server through the secondary transmission channel;

[0032] The remote server update module is used to receive data synchronization information, so that the corresponding files in the remote server are synchronously updated, and after the synchronous update, the corresponding synchronization mark stamp is deleted.

[0033] As a further solution of the present invention: the proximal server update module includes:

[0034] The directory initialization unit is used to initialize the Git repository for the directory where the file is located on the server, add the file to the repository and commit the last version;

[0035] The hook script setting unit is used to set the post-commit hook script in the Git repository. When the file is updated, the script is automatically executed;

[0036] The modification tracking information unit is used in the hook script to use Git commands to obtain the difference file between the current version and the previous version, parse the difference file, extract the modified file name and modification range information, and determine the modification tracking information.

[0037] As a further solution of the present invention: the modification mark insertion module includes:

[0038] A modification area determination unit, configured to receive modification tracking information and determine all data modification areas in the corresponding file according to the modification tracking information;

[0039] The modification mark inserting unit is used to insert a modification mark in each data modification area. The modification mark has a link pop-up window triggering function, and each modification mark corresponds to a synchronization mark stamp.

[0040] As a further solution of the present invention: the emergency synchronization selection module includes:

[0041] A file access unit is used to receive a file access instruction, retrieve synchronization setting information of the accessing user, access the corresponding file, and determine whether there is a modification mark in the file;

[0042] An automatic emergency synchronization unit, configured to, when a modification mark is present and the synchronization setting information is for automatic emergency synchronization, send the corresponding data synchronization information to a remote server via a secondary transmission channel;

[0043] The urgent synchronization unit is used to receive a modification mark click instruction when there is a modification mark and the synchronization setting information is urgent synchronization required, and generate a pop-up window asking whether urgent synchronization is required.

[0044] Compared with the prior art, the present invention has the following beneficial effects:

[0045] The present invention sets up primary, secondary, and tertiary transmission channels. The synchronization mark stamp will first reach the remote server through the primary transmission channel. Based on the modification tracking information, the modification mark will be inserted into the corresponding file on the remote server. In this way, other users can clearly know which data has been modified and whether the data they are accessing is the latest. When other users access a file, if the file contains a modification mark, the user can enter an urgent synchronization confirmation command, which will cause the corresponding data synchronization information to be sent to the remote server through the secondary transmission channel, allowing the data required by the user to be urgently synchronized, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1The present invention is a flowchart of a server data synchronization method.

[0047] Figure 2 A flowchart of generating modification tracking information in a server data synchronization method.

[0048] Figure 3 The present invention is a flow chart of inserting a modification mark into a remote server file in a server data synchronization method.

[0049] Figure 4 The present invention is a flowchart of receiving a file access instruction in a server data synchronization method.

[0050] Figure 5 The figure is a structural diagram of a server data synchronization system.

[0051] Figure numerals: 100 - proximal server update module, 200 - synchronization mark stamp generation module, 300 - data separation and transmission module, 400 - modification mark insertion module, 500 - emergency synchronization selection module, 600 - emergency synchronization transmission module, 700 - remote server update module. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0053] The specific implementation of the present invention is described in detail below with reference to specific embodiments.

[0054] like Figure 1 As shown, an embodiment of the present invention provides a server data synchronization method, the method comprising the following steps:

[0055] S100, receiving file update information sent by the user terminal, the local server updates the corresponding file according to the file update information, and generates modification tracking information;

[0056] S200, generating data synchronization information and a synchronization marker based on the file update information and the modification tracking information, wherein the data synchronization information and the synchronization marker correspond to each other one-to-one, and the synchronization marker includes a data storage location and modification tracking information;

[0057] S300, sending the synchronization marker to the remote server via the primary transmission channel, and sending the data synchronization information to the remote server via the tertiary transmission channel;

[0058] S400, receiving modification tracking information, so that a modification mark is inserted into the corresponding file in the remote server;

[0059] S500: Receive a file access instruction, access the corresponding file, receive a modification mark click instruction, and generate a pop-up window to determine whether urgent synchronization is required;

[0060] S600, receiving an emergency synchronization confirmation instruction, so that the corresponding data synchronization information is sent to the remote server through the secondary transmission channel;

[0061] S700: Receive data synchronization information, so that the corresponding file in the remote server is synchronously updated. After the synchronous update, the corresponding synchronization mark stamp is deleted.

[0062] It should be noted that the traditional server data synchronization method mainly adopts a simple full data synchronization, that is, the entire data set is regularly copied from the source server to the target server. Although this method is simple to implement, it consumes a large amount of network bandwidth and server resources. Especially when the amount of data is large, the synchronization process will become very slow, seriously affecting the performance and response speed of the system. In addition, the existing data synchronization method lacks an effective mechanism when dealing with users' temporary modifications to files and urgent synchronization needs. When a user modifies a file on a near-end server, the remote server may not be able to obtain the modification information in time, and other users cannot know which data has been modified, and thus cannot know whether the data they are accessing is the latest data. The embodiments of the present invention are intended to solve the above problems.

[0063] In an embodiment of the present invention, it is first necessary to construct three transmission channels between servers, namely, a primary transmission channel, a secondary transmission channel, and a tertiary transmission channel, with corresponding transmission speeds decreasing. The primary transmission channel is used for metadata transmission, adopts the UDP protocol to implement lightweight broadcasting, and sets a 128-bit transmission sequence number to ensure sequential consistency; the secondary transmission channel is used for emergency data synchronization, reserves a bandwidth guarantee mechanism, dynamically allocates at least 30% of bandwidth resources, and implements TLS1.3 encrypted transmission; the tertiary transmission channel is used for routine data synchronization, adopts breakpoint resume technology, sets every 2MB as a transmission unit, enables incremental compression technology, and performs LZ4 real-time compression on text files. When a user sends file update information to the proximal server, the proximal server will update the corresponding file according to the file update information, and automatically generate modification tracking information, which reflects the area where the file has been modified. The near-end server will then generate data synchronization information and a synchronization mark stamp based on the file update information and modification tracking information. One piece of data synchronization information corresponds to one synchronization mark stamp, and the synchronization mark stamp includes the data storage location and modification tracking information. The embodiment of the present invention accurately generates data synchronization information and synchronization mark stamps, and only transmits necessary data, which greatly reduces network bandwidth and server resource consumption, and improves the overall performance and resource utilization of the system. The synchronization mark stamp is then sent to the remote server through the first-level transmission channel, and the data synchronization information is sent to the remote server through the third-level transmission channel. It is easy to understand that the synchronization mark stamp arrives at the remote server before the data synchronization information. When the remote server receives the synchronization mark stamp, it will insert a modification mark into the corresponding file in the remote server according to the modification tracking information. In this way, other users can clearly know which data has been modified and whether the data they are accessing is the latest data. Other users can access the corresponding file by inputting the file access instruction. If there is a modification mark in the file, it means that the file is not the latest. When the user clicks the modification mark, it is equivalent to inputting the modification mark click instruction. At this time, a pop-up window will be generated asking whether emergency synchronization is required. When the user clicks yes, an emergency synchronization confirmation instruction will be input. At this time, the corresponding data synchronization information will be sent to the remote server through the secondary transmission channel, so that the data required by the user can be urgently synchronized. After the remote server receives the data synchronization information, it will synchronize the corresponding file on the remote server. After the synchronization update, the corresponding synchronization mark stamp will be deleted, and the corresponding modification mark will no longer exist. In this way, when the user has an urgent synchronization need, the emergency synchronization process can be triggered through a simple operation, so that the data synchronization information can be quickly sent to the remote server through the secondary transmission channel, and the file synchronization update can be completed in time, which improves the user experience and ensures the continuity and real-time performance of the business.

[0064] like Figure 2 As shown, as a preferred embodiment of the present invention, the step of generating modification tracking information specifically includes:

[0065] S101, initialize the Git repository for the directory where the file is located on the server, add the file to the repository and commit the last version;

[0066] S102, set up a post-commit hook script in the Git repository, and the script will be automatically executed when the file is updated;

[0067] S103, in the hook script, use the Git command to obtain the difference file between the current version and the previous version, parse the difference file, extract the modified file name and modification range information, and determine the modification tracking information.

[0068] To obtain change tracking information, the present embodiment leverages the features of version control systems (such as Git) to record incremental file information (diffs) for each file modification. Modified parts can be determined by analyzing the diff information. Specifically, a Git repository is initialized on the server for the directory containing the files to be tracked. The files are added to the repository and the previous version is committed. A post-commit hook script is then set up in the Git repository. This script automatically executes when a file is updated. Within the hook script, Git commands (such as git diff HEAD^HEAD--filename) are used to obtain the difference (diff information) between the current and previous versions. The diff file is parsed to extract the modified file names and modification range information, thereby determining the change tracking information. For example, the display may read "lines 10-15 of file example.txt were modified." This accurately reflects the modification range and supports complex file operations (such as insertion, deletion, and modification). Git itself has powerful version management capabilities.

[0069] like Figure 3 As shown, as a preferred embodiment of the present invention, the step of receiving modification tracking information and inserting a modification mark into the corresponding file in the remote server specifically includes:

[0070] S401, receiving modification tracking information, and determining all data modification areas in the corresponding file according to the modification tracking information;

[0071] S402: inserting a modification mark in each data modification area, wherein the modification mark has a link pop-up window triggering function, and each modification mark corresponds to a synchronization mark stamp.

[0072] In an embodiment of the present invention, the modification tracking information has clearly expressed which parts of the file have been modified, and all data modification areas in the corresponding file can be easily obtained. Then, a modification mark will be inserted in each data modification area. The modification mark has a link pop-up window triggering function. Clicking on any modification mark will trigger a pop-up window.

[0073] like Figure 4 As shown, as a preferred embodiment of the present invention, the steps of receiving a file access instruction, accessing the corresponding file, receiving a modification mark click instruction, and generating a pop-up window of whether emergency synchronization is required specifically include:

[0074] S501, receiving a file access instruction, retrieving synchronization setting information of the accessing user, accessing the corresponding file, and determining whether a modification mark exists in the file;

[0075] S502, when there is a modification mark and the synchronization setting information is automatic emergency synchronization, the corresponding data synchronization information is sent to the remote server through the secondary transmission channel;

[0076] S503: When there is a modification mark and the synchronization setting information is urgent synchronization on demand, a modification mark click instruction is received and a pop-up window is generated to ask whether urgent synchronization is required.

[0077] In an embodiment of the present invention, the user can also customize the emergency synchronization mode and select automatic emergency synchronization or demand emergency synchronization. When there is a modification mark in the file accessed by the user, and the synchronization setting information is automatic emergency synchronization, the corresponding data synchronization information is directly sent to the remote server through the secondary transmission channel. When there is a modification mark in the file accessed by the user, and the synchronization setting information is demand emergency synchronization, if the user checks the file and finds that the part of the content he needs has not been modified and there is no modification mark, there is no need for emergency synchronization; if the user finds that there is a modification mark on the content he needs, he will enter the modification mark click instruction, and a pop-up window will be generated to ask whether emergency synchronization is needed.

[0078] As a preferred embodiment of the present invention, before generating data synchronization information and synchronization mark stamps, the network bandwidth occupancy rate of the tertiary transmission channel will also be measured. When the network bandwidth occupancy rate is lower than the occupancy threshold, it means that the rate of the tertiary transmission channel is faster and equivalent to the rate of the secondary transmission channel. At this time, only data synchronization information is generated, and no synchronization mark stamp is generated, thereby avoiding the execution of useless programs.

[0079] like Figure 5 As shown, an embodiment of the present invention further provides a server data synchronization system, the system comprising:

[0080] The local server update module 100 is used to receive file update information sent by the user end, and the local server updates the corresponding file according to the file update information and generates modification tracking information;

[0081] A synchronization marker generation module 200 is configured to generate data synchronization information and a synchronization marker based on the file update information and the modification tracking information. The data synchronization information and the synchronization marker correspond to each other in a one-to-one manner. The synchronization marker includes a data storage location and modification tracking information.

[0082] The data separation and transmission module 300 is used to send the synchronization mark stamp to the remote server through the primary transmission channel and send the data synchronization information to the remote server through the tertiary transmission channel;

[0083] A modification mark inserting module 400 is used to receive modification tracking information and insert a modification mark into the corresponding file in the remote server;

[0084] The emergency synchronization selection module 500 is used to receive a file access instruction, access the corresponding file, receive a modification mark click instruction, and generate a pop-up window indicating whether emergency synchronization is required;

[0085] The emergency synchronization transmission module 600 is used to receive the emergency synchronization confirmation instruction, so that the corresponding data synchronization information is sent to the remote server through the secondary transmission channel;

[0086] The remote server update module 700 is used to receive data synchronization information, so that the corresponding files in the remote server are synchronously updated, and after the synchronous update, the corresponding synchronization mark stamp is deleted.

[0087] As a preferred embodiment of the present invention, the local server update module 100 includes:

[0088] The directory initialization unit is used to initialize the Git repository for the directory where the file is located on the server, add the file to the repository and commit the last version;

[0089] The hook script setting unit is used to set the post-commit hook script in the Git repository. When the file is updated, the script is automatically executed;

[0090] The modification tracking information unit is used in the hook script to use Git commands to obtain the difference file between the current version and the previous version, parse the difference file, extract the modified file name and modification range information, and determine the modification tracking information.

[0091] As a preferred embodiment of the present invention, the modification mark insertion module 400 includes:

[0092] A modification area determination unit, configured to receive modification tracking information and determine all data modification areas in the corresponding file according to the modification tracking information;

[0093] The modification mark inserting unit is used to insert a modification mark in each data modification area. The modification mark has a link pop-up window triggering function, and each modification mark corresponds to a synchronization mark stamp.

[0094] As a preferred embodiment of the present invention, the emergency synchronization selection module 500 includes:

[0095] A file access unit is used to receive a file access instruction, retrieve synchronization setting information of the accessing user, access the corresponding file, and determine whether there is a modification mark in the file;

[0096] An automatic emergency synchronization unit, configured to, when a modification mark is present and the synchronization setting information is for automatic emergency synchronization, send the corresponding data synchronization information to a remote server via a secondary transmission channel;

[0097] The urgent synchronization unit is used to receive a modification mark click instruction when there is a modification mark and the synchronization setting information is urgent synchronization required, and generate a pop-up window asking whether urgent synchronization is required.

[0098] The above is only a detailed description of the preferred embodiments of the present invention, which is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

[0099] It should be understood that, although the various steps in the flow chart of each embodiment of the present invention are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless otherwise specified herein, the execution of these steps is not strictly limited in order, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0100] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When executed, the program can include the processes of the above-described method embodiments. Any reference to memory, storage, database, or other media used in the various embodiments provided herein may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).

[0101] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the disclosure in the specification and examples. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered merely as exemplary, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. A server data synchronization method, characterized in that: The method comprises the following steps: Receive file update information sent by the user end, and the local server updates the corresponding file according to the file update information and generates modification tracking information; Generate data synchronization information and a synchronization marker based on the file update information and the modification tracking information, wherein the data synchronization information and the synchronization marker correspond to each other one-to-one, and the synchronization marker includes a data storage location and modification tracking information; Send the synchronization mark stamp to the remote server through the first-level transmission channel, and send the data synchronization information to the remote server through the third-level transmission channel; Receive modification tracking information and insert modification markers into the corresponding files on the remote server; Receive file access instructions, access the corresponding files, receive modification mark click instructions, and generate a pop-up window to determine whether urgent synchronization is required; Receive the emergency synchronization confirmation instruction, so that the corresponding data synchronization information is sent to the remote server through the secondary transmission channel; Receive data synchronization information, so that the corresponding files in the remote server are updated synchronously, and after the synchronization is updated, the corresponding synchronization mark stamp is deleted; The steps of receiving a file access instruction, accessing a corresponding file, receiving a modification mark click instruction, and generating a pop-up window indicating whether an emergency synchronization is required specifically include: receiving a file access instruction, retrieving synchronization setting information of an accessing user, accessing a corresponding file, and determining whether a modification mark exists in the file; when a modification mark exists and the synchronization setting information is for automatic emergency synchronization, causing the corresponding data synchronization information to be sent to a remote server via a secondary transmission channel; when a modification mark exists and the synchronization setting information is for on-demand emergency synchronization, receiving a modification mark click instruction and generating a pop-up window indicating whether an emergency synchronization is required; The first-level transmission channel is used for metadata transmission, adopts the UDP protocol to implement lightweight broadcast, and sets a 128-bit transmission sequence number to ensure sequential consistency; the second-level transmission channel is used for emergency data synchronization, reserves a bandwidth guarantee mechanism, and implements TLS1.3 encrypted transmission; the third-level transmission channel is used for regular data synchronization, adopts breakpoint resume technology, sets every 2MB as a transmission unit, and enables incremental compression technology.

2. The server data synchronization method according to claim 1, characterized in that: The step of generating modification tracking information specifically includes: Initialize a Git repository on the server for the directory where the file is located, add the file to the repository and commit the last version; Set up a post-commit hook script in the Git repository, and the script will be automatically executed when the file is updated; In the hook script, use Git commands to obtain the difference file between the current version and the previous version, parse the difference file, extract the modified file name and modification range information, and determine the modification tracking information.

3. The server data synchronization method according to claim 1, characterized in that: The step of receiving the modification tracking information and inserting a modification mark into the corresponding file in the remote server specifically includes: Receive modification tracking information, and determine all data modification areas in the corresponding file based on the modification tracking information; A modification mark is inserted in each data modification area, wherein the modification mark has a link pop-up window triggering function, and each modification mark corresponds to a synchronization mark stamp.

4. The server data synchronization method according to claim 1, characterized in that: The method further includes: before generating the data synchronization information and the synchronization marker, measuring the network bandwidth occupancy rate of the three-level transmission channel; when the network bandwidth occupancy rate is lower than the occupancy threshold, only generating the data synchronization information without generating the synchronization marker.

5. A server data synchronization system, characterized in that: The system comprises: The local server update module is used to receive file update information sent by the user end, and the local server updates the corresponding file according to the file update information and generates modification tracking information; A synchronization mark stamp generating module is used to generate data synchronization information and a synchronization mark stamp based on the file update information and the modification tracking information. The data synchronization information and the synchronization mark stamp have a one-to-one correspondence, and the synchronization mark stamp includes a data storage location and modification tracking information; The data separation and transmission module is used to send the synchronization mark stamp to the remote server through the primary transmission channel and send the data synchronization information to the remote server through the tertiary transmission channel; A modification mark insertion module is used to receive modification tracking information and insert modification marks into corresponding files in the remote server; The emergency synchronization selection module is used to receive file access instructions, access the corresponding files, receive modification mark click instructions, and generate a pop-up window to determine whether emergency synchronization is required; An emergency synchronization transmission module is used to receive an emergency synchronization confirmation instruction, so that the corresponding data synchronization information is sent to the remote server through the secondary transmission channel; The remote server update module is used to receive data synchronization information, so that the corresponding files in the remote server are updated synchronously, and after the synchronization is updated, the corresponding synchronization mark stamp is deleted; The emergency synchronization selection module includes: a file access unit for receiving a file access instruction, retrieving the synchronization setting information of the accessing user, accessing the corresponding file, and determining whether there is a modification mark in the file; an automatic emergency synchronization unit for sending the corresponding data synchronization information to the remote server through a secondary transmission channel when there is a modification mark and the synchronization setting information is automatic emergency synchronization; a demand emergency synchronization unit for receiving a modification mark click instruction and generating a pop-up window indicating whether emergency synchronization is required when there is a modification mark and the synchronization setting information is demand emergency synchronization; The first-level transmission channel is used for metadata transmission, adopts the UDP protocol to implement lightweight broadcast, and sets a 128-bit transmission sequence number to ensure sequential consistency; the second-level transmission channel is used for emergency data synchronization, reserves a bandwidth guarantee mechanism, and implements TLS1.3 encrypted transmission; the third-level transmission channel is used for regular data synchronization, adopts breakpoint resume technology, sets every 2MB as a transmission unit, and enables incremental compression technology.

6. The server data synchronization system according to claim 5, characterized in that: The near-end server update module includes: The directory initialization unit is used to initialize the Git repository for the directory where the file is located on the server, add the file to the repository and commit the last version; The hook script setting unit is used to set the post-commit hook script in the Git repository. When the file is updated, the script is automatically executed; The modification tracking information unit is used in the hook script to use Git commands to obtain the difference file between the current version and the previous version, parse the difference file, extract the modified file name and modification range information, and determine the modification tracking information.

7. The server data synchronization system according to claim 5, characterized in that: The modification mark insertion module includes: A modification area determination unit, configured to receive modification tracking information and determine all data modification areas in the corresponding file according to the modification tracking information; The modification mark inserting unit is used to insert a modification mark in each data modification area. The modification mark has a link pop-up window triggering function, and each modification mark corresponds to a synchronization mark stamp.

Citation Information

Patent Citations

  • A method and system for data synchronization

    CN101009516A

  • Incremental synchronization method for data in tables of frontground and background database of wireless communication base station system

    CN101102577A