Multi-end file updating method and device, computer device and storage medium

CN118193464BActive Publication Date: 2026-11-03ANHUI DINGJIA COMPUTER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410265308.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-08
Publication Date
2026-11-03
Estimated Expiration
2044-03-08

AI Technical Summary

Technical Problem

When a user updates the same file on multiple devices, the updated content cannot be synchronized to the other devices on a single device, resulting in reduced stability of multi-device file updates.

Method used

By retrieving the cached fingerprint metadata of the file to be updated from the local cache, retrieving the historical fingerprint metadata from the server, comparing and updating the cached fingerprint metadata, determining the target incremental data to be uploaded, and uploading it to the server to complete file synchronization.

Benefits of technology

This ensures the stability of file updates across multiple devices, avoids errors caused by inconsistent updates between terminals, and improves the accuracy and efficiency of file updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118193464B_ABST
    Figure CN118193464B_ABST
Patent Text Reader

Abstract

The application relates to a multi-terminal file updating method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring cache fingerprint metadata corresponding to a to-be-updated file from a local cache, and acquiring historical fingerprint metadata corresponding to the to-be-updated file from a server; the cache fingerprint metadata comprises a cache fingerprint data group and cache summary information; the historical fingerprint metadata comprises a historical fingerprint data group and historical summary information; if the cache fingerprint metadata and the historical fingerprint metadata are different, the cache fingerprint metadata is updated based on the historical fingerprint metadata to obtain updated cache fingerprint metadata; target fingerprint metadata corresponding to the to-be-updated file is acquired, the updated cache fingerprint metadata is compared with the target fingerprint metadata, target incremental data to be uploaded is determined, and the target incremental data is uploaded to the server. The method can reduce the error rate during multi-terminal file updating and improve the stability of multi-terminal file updating.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data backup technology, and in particular to a multi-terminal file update method, apparatus, computer equipment, storage medium, and computer program product. Background Technology

[0002] With the explosive growth of personal data, more and more users are choosing to store or back up their data to the cloud. Typically, users first store data on local devices such as personal computers and mobile phones, and then back it up to a cloud storage center via synchronization. Related technologies employ incremental synchronization, which detects changes to files and uploads only the changed portions in each synchronization transfer, reducing network bandwidth consumption and synchronization time. However, when multiple devices update the same file, the inability of a single device to synchronize the updates to the others can lead to errors during subsequent multi-device file synchronizations, thus reducing the stability of multi-device file updates. Summary of the Invention

[0003] Therefore, it is necessary to provide a multi-terminal file update method, apparatus, computer device, computer-readable storage medium, and computer program product to address the aforementioned technical problems.

[0004] Firstly, this application provides a multi-terminal file update method. The method includes:

[0005] The cache fingerprint metadata corresponding to the file to be updated is obtained from the local cache, and the historical fingerprint metadata corresponding to the file to be updated is obtained from the server; the cache fingerprint metadata includes the cache fingerprint data group and cache digest information corresponding to the file to be updated; the historical fingerprint metadata includes the historical fingerprint data group and historical digest information corresponding to the file to be updated.

[0006] If the cached fingerprint metadata is different from the historical fingerprint metadata, then the cached fingerprint metadata is updated based on the historical fingerprint metadata to obtain the updated cached fingerprint metadata.

[0007] Obtain the target fingerprint metadata corresponding to the file to be updated, compare the updated cached fingerprint metadata with the target fingerprint metadata, determine the target incremental data to be uploaded, and upload the target incremental data to the server.

[0008] In one embodiment, updating the cached fingerprint metadata based on the historical fingerprint metadata to obtain the updated cached fingerprint metadata includes:

[0009] Based on the first time information in the cached digest information and the second time information in the historical digest information, the duration information is determined;

[0010] Determine the first difference fingerprint data between the cached fingerprint data group and the historical fingerprint data group, and determine the update fingerprint rate between the cached fingerprint metadata and the historical fingerprint metadata based on the first difference fingerprint data;

[0011] If the duration information and the updated fingerprint rate meet the first threshold condition, then the fingerprint data that differs in the cached fingerprint metadata is updated according to the fingerprint data in the historical fingerprint metadata to obtain the updated cached fingerprint metadata.

[0012] If the duration information and the updated fingerprint rate meet the second threshold condition, then all fingerprint data in the historical fingerprint metadata are updated to the cached fingerprint metadata to obtain the updated cached fingerprint metadata.

[0013] In one embodiment, comparing the updated cached fingerprint metadata with the target fingerprint metadata to determine the target incremental data to be uploaded includes:

[0014] The cached fingerprint data group in the cached fingerprint metadata is compared with the target fingerprint data group in the target fingerprint metadata to obtain the second difference fingerprint data;

[0015] The second differential fingerprint data is uploaded to the server so that the server can determine the second differential fingerprint data that is not stored in the shared fingerprint database based on the shared fingerprint database and multiple second differential fingerprint data, and use it as fingerprint data to be uploaded;

[0016] Receive the fingerprint data to be uploaded returned by the server, and determine the target incremental data corresponding to the fingerprint data to be uploaded.

[0017] In one embodiment, obtaining the target fingerprint metadata corresponding to the file to be updated includes:

[0018] The file to be updated is divided into blocks to obtain multiple blocks of data, and the fingerprint data corresponding to each block of data is determined.

[0019] Based on the file data of the file to be updated and the fingerprint data corresponding to the block data, the target fingerprint metadata corresponding to the file to be updated is generated.

[0020] In one embodiment, after uploading the target incremental data to the server, the method further includes:

[0021] The server receives a first verification code corresponding to the file to be updated, which is the hash value of the updated file after the server updates the file based on the target incremental data.

[0022] If the first verification code and the second verification code pass the consistency check, the cached fingerprint metadata in the local cache is updated based on the target fingerprint metadata; the second verification code is the hash value corresponding to the file to be updated generated by the client.

[0023] In one embodiment, before updating the cached fingerprint metadata based on the historical fingerprint metadata to obtain the updated cached fingerprint metadata, the method further includes:

[0024] If the cached digest information is the same as the historical digest information, then the cached fingerprint data group and the historical fingerprint data group are obtained;

