Data synchronization method

By establishing data overview tables and details tables in the server and local storage, recording user operations and data modification time, efficient coverage of cloud data synchronization is achieved, solving the problem of low data upload efficiency when logging in by multiple clients, and improving data Interaction speed.

CN118964476AInactive Publication Date: 2024-11-15ANHUI XIAODOU NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310540603.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-15
Publication Date
2024-11-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When existing cloud data synchronization is logged in with multiple clients, the data upload efficiency is low, resulting in large amount of data interactions, and the inability to modify targeted coverage, which is low efficiency.

Method used

Create a data overview table and a data detail table in the server and local storage respectively, record the user's total operation last modification time, details data content and modification time. After the client accesses the server, the server uploads the data overview table and details table. The last modification time is compared and overwritten and the locally stored data is only modified and overwritten and overwritten.

Benefits of technology

By uploading and comparing data overview tables and details tables in real time, the amount of data synchronization between local storage and server is reduced, the device load is reduced, and the data interaction speed is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964476A_ABST
    Figure CN118964476A_ABST
Patent Text Reader

Abstract

The invention discloses a data synchronization method, which comprises the following steps of: for a server and local storage, storing a data overview table for a user, and recording the final modification time of the total operation of the user; and for the server and the local storage, a data detail table is stored for each user, and a final modification time is added for each detail data content of the user. According to the invention, the data overview table and the data detail table are respectively established for the server and the local storage, so that the server uploads the final modification time of the total operation to the local storage in real time after the user accesses the server through the client to carry out the data modification operation, and the data detail table of the user is uploaded after the specific operation user is found. According to the method, specific data modified by user operation is found, and then single data is uploaded and synchronized, so that the data synchronization quantity of local storage and a server side is greatly reduced, the equipment load is reduced, and the data interaction speed is improved.
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 data synchronization method. Background Art

[0002] Cloud data synchronization is a service that uploads local data to a server for storage over the network, stores files and data on a remote server, and can be used on any device. It uses scalable computing and storage services, which is very suitable for accessing and updating files and data from many different devices and mobile applications. Cloud synchronization also provides a secure storage space to help users recover lost data and files. For example, existing network communication software has many users and can log in with multiple clients. When multiple clients log in, they interact with the server at the same time, and the server records their data changes and uploads them synchronously in real time. However, due to the different data upload efficiencies caused by multiple clients, if you need to synchronize data between the cloud and the client, you need to continuously and comprehensively update the coverage data, and you cannot modify the coverage in a targeted manner. Therefore, the amount of data interaction is large and the efficiency is low. Summary of the invention

[0003] The object of the present invention is to provide a method for data synchronization to solve the problem of large amount of data synchronization and low efficiency.

[0004] To achieve the above-mentioned purpose, the present invention provides the following technical solutions: A method for data synchronization, comprising the following steps: for a server and a local storage, a data overview table is stored for a user, and the last modification time of the user's total operation is recorded; for a server and a local storage, a data detail table is also stored for each user, and a last modification time is added to each detail data content of the user; When the client accesses the server and performs an operation, the server uploads the last modification time of the data overview table and the data details table; based on the data overview table uploaded by the server, the server compares it with the local storage and modifies and overwrites the locally stored data overview table, and then compares the last modification time of the operation data in the data details table based on the modification time of the data overview table, and then modifies and overwrites the operation data whose last modification time has changed.

[0005] Preferably, the data overview table includes user IDs, and the user IDs are arranged in columns, and the last modification time of the user's total operation is recorded after each column ID.

[0006] Preferably, the data details table includes the user's data ID, which is arranged in columns, and after each column of user ID, the data content is arranged in columns, and after the data content, the last modification time is arranged in columns.

[0007] Preferably, when the client accesses the server and performs an operation, the server uploads the last modification time of the data overview table and the data details table, including: The last modification time of the data details table is uploaded first. When the data details table receives a response, the last modification time of the corresponding user ID data details table is uploaded according to the request data.

