File synchronization method and device, electronic equipment and computer readable storage medium

By using encrypted file keys and attribute information to build an index during file synchronization, and storing encrypted files and keys separately on the storage server, the problem of low security in file synchronization in the existing technology is solved, and file transfer and storage are realized High security.

CN119316434APending Publication Date: 2025-01-14TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310864078.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-13
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

The existing file synchronization methods lack encryption and decryption measures during the synchronization process, resulting in low security of file synchronization.

Method used

By receiving the file key and file attribute information of the encrypted file sent by the terminal, a file synchronization index is constructed, and the encrypted file is encrypted and decrypted when uploading and downloading the file to ensure that the file is encrypted and stored on the storage server. Separate storage of keys.

Benefits of technology

Improves security during file synchronization, prevents data leakage and unauthorized access, and ensures the integrity of files during transmission and storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316434A_ABST
    Figure CN119316434A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a file synchronization method and device, electronic equipment and a computer readable storage medium. According to the embodiment of the invention, after a file uploading request sent by a first terminal is received, a storage address of an encrypted file is sent to the first terminal, so that the first terminal uploads the encrypted file to a storage server based on the storage address, and when it is determined that uploading of the encrypted file is completed, the encrypted file is uploaded to the storage server based on the storage address, a file key and file attribute information. Constructing a file synchronization index of a source file corresponding to the encrypted file, determining a storage address and a file key of the encrypted file corresponding to the source file based on the file synchronization index when a file downloading request for the source file sent by a second terminal is received, and sending the storage address and the file key to the second terminal, the second terminal obtains the encrypted file based on the storage address, and decrypts the encrypted file by using the file key to obtain the source file; according to the scheme, the security of file synchronization can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of file processing technology, and in particular to a file synchronization method, device, electronic device and computer-readable storage medium. Background Art

[0002] In recent years, with the rapid development of Internet technology, personal or corporate office platforms have become more and more diverse. Personal or corporate file resources are often stored in office platforms. In order to improve the convenience of office work, it is necessary to synchronize file resources. The current file synchronization method is to directly upload the source file to a unified storage server. When the source file needs to be downloaded, the source file can be directly downloaded from the storage server according to the file identifier of the source file, thereby realizing file synchronization of the source file.

[0003] In the process of researching and practicing the current technology, the inventor of the present application found that in the existing file synchronization method, the source file is not encrypted and decrypted during the file synchronization process, which results in certain security risks in the file synchronization process, thus resulting in low security of file synchronization. Summary of the invention

[0004] Embodiments of the present invention provide a file synchronization method, device, electronic device and computer-readable storage medium, which can improve the security of file synchronization.

[0005] A file synchronization method, comprising:

[0006] Receiving a file upload request sent by the first terminal, the file upload request carrying a file key and file attribute information of an encrypted file, the encrypted file including a file obtained by encrypting a source file;

[0007] Based on the file upload request, sending the storage address of the encrypted file to the first terminal, so that the first terminal uploads the encrypted file to the storage server based on the storage address;

[0008] When it is determined that the encrypted file has been uploaded, constructing a file synchronization index of the source file based on the storage address, the file key and the file attribute information;

[0009] When receiving a file download request for the source file sent by the second terminal, determining a storage address and a file key of an encrypted file corresponding to the source file based on the file synchronization index;

[0010] The storage address and the file key are sent to the second terminal, so that the second terminal obtains the encrypted file based on the storage address, and decrypts the encrypted file using the file key to obtain the source file.

[0011] Optionally, the embodiment of the present invention may further provide another file synchronization method, including:

[0012] Obtaining a source file and a file key corresponding to the source file, and encrypting the source file based on the file key to obtain an encrypted file;

[0013] Obtaining file attribute information of the encrypted file, and sending the file key and file attribute information to the synchronization server;

[0014] Receiving the storage address of the encrypted file returned by the synchronization server, and uploading the encrypted file to the storage server based on the storage address;

[0015] When the encrypted file is uploaded, a prompt message indicating that the upload is completed is sent to the synchronization server so that the synchronization server constructs a file synchronization index of the source file based on the prompt message.

[0016] Optionally, the embodiment of the present invention may further provide another file synchronization method, including:

[0017] Send a file download request for the source file to the synchronization server;

[0018] Receive the storage address and file key of the encrypted file corresponding to the source file returned by the synchronization server based on the file download request;

[0019] Based on the storage address, downloading the encrypted file in the storage server;

[0020] The encrypted file is decrypted according to the file key to obtain the source file.

[0021] Accordingly, an embodiment of the present invention provides a file synchronization device, including:

[0022] A first receiving unit is used to receive a file upload request sent by a first terminal, wherein the file upload request carries a file key and file attribute information of an encrypted file, and the encrypted file includes a file obtained by encrypting a source file;

[0023] A first sending unit, configured to send the storage address of the encrypted file to the first terminal based on the file upload request, so that the first terminal uploads the encrypted file to a storage server based on the storage address;

[0024] A construction unit, configured to construct a file synchronization index of the source file based on the storage address, the file key and the file attribute information when it is determined that the encrypted file has been uploaded;

[0025] a determining unit, configured to determine, when receiving a file download request for the source file sent by the second terminal, a storage address and a file key of an encrypted file corresponding to the source file based on the file synchronization index;

[0026] The second sending unit is used to send the storage address and the file key to the second terminal, so that the second terminal obtains the encrypted file based on the storage address and decrypts the encrypted file using the file key to obtain the source file.

[0027] Optionally, an embodiment of the present invention may further provide a file synchronization device, including:

[0028] An encryption unit, used to obtain a source file and a file key corresponding to the source file, and encrypt the source file based on the file key to obtain an encrypted file;

[0029] An acquiring unit, used for acquiring file attribute information of the encrypted file, and sending the file key and the file attribute information to a synchronization server;

[0030] an uploading unit, configured to receive the storage address of the encrypted file returned by the synchronization server, and upload the encrypted file to the storage server based on the storage address;

[0031] The third sending unit is used to send a prompt message of upload completion to the synchronization server when the encrypted file is uploaded successfully, so that the synchronization server can build a file synchronization index of the source file based on the prompt message.

[0032] Optionally, an embodiment of the present invention may further provide a file synchronization device, including:

[0033] A fourth sending unit, configured to send a file download request for a source file to the synchronization server;

[0034] A second receiving unit, configured to receive a storage address and a file key of an encrypted file corresponding to the source file returned by the synchronization server based on the file download request;

[0035] A downloading unit, configured to download the encrypted file from a storage server based on the storage address;

[0036] The decryption unit is used to decrypt the encrypted file according to the file secret key to obtain the source file.

[0037] In some embodiments, the first sending unit can be specifically used to generate a file storage request for the encrypted file based on the file attribute information; send the file storage request to a storage server so that the storage server determines the storage address of the encrypted file based on the file storage request; receive the storage address returned by the storage server, and send the storage address to the first terminal.

[0038] In some embodiments, the first sending unit can be specifically used to extract the file identifier of the source file from the file attribute information; based on the file identifier, the file key, file attribute information and storage address are data encoded to obtain encoded encrypted information; the file synchronization index of the source file based on the storage address, file key and file attribute information is constructed, including: based on the file identifier and the encoded encrypted information, a file synchronization index of the source file is constructed.

[0039] In some embodiments, the construction unit can be specifically used to construct a mapping relationship between the file identifier and the encoded encrypted information; use the file identifier as a keyword, and use the encoded encrypted information as the value information corresponding to the keyword; and generate a file synchronization index of the source file based on the mapping relationship, keyword and value information.

[0040] In some embodiments, the first sending unit may be specifically configured to determine that the upload of the encrypted file is completed when receiving a prompt message indicating that the upload is completed sent by the first terminal, or receiving a prompt message indicating that the upload is completed sent by the storage server.

[0041] In some embodiments, the determination unit can be specifically used to extract the object identifier of the download object corresponding to the second terminal in the file download request; based on the object identifier, perform object authentication on the download object; when the download object authentication passes, determine the storage address and file key of the encrypted file corresponding to the source file based on the file synchronization index.

[0042] In some embodiments, the second sending unit can be specifically used to encrypt the file key to obtain the encrypted file key, and use the encrypted file key as the file key; encrypt the file attribute information to obtain the encrypted file attribute information, and use the encrypted file attribute information as the file attribute information; generate a file upload request based on the file key and file attribute information, and send the file upload request to the synchronization server, the file upload request carrying the file key and file attribute information.

[0043] In some embodiments, the encryption unit can be specifically used to divide the data in the source file to obtain multiple data blocks; and encrypt each data block based on the file key to obtain an encrypted file.

[0044] In some embodiments, the download unit may be specifically configured to download the encrypted file in blocks in the storage server based on the storage address to obtain a plurality of encrypted data blocks; and merge the encrypted data blocks to obtain the encrypted file.

[0045] In some embodiments, the decryption unit can be specifically used to decrypt the encrypted file based on the file key to obtain a decrypted file; verify the file integrity of the decrypted file, and the file integrity represents the completeness of the decrypted file after downloading; when the file integrity verification passes, the decrypted file is used as the source file.

[0046] In addition, an embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores an application program, and the processor is used to run the application program in the memory to implement the file synchronization method provided by the embodiment of the present invention.