[0025] If the cached fingerprint data group and the historical fingerprint data group are the same, then it is determined that the cached fingerprint metadata and the historical fingerprint metadata are the same.

[0026] In one embodiment, the method further includes:

[0027] If the local cache does not store cached fingerprint metadata, then historical fingerprint metadata is obtained from the server and used as the updated cached fingerprint metadata.

[0028] If the server does not store the historical fingerprint metadata corresponding to the file to be updated, then the file to be updated and the target fingerprint metadata corresponding to the file to be updated will be uploaded to the server in their entirety.

[0029] Secondly, this application also provides a multi-terminal file update device. The device includes:

[0030] The metadata acquisition module is used to obtain cache fingerprint metadata corresponding to the file to be updated from the local cache, and to obtain historical fingerprint metadata corresponding to the file to be updated from the server; the cache fingerprint metadata includes cache fingerprint data group and cache digest information corresponding to the file to be updated; the historical fingerprint metadata includes historical fingerprint data group and historical digest information corresponding to the file to be updated.

[0031] The metadata update module is used to update the cached fingerprint metadata based on the historical fingerprint metadata if the cached fingerprint metadata and the historical fingerprint metadata are different, so as to obtain the updated cached fingerprint metadata.

[0032] The file update module is used to obtain the target fingerprint metadata corresponding to the file to be updated, compare the updated cached fingerprint metadata with the target fingerprint metadata, determine the target incremental data to be uploaded, and upload the target incremental data to the server.

[0033] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described in the first aspect.

[0034] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.

[0035] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the method as described in the first aspect.

[0036] The aforementioned multi-terminal file update method, apparatus, computer equipment, storage medium, and computer program products involve the client reading cached fingerprint metadata corresponding to the file to be updated pre-stored in its local cache, and obtaining historical fingerprint metadata corresponding to the file to be updated from the server. Since both cached and historical fingerprint metadata are fingerprint metadata of the file to be updated, and fingerprint metadata contains fingerprint data groups and digest information, it can be determined whether the two versions of fingerprint metadata are completely identical by comparing them. If the cached and historical fingerprint metadata are different, it indicates that the historical fingerprint metadata may have been synchronized by other terminals. Based on this, the historical fingerprint metadata from the server needs to be synchronized to the client, i.e., the historical fingerprint metadata is updated to the cached fingerprint metadata. The client determines the target fingerprint metadata of the latest version of the file to be updated and compares the target fingerprint metadata with the updated cached fingerprint metadata, obtaining the fingerprint data that differs and the corresponding target incremental data, i.e., the data indicating the change in the file to be updated. Finally, the client uploads the target incremental data to the server, which can then complete the multi-terminal file update based on the target incremental data. The above steps verify the cached fingerprint metadata and historical fingerprint metadata. Therefore, if other terminals update the file to be updated, the verification can be used to correct the error, thus ensuring that the file update of this client will not cause errors and improving the stability of multi-terminal file updates. Attached Figure Description

[0037] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0038] Figure 1 This is a diagram illustrating the application environment of a multi-terminal file update method in one embodiment.

[0039] Figure 2 This is a flowchart illustrating a multi-terminal file update method in one embodiment;

[0040] Figure 3 This is a flowchart illustrating the step of updating cached fingerprint metadata in one embodiment;

[0041] Figure 4 This is a flowchart illustrating the steps for determining target incremental data in one embodiment;

[0042] Figure 5 This is a schematic diagram illustrating multi-terminal file updates in one embodiment;

[0043] Figure 6 This is a flowchart illustrating a multi-terminal file update method in another embodiment;

[0044] Figure 7 This is a flowchart illustrating a multi-terminal file update method in another embodiment;

[0045] Figure 8 This is a structural block diagram of a multi-terminal file update device in one embodiment;

[0046] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0048] The multi-terminal file update method provided in this application can be applied to, for example... Figure 1The application environment shown illustrates this. The client communicates with the server via a network. The client can retrieve cached fingerprint metadata of the file to be updated from its local cache, or from the server's shared fingerprint database to retrieve historical fingerprint metadata corresponding to the file. The client can compare the cached fingerprint metadata with the historical fingerprint metadata; if they are not identical, the client can update the cached fingerprint metadata based on the historical fingerprint metadata to obtain the latest version of the cached fingerprint metadata. The client generates target fingerprint metadata for the latest file to be updated and compares the target fingerprint metadata with the latest version of the cached fingerprint metadata to obtain the target incremental data to be uploaded. The client can upload the target incremental data to the server's shared fingerprint database and file database via the network. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. The server can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0049] In one exemplary embodiment, such as Figure 2 As shown, a multi-terminal file update method is provided, which can be applied to... Figure 1 Taking the client as an example, the explanation includes the following steps S202 to S206. Wherein:

[0050] Step S202: Obtain the cached fingerprint metadata corresponding to the file to be updated from the local cache, and obtain the historical fingerprint metadata corresponding to the file to be updated from the server.

[0051] The cached fingerprint metadata includes the cached fingerprint data set and cached digest information corresponding to the file to be updated; the historical fingerprint metadata includes the historical fingerprint data set and historical digest information corresponding to the file to be updated. The fingerprint data set contains fingerprint data corresponding to all file data of the file to be updated. The fingerprint data uniquely represents the file data in the file to be updated; for example, the fingerprint data can be a hash value corresponding to the file data. The digest information uniquely represents the corresponding version of the file to be updated. For example, the cached digest information of the cached fingerprint metadata can represent the version of the file to be updated in the local cache, and the historical digest information of the historical fingerprint metadata can represent the version of the file to be updated on the server.

[0052] Specifically, the client retrieves the cached fingerprint metadata stored in its local cache when the file to be updated was previously synchronized to the server, based on the file identifier of the file to be updated. The cached fingerprint metadata contains the cached fingerprint data group corresponding to the file to be updated during previous synchronization, as well as cache summary information. The cached fingerprint data group contains multiple fingerprint data corresponding to the file to be updated, and the cache summary information records data such as time information, version information, and file information corresponding to the cached fingerprint metadata. Correspondingly, the client can receive historical fingerprint metadata corresponding to the file to be updated stored on the server. Historical fingerprint metadata also contains historical fingerprint data groups corresponding to the file to be updated, as well as historical summary information. Since the file to be updated is stored on multiple terminals and may be updated on other terminals, the cached fingerprint metadata and historical fingerprint metadata may be the same or different.

