File restoration method and device, terminal and storage medium

By performing differential processing and comparison on ZIP files, a differential file that is consistent with the backup file is generated, which solves the problem of poor ZIP file restoration and achieves higher accuracy and flexibility.

CN118733336APending Publication Date: 2024-10-01HEDUO TECH (GUANGZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310343370.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-31
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the existing technology, during the ZIP file restoration process, there are differences between the restored files and the files backed up by the user, resulting in poor file restoration effect.

Method used

By obtaining two ZIP files, perform differential processing to generate a target differential file, and based on the original file and differential file, generate a restored ZIP file that is the same as the backup file. Specific steps include decompression, file comparison, generating initial differential files, restoration processing and merging to ensure that the restored files match the backup files.

Benefits of technology

The accuracy and flexibility of file restoration are improved, ensuring that the restored files are completely consistent with the backup files, and solving the problem of poor file restoration effect in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733336A_ABST
    Figure CN118733336A_ABST
Patent Text Reader

Abstract

The invention discloses a file restoration method and device, a terminal and a storage medium, and the method comprises the steps: obtaining a first zip file and a second zip file, carrying out the differential processing of the first zip file and the second zip file, obtaining a target differential file, and obtaining a restored zip file based on the first zip file and the target differential file. According to the method and the device, the matched difference tool is selected according to the formats of the obtained first zip file and the second zip file, the difference file is generated, the difference rate can be improved, and the file restoration accuracy is further improved. In addition, the differential tool can be flexibly replaced according to specific requirements, and the file restoration flexibility is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a file restoration method, device, terminal and storage medium. Background Art

[0002] In order to restore the operating system or the files therein, users generally install backup and restore tools on the operating system, such as rsync, rclone, scp, etc. These tools can restore the ZIP file after the system is started.

[0003] Currently, for restoring a ZIP file, the ZIP file is generally regarded as an ordinary binary file, and then the ZIP file is processed using a binary file differential algorithm to generate a differential file, and then the generated differential file is restored to obtain a restored ZIP file.

[0004] However, there are differences between the ZIP file restored by the above method and the ZIP file backed up by the user, resulting in poor file restoration effect. Summary of the invention

[0005] The main purpose of the present application is to provide a file restoration method, device, terminal and storage medium to solve the problem of poor file restoration effect in the related art.

[0006] In order to achieve the above objectives, in a first aspect, the present application provides a file restoration method, comprising:

[0007] Get the first zip file and the second zip file;

[0008] Performing differential processing on the first zip file and the second zip file to obtain a target differential file;

[0009] Based on the first zip file and the target differential file, a restored zip file is obtained, wherein the restored zip file is the same as the second zip file.

[0010] In a possible implementation, performing differential processing on the first zip file and the second zip file to obtain a target differential file includes:

[0011] Decompressing the first zip file and the second zip file respectively to obtain a first folder and a second folder, wherein the first zip file corresponds to the first folder, and the second zip file corresponds to the second folder;

[0012] Compare the files in the first folder and the files in the second folder to obtain an initial differential file;

[0013] Based on the first folder, the second folder and the initial differential file, a target differential file is determined.

[0014] In a possible implementation, comparing the files in the first folder and the second folder to obtain an initial differential file includes:

[0015] If the file in the first folder and the file in the second folder are different, generate an initial differential file based on the file in the first folder and the file in the second folder;

[0016] If the file file does not exist in the first folder and the file file exists in the second folder, an initial differential file is generated based on the file file in the second folder.

[0017] In a possible implementation, the method further includes:

[0018] If the file file exists in the first folder and the file file does not exist in the second folder, the information that the file file exists in the first folder is recorded.

[0019] In a possible implementation, determining a target differential file based on the first folder, the second folder, and the initial differential file includes:

[0020] Restoring the initial differential file and the first folder to obtain a compressed folder;

[0021] Process the compressed file and the second folder to obtain a processed folder;

[0022] Merge the initial differential file and the processed file to obtain the target differential file.

[0023] In a possible implementation, obtaining a restored zip file based on the first zip file target differential file includes:

[0024] Verify that the files in the first zip file and the target differential file match;

[0025] If they match, decompress the first zip file and the target differential file to obtain the decompressed file;

[0026] Extract the same files as those in the second folder from the decompressed files to obtain an extracted folder;

[0027] Based on the extracted folder and the second zip file, a restored zip file is determined.

[0028] In a possible implementation, determining the restored zip file based on the extracted folder and the second zip file includes:

[0029] Compress the extracted folder to obtain the third zip file;

[0030] Compare the information in the third zip file with the information in the second zip file recorded in the differential file;

[0031] If the information in the third zip file matches the information of the second zip file recorded in the differential file, the restored zip file is output.

[0032] In a second aspect, an embodiment of the present invention provides a file restoration device, comprising:

[0033] A file acquisition module, used to acquire a first zip file and a second zip file;

[0034] A difference module is used to perform difference processing on the first zip file and the second zip file to obtain a target difference file;

[0035] The restoration module is used to obtain a restored zip file based on the first zip file and the target differential file, wherein the restored zip file is the same as the second zip file.

[0036] In a third aspect, an embodiment of the present invention provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above file restoration methods when executing the computer program.

[0037] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above file restoration methods are implemented.

[0038] The embodiment of the present invention provides a file restoration method, device, terminal and storage medium, including: obtaining a first zip file and a second zip file, performing differential processing on the first zip file and the second zip file to obtain a target differential file, and then obtaining a restored zip file based on the first zip file and the target differential file. The present invention selects a matching differential tool for the formats of the obtained first zip file and the second zip file to generate a differential file, which can improve the differential rate and thus improve the accuracy of file restoration. In addition, the differential tool of the present invention can be flexibly replaced according to specific needs, thereby improving the flexibility of file restoration. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The drawings constituting a part of this application are used to provide a further understanding of this application, so that other features, purposes and advantages of this application become more obvious. The schematic embodiment drawings and their descriptions of this application are used to explain this application and do not constitute an improper limitation on this application. In the drawings:

[0040] Figure 1 It is a schematic diagram of an application environment of a file restoration method provided by an embodiment of the present invention;

[0041] Figure 2 is a flowchart of a file restoration method provided by an embodiment of the present invention;

[0042] Figure 3 It is a structural schematic diagram of a file restoration device provided by an embodiment of the present invention;

[0043] Figure 4 is a schematic diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in sequences other than those illustrated or described herein.

[0046] It should be understood that in various embodiments of the present invention, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0047] It should be understood that in the present invention, "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products or apparatuses.