[0047] In addition, an embodiment of the present invention further provides a computer-readable storage medium, which stores a plurality of instructions, and the instructions are suitable for a processor to load to execute the steps in any one of the file synchronization methods provided in the embodiments of the present invention.

[0048] In addition, an embodiment of the present application also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps in the file synchronization method provided in the embodiment of the present application.

[0049] In an embodiment of the present invention, after receiving a file upload request sent by a first terminal, the file upload request carries a file key and file attribute information of an encrypted file, and the encrypted file includes a file after the source file is encrypted. Based on the file upload request, the storage address of the encrypted file is sent to the first terminal, so that the first terminal uploads the encrypted file to the storage server based on the storage address. When it is determined that the upload of the encrypted file is completed, a file synchronization index of the source file is constructed based on the storage address, the file key and the file attribute information. When a file download request for the source file sent by a second terminal is received, the storage address and file key of the encrypted file corresponding to the source file are determined based on the file synchronization index, and the storage address and the file key are sent to the second terminal so that The second terminal obtains the encrypted file based on the storage address, and uses the file key to decrypt the encrypted file to obtain the source file; since the source file can be encrypted in this scheme, on the premise of encrypting the source file, the file key of the encrypted file sent by the first terminal is received, and then, when a download request for the source file is received, the file key can be sent to the second terminal, so that the second terminal decrypts the downloaded encrypted file, thereby realizing encryption / decryption of the file during the file upload / download process. In addition, the encrypted file is stored in the storage server, so that the encrypted file and the file key are stored separately, which reduces the security risk in the file synchronization (upload / download) process, and therefore, the security of file synchronization can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0051] Figure 1 is a system schematic diagram of a file synchronization system provided by an embodiment of the present invention;

[0052] Figure 2 is a scenario schematic diagram of a file synchronization method provided by an embodiment of the present invention;

[0053] Figure 3 is a flowchart of a file synchronization method provided by an embodiment of the present invention;

[0054] Figure 4 is a schematic diagram of the architecture of a file synchronization system provided by an embodiment of the present invention;

[0055] Figure 5 is another flowchart of the file synchronization method provided by an embodiment of the present invention;

[0056] Figure 6It is a schematic diagram of the process of uploading files in file synchronization provided by an embodiment of the present invention;

[0057] Figure 7 is another flowchart of the file synchronization method provided by an embodiment of the present invention;

[0058] Figure 8 It is a schematic diagram of the process of file downloading in file synchronization provided by an embodiment of the present invention;

[0059] Fig. 9 is another flowchart of the file synchronization method provided by an embodiment of the present invention;

[0060] Fig.10 is a page schematic diagram of a file upload page provided by an embodiment of the present invention;

[0061] Fig.11 is a page schematic diagram of a file download page provided by an embodiment of the present invention;

[0062] Fig.12 is a structural diagram of a first file synchronization device provided by an embodiment of the present invention;

[0063] Fig.13 is a structural diagram of a second file synchronization device provided by an embodiment of the present invention;

[0064] Fig.14 is a structural diagram of a third file synchronization device provided by an embodiment of the present invention;

[0065] Fig.15 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0066] 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0067] The embodiment of the present invention provides a file synchronization method, device, electronic device and computer-readable storage medium. Among them, the file synchronization device can be integrated in an electronic device, and the electronic device can be a server or a terminal. Specifically, the embodiment of the present invention provides a file synchronization device applicable to a first electronic device (in order to distinguish, it can be called a first file synchronization device), a file synchronization device applicable to a second electronic device (in order to distinguish, it can be called a second file synchronization device), and a file synchronization device applicable to a third electronic device (in order to distinguish, it can be called a third file synchronization device). Among them, the first electronic device can be a network-side device such as a server, and the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. The second electronic device and the third electronic device can be devices such as terminals, and the terminals include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc., but are not limited thereto. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application is not limited here. The embodiments of the present invention can be applied to various scenarios, including but not limited to cloud technology, cloud security, artificial intelligence, smart transportation, assisted driving, etc.

[0068] In the embodiment of the present invention, the first electronic device is a synchronization server, the second electronic device is a first terminal, and the third electronic device is a second terminal as an example to introduce a file synchronization method. The first terminal and the second terminal can be the same terminal or different terminals. The synchronization server can be a server for performing file synchronization, the first terminal can be a terminal for uploading files during the file synchronization process, and the second terminal can be a terminal for downloading files during the file synchronization process.

[0069] For example, see Figure 1 The file synchronization system provided by the embodiment of the present invention may include a synchronization server 10, a storage server 20, a first terminal 30 and a second terminal 40. The synchronization server 10, the storage server 20, the first terminal 30 and the second terminal 40 may be connected through a network, or may be connected through a wired or wireless network, etc., wherein the file synchronization device may be integrated in the first terminal or the second terminal, for example, integrated in the first terminal or the second terminal in the form of a client.

[0070] Among them, the synchronization server 10 can be used to receive a file upload request sent by the first terminal 30, the file upload request carries the file key and file attribute information of the encrypted file, the encrypted file includes the file after the source file is encrypted, based on the file upload request, the storage address of the encrypted file is sent to the first terminal 30, so that the first terminal 30 uploads the encrypted file to the storage server 20 based on the storage address, when it is determined that the upload of the encrypted file is completed, based on the storage address, the file key and the file attribute information, the file synchronization index of the source file is constructed, when the file download request for the source file sent by the second terminal 40 is received, based on the file synchronization index, the storage address and file key of the encrypted file corresponding to the source file are determined, the storage address and file key are sent to the second terminal 40, so that the second terminal 40 obtains the encrypted file based on the storage address, and uses the file key to decrypt the encrypted file to obtain the source file, thereby improving the security of file synchronization, which can be specifically as follows Figure 2 shown.

[0071] The first terminal 30 may send the file key and file attribute information of the encrypted file to the synchronization server 10 to obtain the storage address of the encrypted file returned by the synchronization server 10, and store the encrypted file in the storage server 20 based on the storage address, thereby encrypting the source file during the file upload process. There are many ways for the first terminal 30 to send the file key and file attribute information of the encrypted file to the synchronization server, and the first terminal 30 may specifically be as follows:

[0072] Obtain the source file and the file key corresponding to the source file, and encrypt the source file based on the file key to obtain the encrypted file, obtain the file attribute information of the encrypted file, and send the file key and the file attribute information to the synchronization server 10, receive the storage address of the encrypted file returned by the synchronization server 10, and upload the encrypted file to the storage server 20 based on the storage address. When the encrypted file is uploaded, send a prompt message of the upload completion to the synchronization server 10, so that the synchronization server 10 can build a file synchronization index of the source file based on the prompt message, thereby improving the security of file synchronization.

[0073] The second terminal 40 may send a file download request for the source file to the synchronization server 10, and receive the file key and storage address of the encrypted file corresponding to the source file returned by the synchronization server 10, thereby obtaining the encrypted file and decrypting the encrypted file. There are many ways for the second terminal 40 to download the source file, and the second terminal 40 may specifically be as follows:

[0074] A file download request for the source file is sent to the synchronization server 10, and the storage address and file key of the encrypted file corresponding to the source file returned by the synchronization server 10 based on the file download request are received; based on the storage address, the encrypted file is downloaded from the storage server 20; the encrypted file is decrypted according to the file key to obtain the source file, thereby improving the security of file synchronization.

[0075] It can be understood that in the specific implementation of the present application, related data related to the object, such as the source file, the encrypted file corresponding to the source file, the file key and file attribute information of the encrypted file, etc., when the following embodiments of the present application are applied to specific products or technologies, permission or consent is required, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0076] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.

[0077] In this embodiment, it will be described from the perspective of the first file synchronization device. The first file synchronization device can be specifically integrated in the first electronic device, with the first electronic device as the server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.

[0078] A file synchronization method, comprising:

[0079] A file upload request sent by a first terminal is received, the file upload request carries a file key and file attribute information of an encrypted file, the encrypted file includes a file after encrypting a source file, and based on the file upload request, a storage address of the encrypted file is sent to the first terminal, so that the first terminal uploads the encrypted file to a storage server based on the storage address, and when it is determined that the upload of the encrypted file is completed, a file synchronization index of the source file is constructed based on the storage address, the file key and the file attribute information, and when a file download request for the source file sent by a second terminal is received, a storage address and a file key of the encrypted file corresponding to the source file are determined based on the file synchronization index, and the storage address and the file key are sent to the second terminal, so that the second terminal obtains the encrypted file based on the storage address, and decrypts the encrypted file using the file key to obtain the source file.

[0080] like Figure 3 As shown, the specific process of the file synchronization method is as follows:

[0081] 101. Receive a file upload request sent by a first terminal.

[0082] Among them, the file upload request carries the file key and file attribute information of the encrypted file. The so-called encrypted file may include a file after the source file is encrypted. There may be multiple ways to encrypt the source file. For example, the encrypted file may be a file obtained by encrypting the source file based on the file key by the first terminal, or it may be a file obtained by encrypting the source file using the file key by other terminals or objects, and so on. The so-called file key may be a key for encrypting the source file to obtain the encrypted file, or it may be a key for decrypting the decrypted file to obtain the source file. The so-called file attribute information may be information of at least one attribute of the encrypted file, for example, it may include attribute information such as file size, file type, storage object of the file, download permission of the file, etc. It should be noted that the file key may be an encrypted key or an unencrypted key, and the file attribute information may be encrypted attribute information or unencrypted attribute information, and so on.