[0053] Step S204: If the cached fingerprint metadata and the historical fingerprint metadata are different, then the cached fingerprint metadata is updated based on the historical fingerprint metadata to obtain the updated cached fingerprint metadata.

[0054] Specifically, the client compares the cached fingerprint metadata with the historical fingerprint metadata to determine if they are identical. If the cached fingerprint metadata differs from the historical fingerprint metadata, the client can synchronize the historical fingerprint metadata to the cached fingerprint metadata, making the updated cached fingerprint metadata identical to the historical fingerprint metadata. The client then compares the cached fingerprint data groups in the cached fingerprint metadata with the historical fingerprint data groups in the historical fingerprint metadata to determine if they are identical. Correspondingly, the client compares the cached digest information in the cached fingerprint metadata with the historical digest information in the historical fingerprint metadata to determine if they are identical.

[0055] If the comparison determines that the cached fingerprint metadata is different from the historical fingerprint metadata, the client can update the cached fingerprint metadata based on the historical fingerprint data group and historical digest information of the historical fingerprint metadata, so that the cached fingerprint data group and cached digest information of the cached fingerprint metadata are the same as the historical fingerprint data group and historical digest information, respectively.

[0056] Step S206: Obtain the target fingerprint metadata corresponding to the file to be updated, compare the updated cached fingerprint metadata with the target fingerprint metadata, determine the target incremental data to be uploaded, and upload the target incremental data to the server.

[0057] The target fingerprint metadata is the fingerprint metadata of the file to be updated at the current time and current version. It includes the target fingerprint data group and target digest information corresponding to the file to be updated. The target incremental data is the file data that the client needs to upload to the server.

[0058] Specifically, for the file to be updated at the current time and with the current version, the client generates a corresponding target fingerprint data set and target digest information, thereby obtaining the target fingerprint metadata. The client can divide the file into blocks and calculate the fingerprint data corresponding to each block, thus obtaining the target fingerprint data set. Simultaneously, the client can determine the version number and update time information of the target digest information through the update log, determine the directory digest information and data digest information of the file to be updated through an identification algorithm, and use this information as the target digest information.

[0059] The client compares the target fingerprint metadata with the cached fingerprint metadata. Since the cached fingerprint metadata is identical to the historical fingerprint metadata at this point, the client can identify differing fingerprint data through comparison. The client can also identify differing fingerprint data by comparing the target fingerprint data group and the cached fingerprint data group. Finally, the client can use the differing fingerprint data to search its local storage space for the corresponding file data, which will then be used as the target incremental data.

[0060] Optionally, when the client determines which file needs to be updated to the server, the client can compare the target summary information and historical summary information of each file to determine which files have changed, thereby identifying the file to be updated among multiple files.

[0061] In the aforementioned multi-device file update method, the client reads the cached fingerprint metadata corresponding to the file to be updated pre-stored in its local cache, and obtains the historical fingerprint metadata corresponding to the file to be updated from the server. Since both the cached and historical fingerprint metadata are fingerprint metadata for the file to be updated, and fingerprint metadata contains fingerprint data groups and digest information, the consistency of the two versions of fingerprint metadata can be determined by comparing them. If the cached and historical fingerprint metadata differ, it indicates that the historical fingerprint metadata may have been synchronized by other terminals. Therefore, the historical fingerprint metadata from the server needs to be synchronized to the client, i.e., the historical fingerprint metadata is updated to the cached fingerprint metadata. The client determines the target fingerprint metadata for the latest version of the file to be updated, compares the target fingerprint metadata with the updated cached fingerprint metadata, obtains the fingerprint data that differs, and obtains the corresponding target incremental data, i.e., the data indicating changes in the file to be updated. Finally, the client uploads the target incremental data to the server, which can then complete the multi-device file update based on the target incremental data. The above steps verify the cached fingerprint metadata and historical fingerprint metadata. Therefore, if other terminals update the file to be updated, the verification can be used to correct the error, thus ensuring that the file update of this client will not cause errors and improving the stability of multi-terminal file updates.

[0062] In one exemplary embodiment, such as Figure 3 As shown, the specific implementation process of the step "updating the cached fingerprint metadata based on historical fingerprint metadata to obtain the updated cached fingerprint metadata" includes steps S302 to S308. Wherein:

[0063] Step S302: Determine the duration information based on the first time information in the cached summary information and the second time information in the historical summary information.

[0064] The first time information can be the update timestamp of the cached summary information, and the second time information can be the update timestamp in the historical summary information.

[0065] Specifically, the client obtains the update timestamp from the cached summary information and the update timestamp from the historical summary information, and calculates the interval between the two update timestamps as the duration information.

[0066] Step S304: Determine the first difference fingerprint data between the cached fingerprint data group and the historical fingerprint data group, and determine the update fingerprint rate between the cached fingerprint metadata and the historical fingerprint metadata based on the first difference fingerprint data.

[0067] The first difference fingerprint data refers to newly added or modified fingerprint data in both the cached fingerprint data group and the historical fingerprint data group. The update fingerprint rate refers to the percentage of fingerprint data in the historical fingerprint data group that has changed compared to the fingerprint data in the cached fingerprint data group. A higher update fingerprint rate indicates a larger number of changed fingerprint data in the historical fingerprint data group, and a greater change in the historical fingerprint data group compared to the cached fingerprint data group.

[0068] Specifically, the client iterates through both the cached fingerprint data group and the historical fingerprint data group, comparing each fingerprint data to identify those with discrepancies, thus obtaining multiple first-difference fingerprint data. Based on this, the client determines the ratio between the number of first-difference fingerprint data and the total number of fingerprint data in the cached fingerprint data group, and uses this ratio as the update fingerprint rate between the cached fingerprint metadata and the historical fingerprint metadata.

[0069] Step S306: If the duration information and the fingerprint update rate meet the first threshold condition, then update the fingerprint data that differs from the cached fingerprint metadata based on the fingerprint data in the historical fingerprint metadata to obtain the updated cached fingerprint metadata.