[0048] It should be understood that in the present invention, "plurality" refers to two or more than two. "And / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "Contains A, B and C", "Contains A, B, C" means that A, B, and C are all included, "Contains A, B or C" means that one of A, B, and C is included, and "Contains A, B and / or C" means that any one, any two, or any three of A, B, and C are included.

[0049] It should be understood that in the present invention, "B corresponding to A", "B corresponding to A", "A corresponds to B" or "B corresponds to A" means that B is associated with A and B can be determined based on A. Determining B based on A does not mean determining B based only on A, but B can also be determined based on A and / or other information. A and B match when the similarity between A and B is greater than or equal to a preset threshold.

[0050] Depending on the context, "if" as used herein may be interpreted as "when" or "when" or "in response to determining" or "in response to detecting."

[0051] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0052] Furthermore, in order to make the objectives, technical solutions and advantages of the present invention more clear, specific embodiments will be described below in conjunction with the accompanying drawings.

[0053] The file restoration method provided by this application can be applied to Figure 1 In the application environment shown, the client 102 receives the first zip file and the second zip file, and then transmits the first zip file and the second zip file to the server 104. The server 104 obtains the first zip file and the second zip file, and then performs differential processing on the first zip file and the second zip file to obtain a target differential file, and then obtains a restored zip file based on the first zip file and the target differential file.