[0008] Preferably, the server compares the data overview table uploaded by the server with the local storage, modifies and covers the locally stored data overview table, and then compares the last modification time of the operation data in the data details table according to the modification time of the data overview table, and then modifies and covers the operation data whose last modification time has changed, including: The client compares the data returned by the data overview table with the local data. When it is found that the last update time of the locally stored data overview table lags behind the update time of the data overview table returned by the server, it initiates a response to the server to request the data details table data of the user ID that needs to be updated; Then compare the last update time in the data details table in turn. If the last modification time of the locally stored data ID lags behind that of the server, re-initiate a request to the server to re-acquire the details data of the data ID, and then refresh the locally stored details data and the last update time.

[0009] Preferably, the server compares the data summary table uploaded by the server with the local storage, modifies and covers the locally stored data summary table, then compares the last modification time of the operation data in the data details table according to the modification time of the data summary table, and then modifies and covers the operation data whose last modification time has changed, and then further includes: If an exception occurs in the local storage during the data update process, a request is re-sent to the server to obtain all the data in the data overview table and the data details table, and then all the data in the local storage and the last update time are overwritten.

[0010] The present invention also provides a data synchronization device, comprising: The data operation module is used to store a data overview table for the user on the server and locally, and record the last modification time of the user's total operation; The data operation module is also used for the server and local storage, and stores a data detail table for each user, and adds a last modification time for each detail data content of the user; The data operation module is also used to compare the server with the local storage according to the data overview table uploaded by the server, and modify and overwrite the locally stored data overview table, and then compare the last modification time of the operation data in the data details table according to the modification time of the data overview table, and then modify and overwrite the operation data whose last modification time has changed; The data transmission module is used when the client accesses the server and performs an operation, and the server uploads the last modification time of the data overview table and the data details table.

[0011] The present invention also provides a data synchronization device, which is a physical device and includes: A processor and a memory, wherein the processor and the memory are communicatively connected with the processor; The memory is used to store at least one executable instruction executed by the processor, and the processor is used to execute the executable instruction to implement the data synchronization method as described above.

[0012] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data synchronization method as described above is implemented.

[0013] Compared with the prior art, the present invention has the following beneficial effects: By establishing a data overview table and a data detail table for the server and local storage respectively, the data is used to record the last modification time of the user's total operation and the user's detailed data content and modification time. After the user accesses the server through the client to modify the data, the server uploads the last modification time of the total operation to the local storage in real time. After finding the specific operation user, the data detail table of the user is uploaded to find the specific data modified by the user operation, and then the individual data is uploaded and synchronized, which greatly reduces the data synchronization amount between the local storage and the server, reduces the equipment load, and improves the data interaction speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 A main flow chart of a data synchronization method provided by an embodiment of the present invention; Figure 2 A structural block diagram of a data synchronization device provided by an embodiment of the present invention. Implementation

[0015] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0016] The execution subject of the method of this embodiment is a terminal, which can be a mobile phone, tablet computer, PDA, notebook or desktop computer, etc. Of course, it can also be other devices with similar functions, which is not limited in this embodiment.

[0017] See also Figures 1 to 2 The present invention provides a data synchronization method, which is applied to cloud data synchronization and includes: Step 101, for the server and local storage, a data overview table is stored for the user, and the last modification time of the user's total operation is recorded.

[0018] Specifically, the data overview table is as follows: Data Overview Table The table includes user IDs, and the user IDs are arranged in columns. The last modification time of the user's total operation is recorded after each column ID.

[0019] Step 102: For the server and local storage, a data detail table is stored for each user, and a last modification time is added to each detail data content of the user.

[0020] Specifically, the data details table is as follows: User A data details table The table includes the user's data ID, which is arranged in columns. After each column of user ID, the data content is arranged in columns, and after the data content, the last modification time is arranged in columns.

[0021] Among them, the data overview table and data summary table on the server are synchronized with the client. When the client user performs an operation, the server will synchronize the changes and record the last modification time.

[0022] Step 103, after the client accesses the server and performs an operation, the server uploads the last modification time of the data overview table and the data details table.