[0070] Specifically, the first threshold condition can be that the time information does not exceed a time threshold, and the fingerprint update rate does not exceed a fingerprint rate threshold. When the time information and the fingerprint update rate meet the first threshold condition, it indicates that the difference between the historical fingerprint metadata and the cached fingerprint metadata is not significant, and the client can update only the fingerprint data that differs in the cached fingerprint metadata. The client can retrieve the fingerprint data that differs from the historical fingerprint metadata and update the cached fingerprint metadata with the differing fingerprint data, while simultaneously updating the cached digest information with the historical digest information. For example, the client can use an update command to update multiple fingerprint data that differ separately.

[0071] Step S308: If the duration information and the fingerprint update rate meet the second threshold condition, then all fingerprint data in the historical fingerprint metadata are updated to the cached fingerprint metadata to obtain the updated cached fingerprint metadata.

[0072] Specifically, the second threshold condition can be that the time information is greater than the time threshold, or that the fingerprint update rate is greater than the fingerprint rate threshold. When the time information and the fingerprint update rate meet the second threshold condition, it indicates that there is a significant difference between the historical fingerprint metadata and the cached fingerprint metadata. The client can then synchronize the historical fingerprint data groups and historical summary information from the historical fingerprint metadata to the cached fingerprint metadata to obtain the updated cached fingerprint metadata. For example, the client can delete the cached fingerprint metadata in the local cache and use the historical fingerprint metadata as the updated cached fingerprint metadata.

[0073] In this embodiment, by using the duration information between cached summary information and historical summary information, as well as the update rate between cached fingerprint metadata and historical fingerprint metadata, it is possible to determine the differences between historical fingerprint metadata and cached fingerprint metadata. This allows for the determination of different methods to be used for updating, resulting in updated cached fingerprint metadata. This improves the efficiency of updating cached fingerprint metadata and enhances synchronization efficiency.

[0074] In one exemplary embodiment, such as Figure 4 As shown, the specific implementation process of the step "comparing the updated cached fingerprint metadata with the target fingerprint metadata to determine the target incremental data to be uploaded" includes steps S402 to S406. Among them:

[0075] Step S402: Compare the cached fingerprint data group in the cached fingerprint metadata with the target fingerprint data group in the target fingerprint metadata to obtain the second differential fingerprint data.

[0076] The second difference fingerprint data is used to represent fingerprint data that differs between the cached fingerprint data group and the target fingerprint data group.

[0077] Specifically, the client iterates through the cached fingerprint data group and the target fingerprint data group respectively, compares all the fingerprint data corresponding to the cached fingerprint data group and the target fingerprint data group respectively, and obtains the newly added and modified fingerprint data, which is used as the second difference fingerprint data.

[0078] In one example, the client can iterate through the fingerprint data group of the target fingerprint metadata according to the index number of each fingerprint data, and determine whether the current fingerprint data of the target fingerprint metadata is the same as the fingerprint data contained in the cached fingerprint metadata. If the current fingerprint data is the same as the fingerprint data contained in the cached fingerprint metadata, no processing is performed; if the fingerprint data in the cached fingerprint metadata does not contain the current fingerprint data, the current fingerprint data is determined to be the second differential fingerprint data; if the current fingerprint data is different from the fingerprint data contained in the cached fingerprint metadata, the current fingerprint data is determined to be the second differential fingerprint data. After completing the traversal of the target fingerprint metadata, the second differential fingerprint data composed of multiple fingerprint data is obtained. Based on the second differential fingerprint data, the client determines the file data corresponding to the second differential fingerprint data in the file data corresponding to the file to be updated, thereby obtaining the target incremental data.

[0079] Optionally, the target fingerprint data group in the target fingerprint metadata may contain newly added fingerprint data, modified fingerprint data, or deleted fingerprint data, relative to the cached fingerprint data group in the cached fingerprint metadata. If newly added fingerprint data exists, the client can determine the target incremental data corresponding to the newly added fingerprint data and send it to the server. If modified fingerprint data exists, the client determines the target modified data corresponding to the modified fingerprint data and sends it to the server, whereby the server overwrites the original data with the target modified data. If fingerprint data needs to be deleted, the deleted fingerprint data is sent to the server, and the server determines the target deleted data corresponding to the deleted fingerprint data before deleting the target incremental data stored in the database.

[0080] Step S404: Upload the second differential fingerprint data to the server so that the server can determine the second differential fingerprint data not stored in the shared fingerprint database based on the shared fingerprint database and multiple second differential fingerprint data, and use it as the fingerprint data to be uploaded.

[0081] The shared fingerprint database is a server-side database used to store fingerprint metadata corresponding to multiple terminals and multiple files. In addition, the server also has a file database, which stores the file data corresponding to each fingerprint. Therefore, the shared fingerprint database and the file database are a corresponding pair of databases, storing fingerprint metadata and file data respectively.

[0082] Specifically, the client sends the second differential fingerprint data to the server. Upon receiving the second differential fingerprint data, the server iterates through the shared fingerprint database to check if it already contains the second differential fingerprint data. It should be understood that the shared fingerprint database exists in three scenarios: the second differential fingerprint data is completely stored in the shared fingerprint database; some of the fingerprint data is stored in the shared fingerprint database; or the second differential fingerprint data is not stored in the shared fingerprint database. Based on this, the server can determine the second differential fingerprint data not stored in the shared fingerprint database (i.e., the fingerprint data to be uploaded) based on the iteration results, and then package this fingerprint data into a message and return it to the client, allowing the client to determine the fingerprint data and file data that need to be uploaded.

[0083] Step S406: Receive the fingerprint data to be uploaded returned by the server, and determine the target incremental data corresponding to the fingerprint data to be uploaded.

[0084] Specifically, the client receives the message returned by the server and retrieves the fingerprint data to be uploaded from the message. The client parses the fingerprint data to be uploaded, determines the file data corresponding to the fingerprint data to be uploaded, and uses it as the target incremental data.

[0085] In this embodiment, by obtaining the second difference fingerprint data between the cached fingerprint data group and the target fingerprint data group, and by traversing the second difference fingerprint data on the server side to determine the fingerprint data and incremental data that actually need to be uploaded, and returning the message to the client, the client can determine the target incremental data. This reduces the amount of data uploaded to the server, thereby improving file update efficiency.