[0054] Among them, the client 102 includes but is not limited to at least one of the following: mobile phones (such as Android phones, iOS phones, etc.), laptops, tablet computers, e-book readers, smart glasses, PDAs, MIDs (Mobile Internet Devices), PADs, desktop computers, smart TVs, etc.

[0055] The server 104 may be an on-site server or a remote server, wherein both the on-site server and the remote server may be implemented as an independent server or a service cluster or distributed system composed of multiple servers, and may 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, content delivery networks (CDN), and big data and artificial intelligence platforms. The above is only an example, and this embodiment does not make any limitation to this.

[0056] The server 104 may be a server that provides background services for an application installed in the client 102 . The background server may manage the version of the application, perform background processing on the application and return results, etc.

[0057] The client 102 and the server 104 are connected via a communication network. Optionally, the communication network is a wired network or a wireless network.

[0058] Optionally, the wired network or wireless network uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to any combination of LAN (Local Area Network), MAN (Metropolitan Area Network), WAN (Wide Area Network), mobile, wired or wireless network, dedicated network or virtual private network. In some embodiments, the data exchanged through the network is represented by the technology and / or format including HTML (Hyper Text Mark-up Language), EML (Extensible Markup Language), etc. In addition, conventional encryption technologies such as SSL (Secure Socket Layer), TLS (Transport Layer Security), VPN (Virtual Private Network), IPsec (Internet Protocol Security) can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technology can also be used to replace or supplement the above-mentioned data communication technology.

[0059] In one embodiment, Figure 2 As shown, a file restoration method is provided, comprising the following steps:

[0060] Step S201: Obtain a first zip file and a second zip file.

[0061] Among them, the ZIP (zip) file format is a file format for data compression and document storage. It is also an archive format that compresses each file separately, allowing independent files to be retrieved without reading other data; in theory, this format allows different algorithms to be used for different files. Regardless of the method used, a caveat to this format is that when it contains many small files, the archive will be significantly larger than if it were compressed into a single file.

[0062] Since there may be a difference in file size before and after the zip is restored, the present application proposes a file restoration method that can make the file sizes before and after the restoration the same.

[0063] Among them, the first zip file and the second zip file in this application are different zip files.

[0064] Step S202: performing differential processing on the first zip file and the second zip file to obtain a target differential file.

[0065] The method performs differential processing on a first zip file and a second zip file to obtain a target differential file, comprising: firstly decompressing the first zip file and the second zip file respectively to obtain a first folder and a second folder, wherein the first zip file corresponds to the first folder and the second zip file corresponds to the second folder; then comparing the files in the first folder and the second folder to obtain an initial differential file; and then determining a target differential file based on the first folder, the second folder and the initial differential file.

[0066] Among them, the files in the first folder and the files in the second folder are compared to obtain an initial differential file, including: if the file file in the first folder and the file file in the second folder are different, the initial differential file is generated based on the file file in the first folder and the file in the second folder; if the file file does not exist in the first folder and the file file exists in the second folder, the initial differential file is generated based on the file file in the second folder.

[0067] Specifically, the files in the first folder and the second folder are compared, mainly using a fuzzy matching method, which is a data matching technology used to compare two or more records and calculate the possibility that they belong to the same entity. Most of the fuzzy matching technologies currently used are different from the formula algorithms for comparing and matching fields. Appropriate technologies can be selected according to the nature of the data, including but not limited to fuzzy matching technologies.

[0068] 1. Character-based similarity measure (best for matching strings):

[0069] a) Edit distance: Calculate the distance between two strings, character by character.

[0070] b) Affine Gap Distance: Calculates the distance between two strings by also considering the gap or space between the strings.

[0071] c) Smith-Waterman distance: It calculates the distance between two strings by considering the presence or absence of both prefix and suffix.