[0083] There are many ways to accept the file upload request sent by the first terminal, which can be as follows:

[0084] For example, the file upload request sent by the first terminal can be directly received, or the file upload request sent by the first terminal can be received through a third-party platform or device. Alternatively, when the number of encrypted files is large, the file upload request can also carry the file key and file attributes in the encrypted information storage address of the first terminal or the third-party platform, and obtain the file key and file attributes of the encrypted file based on the encrypted information storage address, and so on.

[0085] 102. Based on the file upload request, send a storage address of the encrypted file to the first terminal, so that the first terminal uploads the encrypted file to the storage server based on the storage address.

[0086] Among them, the storage server can also be called a unified storage server, which is mainly used to uniformly store the encrypted files corresponding to the uploaded source files during the file synchronization process, so that the file key and the encrypted file of the encrypted file can be stored separately, further improving the security of the file synchronization process.

[0087] The storage address may be an address where the encrypted file is stored in the storage server. Based on the file upload request, there are multiple ways to send the storage address of the encrypted file to the first terminal, which may be as follows:

[0088] For example, based on the file attribute information, a file storage request for the encrypted file can be generated, and the file storage request can be sent to the storage server so that the storage server can determine the storage address of the encrypted file based on the file storage request, receive the storage address returned by the storage server, and send the storage address to the first terminal.

[0089] There are many ways for the storage server to determine the storage address of the encrypted file based on the file storage request. For example, the storage server can extract information such as the file type and file size of the encrypted file from the file attribute information. The storage server determines the storage address of the encrypted file based on the file type, file size, and the space type and remaining capacity of the internal storage space, and so on.

[0090] After receiving the storage address returned by the storage server, the file key, file attribute information and storage address may be encoded. There are many ways to encode the file key, file attribute information and storage address. For example, the file identifier of the source file may be extracted from the file attribute information, and the file key, file attribute information and storage address may be encoded based on the file identifier to obtain the encoded encrypted information.

[0091] There may be multiple ways of data encoding, for example, a storyed encoding algorithm (a data encoding method) or other ways of data encoding, and so on.

[0092] Among them, after sending the storage address of the encrypted file to the first terminal, the first terminal can upload the encrypted file to the storage server based on the storage address. The specific way in which the first terminal uploads the encrypted file to the storage server based on the storage address can be seen below and will not be repeated here.

[0093] In some embodiments, after sending the storage address of the encrypted file to the first terminal, it can also be determined that the upload of the encrypted file is complete. There can be multiple ways to determine that the upload of the encrypted file is complete. For example, when a prompt message of the upload completion is received from the first terminal, or when a prompt message of the upload completion is received from the storage server, it is determined that the upload of the encrypted file is complete.

[0094] 103. When it is determined that the encrypted file upload is completed, a file synchronization index of the source file is constructed based on the storage address, the file key and the file attribute information.

[0095] The prompt information may be used to prompt that the encrypted file has been uploaded to the storage server.

[0096] The file synchronization index may be used to query the storage address of the encrypted file and the index information of the encrypted file.

[0097] There are multiple ways to construct a file synchronization index of a source file based on the storage address, file key, and file attribute information, which are as follows:

[0098] For example, when it is determined that the encrypted file upload is complete, a mapping relationship between the file identifier and the encoded encrypted information can be constructed, with the file identifier used as the keyword and the encoded encrypted information used as the value information corresponding to the keyword. Based on the mapping relationship, keyword and value information, a file synchronization index of the source file is generated.

[0099] 104. When receiving a file download request for a source file sent by a second terminal, determine a storage address and a file key of an encrypted file corresponding to the source file based on the file synchronization index.

[0100] For example, when a file download request for a source file is received from a second terminal, the object identifier of the download object corresponding to the second terminal is extracted from the file download request, and the download object is authenticated based on the object identifier. When the download object authentication passes, the storage address and file key of the encrypted file corresponding to the source file are determined based on the file synchronization index.

[0101] The download object may be an object that downloads the source file through the second terminal, or may be the second terminal itself. The object identifier may be the identifier of the object that downloads the source file through the second terminal, or may be the terminal identifier of the second terminal. Based on the object identifier, there may be multiple ways to authenticate the download object. For example, the object permission information corresponding to the encrypted file may be obtained, and the object permission of the download object may be determined based on the object permission information. When the object permission is the download permission, it is determined that the download object authentication has passed. When the object permission is other permissions or does not have permission, it is determined that the download object authentication has not passed. Alternatively, a preset download object identifier set with permission to download encrypted files may be obtained, and the object identifier may be queried in the preset object identifier set. When the object identifier exists, it is determined that the download object authentication has passed. When the object identifier does not exist, it is determined that the download object authentication has not passed, and so on.

[0102] After object authentication is performed on the download object, when the download object authentication is passed, the storage address and file key of the encrypted file corresponding to the source file can be determined based on the file synchronization index. There are many ways to determine the storage address and file key. For example, the encoded encrypted information corresponding to the file identifier of the source file can be extracted from the file synchronization index, and the encoded encrypted information can be decoded to obtain the storage address and file key of the encrypted file corresponding to the source file.

[0103] 105. Send the storage address and the file key to the second terminal, so that the second terminal obtains the encrypted file based on the storage address, and uses the file key to decrypt the encrypted file to obtain the source file.

[0104] There are many ways to send the storage address and the file key to the second terminal, which can be as follows:

[0105] For example, the storage address and the file key can be directly sent to the second terminal, or the storage address and the file key can be encrypted and the encrypted storage address and the file key can be sent to the second terminal as the storage address and the file key respectively, or the storage address and the file key can be sent to the second terminal through a third-party platform, and so on.

[0106] In some embodiments, after the second terminal receives the storage address and the file key, it can obtain or download the encrypted file from the storage server based on the storage address, and use the file key to decrypt the encrypted file to obtain the source file. The process of downloading the encrypted file and decrypting it can be seen below and will not be repeated here.

[0107] In the process of file synchronization, the file synchronization system may include a synchronization server, a storage server, a first terminal and a second terminal. Taking the first terminal and the second terminal as examples, the synchronization client may be integrated therein, and the file attribute information is the file size. That is, the terminal for uploading files through the synchronization client may be the first terminal, and the terminal for downloading files through the synchronization client may be the second terminal. The structure of the file synchronization system may be as follows: Figure 4 As shown, the synchronization client implements encryption and uploading of files, as well as downloading and decrypting of files. The synchronization server can use KV (a distributed storage method) storage method to store the file key of the encrypted file, the file size and other information. The storage server is used to store the encrypted file after encrypting the source file. In the file synchronization system of this solution, the synchronization client encrypts / decrypts the file during the upload / download process, and the storage server stores the encrypted file. The synchronization server stores the file key of the encrypted file, which avoids security risks to a certain extent, thereby improving the security of file synchronization.

[0108] From the above, it can be seen that after receiving the file upload request sent by the first terminal, the embodiment of the present application carries the file key and file attribute information of the encrypted file, and the encrypted file includes the file after the source file is encrypted. Based on the file upload request, the storage address of the encrypted file is sent to the first terminal, so that the first terminal uploads the encrypted file to the storage server based on the storage address. When it is determined that the upload of the encrypted file is completed, a file synchronization index of the source file is constructed based on the storage address, the file key and the file attribute information. When a file download request for the source file sent by the second terminal is received, the storage address and file key of the encrypted file corresponding to the source file are determined based on the file synchronization index, and the storage address and file key are sent to the second terminal. , so that the second terminal obtains the encrypted file based on the storage address, and uses the file key to decrypt the encrypted file to obtain the source file; since the source file can be encrypted in this scheme, on the premise of encrypting the source file, the file key of the encrypted file sent by the first terminal is received, and then, when a download request for the source file is received, the file key can be sent to the second terminal, so that the second terminal decrypts the downloaded encrypted file, thereby realizing encryption / decryption of the file during the file upload / download process. In addition, the encrypted file is stored in the storage server, so that the encrypted file and the file key are stored separately, which reduces the security risk in the file synchronization (upload / download) process, and therefore, the security of file synchronization can be improved.

[0109] According to the method described in the above embodiment, the following is further described in detail with examples.

[0110] This embodiment will be described from the perspective of a second file synchronization device, which can be specifically integrated in a second electronic device, and the second electronic device can be a terminal or other device; wherein the terminal can include a tablet computer, a laptop computer, a personal computer (PC), a wearable device, a virtual reality device or other smart devices that can perform file synchronization.

[0111] A file synchronization method, comprising:

[0112] Obtain the source file and the file key corresponding to the source file, and encrypt the source file based on the file key to obtain the encrypted file, obtain the file attribute information of the encrypted file, and send the file key and the file attribute information to the synchronization server, receive the storage address of the encrypted file returned by the synchronization server, and upload the encrypted file to the storage server based on the storage address. When the encrypted file is uploaded, send a prompt message of the upload completion to the synchronization server so that the synchronization server can build a file synchronization index of the source file based on the prompt message.