[0086] In an exemplary embodiment, the specific implementation process of the step "obtaining the target fingerprint metadata corresponding to the file to be updated" includes:

[0087] The file to be updated is divided into blocks to obtain multiple blocks of data, and the fingerprint data corresponding to each block of data is determined. Based on the file data of the file to be updated and the fingerprint data corresponding to the block data, the target fingerprint metadata corresponding to the file to be updated is generated.

[0088] Specifically, the client can segment the file to be updated into blocks based on a variable window and pointcuts, obtaining multiple blocks of data and determining the fingerprint data corresponding to each block. The variable window is a segmentation window used to divide the file data to be updated; its size dynamically changes during the segmentation process. Pointcuts determine the start and end points of the variable window; segmentation at these points yields blocks of data corresponding to the size of the variable window. The variable window and pointcuts are determined based on the segmentation strategy of the file to be updated, which determines the window size and the specific location of the pointcuts. The fingerprint data uniquely identifies the corresponding block of data and can be a signature value corresponding to the block data.

[0089] The client obtains the file data of the file to be updated, which may contain multiple bytes. Following the order of the file data, the client traverses the data from beginning to end using a chunking strategy, determining the cutoff point for each byte segment based on a variable window. This results in multiple cutoff points, which are then used to segment the file data into multiple chunks. The client calculates the signature value of each chunk, thus obtaining the fingerprint data corresponding to each chunk.

[0090] The server determines the digest information of the file to be updated based on its file data, and merges the fingerprint data to obtain the fingerprint data group corresponding to the file to be updated. The digest information and fingerprint data group of the file to be updated are then encapsulated to obtain the target fingerprint metadata.

[0091] In this embodiment, by dividing the file to be updated into blocks and determining the fingerprint data of the block data, the client can obtain the current target fingerprint metadata of the file to be updated through the file data and fingerprint data of the file to be updated, which can improve the efficiency of generating fingerprint metadata.

[0092] In an exemplary embodiment, after the step "upload the target incremental data to the server", the multi-terminal file update method further includes:

[0093] Receive the first verification code corresponding to the file to be updated returned by the server; the first verification code is the hash value of the updated file after the server updates the file to be updated based on the target incremental data.

[0094] If the first and second verification codes pass the consistency check, the cached fingerprint metadata in the local cache is updated based on the target fingerprint metadata; the second verification code is the hash value corresponding to the file to be updated generated by the client.

[0095] The first verification code is a verification code generated by the server for the updated file to be updated. A hash algorithm can be used to determine the hash value corresponding to the file to be updated.

[0096] Specifically, after receiving the target incremental data, the server merges the target incremental data with the original file to be updated to obtain the complete file to be updated. The server then uses a hash algorithm to calculate the first checksum corresponding to the complete file to be updated. The server sends this first checksum to the client.

[0097] The client receives the first checksum. The client then calculates the second checksum for the file to be updated, stored locally, using a hash algorithm. At this point, the file to be updated locally on the client and on the server should be identical, so the first and second checksums should be the same. However, if an error occurs during the transmission of the target incremental data, the generated first and second checksums may differ. Therefore, the client performs a consistency check on the first and second checksums to determine if they are completely identical. If the first and second checksums pass the consistency check, the file update is successful. The client can use the target fingerprint metadata as the latest fingerprint metadata and store it in its local cache, thus obtaining the updated cached fingerprint metadata for reference during the next update.

[0098] In this embodiment, consistency verification can determine whether the file to be updated has been successfully updated, and the cached fingerprint metadata is updated to reduce the probability of errors when updating the file repeatedly in the future, thereby improving the stability of file updates.

[0099] In an exemplary embodiment, before the step "updating the cached fingerprint metadata based on historical fingerprint metadata to obtain the updated cached fingerprint metadata", the multi-terminal file update method further includes:

[0100] If the cached digest information is the same as the historical digest information, then obtain the cached fingerprint data group and the historical fingerprint data group; if the cached fingerprint data group and the historical fingerprint data group are the same, then determine that the cached fingerprint metadata and the historical fingerprint metadata are the same.

[0101] Specifically, the client compares the cached fingerprint metadata with the historical fingerprint metadata to determine if they are completely identical. The client then compares the cached fingerprint data set in the cached fingerprint metadata with the historical fingerprint data set in the historical fingerprint metadata to determine if they are completely identical. Correspondingly, the client compares the cached digest information in the cached fingerprint metadata with the historical digest information in the historical fingerprint metadata to determine if they are completely identical. When all the above digest information and fingerprint data sets are identical, the cached fingerprint metadata and the historical fingerprint metadata are determined to be the same.

[0102] In one example, the client can compare the first version number in the cached summary information with the second version number in the historical summary information. If the first and second version numbers are the same, the client can retrieve the directory summary information from both the cached and historical summaries. The directory summary information is the unique identifier for the file directory. If the two directory summaries are completely identical, the client can retrieve the data summary information from both the cached and historical summaries. The data summary information is the unique identifier corresponding to the file data of the file to be updated. If the two data summaries are completely identical, then the cached and historical summaries are determined to be identical.

[0103] In one example, the client can compare cached fingerprint data sets with historical fingerprint data sets. By using the identifier of each fingerprint data, it determines whether the identifiers of corresponding fingerprint data pairs match, thus determining whether the fingerprint pairs are identical. Ultimately, it determines whether the cached fingerprint data set and the historical fingerprint data set are completely identical. The cached fingerprint data set and the historical fingerprint data set are considered identical if all fingerprint data in both sets are identical.

[0104] In this embodiment, by comparing cached summary information with historical summary information, cached fingerprint data group with historical fingerprint data group, it is determined whether the cached fingerprint metadata and historical fingerprint metadata are completely identical. This can accurately determine whether other terminals have updated the file, avoid using incorrect fingerprint metadata for updates, and thus improve the security of file updates.

[0105] In one exemplary embodiment, the multi-terminal file update method further includes:

[0106] If the local cache does not store the cached fingerprint metadata, then the historical fingerprint metadata is obtained from the server and used as the updated cached fingerprint metadata.