[0072] d) Jaro distance: used to match first and last names.

[0073] 2. Token-based similarity measures (best for matching complete words in a string):

[0074] a) Atomic Strings: Divide long strings into words separated by punctuation marks and perform comparison on words.

[0075] b) WHIRL: Similar to atomic string, but WHIRL assigns weights to each word.

[0076] 3. Phonetic Similarity Index (Best for words with similar pronunciation but different characters):

[0077] a) Soundex: Compare similar sounding surnames with different spellings.

[0078] b) NYSIIS: Similar to Soundex, except that it preserves detailed information about vowel positions.

[0079] c) Metaphone: Compare similar-sounding words, words commonly used by Americans, and first and last names commonly used in the United States.

[0080] 4. Numerical similarity indicators, distance between numbers, distribution of digital data, etc.

[0081] The present application compares the files in the first folder and the second folder based on the character similarity measurement fuzzy matching method. In the process of comparing the files in the first folder and the second folder, it is first necessary to select and map attributes according to the fuzzy matching of the first folder and the second folder, and then select a fuzzy matching technology for each attribute. For example, matching can be based on the numerical similarity index in the file, and a weight needs to be selected for each attribute so that attributes assigned a higher weight (or higher priority) will have a greater impact on the overall matching confidence level compared to fields with lower weights.

[0082] After that, you need to define the threshold level, records with fuzzy matching scores above this level are considered matched, and records that do not reach the matching value are considered unmatched. Finally, run the fuzzy matching algorithm and analyze the matching results.

[0083] The present application adopts a fuzzy matching method to match files, which not only reduces the computational complexity but also improves the matching accuracy, thereby improving the accuracy of file restoration.

[0084] In addition, the method further includes: if the first folder contains the file file, and the second folder does not contain the file file, recording information that the file file exists in the first folder, wherein the information includes but is not limited to the file file attributes and the like.

[0085] After the initial differential file is obtained through the above embodiment, the initial differential file needs to be verified to determine the target differential file. That is, the target differential file needs to be determined based on the first folder, the second folder and the initial differential file, and the specific steps include: firstly restoring the initial differential file and the first folder to obtain a compressed folder, then processing the compressed folder and the second folder to obtain a processed folder, and then merging the initial differential file and the processed file to obtain the target differential file.

[0086] The binary levels of the compressed folder and the second folder are consistent.

[0087] Step S203: obtaining a restored zip file based on the first zip file and the target differential file.

[0088] The restored zip file is the same as the second zip file.

[0089] Based on the first zip file and the target differential file, the restored zip file is obtained, including: verifying whether the files in the first zip file and the target differential file match; if they match, decompressing the first zip file and the target differential file to obtain a decompressed file, then extracting the same file as the second folder from the decompressed file to obtain an extracted folder, and then determining the restored zip file based on the extracted folder and the second zip file. If they do not match, an error is reported and this process is exited.

[0090] Specifically, the verification of whether the files in the first zip file and the target differential file match is mainly performed through the names of the files in the first zip file and the target differential file. If the names of the files in the first zip file and the target differential file are the same, it means that the first zip file and the target differential file match. The matching content of the first zip file and the target differential file is only an example, not limited to the above matching method, and can be set according to specific circumstances.

[0091] After the first zip file and the target differential file are matched, the first zip file and the target differential file can be decompressed to obtain the decompressed file. If the first zip file and the target differential file are matched based on the above file names, it means that the files decompressed by the first zip file and the target differential file are exactly the same, and only one copy needs to be retained as the decompressed file.

[0092] Wherein, based on the extracted folder and the second zip file, determining the restored zip file includes: first compressing the extracted folder to obtain a third zip file, and then comparing the information in the third zip file with the information of the second zip file recorded in the differential file, if the information in the third zip file matches the information of the second zip file recorded in the differential file, outputting the restored zip file. If the information in the third zip file does not match the information of the second zip file recorded in the differential file, an error is reported and this process is exited.