[0023] Specifically, when the data overview table and data overview table on the server are changed, the last modification time of the data details table is uploaded to the local storage first. When the data details table receives a response, the last modification time of the corresponding user ID data details table is uploaded according to the request data.

[0024] Step 104, based on the data overview table uploaded by the server, the server compares it with the local storage, and modifies and overwrites the locally stored data overview table, and then compares the last modification time of the operation data in the data details table based on the modification time of the data overview table, and then modifies and overwrites the operation data whose last modification time has changed.

[0025] Specifically, for the data returned by the data overview table, the client compares the data with the local data. When it is found that the last update time of the locally stored data overview table lags behind the update time of the data overview table returned by the server, a response is initiated to the server to request the data of the data details table of the user ID that needs to be updated; Then compare the last update time in the data detail table in turn. If the last modification time of the locally stored data ID lags behind that of the server, re-initiate a request to the server to re-acquire the detail data of the data ID, and then refresh the locally stored detail data and the last update time. For example: After user A accesses the server through the client, the data overview table and the data overview table on the server do not change. If user A modifies data b, the last modification time of the data overview table is synchronized and changed to the time after the user operation is completed. At the same time, the data content b column corresponding to the modified data in the data details table is synchronized and the last modification time is updated.

[0026] Step 105: If an exception occurs during the data update process in step 104, a request is re-sent to the server to obtain all the data in the data overview table and the data details table, and then all the locally stored data and the last update time are overwritten.

[0027] Specifically, if it is found that the local storage initiates a response to the server and the data is the same when synchronizing data with the server and does not need to be updated, or if the server fails to initiate a request in time after the data changes, then a request is initiated to the server to obtain all the data in the data overview table and the data details table, and then overwrite all the data in the local storage and the last update time.

[0028] In this embodiment, a data overview table and a data detail table are established for the server and local storage respectively to record the last modification time of the user's total operation and the user's detailed data content and modification time. This allows the user to access the server through the client to perform data modification operations, and the server uploads the last modification time of the total operation to the local storage in real time. After finding the specific operation user, the user's data detail table is uploaded to find the specific data modified by the user's operation, and then the individual data is uploaded and synchronized, which greatly reduces the amount of data synchronization between the local storage and the server, reduces the equipment load, and improves the data interaction speed.

[0029] Based on the above embodiment, the present invention further provides a data synchronization device for supporting the data synchronization method of the above embodiment, the data synchronization device comprising: The data operation module is used to store a data overview table for the user on the server and locally, and record the last modification time of the user's total operation; The data operation module is also used for the server and local storage, and stores a data detail table for each user, and adds a last modification time for each detail data content of the user; The data operation module is also used to compare the server with the local storage according to the data overview table uploaded by the server, and modify and overwrite the locally stored data overview table, and then compare the last modification time of the operation data in the data details table according to the modification time of the data overview table, and then modify and overwrite the operation data whose last modification time has changed; The data transmission module is used when the client accesses the server and performs an operation, and the server uploads the last modification time of the data overview table and the data details table.

[0030] Furthermore, the data synchronization device may run the above-mentioned data synchronization method. For specific implementation, please refer to the method embodiment, which will not be described in detail here.

[0031] Based on the above embodiments, the present invention further provides a data synchronization device, the data synchronization device comprising: a processor and a memory, the processor being communicatively connected with the memory; In this embodiment, the memory may be implemented in any appropriate manner, for example, the memory may be a read-only memory, a mechanical hard disk, a solid-state hard disk, or a USB flash drive, etc.; the memory is used to store at least one executable instruction executed by the processor; In this embodiment, the processor can be implemented in any appropriate manner. For example, the processor can take the form of a microprocessor or a processor and a computer-readable medium storing computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, etc.; the processor is used to execute the executable instructions to implement the data synchronization method as described above.

[0032] Based on the above embodiments, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data synchronization method as described above is implemented.

[0033] Those of ordinary skill in the art will appreciate that the modules and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0034] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, equipment and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0035] In the several embodiments provided in the present application, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or equipment, which can be electrical, mechanical or other forms.