[0107] If the server does not store the historical fingerprint metadata corresponding to the file to be updated, then the file to be updated and the target fingerprint metadata corresponding to the file to be updated will be uploaded to the server in their entirety.

[0108] Specifically, if the client's local cache does not contain cached fingerprint metadata for the file to be updated, it means that the file has not been updated from the client to the server. Therefore, the client can obtain the historical fingerprint metadata for the file to be updated from the server and use it as cached fingerprint metadata. It should be understood that the server may not also store the historical fingerprint metadata for the file to be updated, meaning that the file has not been updated from any client. Based on this, for the first update, the client can upload the target fingerprint metadata and the entire file data to the server.

[0109] In this embodiment, by determining whether the local cache stores the fingerprint metadata corresponding to the file to be updated, and whether the server stores the fingerprint metadata corresponding to the file to be updated, it is possible to determine whether to perform a full upload, thereby ensuring that the terminal updating the file for the first time can correctly update the file.

[0110] The following describes in detail the specific execution process of the above-described multi-terminal file update method with reference to several specific embodiments.

[0111] In one example, as shown below, a fingerprint metadata model using JSON format is given.

[0112] {

[0113] Ver: Version number

[0114] TS: Time Stamp

[0115] DFP: File Data Figure Print (Fingerprint Data)

[0116] PFP: File Path Figure Print (File Path Fingerprint Data)

[0117] TC: Total Count = N (Total)

[0118] }, [

[0120] {

[0121] Index: 1

[0122] CFP: (Chunk Figure Print) 1 Fingerprint data of block data 1

[0123] Offset: 0 (Tangent position)

[0124] Length: (Chunk Length)1 Fingerprint data length

[0125] }

[0126] …

[0127] {

[0128] Index: N

[0129] CFP: (Chunk Figure Print) Fingerprint data of N chunks of data.

[0130] Offset: (File Offset) The cutoff point position of the NN.

[0131] Length: (Chunk Length) The length of the fingerprint data in the NN.

[0132] } ]

[0134] The root node of this structure uses the MD5 hash of the path, i.e., PFP (File Path Figure Print), and the MD5 hash of the file content, i.e., DFP (File Data Figure Print), to identify the directory summary information and data summary information of the file. When it is not possible to monitor whether the file has changed in some scenarios, the client can first compare the two values ​​of PFP and DFP with the local cache to find out which files have changed, and then perform incremental synchronization for each file.

[0135] Additionally, this data can include information such as data version number and change time. When synchronizing incremental data, the fingerprint metadata can be used to determine whether the data has changed, reducing the number of data items that need to be synchronized in the data list. Here, Ver (Version) represents the file version number, TS (Time Stamp) represents the file update timestamp, TC (Total Count) represents the format of the Chunk information in the data, and Chunk represents a data block of the fingerprint data.

[0136] The fingerprint information of each Chunk is represented by an array. Index represents the index number, CFP (ChunkFigure Print) represents the summary information of a single chunk, Offset represents the cut point position of the chunk in the data, i.e., the offset position, and Length represents the length of each Chunk.

[0137] Fingerprint metadata can also be represented in binary. In this case, the size of the fingerprint data FP is 128 bytes, and the sequence number, cut point and length information are 32 bytes. Therefore, in binary mode, the size of the data transmitted and stored can be further reduced.

[0138] In one example, such as Figure 5 The image shows an example of incremental file synchronization.

[0139] At the initial time t1, the source file (incremental file) is version 1. At this point, the file is divided into chunks 1 through N, and neither the local cache nor the server possesses the original fingerprint metadata. Typically, in this situation, all chunks 1 through N, along with their corresponding fingerprint metadata, will be uploaded. At time t2, the source file is upgraded to version 2. During this period, chunk1 is modified to chunk1'. To ensure that the server-side backup data remains consistent with the source data, the client initiates a synchronization request. By comparing the fingerprint metadata with Version=1 on the local machine / server, only chunk1' is uploaded during incremental synchronization. After successful upload, both the server and client update the fingerprint metadata.

[0140] At time t3, the source file version is 3. At this point, chunk1' in the file has been deleted. The client initiates a synchronization request, but in the case of incremental synchronization, since the existing data has not changed, no data upload occurs. After synchronizing the file information, the fingerprint metadata of both the server and the client is updated.

[0141] At time t4, the source file version is 4. At this point, a chunkN+1 data block is appended to the file. The client initiates a synchronization request; in incremental synchronization, only the appended chunkN+1 is uploaded. After synchronizing the file, the fingerprint metadata on both the server and client is updated again.

[0142] In one example, the specific execution process of the multi-terminal file update method is as follows: Figure 6 As shown, when the client has cached fingerprint metadata from the previous version, the file synchronization update steps are as follows:

[0143] Step A1: The client divides the file to be updated into chunks. In one implementation, this process can use the CDC (content-defined-chunking) algorithm to select appropriate chunking points and window sizes. The CDC algorithm is a strategy that uses Rabin fingerprints to cut files into chunks of varying lengths. Unlike fixed-chunking strategies, it divides data chunks based on content, thus allowing the chunk size to be variable.

[0144] Step A2: Traverse each data block, use the MD5 algorithm to generate the hash fingerprint value of the data block, and generate the metadata structure of the current version.

[0145] Step A3: Read the cache fingerprint metadata of the previous version from the local cache.

[0146] Step A4 verifies the validity and expiration of the locally cached fingerprint metadata, i.e., compares the cached fingerprint metadata with the historical fingerprint metadata stored on the server. This mainly involves comparing the Version, DFP, and PFP in the metadata structure to see if they are the same as those on the server. If they differ, the historical fingerprint metadata on the server needs to be sent back first to resolve the conflict. If the conflict cannot be resolved automatically, a new file copy can be generated, and the file data and fingerprint metadata can be fully uploaded.

[0147] Step A5: Compare the newly generated file block Chunk FP with the file block corresponding to the previous version, that is, compare whether the corresponding fingerprint data is the same, and use the different file blocks as the fingerprint metadata to be updated.

[0148] Step A6 involves uploading the fingerprint metadata that needs updating to the server. This updated fingerprint metadata is then compared with the server's shared fingerprint database, which contains the fingerprint metadata of all data in the storage pool. This step further reduces the size of the target incremental data that needs to be uploaded.