[0093] Specifically, since the information of the zip file includes a file list, detailed information, etc., it is necessary to compare the file list and detailed information in the third zip file with the file list and detailed information of the second zip file recorded in the differential file to determine whether the file list and detailed information in the third zip file are the same as the file list and detailed information of the second zip file recorded in the differential file. If the file list and detailed information in the third zip file are the same as the file list and detailed information of the second zip file recorded in the differential file, it means that the differential file meets the requirements, that is, the restored zip file is output.

[0094] The embodiment of the present invention provides a file restoration method, comprising: obtaining a first zip file and a second zip file, performing differential processing on the first zip file and the second zip file to obtain a target differential file, and then obtaining a restored zip file based on the first zip file and the target differential file. The present invention selects a matching differential tool according to the formats of the obtained first zip file and the second zip file to generate a differential file, which can improve the differential rate and thus improve the accuracy of file restoration. In addition, the differential tool of the present invention can be flexibly replaced according to specific needs, thereby improving the flexibility of file restoration.

[0095] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0096] The following is an embodiment of the device of the present invention. For details not described in detail therein, reference may be made to the corresponding method embodiment described above.

[0097] Figure 3 A schematic diagram of the structure of a file restoration device provided by an embodiment of the present invention is shown. For the sake of convenience, only the parts related to the embodiment of the present invention are shown. The file restoration device includes a file acquisition module 31, a difference module 32 and a restoration module 33, which are specifically as follows:

[0098] A file acquisition module 31, used to acquire a first zip file and a second zip file;

[0099] The difference module 32 is used to perform difference processing on the first zip file and the second zip file to obtain a target difference file;

[0100] The restoration module 33 is used to obtain a restored zip file based on the first zip file target differential file, wherein the restored zip file is the same as the second zip file.

[0101] In a possible implementation, the difference module 32 is further used to decompress the first zip file and the second zip file respectively to obtain a first folder and a second folder, wherein the first zip file corresponds to the first folder, and the second zip file corresponds to the second folder;

[0102] Compare the files in the first folder and the files in the second folder to obtain an initial differential file;

[0103] Based on the first folder, the second folder and the initial differential file, a target differential file is determined.

[0104] In a possible implementation, the difference module 32 is further configured to generate an initial difference file based on the file in the first folder and the file in the second folder if the file in the first folder and the file in the second folder are different;

[0105] If the file file does not exist in the first folder and the file file exists in the second folder, an initial differential file is generated based on the file file in the second folder.

[0106] In a possible implementation, the device further includes an information recording module, and the information recording module is used to record information that the file exists in the first folder if the file exists in the first folder and the file does not exist in the second folder.

[0107] In a possible implementation, the difference module 32 is further used to restore the initial difference file and the first folder to obtain a compressed folder;

[0108] Process the compressed file and the second folder to obtain a processed folder;

[0109] Merge the initial differential file and the processed file to obtain the target differential file.

[0110] In one possible implementation, the restoration module 33 verifies whether the files in the first zip file and the target differential file match;

[0111] If they match, decompress the first zip file and the target differential file to obtain the decompressed file;

[0112] Extract the same files as those in the second folder from the decompressed files to obtain an extracted folder;

[0113] Based on the extracted folder and the second zip file, a restored zip file is determined.

[0114] In a possible implementation, the restoration module 33 compresses the extracted folder to obtain a third zip file;

[0115] Compare the information in the third zip file with the information in the second zip file recorded in the differential file;

[0116] If the information in the third zip file matches the information of the second zip file recorded in the differential file, the restored zip file is output.