[0113] like Figure 5As shown, a file synchronization method, the specific process is as follows:

[0114] 201. Obtain a source file and a file key corresponding to the source file, and encrypt the source file based on the file key to obtain an encrypted file.

[0115] There are many ways to obtain the source file and the file key corresponding to the source file, which can be as follows:

[0116] For example, at least one file to be uploaded uploaded by a terminal or client can be obtained, the source file can be obtained, and a file key corresponding to the source file can be generated. Alternatively, at least one file to be uploaded can be obtained from a network or file database, the source file can be obtained, and a file key corresponding to the source file can be generated, and so on.

[0117] Among them, after obtaining the source file, there are many ways to generate the file key corresponding to the source file. For example, the file key corresponding to the source file can be randomly generated, or the file key corresponding to the source file can be generated based on the file information of the source file, or the file key corresponding to the source file can be screened out from a preset file key set, and so on.

[0118] There may be various types of file keys, for example, characters of a preset type or format, strings of a preset type or format, or other keys that can encrypt and decrypt source files, and so on.

[0119] After obtaining the source file and the file key corresponding to the source file, the source file can be encrypted based on the file key to obtain an encrypted file. There are many ways to encrypt a source file based on a file key. For example, AES_ECB (a symmetric encryption algorithm) can be used to split the data in the source file to obtain multiple data blocks, and each data block can be encrypted based on the file key to obtain an encrypted file. Alternatively, other types of symmetric encryption algorithms can be used to symmetrically encrypt the source file based on the file key to obtain an encrypted file. Alternatively, an asymmetric encryption algorithm can be used to asymmetrically encrypt the source file based on the file key to obtain an encrypted file, and so on.

[0120] 202. Obtain file attribute information of the encrypted file, and send the file key and the file attribute information to the synchronization server.

[0121] There are many ways to obtain the file attribute information of the encrypted file, which can be as follows:

[0122] For example, you can obtain attribute information such as the file size, file type, and file identifier of the source file corresponding to the encrypted file to obtain file attribute information. Alternatively, you can obtain attribute information on the file size of the encrypted file, obtain the file identifier of the source file, and use the file identifier of the source file and the attribute information on the file size of the encrypted file as file attribute information, and so on.

[0123] After obtaining the file attribute information of the encrypted file, the file key and the file attribute information can be sent to the synchronization server. There are many ways to send the file key and the file attribute information to the synchronization server, for example, the file key can be encrypted to obtain the encrypted file key, and the encrypted file key can be used as the file key, the file attribute information can be encrypted to obtain the encrypted file attribute information, and the encrypted file attribute information can be used as the file attribute information, based on the file key and the file attribute information, a file upload request is generated, and the file upload request is sent to the synchronization server, the file upload request carries the file key and the file attribute information, or the file key and the file attribute information can be directly sent to the synchronization server, and so on.

[0124] 203. Receive the storage address of the encrypted file returned by the synchronization server, and upload the encrypted file to the storage server based on the storage address.

[0125] There are many ways to receive the storage address of the encrypted file returned by the synchronization server, which can be as follows:

[0126] For example, the storage address of the encrypted file returned by the synchronization server may be directly received, or the storage address of the encrypted file may be received through a third-party platform or server, and so on.

[0127] After receiving the storage address of the encrypted file returned by the synchronization server, the encrypted file can be uploaded to the storage server based on the storage address. There are many ways to upload the encrypted file to the storage server. For example, the encrypted file can be uploaded to the storage space corresponding to the storage address in the storage server, or the encrypted file and the storage address can be sent to the storage server so that the storage server can store the encrypted file based on the storage address, and so on.

[0128] Optionally, in order to ensure the download integrity of the source file, a reference value of the integrity of the source file may be calculated and sent to the storage server so that the second terminal may verify the integrity of the downloaded and decrypted source file when downloading the source file.

[0129] The integrity reference value may be a reference value for evaluating or assessing the integrity of the source file. There may be multiple ways to calculate the integrity reference value. For example, the MD5 (hash algorithm) algorithm may be used to calculate the md5 value of the source file, and the md5 value may be used as the integrity reference value. 204. When the encrypted file is uploaded, a prompt message indicating that the upload is complete is sent to the synchronization server so that the synchronization server can construct a file synchronization index of the source file based on the prompt message.

[0130] For example, when the encrypted file is uploaded, a prompt message indicating that the upload is completed is generated and sent to the synchronization server so that the synchronization server constructs a file synchronization index of the source file based on the prompt message.

[0131] The specific manner in which the synchronization server constructs the file synchronization index of the source file based on the prompt information can be found in the above description, and will not be described in detail here.

[0132] In some embodiments, when the encrypted file is uploaded, the generated prompt information of the upload completion can also be sent to the storage server, so that the storage server sends the prompt information of the upload completion to the synchronization server.

[0133] Taking the AES_ECB symmetric encryption algorithm as an example, the file upload process in file synchronization can be as follows: Figure 6 As shown, the synchronization client in the first terminal obtains the source file and randomly generates a file key for the source file, and according to the AES_ECB symmetric encryption algorithm, uses the file key to stream encrypt the source file to obtain an encrypted file, and sends the file key and file size and other information of the encrypted file to the synchronization server, so that the synchronization server stores the file ID of the encrypted file and encodes and encrypts the received information, and then receives the URL address of the encrypted file returned by the synchronization server, uploads the encrypted file to the storage server based on the URL address, and returns a prompt message to the synchronization server when the upload is completed, so that the synchronization server builds a file index of the source file, thereby completing file encryption and upload.

[0134] From the above, it can be seen that the embodiment of the present application obtains the source file and the file key corresponding to the source file, and encrypts the source file based on the file key. After obtaining the encrypted file, the file attribute information of the encrypted file is obtained, and the file key and the file attribute information are sent to the synchronization server. Then, the storage address of the encrypted file returned by the synchronization server is received, and based on the storage address, the encrypted file is uploaded to the storage server. When the encrypted file is uploaded, a prompt message of the upload completion is sent to the synchronization server so that the synchronization server can build a file synchronization index of the source file based on the prompt message; since the scheme can encrypt the source file before uploading the file, and send the file key to the synchronization server, and store the encrypted file in the storage server based on the storage address returned by the synchronization server, the encrypted file and the file key are stored separately, which reduces the security risk in the file upload process, and therefore can improve the security of file synchronization.

[0135] According to the method described in the above embodiment, the following is further described in detail with examples.

[0136] This embodiment will be described from the perspective of a third file synchronization device, which can be specifically integrated in a third electronic device, and the third electronic device can be a terminal or other device; wherein the terminal can include a tablet computer, a laptop computer, a personal computer (PC), a wearable device, a virtual reality device or other smart devices that can perform file synchronization.

[0137] A file synchronization method, comprising:

[0138] Send a file download request for the source file to the synchronization server, receive the storage address and file key of the encrypted file corresponding to the source file returned by the synchronization server based on the file download request, download the encrypted file from the storage server based on the storage address, decrypt the encrypted file according to the file key, and obtain the source file.

[0139] like Figure 7 As shown, a file synchronization method, the specific process is as follows:

[0140] 301. Send a file download request for a source file to a synchronization server.

[0141] For example, a file download page is displayed, which includes a download control for the source file. In response to a trigger operation on the download control, a file download request for the source file is generated, and the file download request is sent to a synchronization server. Alternatively, a file identifier of the source file is obtained, and based on the file identifier, a file download request for the source file is generated, and the file download request is sent to the synchronization server, etc.

[0142] Among them, the response is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed can be in real time or have a set delay. Unless otherwise specified, there is no restriction on the order of execution of the multiple operations executed.

[0143] In some embodiments, after receiving a file download request for a source file, the synchronization server can determine the storage address and file key of the encrypted file corresponding to the source file based on the file synchronization index of the source file. For details, please refer to the above description and will not be repeated here.

[0144] 302. Receive the storage address and file key of the encrypted file corresponding to the source file returned by the synchronization server based on the file download request.

[0145] For example, you can directly receive the storage address and file key of the encrypted file corresponding to the source file returned by the synchronization server, or you can also obtain the storage address and file key of the encrypted file corresponding to the source file through a third-party platform or server, and so on.

[0146] 303. Based on the storage address, download the encrypted file from the storage server.

[0147] For example, based on the storage address, the encrypted file can be downloaded in blocks in the storage server to obtain multiple encrypted data blocks, and the encrypted data blocks can be merged to obtain the encrypted file.

[0148] Among them, based on the storage address, there can be multiple ways to separately download encrypted files in the storage server. For example, based on the storage address, multiple encrypted data blocks of preset sizes are downloaded from the storage server, thereby obtaining multiple encrypted data blocks. That is, after downloading data of a preset size from the storage server, the downloaded data is used as an encrypted data block, and then the download of the next encrypted data block is started until the download of the encrypted file is completed, thereby obtaining multiple encrypted data blocks.

[0149] It should be noted that the sizes of multiple encrypted data blocks can be the same or different. For example, if the size of each encrypted data block is the same and is 4M, and the encrypted file is 100M, then each download of 4M data can be used as an encrypted data block, thereby obtaining 25 encrypted data blocks. If the size of the last encrypted data block is less than 4M, the data less than 4M can also be used as the last encrypted data block. For example, if the encrypted file is 95M, 23 encrypted data blocks of 4M in size can be downloaded, and the size of the last encrypted data block can be 3M, thus obtaining 24 encrypted data blocks.