[0149] In step A7, the client receives the fingerprint metadata required by the server and sends the fingerprint metadata, as well as the target incremental data.

[0150] In step A8, after the server receives the data, it generates an MD5 checksum fingerprint (DFP) for the new file. The server then sends the DFP back to the client.

[0151] Step A9: The client receives the MD5 information (DFP) and compares it with the DFP corresponding to the local file. After successful verification, the fingerprint metadata of the server and the client is updated.

[0152] In one example, the specific execution process of the multi-terminal file update method is as follows: Figure 7 As shown, when the client does not have the cached fingerprint metadata from the previous version, the file synchronization update steps are as follows:

[0153] Figure 7 The incremental synchronization steps are explained below when the client uploads for the first time, or when the metadata of the previous version is not available locally due to restart, cache file clearing, or other reasons:

[0154] Step B1: The client divides the file to be updated into blocks. In one implementation example, this process can use the CDC algorithm to select appropriate cut points and window sizes.

[0155] Step B2: Traverse each data block, use the MD5 algorithm to generate the hash fingerprint value of the data block, and generate the metadata structure of the current version.

[0156] Step B3: Since the client's local cache does not contain the fingerprint metadata of the previous version, the client queries the server to see if the fingerprint metadata of the file to be updated exists.

[0157] Step B4: If the server also lacks fingerprint metadata, the file should be uploaded fully for the first time. If the server has fingerprint metadata, but the local cache does not contain fingerprint metadata, then proceed to step B5.

[0158] Step B5: Obtain the fingerprint metadata of the previous version returned by the server, and compare the newly generated fingerprint metadata of the file to be updated with the fingerprint metadata of the previous version to obtain the fingerprint metadata that needs to be updated to the server.

[0159] In step B6, the server's shared fingerprint database compares the fingerprint metadata that needs to be updated to determine the fingerprint metadata that the server actually needs.

[0160] In step B7, the client receives information from the server containing the required fingerprint metadata and sends the relevant fingerprint metadata and target incremental data to the server.

[0161] In step B8, after the server receives the fingerprint metadata and target incremental data, it generates an MD5 verification fingerprint, or DFP, for the updated file and sends it back to the client.

[0162] In step B9, the client receives the aforementioned MD5 checksum fingerprint and compares it with the MD5 checksum fingerprint corresponding to the local file to determine if they are completely identical. Upon successful verification, the fingerprint metadata on both the server and client is updated.

[0163] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0164] Based on the same inventive concept, this application also provides a multi-terminal file update apparatus for implementing the multi-terminal file update method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more embodiments of the multi-terminal file update apparatus provided below can be found in the limitations of the multi-terminal file update method described above, and will not be repeated here.

[0165] In one exemplary embodiment, such as Figure 8 As shown, a multi-terminal file update device 800 is provided, including: a metadata acquisition module 801, a metadata update module 802, and a file update module 803, wherein:

[0166] The metadata acquisition module 801 is used to obtain cached fingerprint metadata corresponding to the file to be updated from the local cache and to obtain historical fingerprint metadata corresponding to the file to be updated from the server. The cached fingerprint metadata includes the cached fingerprint data group and cached digest information corresponding to the file to be updated. The historical fingerprint metadata includes the historical fingerprint data group and historical digest information corresponding to the file to be updated.

[0167] The metadata update module 802 is used to update the cached fingerprint metadata based on the historical fingerprint metadata if the cached fingerprint metadata and the historical fingerprint metadata are different, so as to obtain the updated cached fingerprint metadata.

[0168] The file update module 803 is used to obtain the target fingerprint metadata corresponding to the file to be updated, compare the updated cached fingerprint metadata with the target fingerprint metadata, determine the target incremental data to be uploaded, and upload the target incremental data to the server.

[0169] Furthermore, the metadata update module 802 is specifically used for: determining duration information based on the first time information in the cached summary information and the second time information in the historical summary information; determining the first difference fingerprint data between the cached fingerprint data group and the historical fingerprint data group, and determining the update fingerprint rate between the cached fingerprint metadata and the historical fingerprint metadata based on the first difference fingerprint data; if the duration information and the update fingerprint rate meet the first threshold condition, then updating the fingerprint data that differs in the cached fingerprint metadata according to the fingerprint data in the historical fingerprint metadata to obtain the updated cached fingerprint metadata; if the duration information and the update fingerprint rate meet the second threshold condition, then updating all the fingerprint data in the historical fingerprint metadata to the cached fingerprint metadata to obtain the updated cached fingerprint metadata.

[0170] Furthermore, the file update module 803 is specifically used to: compare the cached fingerprint data group in the cached fingerprint metadata with the target fingerprint data group in the target fingerprint metadata to obtain the second differential fingerprint data; upload the second differential fingerprint data to the server so that the server can determine the second differential fingerprint data not stored in the shared fingerprint database based on the shared fingerprint database and multiple second differential fingerprint data, and use it as the fingerprint data to be uploaded; receive the fingerprint data to be uploaded returned by the server, and determine the target incremental data corresponding to the fingerprint data to be uploaded.

[0171] Furthermore, the file update module 803 is specifically used to: divide the file to be updated into blocks to obtain multiple block data, and determine the fingerprint data corresponding to each block data; and generate target fingerprint metadata corresponding to the file to be updated based on the file data of the file to be updated and the fingerprint data corresponding to the block data.

[0172] Furthermore, the device also includes a file verification module, specifically used for: receiving a first verification code corresponding to the file to be updated returned by the server; the first verification code is the hash value corresponding to the updated file after the server updates the file to be updated based on the target incremental data; if the first verification code and the second verification code pass the consistency check, updating the cached fingerprint metadata in the local cache based on the target fingerprint metadata; the second verification code is the hash value corresponding to the file to be updated generated by the client.

[0173] Furthermore, the device also includes a fingerprint metadata determination module, specifically used for: if the cached digest information is the same as the historical digest information, then obtaining the cached fingerprint data group and the historical fingerprint data group; if the cached fingerprint data group and the historical fingerprint data group are the same, then determining that the cached fingerprint metadata and the historical fingerprint metadata are the same.