[0117] Figure 4 is a schematic diagram of a terminal provided by an embodiment of the present invention. Figure 4 As shown, the terminal 4 of this embodiment includes: a processor 41, a memory 42, and a computer program 43 stored in the memory 42 and executable on the processor 41. When the processor 41 executes the computer program 43, the steps in the above-mentioned various file restoration method embodiments are implemented, for example Figure 2 Alternatively, when the processor 41 executes the computer program 43, the functions of each module / unit in the above-mentioned file restoration device embodiments are realized, for example Figure 3 Functions of the modules / units 31 to 33 are shown.

[0118] The present invention also provides a readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the file restoration method provided by the various embodiments described above.

[0119] Among them, the readable storage medium can be a computer storage medium or a communication medium. The communication medium includes any medium that facilitates the transmission of a computer program from one place to another. The computer storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer. For example, a readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application-specific integrated circuit (Application Specific Integrated Circuits, abbreviated as: ASIC). In addition, the ASIC can be located in a user device. Of course, the processor and the readable storage medium can also exist in a communication device as discrete components. The readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0120] The present invention also provides a program product, which includes an execution instruction stored in a readable storage medium. At least one processor of a device can read the execution instruction from the readable storage medium, and at least one processor executes the execution instruction so that the device implements the file restoration method provided by the various embodiments described above.

[0121] In the embodiments of the above-mentioned devices, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0122] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A file restoration method, characterized in that: include: Get the first zip file and the second zip file; Performing differential processing on the first zip file and the second zip file to obtain a target differential file; A restored zip file is obtained based on the first zip file and the target differential file, wherein the restored zip file is the same as the second zip file.

2. The file restoration method according to claim 1, characterized in that: The performing differential processing on the first zip file and the second zip file to obtain a target differential file includes: Decompressing the first zip file and the second zip file respectively to obtain a first folder and a second folder, wherein the first zip file corresponds to the first folder, and the second zip file corresponds to the second folder; Compare the files in the first folder and the files in the second folder to obtain an initial differential file; The target differential file is determined based on the first folder, the second folder and the initial differential file.

3. The file restoration method according to claim 2, characterized in that: The step of comparing the files in the first folder and the files in the second folder to obtain an initial differential file includes: If the file in the first folder is different from the file in the second folder, generating the initial differential file based on the file in the first folder and the file in the second folder; If the file file does not exist in the first folder, and the file file exists in the second folder, the initial differential file is generated based on the file file in the second folder.

4. The file restoration method according to claim 3, characterized in that: The method further comprises: If the file file exists in the first folder and the file file does not exist in the second folder, the information that the file file exists in the first folder is recorded.

5. The file restoration method according to claim 2, characterized in that: The step of determining the target differential file based on the first folder, the second folder and the initial differential file includes: Restoring the initial differential file and the first folder to obtain a compressed folder; Processing the compressed file and the second folder to obtain a processed folder; The initial differential file and the processed file are merged to obtain a target differential file.

6. The file restoration method according to claim 1, characterized in that: The step of obtaining a restored zip file based on the first zip file and the target differential file includes: Verify whether the files in the first zip file and the target differential file match; If they match, decompress the first zip file and the target differential file to obtain a decompressed file; Extract the same files as those in the second folder from the decompressed files to obtain an extracted folder; The restored zip file is determined based on the extracted folder and the second zip file.

7. The file restoration method according to claim 6, characterized in that: The step of determining the restored zip file based on the extracted folder and the second zip file includes: Compressing the extracted folder to obtain a third zip file; Compare the information in the third zip file with the information of the second zip file recorded in the differential file; If the information in the third zip file matches the information of the second zip file recorded in the differential file, the restored zip file is output.

8. A file restoration device, characterized in that: include: A file acquisition module, used to acquire a first zip file and a second zip file; A difference module, used for performing difference processing on the first zip file and the second zip file to obtain a target difference file; A restoration module is used to obtain a restored zip file based on the first zip file and the target differential file, wherein the restored zip file is the same as the second zip file.

9. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the file restoration method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the file restoration method according to any one of claims 1 to 7 are implemented.