[0036] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0037] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0038] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program instructions, such as a USB flash drive, a mobile hard disk, a read-only storage server, a random access storage server, a magnetic disk or an optical disk.

[0039] In addition, it should be noted that the combination of the various technical features in this case is not limited to the combination described in the claims of this case or the combination described in the specific embodiments. All technical features described in this case can be freely combined or combined in any way unless there is a contradiction between them.

[0040] It should be noted that the above examples are only specific embodiments of the present invention, and the present invention is obviously not limited to the above examples, and there are many similar variations. All variations directly derived or associated from the contents disclosed by the technicians in this field should fall within the protection scope of the present invention.

[0041] The above are only preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for data synchronization, characterized in that: The following steps are involved: For the server and local storage, a data overview table is stored for the user, and the last modification time of the user's total operation is recorded; For the server and local storage, a data detail table is also stored for each user, and a last modification time is added to each detail data content of the user; When the client accesses the server and performs operations, the server uploads the last modification time of the data overview table and data details table; Based on the data overview table uploaded by the server, the server compares it with the local storage and modifies and overwrites the local stored data overview table. Then, based on the modification time of the data overview table, the server compares the last modification time of the operation data in the data details table and modifies and overwrites the operation data whose last modification time has changed.

2. The data synchronization method according to claim 1, characterized in that: The data overview table includes user IDs, and the user IDs are arranged in columns, and the last modification time of the user's total operation is recorded after each column ID.

3. The data synchronization method according to claim 1, characterized in that: The data details table includes the user's data ID, which is arranged in columns. After each column of user ID, data content is arranged in columns, and after the data content, the last modification time is arranged in columns.

4. The method for data synchronization according to claim 2, characterized in that: When the client accesses the server and performs an operation, the server uploads the last modification time of the data overview table and the data details table, including: The last modification time of the data details table is uploaded first. When the data details table receives a response, the last modification time of the corresponding user ID data details table is uploaded according to the request data.

5. The data synchronization method according to claim 1, characterized in that: The server compares the data overview table uploaded by the server with the local storage, modifies and covers the locally stored data overview table, and then compares the last modification time of the operation data in the data details table according to the modification time of the data overview table, and then modifies and covers the operation data whose last modification time has changed, including: The client compares the data returned by the data overview table with the local data. When it is found that the last update time of the locally stored data overview table lags behind the update time of the data overview table returned by the server, it initiates a response to the server to request the data of the data details table of the user ID that needs to be updated; Then compare the last update time in the data details table in turn. If the last modification time of the locally stored data ID lags behind that of the server, re-initiate a request to the server to re-acquire the details data of the data ID, and then refresh the locally stored details data and the last update time.

6. The method for data synchronization according to claim 1, characterized in that: According to the data overview table uploaded by the server, the server compares with the local storage, modifies and covers the local stored data overview table, and then compares the last modification time of the operation data in the data details table according to the modification time of the data overview table, and then modifies and covers the operation data whose last modification time has changed, and then also includes: If an exception occurs in the local storage during the data update process, a request is re-sent to the server to obtain all the data in the data overview table and the data details table, and then all the data in the local storage and the last update time are overwritten.

7. A data synchronization device, characterized in that: include: The data operation module is used to store a data overview table for the user on the server and locally, and record the last modification time of the user's total operation; The data operation module is also used for the server and local storage, and stores a data detail table for each user, and adds a last modification time for each detail data content of the user; The data operation module is also used to compare the server with the local storage according to the data overview table uploaded by the server, and modify and overwrite the locally stored data overview table, and then compare the last modification time of the operation data in the data details table according to the modification time of the data overview table, and then modify and overwrite the operation data whose last modification time has changed; The data transmission module is used for the server to upload the last modification time of the data overview table and the data details table after the client accesses the server and performs an operation.

8. A data synchronization device, characterized in that: The data synchronization device comprises: A processor and a memory, wherein the processor and the memory are communicatively connected with the processor; The memory is used to store at least one executable instruction executed by the processor, and the processor is used to execute the executable instruction to implement the data synchronization method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for data synchronization according to any one of claims 1 to 6 is implemented.