[0174] Furthermore, the device also includes a fingerprint metadata adjustment module, specifically used for: if the local cache does not store cached fingerprint metadata, obtaining historical fingerprint metadata from the server and using it as the updated cached fingerprint metadata; if the server does not store historical fingerprint metadata corresponding to the file to be updated, uploading the file to be updated and the target fingerprint metadata corresponding to the file to be updated to the server in full.

[0175] Each module in the aforementioned multi-terminal file update device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0176] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a multi-terminal file update method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0177] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0178] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0179] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0180] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0181] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0182] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0183] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0184] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A multi-terminal file update method, characterized in that, Applied to a client, the method includes: The cache fingerprint metadata corresponding to the file to be updated is obtained from the local cache, and the historical fingerprint metadata corresponding to the file to be updated is obtained from the server; the cache fingerprint metadata includes the cache fingerprint data group and cache digest information corresponding to the file to be updated; the historical fingerprint metadata includes the historical fingerprint data group and historical digest information corresponding to the file to be updated. If the cached fingerprint metadata is different from the historical fingerprint metadata, then the cached fingerprint metadata is updated based on the historical fingerprint metadata to obtain the updated cached fingerprint metadata. Obtain the target fingerprint metadata corresponding to the file to be updated, compare the updated cached fingerprint metadata with the target fingerprint metadata, determine the target incremental data to be uploaded, and upload the target incremental data to the server. The step of updating the cached fingerprint metadata based on the historical fingerprint metadata to obtain the updated cached fingerprint metadata includes: Based on the first time information in the cached digest information and the second time information in the historical digest information, the duration information is determined; Determine the first difference fingerprint data between the cached fingerprint data group and the historical fingerprint data group, and determine the update fingerprint rate between the cached fingerprint metadata and the historical fingerprint metadata based on the first difference fingerprint data; If the duration information and the updated fingerprint rate meet the first threshold condition, then the fingerprint data that differs in the cached fingerprint metadata is updated according to the fingerprint data in the historical fingerprint metadata to obtain the updated cached fingerprint metadata. If the duration information and the updated fingerprint rate meet the second threshold condition, then all fingerprint data in the historical fingerprint metadata are updated to the cached fingerprint metadata to obtain the updated cached fingerprint metadata.

2. The method according to claim 1, characterized in that, The step of comparing the updated cached fingerprint metadata with the target fingerprint metadata to determine the target incremental data to be uploaded includes: The cached fingerprint data group in the cached fingerprint metadata is compared with the target fingerprint data group in the target fingerprint metadata to obtain the second difference fingerprint data; The second differential fingerprint data is uploaded to the server so that the server can determine the second differential fingerprint data that is not stored in the shared fingerprint database based on the shared fingerprint database and multiple second differential fingerprint data, and use it as fingerprint data to be uploaded; Receive the fingerprint data to be uploaded returned by the server, and determine the target incremental data corresponding to the fingerprint data to be uploaded.

3. The method according to claim 1, characterized in that, The step of obtaining the target fingerprint metadata corresponding to the file to be updated includes: The file to be updated is divided into blocks to obtain multiple blocks of data, and the fingerprint data corresponding to each block of data is determined. Based on the file data of the file to be updated and the fingerprint data corresponding to the block data, the target fingerprint metadata corresponding to the file to be updated is generated.

4. The method according to claim 1, characterized in that, After uploading the target incremental data to the server, the process further includes: The server receives a first verification code corresponding to the file to be updated, which is the hash value of the updated file after the server updates the file based on the target incremental data. If the first verification code and the second verification code pass the consistency check, the cached fingerprint metadata in the local cache is updated based on the target fingerprint metadata; the second verification code is the hash value corresponding to the file to be updated generated by the client.

5. The method according to claim 1, characterized in that, Before updating the cached fingerprint metadata based on the historical fingerprint metadata to obtain the updated cached fingerprint metadata, the process further includes: If the cached digest information is the same as the historical digest information, then the cached fingerprint data group and the historical fingerprint data group are obtained; If the cached fingerprint data group and the historical fingerprint data group are the same, then it is determined that the cached fingerprint metadata and the historical fingerprint metadata are the same.

6. The method according to claim 1, characterized in that, The method further includes: If the local cache does not store cached fingerprint metadata, then historical fingerprint metadata is obtained from the server and used as the updated cached fingerprint metadata. If the server does not store the historical fingerprint metadata corresponding to the file to be updated, then the file to be updated and the target fingerprint metadata corresponding to the file to be updated will be uploaded to the server in their entirety.

7. A multi-terminal file update device, characterized in that, The device includes: The metadata acquisition module is used to obtain cache fingerprint metadata corresponding to the file to be updated from the local cache, and to obtain historical fingerprint metadata corresponding to the file to be updated from the server; the cache fingerprint metadata includes cache fingerprint data group and cache digest information corresponding to the file to be updated; the historical fingerprint metadata includes historical fingerprint data group and historical digest information corresponding to the file to be updated. The metadata update module is used to update the cached fingerprint metadata based on the historical fingerprint metadata if the cached fingerprint metadata and the historical fingerprint metadata are different, thereby obtaining updated cached fingerprint metadata. Specifically, it is used to determine duration information based on the first time information in the cached digest information and the second time information in the historical digest information; determine the first difference fingerprint data between the cached fingerprint data group and the historical fingerprint data group, and determine the update fingerprint rate between the cached fingerprint metadata and the historical fingerprint metadata based on the first difference fingerprint data; if the duration information and the update fingerprint rate meet a first threshold condition, then update the fingerprint data in the cached fingerprint metadata that differ from the historical fingerprint metadata according to the fingerprint data in the historical fingerprint metadata, thereby obtaining updated cached fingerprint metadata; if the duration information and the update fingerprint rate meet a second threshold condition, then update all the fingerprint data in the historical fingerprint metadata to the cached fingerprint metadata, thereby obtaining updated cached fingerprint metadata. The file update module is used to obtain the target fingerprint metadata corresponding to the file to be updated, compare the updated cached fingerprint metadata with the target fingerprint metadata, determine the target incremental data to be uploaded, and upload the target incremental data to the server.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Cloud disk file synchronization updating method and apparatus thereof

    CN105763644A

  • File synchronization method and device, electronic equipment and storage medium

    CN114328428A