[0150] After downloading the encrypted file in blocks in the storage server and obtaining multiple encrypted data blocks, the encrypted data blocks can be merged to obtain the encrypted file. There are many ways to merge the encrypted data blocks, for example, the download time of each encrypted data block can be obtained, the encrypted data blocks can be sorted based on the download time, and the encrypted data blocks can be merged based on the sorting result.

[0151] There are multiple ways to merge the encrypted data blocks based on the sorting result. For example, the encrypted data blocks can be sequentially spliced ​​from small to large or from large to small based on the sorting result to obtain an encrypted file.

[0152] 304. Decrypt the encrypted file according to the file secret key to obtain the source file.

[0153] For example, the encrypted file can be decrypted based on the file key to obtain the decrypted file, and the file integrity of the decrypted file can be verified. When the file integrity verification passes, the decrypted file is used as the source file.

[0154] Among them, there are many ways to decrypt the encrypted file based on the file key. For example, based on the decryption method corresponding to the encryption method, the file key can be used for decryption to obtain the decrypted file. For example, taking the encryption method as AES_ECB symmetric algorithm as an example, the encrypted file can be decrypted by the AES_ECB symmetric algorithm using the file key. Alternatively, when the file key is in an encrypted state, the file key can be decrypted to obtain the decrypted file key, and the decrypted file key can be used to decrypt the encrypted file through the AES_ECB symmetric algorithm to obtain the encrypted file, and so on.

[0155] After decrypting the encrypted file, the file integrity of the decrypted file can be verified. The so-called file integrity represents the completeness of the decrypted file after downloading. There are many ways to verify the file integrity of the decrypted file. For example, you can obtain the integrity reference value of the source file returned by the receiving storage server, calculate the current integrity reference value of the decrypted file, and compare the integrity reference value of the source file with the current integrity reference value. When the integrity reference value is the same as the current integrity reference value, it can be determined that the integrity check of the decrypted file has passed. When the integrity reference value is different from the current integrity reference value, it can be determined that the integrity check of the decrypted file has not passed.

[0156] The method of calculating the current integrity reference value of the decrypted file may be similar to the method of calculating the integrity reference value of the source file, as described above, and will not be described in detail here.

[0157] After the file integrity of the decrypted file is verified, when the file integrity verification passes, the decrypted file can be used as the source file.

[0158] Optionally, in some embodiments, when the file integrity check fails, the process may return to executing the step of sending a file download request for the source file to the synchronization server until the file integrity check passes, thereby obtaining the source file.

[0159] Taking the AES_ECB symmetric encryption algorithm as an example, the file download process in file synchronization can be as follows: Figure 8 As shown, the second terminal sends a download link (file download request) to the synchronization server to obtain the source file. After the synchronization server is authenticated, the URL address and file key of the encrypted file corresponding to the source file can be sent to the second terminal. The second terminal downloads the complete encrypted file in blocks to a temporary directory, and then merges them into a complete encrypted file. The encrypted file is decrypted to the specified download directory according to the AES_ECB algorithm, and finally the md5 value of the decrypted file is calculated to determine whether the decrypted file download is complete. When the verification is passed, the second terminal can use the decrypted file as the source file, thereby realizing the download and decryption of the source file, thereby improving the security of file download.

[0160] From the above, it can be seen that after sending a file download request for the source file to the synchronization server, the embodiment of the present application receives the storage address and file key of the encrypted file corresponding to the source file returned by the synchronization server based on the file download request, and then, based on the storage address, downloads the encrypted file from the storage server, and decrypts the encrypted file according to the file key to obtain the source file; since this scheme can obtain the encrypted file and the file key corresponding to the encrypted file from different places during the file download process, and decrypt the encrypted file through the file key, thereby realizing the secure download of the source file, thereby avoiding security risks such as data leakage or download errors in file downloading to a certain extent, and therefore, the security of file synchronization can be improved.

[0161] According to the method described in the above embodiment, the following is further described in detail with examples.

[0162] In this embodiment, the first file synchronization device is specifically integrated in the server, and the server is a synchronization server, the second file synchronization device is integrated in the terminal, and the terminal is a first terminal, the third file synchronization device is integrated in the terminal, and the terminal is a second terminal, and the storage server is a unified storage server.

[0163] like Fig. 9 As shown, a file synchronization method, the specific process is as follows:

[0164] 401. The first terminal obtains a source file and a file key corresponding to the source file, and encrypts the source file based on the file key to obtain an encrypted file.

[0165] For example, the first terminal may obtain at least one file to be uploaded uploaded by the terminal or the client, obtain the source file, and generate a file key corresponding to the source file, or may obtain at least one file to be uploaded in the network or the file database, obtain the source file, and generate a file key corresponding to the source file, etc.

[0166] The first terminal uses AES_ECB (a symmetric encryption algorithm) to split the data in the source file to obtain multiple data blocks, and encrypts each data block based on the file key to obtain an encrypted file. Alternatively, other types of symmetric encryption algorithms can be used to symmetrically encrypt the source file based on the file key to obtain an encrypted file. Alternatively, an asymmetric encryption algorithm can be used to asymmetrically encrypt the source file based on the file key to obtain an encrypted file, and so on.

[0167] 402. The first terminal obtains file attribute information of the encrypted file, and sends the file key and the file attribute information to the synchronization server.

[0168] For example, the first terminal can obtain attribute information such as the file size, file type, and file identifier of the source file corresponding to the encrypted file, thereby obtaining file attribute information. Alternatively, it can also obtain attribute information of the file size of the encrypted file, obtain the file identifier of the source file, and use the file identifier of the source file and the attribute information of the file size of the encrypted file as file attribute information, and so on.

[0169] The first terminal encrypts the file key to obtain the encrypted file key, and uses the encrypted file key as the file key, encrypts the file attribute information to obtain the encrypted file attribute information, and uses the encrypted file attribute information as the file attribute information, generates a file upload request based on the file key and the file attribute information, and sends the file upload request to the synchronization server. The file upload request carries the file key and the file attribute information, or the file key and the file attribute information can be directly sent to the synchronization server, and so on.

[0170] 403. The synchronization server sends the storage address of the encrypted file to the first terminal.

[0171] For example, the synchronization server can generate a file storage request for the encrypted file based on file attribute information, send the file storage request to the storage server, so that the storage server determines the storage address of the encrypted file based on the file storage request, receives the storage address returned by the storage server, and sends the storage address to the first terminal.

[0172] Optionally, in some embodiments, the synchronization server may extract the file identifier of the source file from the file attribute information, and based on the file identifier, perform data encoding on the file key, the file attribute information and the storage address to obtain the encoded encrypted information.

[0173] 404. The first terminal uploads the encrypted file to the storage server based on the storage address.

[0174] For example, the first terminal may upload the encrypted file to the storage space corresponding to the storage address in the storage server, or may send the encrypted file and the storage address to the storage server so that the storage server stores the encrypted file based on the storage address, and so on.

[0175] Optionally, the first terminal may also use the MD5 algorithm to calculate the md5 value of the source file, and use the md5 value as the integrity reference value, and send the integrity reference value to the storage server so that the second terminal can verify the integrity of the downloaded and decrypted source file when downloading the source file.

[0176] 405. When the encrypted file is uploaded, the first terminal sends a prompt message indicating that the upload is completed to the synchronization server.

[0177] For example, when the encrypted file is uploaded, the first terminal generates a prompt message indicating the upload is complete, and sends the prompt message to the synchronization server so that the synchronization server can build a file synchronization index of the source file based on the prompt message. Alternatively, when the decrypted file is uploaded, the first terminal generates a prompt message indicating the upload is complete, and sends the prompt message to the storage server so that the storage server sends the prompt message to the synchronization server, so that the synchronization server can determine that the encrypted file upload is complete and build a file synchronization index of the source file.

[0178] 406. The synchronization server constructs a file synchronization index of the source file based on the storage address, the file key, and the file attribute information.

[0179] For example, the synchronization server can construct a mapping relationship between the file identifier and the encoded encrypted information, use the file identifier as the keyword, and the encoded encrypted information as the value information corresponding to the keyword, and generate a file synchronization index for the source file based on the mapping relationship, keyword and value information.

[0180] 407. The second terminal sends a file download request for the source file to the synchronization server.

[0181] For example, the second terminal can display a file download page, which includes a download control for the source file, and in response to a trigger operation on the download control, generate a file download request for the source file, and send the file download request to the synchronization server, or obtain the file identifier of the source file, generate a file download request for the source file based on the file identifier, and send the file download request to the synchronization server, etc.

[0182] 408. When receiving the file download request for the source file sent by the second terminal, the synchronization server determines the storage address and file key of the encrypted file corresponding to the source file based on the file synchronization index.

[0183] For example, when the synchronization server receives a file download request for a source file sent by a second terminal, the synchronization server extracts the object identifier of the download object corresponding to the second terminal in the file download request, obtains the object permission information corresponding to the encrypted file, and determines the object permission of the download object based on the object permission information. When the object permission is a download permission, it is determined that the download object authentication has passed; when the object permission is other permissions or does not have permission, it is determined that the download object authentication has not passed. Alternatively, a preset download object identifier set with permission to download encrypted files is obtained, and the object identifier is queried in the preset object identifier set. When the object identifier exists, it is determined that the download object authentication has passed; when the object identifier does not exist, it is determined that the download object authentication has not passed, and so on.

[0184] When the download object authentication is passed, the synchronization server extracts the encoded encrypted information corresponding to the file identifier of the source file in the file synchronization index, decodes the encoded encrypted information, and obtains the storage address and file key of the encrypted file corresponding to the source file.

[0185] 409. The synchronization server sends the storage address and the file key to the second terminal.

[0186] For example, the synchronization server can directly send the storage address and file key to the second terminal, or encrypt the storage address and file key and send the encrypted storage address and file key to the second terminal as the storage address and file key respectively, or send the storage address and file key to the second terminal through a third-party platform, and so on.

[0187] 410. The second terminal downloads the encrypted file from the storage server based on the storage address.

[0188] For example, the second terminal can download multiple encrypted data blocks of a preset size from the storage server based on the storage address, thereby obtaining multiple encrypted data blocks. That is, after downloading data of a preset size from the storage server, the downloaded data is used as an encrypted data block, and then the download of the next encrypted data block is started until the download of the encrypted file is completed, thereby obtaining multiple encrypted data blocks.

[0189] The second terminal can obtain the download time of each encrypted data block, sort the encrypted data blocks based on the download time, and splice the encrypted data blocks in sequence from small to large or from large to small based on the sorting result to obtain an encrypted file.

[0190] 411. The second terminal decrypts the encrypted file according to the file key to obtain the source file.

[0191] For example, the second terminal can use the file key to decrypt the encrypted file through the AES_ECB symmetric algorithm, or, when the file key is in an encrypted state, it can also decrypt the file key to obtain the decrypted file key, and use the decrypted file key to decrypt the encrypted file through the AES_ECB symmetric algorithm to obtain the encrypted file, and so on.

[0192] The second terminal can obtain the integrity reference value of the source file returned by the receiving storage server, calculate the current integrity reference value of the decrypted file, and compare the integrity reference value of the source file with the current integrity reference value. When the integrity reference value is the same as the current integrity reference value, it can be determined that the integrity check of the decrypted file has passed. When the integrity reference value is different from the current integrity reference value, it can be determined that the integrity check of the decrypted file has not passed. When the file integrity check passes, the decrypted file can be used as the source file.

[0193] Optionally, in some embodiments, when the file integrity check fails, the second terminal may return to executing the step of sending a file download request for the source file to the synchronization server until the file integrity check passes, thereby obtaining the source file.

[0194] It should be noted that, in the file synchronization method of this solution, encryption and decryption can be realized without perception during the file upload / download process, and the file upload page in the file synchronization can be as follows: Fig.10 As shown, the file download page can be Fig.11 shown.

[0195] From the above, it can be seen that in this embodiment, after the synchronization server receives the file upload request sent by the first terminal, the file upload request carries the file key and file attribute information of the encrypted file, and the encrypted file includes the file after the source file is encrypted; based on the file upload request, the storage address of the encrypted file is then sent to the first terminal, so that the first terminal uploads the encrypted file to the storage server based on the storage address, and when it is determined that the encrypted file upload is completed, a file synchronization index of the source file is constructed based on the storage address, the file key and the file attribute information; when a file download request for the source file sent by the second terminal is received, the storage address and file key of the encrypted file corresponding to the source file are determined based on the file synchronization index, and the storage address and file key are sent to the first terminal. Two terminals, so that the second terminal obtains the encrypted file based on the storage address, and uses the file key to decrypt the encrypted file to obtain the source file; since the source file can be encrypted in this scheme, on the premise of encrypting the source file, the file key of the encrypted file sent by the first terminal is received, and then, when a download request for the source file is received, the file key can be sent to the second terminal, so that the second terminal decrypts the downloaded encrypted file, thereby realizing encryption / decryption of the file during the file upload / download process. In addition, the encrypted file is stored in the storage server, so that the encrypted file and the file key are stored separately, which reduces the security risk in the file synchronization (upload / download) process, and therefore, the security of file synchronization can be improved.

[0196] In order to better implement the above method, an embodiment of the present invention further provides a file synchronization device (ie, a first file synchronization device), which can be integrated in a server, and the server can be a single server or a server cluster composed of multiple servers.

[0197] For example, Fig.12 As shown, the first file synchronization device may include a first receiving unit 501, a first sending unit 502, a construction unit 503, a determination unit 504 and a second sending unit 505, as follows:

[0198] (1) a first receiving unit 501;

[0199] The first receiving unit 501 is used to receive a file upload request sent by a first terminal, where the file upload request carries a file key and file attribute information of an encrypted file, where the encrypted file includes a file obtained by encrypting a source file.

[0200] For example, the first receiving unit 501 can be specifically used to directly receive a file upload request sent by the first terminal, or can also receive the file upload request sent by the first terminal through a third-party platform or device. Alternatively, when the number of encrypted files is large, the file upload request can also carry the file key and file attributes in the encrypted information storage address of the first terminal or the third-party platform, and obtain the file key and file attributes of the encrypted file based on the encrypted information storage address, and so on.

[0201] (2) a first sending unit 502;

[0202] The first sending unit 502 is configured to send the storage address of the encrypted file to the first terminal based on the file upload request, so that the first terminal uploads the encrypted file to the storage server based on the storage address.

[0203] For example, the first sending unit 502 can be specifically used to generate a file storage request for an encrypted file based on file attribute information, send the file storage request to a storage server, so that the storage server determines a storage address of the encrypted file based on the file storage request, receives the storage address returned by the storage server, and sends the storage address to the first terminal, so that the first terminal uploads the encrypted file to the storage server based on the storage address.

[0204] (3) constructing unit 503;

[0205] The construction unit 503 is used to construct a file synchronization index of the source file based on the storage address, the file key and the file attribute information when it is determined that the encrypted file upload is completed.

[0206] For example, construction unit 503 can be specifically used to construct a mapping relationship between the file identifier and the encoded encrypted information when it is determined that the encrypted file upload is completed. The file identifier is used as a keyword, and the encoded encrypted information is used as the value information corresponding to the keyword. Based on the mapping relationship, keyword and value information, a file synchronization index of the source file is generated.

[0207] (4) determining unit 504;

[0208] The determination unit 504 is configured to determine, when receiving a file download request for a source file sent by the second terminal, a storage address and a file key of an encrypted file corresponding to the source file based on the file synchronization index.

[0209] For example, the determination unit 504 can be specifically used to extract the object identifier of the download object corresponding to the second terminal in the file download request when a file download request for the source file is received from the second terminal, and authenticate the download object based on the object identifier. When the download object authentication is passed, the storage address and file key of the encrypted file corresponding to the source file are determined based on the file synchronization index.

[0210] (5) a second sending unit 505;

[0211] The second sending unit 505 is used to send the storage address and the file key to the second terminal, so that the second terminal obtains the encrypted file based on the storage address and decrypts the encrypted file using the file key to obtain the source file.

[0212] For example, the second sending unit 505 can be specifically used to send the storage address and the file key directly to the second terminal, or the storage address and the file key can be encrypted and the encrypted storage address and the file key can be sent to the second terminal as the storage address and the file key respectively, or the storage address and the file key can be sent to the second terminal through a third-party platform and other methods, so that the second terminal obtains the encrypted file based on the storage address, and uses the file key to decrypt the encrypted file to obtain the source file.

[0213] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.

[0214] As can be seen from the above, in this embodiment, after the first receiving unit 501 receives the file upload request sent by the first terminal, the file upload request carries the file key and file attribute information of the encrypted file, and the encrypted file includes the file after the source file is encrypted, the first sending unit 502 sends the storage address of the encrypted file to the first terminal based on the file upload request, so that the first terminal uploads the encrypted file to the storage server based on the storage address, and the construction unit 503, when determining that the encrypted file upload is completed, constructs a file synchronization index of the source file based on the storage address, the file key and the file attribute information, and the determination unit 504, when receiving the file download request for the source file sent by the second terminal, determines the storage address and file key of the encrypted file corresponding to the source file based on the file synchronization index, and the second sending unit 5 05 The storage address and the file key are sent to the second terminal, so that the second terminal obtains the encrypted file based on the storage address, and uses the file key to decrypt the encrypted file to obtain the source file; since the source file can be encrypted in this scheme, on the premise of encrypting the source file, the file key of the encrypted file sent by the first terminal is received, and then, when a download request for the source file is received, the file key can be sent to the second terminal, so that the second terminal decrypts the downloaded encrypted file, thereby realizing encryption / decryption of the file during the file upload / download process. In addition, the encrypted file is stored in the storage server, so that the encrypted file and the file key are stored separately, which reduces the security risk in the file synchronization (upload / download) process, and therefore, the security of file synchronization can be improved.

[0215] In order to better implement the above method, an embodiment of the present invention further provides a file synchronization device (ie, a second file synchronization device), which can be integrated in a terminal, and the terminal can include a tablet computer, a laptop computer and / or a personal computer, etc.

[0216] For example, Fig.13 As shown, the second file synchronization device may include an encryption unit 601, an acquisition unit 602, an upload unit 603 and a third sending unit 604, as follows:

[0217] (1) Encryption unit 601;

[0218] The encryption unit 601 is used to obtain a source file and a file key corresponding to the source file, and encrypt the source file based on the file key to obtain an encrypted file.

[0219] For example, the encryption unit 601 can be specifically used to obtain a source file, generate a file key corresponding to the source file, divide the data in the source file to obtain multiple data blocks, and encrypt each data block based on the file key to obtain an encrypted file.

[0220] (2) Acquisition unit 602;

[0221] The acquisition unit 602 is used to acquire the file attribute information of the encrypted file and send the file key and the file attribute information to the synchronization server.

[0222] For example, the acquisition unit 602 can be specifically used to obtain the file attribute information of the encrypted file, encrypt the file key to obtain the encrypted file key, and use the encrypted file key as the file key, encrypt the file attribute information to obtain the encrypted file attribute information, and use the encrypted file attribute information as the file attribute information, generate a file upload request based on the file key and the file attribute information, and send the file upload request to the synchronization server, where the file upload request carries the file key and the file attribute information.

[0223] (3) Upload unit 603;

[0224] The uploading unit 603 is used to receive the storage address of the encrypted file returned by the synchronization server, and upload the encrypted file to the storage server based on the storage address.

[0225] For example, the upload unit 603 can be specifically used to receive the storage address of the encrypted file returned by the synchronization server, upload the encrypted file to the storage space corresponding to the storage address in the storage server, or send the encrypted file and the storage address to the storage server so that the storage server stores the encrypted file based on the storage address, and so on.

[0226] (4) a third sending unit 604;

[0227] The third sending unit 604 is used to send a prompt message of upload completion to the synchronization server when the encrypted file is uploaded successfully, so that the synchronization server can build a file synchronization index of the source file based on the prompt message.

[0228] For example, the third sending unit 604 can be specifically used to generate a prompt message indicating that the upload is completed when the encrypted file is uploaded, and send the prompt message to the synchronization server so that the synchronization server builds a file synchronization index of the source file based on the prompt message.

[0229] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.

[0230] From the above, it can be seen that in this embodiment, the encryption unit 601 obtains the source file and the file key corresponding to the source file, and encrypts the source file based on the file key. After obtaining the encrypted file, the acquisition unit 602 obtains the file attribute information of the encrypted file, and sends the file key and the file attribute information to the synchronization server. Then, the upload unit 603 receives the storage address of the encrypted file returned by the synchronization server, and uploads the encrypted file to the storage server based on the storage address. When the encrypted file is uploaded, the third sending unit 604 sends a prompt message of the upload completion to the synchronization server so that the synchronization server builds a file synchronization index of the source file based on the prompt message; because this scheme can encrypt the source file before uploading the file, and send the file key to the synchronization server, and store the encrypted file in the storage server based on the storage address returned by the synchronization server, the encrypted file and the file key are stored separately, which reduces the security risk in the file upload process, and therefore, the security of file synchronization can be improved.

[0231] In order to better implement the above method, an embodiment of the present invention further provides a file synchronization device (ie, a third file synchronization device), which can be integrated in a terminal, and the terminal can include a tablet computer, a laptop computer and / or a personal computer, etc.

[0232] For example, Fig.14 As shown, the third multi-person voice call device may include a fourth sending unit 701, a second receiving unit 702, a downloading unit 703 and a decryption unit 704, as follows:

[0233] (1) a fourth sending unit 701;

[0234] The fourth sending unit 701 is used to send a file download request for a source file to the synchronization server.

[0235] For example, the fourth sending unit 701 can be specifically used to display a file download page, which includes a download control for the source file. In response to a trigger operation on the download control, a file download request for the source file is generated, and the file download request is sent to the synchronization server, or the file identifier of the source file is obtained, and based on the file identifier, a file download request for the source file is generated, and the file download request is sent to the synchronization server, and so on.

[0236] (2) a second receiving unit 702;

[0237] The second receiving unit 702 is used to receive the storage address and file key of the encrypted file corresponding to the source file returned by the synchronization server based on the file download request.

[0238] For example, the second receiving unit 702 can be specifically used to directly receive the storage address and file key of the encrypted file corresponding to the source file returned by the synchronization server, or it can also obtain the storage address and file key of the encrypted file corresponding to the source file through a third-party platform or server, and so on.

[0239] (3) Download unit 703;

[0240] The downloading unit 703 is used to download the encrypted file from the storage server based on the storage address.

[0241] For example, the downloading unit 703 may be specifically configured to download the encrypted file in blocks in the storage server based on the storage address, obtain multiple encrypted data blocks, and merge the encrypted data blocks to obtain the encrypted file.

[0242] (4) decryption unit 704;

[0243] The decryption unit 704 is used to decrypt the encrypted file according to the file secret key to obtain the source file.

[0244] For example, the decryption unit 704 can be specifically used to decrypt the encrypted file based on the file key to obtain the decrypted file, verify the file integrity of the decrypted file, and when the file integrity verification passes, use the decrypted file as the source file.

[0245] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.

[0246] From the above, it can be seen that in this embodiment, after the fourth sending unit 701 sends a file download request for the source file to the synchronization server, the second receiving unit 702 receives the storage address and file key of the encrypted file corresponding to the source file returned by the synchronization server based on the file download request, and then the download unit 703 downloads the encrypted file from the storage server based on the storage address, and the decryption unit 704 decrypts the encrypted file according to the file key to obtain the source file; since this scheme can obtain the encrypted file and the file key corresponding to the encrypted file from different places during the file download process, and decrypt the encrypted file by the file key, thereby realizing the secure download of the source file, thereby avoiding security risks such as data leakage or download errors in file downloading to a certain extent, and therefore, the security of file synchronization can be improved.

[0247] The embodiment of the present invention further provides an electronic device, such as Fig.15 As shown, it shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present invention, specifically:

[0248] The electronic device may include components such as a processor 801 with one or more processing cores, a memory 802 with one or more computer-readable storage media, a power supply 803, and an input unit 804. Those skilled in the art will appreciate that Fig.15 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0249] The processor 801 is the control center of the electronic device, which uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 802, and calling data stored in the memory 802. Optionally, the processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 801.

[0250] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and data processing by running the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.

[0251] The electronic device also includes a power supply 803 for supplying power to each component. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 803 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0252] The electronic device may further include an input unit 804, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0253] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 801 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 802 according to the following instructions, and the processor 801 will run the application programs stored in the memory 802, thereby realizing various functions, as follows:

[0254] A file upload request sent by a first terminal is received, the file upload request carries a file key and file attribute information of an encrypted file, the encrypted file includes a file after encrypting a source file, and based on the file upload request, a storage address of the encrypted file is sent to the first terminal so that the first terminal uploads the encrypted file to a storage server based on the storage address, and when it is determined that the upload of the encrypted file is completed, a file synchronization index of the source file is constructed based on the storage address, the file key and the file attribute information, and when a file download request for the source file sent by a second terminal is received, a storage address and a file key of the encrypted file corresponding to the source file are determined based on the file synchronization index, and the storage address and the file key are sent to the second terminal so that the second terminal obtains the encrypted file based on the storage address, and decrypts the encrypted file using the file key to obtain the source file.

[0255] or

[0256] Obtain the source file and the file key corresponding to the source file, and encrypt the source file based on the file key to obtain the encrypted file, obtain the file attribute information of the encrypted file, and send the file key and the file attribute information to the synchronization server, receive the storage address of the encrypted file returned by the synchronization server, and upload the encrypted file to the storage server based on the storage address. When the encrypted file is uploaded, send a prompt message of the upload completion to the synchronization server so that the synchronization server can build a file synchronization index of the source file based on the prompt message.

[0257] or

[0258] Send a file download request for the source file to the synchronization server, receive the storage address and file key of the encrypted file corresponding to the source file returned by the synchronization server based on the file download request, download the encrypted file from the storage server based on the storage address, decrypt the encrypted file according to the file key, and obtain the source file.

[0259] The specific implementation of the above operations can be found in the previous embodiments and will not be described in detail here.

[0260] From the above, it can be seen that in an embodiment of the present invention, after receiving a file upload request sent by a first terminal, the file upload request carries a file key and file attribute information of an encrypted file, and the encrypted file includes a file after the source file is encrypted. Based on the file upload request, a storage address of the encrypted file is sent to the first terminal, so that the first terminal uploads the encrypted file to the storage server based on the storage address. When it is determined that the upload of the encrypted file is completed, a file synchronization index of the source file is constructed based on the storage address, the file key and the file attribute information. When a file download request for the source file sent by a second terminal is received, the storage address and file key of the encrypted file corresponding to the source file are determined based on the file synchronization index, and the storage address and the file key are sent to the second terminal. , so that the second terminal obtains the encrypted file based on the storage address, and uses the file key to decrypt the encrypted file to obtain the source file; since the source file can be encrypted in this scheme, on the premise of encrypting the source file, the file key of the encrypted file sent by the first terminal is received, and then, when a download request for the source file is received, the file key can be sent to the second terminal, so that the second terminal decrypts the downloaded encrypted file, thereby realizing encryption / decryption of the file during the file upload / download process. In addition, the encrypted file is stored in the storage server, so that the encrypted file and the file key are stored separately, which reduces the security risk in the file synchronization (upload / download) process, and therefore, the security of file synchronization can be improved.

[0261] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0262] To this end, an embodiment of the present invention provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any file synchronization method provided in the embodiment of the present invention. For example, the instructions can execute the following steps:

[0263] A file upload request sent by a first terminal is received, the file upload request carries a file key and file attribute information of an encrypted file, the encrypted file includes a file after encrypting a source file, and based on the file upload request, a storage address of the encrypted file is sent to the first terminal so that the first terminal uploads the encrypted file to a storage server based on the storage address, and when it is determined that the upload of the encrypted file is completed, a file synchronization index of the source file is constructed based on the storage address, the file key and the file attribute information, and when a file download request for the source file sent by a second terminal is received, a storage address and a file key of the encrypted file corresponding to the source file are determined based on the file synchronization index, and the storage address and the file key are sent to the second terminal so that the second terminal obtains the encrypted file based on the storage address, and decrypts the encrypted file using the file key to obtain the source file.

[0264] or

[0265] Obtain the source file and the file key corresponding to the source file, and encrypt the source file based on the file key to obtain the encrypted file, obtain the file attribute information of the encrypted file, and send the file key and the file attribute information to the synchronization server, receive the storage address of the encrypted file returned by the synchronization server, and upload the encrypted file to the storage server based on the storage address. When the encrypted file is uploaded, send a prompt message of the upload completion to the synchronization server so that the synchronization server can build a file synchronization index of the source file based on the prompt message.

[0266] or

[0267] Send a file download request for the source file to the synchronization server, receive the storage address and file key of the encrypted file corresponding to the source file returned by the synchronization server based on the file download request, download the encrypted file from the storage server based on the storage address, decrypt the encrypted file according to the file key, and obtain the source file.

[0268] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0269] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0270] Since the instructions stored in the computer-readable storage medium can execute the steps in any file synchronization method provided in the embodiments of the present invention, the beneficial effects that can be achieved by any file synchronization method provided in the embodiments of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0271] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various optional implementations of the above-mentioned file synchronization or file upload / download aspects.

[0272] The above is a detailed introduction to a file synchronization method, device, electronic device and computer-readable storage medium provided in an embodiment of the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A file synchronization method, characterized in that: include: Receiving a file upload request sent by the first terminal, the file upload request carrying a file key and file attribute information of an encrypted file, the encrypted file including a file obtained by encrypting a source file; Based on the file upload request, sending the storage address of the encrypted file to the first terminal, so that the first terminal uploads the encrypted file to the storage server based on the storage address; When it is determined that the encrypted file has been uploaded, constructing a file synchronization index of the source file based on the storage address, the file key and the file attribute information; When receiving a file download request for the source file sent by the second terminal, determining a storage address and a file key of an encrypted file corresponding to the source file based on the file synchronization index; The storage address and the file key are sent to the second terminal, so that the second terminal obtains the encrypted file based on the storage address, and decrypts the encrypted file using the file key to obtain the source file.

2. The file synchronization method according to claim 1, characterized in that: The sending the storage address of the encrypted file to the first terminal based on the file upload request includes: Based on the file attribute information, generating a file storage request for the encrypted file; Sending the file storage request to a storage server so that the storage server determines a storage address of the encrypted file based on the file storage request; The storage address returned by the storage server is received, and the storage address is sent to the first terminal.

3. The file synchronization method according to claim 2, characterized in that: After receiving the storage address returned by the storage server, the method further includes: Extracting the file identifier of the source file from the file attribute information; Based on the file identifier, data encoding is performed on the file key, file attribute information and storage address to obtain encoded encrypted information; The constructing the file synchronization index of the source file based on the storage address, the file key and the file attribute information includes: constructing the file synchronization index of the source file based on the file identifier and the encoded encryption information.

4. The file synchronization method according to claim 3, characterized in that: The step of constructing a file synchronization index of the source file based on the file identifier and the encoded encrypted information includes: Constructing a mapping relationship between the file identifier and the encoded encrypted information; Using the file identifier as a keyword, and using the encoded encrypted information as value information corresponding to the keyword; Based on the mapping relationship, keyword and value information, a file synchronization index of the source file is generated.

5. The file synchronization method according to claim 1, characterized in that: After sending the storage address of the encrypted file to the first terminal, the method further includes: When receiving the prompt information of upload completion sent by the first terminal, or receiving the prompt information of upload completion sent by the storage server, it is determined that the upload of the encrypted file is completed.

6. The file synchronization method according to claim 1, characterized in that: The determining, based on the file synchronization index, a storage address and a file key of the encrypted file corresponding to the source file includes: extracting an object identifier of a download object corresponding to the second terminal from the file download request; Based on the object identifier, performing object authentication on the downloaded object; When the download object authentication is passed, the storage address and file key of the encrypted file corresponding to the source file are determined based on the file synchronization index.

7. A file synchronization method, characterized in that: Applied to a first terminal, the method includes: Obtaining a source file and a file key corresponding to the source file, and encrypting the source file based on the file key to obtain an encrypted file; Obtaining file attribute information of the encrypted file, and sending the file key and file attribute information to the synchronization server; Receiving the storage address of the encrypted file returned by the synchronization server, and uploading the encrypted file to the storage server based on the storage address; When the encrypted file is uploaded, a prompt message indicating that the upload is completed is sent to the synchronization server so that the synchronization server constructs a file synchronization index of the source file based on the prompt message.

8. The file synchronization method according to claim 7, characterized in that: The sending the file key and the file attribute information to the synchronization server includes: Encrypting the file key to obtain an encrypted file key, and using the encrypted file key as the file key; Encrypting the file attribute information to obtain encrypted file attribute information, and using the encrypted file attribute information as the file attribute information; Based on the file key and the file attribute information, a file upload request is generated and sent to the synchronization server, where the file upload request carries the file key and the file attribute information.

9. The file synchronization method according to claim 7, characterized in that: The step of encrypting the source file based on the file key to obtain an encrypted file includes: Splitting the data in the source file to obtain multiple data blocks; Each data block is encrypted based on the file key to obtain an encrypted file.

10. A file synchronization method, characterized in that: Applied to the second terminal, the method includes: Send a file download request for the source file to the synchronization server; Receive the storage address and file key of the encrypted file corresponding to the source file returned by the synchronization server based on the file download request; Based on the storage address, downloading the encrypted file in the storage server; The encrypted file is decrypted according to the file key to obtain the source file.

11. The file synchronization method according to claim 10, characterized in that: The step of downloading the encrypted file from the storage server based on the storage address includes: Based on the storage address, downloading the encrypted file in blocks in the storage server to obtain multiple encrypted data blocks; The encrypted data blocks are merged to obtain the encrypted file.

12. The file synchronization method according to claim 10, characterized in that: The decrypting the encrypted file according to the file secret key to obtain the source file includes: Decrypting the encrypted file based on the file key to obtain a decrypted file; Verifying the file integrity of the decrypted file, wherein the file integrity represents the completeness of the decrypted file after downloading; When the file integrity check passes, the decrypted file is used as the source file.

13. A file synchronization device, characterized in that: include: A first receiving unit, configured to receive a file upload request sent by a first terminal, wherein the file upload request carries a file key and file attribute information of an encrypted file, and the encrypted file includes a file obtained by encrypting a source file; A first sending unit, configured to send the storage address of the encrypted file to the first terminal based on the file upload request, so that the first terminal uploads the encrypted file to a storage server based on the storage address; A construction unit, configured to construct a file synchronization index of the source file based on the storage address, the file key and the file attribute information when it is determined that the encrypted file has been uploaded; a determining unit, configured to determine, when receiving a file download request for the source file sent by the second terminal, a storage address and a file key of an encrypted file corresponding to the source file based on the file synchronization index; The second sending unit is used to send the storage address and the file key to the second terminal, so that the second terminal obtains the encrypted file based on the storage address and decrypts the encrypted file using the file key to obtain the source file.

14. A file synchronization device, characterized in that: include: An encryption unit, used to obtain a source file and a file key corresponding to the source file, and encrypt the source file based on the file key to obtain an encrypted file; An acquiring unit, used for acquiring file attribute information of the encrypted file, and sending the file key and the file attribute information to a synchronization server; an uploading unit, configured to receive the storage address of the encrypted file returned by the synchronization server, and upload the encrypted file to the storage server based on the storage address; The third sending unit is used to send a prompt message of upload completion to the synchronization server when the encrypted file is uploaded successfully, so that the synchronization server can build a file synchronization index of the source file based on the prompt message.

15. A file synchronization device, characterized in that: include: A fourth sending unit, configured to send a file download request for a source file to the synchronization server; A second receiving unit, configured to receive a storage address and a file key of an encrypted file corresponding to the source file returned by the synchronization server based on the file download request; A downloading unit, configured to download the encrypted file from a storage server based on the storage address; The decryption unit is used to decrypt the encrypted file according to the file secret key to obtain the source file.

16. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores an application program, and the processor is used to run the application program in the memory to execute the steps in the file synchronization method according to any one of claims 1 to 12.

17. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps in the file synchronization method described in any one of claims 1 to 12 are implemented.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the file synchronization method according to any one of claims 1 to 12.