File processing method, file processing device, mobile terminal and server

By obtaining incremental packages and using multi-thread processing, the problem of high traffic consumption and slow speed when updating applications is solved, and more efficient file synthesis and update speeds are achieved.

CN114424162BActive Publication Date: 2024-10-29SHENZHEN HEYTAP TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201980100487.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-27
Publication Date
2024-10-29
Estimated Expiration
2039-12-27

AI Technical Summary

Technical Problem

The existing technology requires full downloading when an application is updated, resulting in high traffic consumption and slow update speed, and cannot effectively utilize multi-thread optimization.

Method used

By obtaining incremental packages and using multi-threading for decompression, synthesis and compression, new installation packages are generated to reduce traffic consumption and increase update speed.

Benefits of technology

It achieves reduced traffic consumption and improved update speed when updating applications. Through multi-thread processing of incremental packages, the efficiency of the file synthesis process is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114424162B_ABST
    Figure CN114424162B_ABST
Patent Text Reader

Abstract

A file processing method, a file processing device, a mobile terminal, a server and a computer-readable storage medium, the method comprising: obtaining an incremental package of an application (S101); decompressing the incremental package to obtain an incremental file (S102); obtaining a first installation package of the application (S103); decompressing the to-be-decompressed file in the first installation package using multiple threads according to a decompression control field in the incremental package, and decompressing it to a first target file (S104); synthesizing the incremental file with the first target file to obtain a second target file (S105); compressing the second target file using multiple threads according to a compression control field in the incremental package, and compressing it to a designated file (S106); according to a copy control field in the incremental package, copying the to-be-copied file in the first installation package to a designated file, and the designated file including the to-be-copied file and the compressed second target file is a second installation package (S107). The method can download the incremental package when there is an update to the application without downloading the entire package, thereby reducing traffic consumption and improving the synthesis speed of the incremental package through multiple threads.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of file processing technology, and in particular, relates to a file processing method, a file processing device, a mobile terminal, a server and a computer-readable storage medium. Background Art

[0002] With the development of communication technology, more and more applications are installed on mobile terminals. When an application is updated, the mobile terminal usually downloads the target application (i.e. the updated application) from the server and installs the target application to replace the application originally installed in the mobile terminal. Summary of the invention

[0003] The present application provides a file processing method, a file processing device, a mobile terminal, a server and a computer-readable storage medium, so that when an application is updated, an incremental package can be downloaded without downloading the entire package, thereby reducing traffic consumption and improving the synthesis speed of the incremental package through multi-threading.

[0004] In a first aspect, an embodiment of the present application provides a file processing method, the file processing method comprising:

[0005] Obtaining an incremental package of the application, wherein the incremental package includes a decompression control field, a compression control field, and a copy control field;

[0006] Decompressing the incremental package to obtain an incremental file;

[0007] Obtaining a first installation package of the application;

[0008] Decompress the to-be-decompressed files in the first installation package into a first target file using multiple threads according to the decompression control field in the incremental package;

[0009] Synthesize the incremental file with the first target file to obtain a second target file;

[0010] According to the compression control field in the incremental packet, compressing the second target file into a designated file by using multiple threads;

[0011] According to the copy control field in the incremental package, the files to be copied in the first installation package are copied to the designated file, and the designated file including the files to be copied and the compressed second target file is the second installation package.

[0012] In a second aspect, an embodiment of the present application provides a file processing method, the file processing method comprising:

[0013] Obtaining files to be decompressed in a first installation package of the application, files to be decompressed in a second installation package, and files to be copied in the first installation package and the second installation package, wherein the files to be copied refer to files that have no difference between the first installation package and the second installation package;

[0014] Obtaining the starting position and ending position of the file to be decompressed in the first installation package, the starting position and ending position of the file to be copied in the first installation package, the starting position and ending position of the file to be decompressed in the second installation package, and the starting position and ending position of the file to be copied in the second installation package;

[0015] Decompress the files to be decompressed in the first installation package and the files to be decompressed in the second installation package, decompress the files to be decompressed in the first installation package into a first target file, and decompress the files to be decompressed in the second installation package into a second target file;

[0016] Obtaining the starting position and ending position of the file to be decompressed in the first target file after being decompressed in the first installation package, and the starting position and ending position of the file to be decompressed in the second target file after being decompressed in the second installation package, wherein the starting position and ending position of the file to be decompressed in the second target file after being decompressed in the second installation package refer to the starting position and ending position of the file to be compressed in the second target file, and the starting position and ending position of the file to be decompressed in the second installation package refer to the starting position and ending position of the file to be compressed in the second target file in the second installation package after being compressed;

[0017] Recording the starting position and the ending position of a file to be decompressed in the first installation package and the starting position and the ending position of the file to be decompressed in the first target file after decompression in a set of decompression control fields;

[0018] Recording the starting position and the ending position of a file to be compressed in the second target file and the starting position and the ending position of the file to be compressed in the second installation package after compression in a set of compression control fields;

[0019] Recording a starting position and an ending position of a file to be copied in the first installation package, and a starting position and an ending position of a file to be copied in the second installation package in a set of copy control fields;

[0020] According to a preset difference algorithm, obtaining an incremental file of the to-be-decompressed file after decompression in the first target file and the to-be-decompressed file after decompression in the second target file;

[0021] Compress the incremental file to obtain an incremental package, and insert a decompression control field, a compression control field, and a copy control field into the incremental package.

[0022] In a third aspect, an embodiment of the present application provides a file processing device, the file processing device comprising:

[0023] An incremental package acquisition module, used to acquire an incremental package of an application, wherein the incremental package includes a decompression control field, a compression control field, and a copy control field;

[0024] An incremental file acquisition module, used to decompress the incremental package to obtain an incremental file;

[0025] A first installation package acquisition module, used to acquire a first installation package of the application;

[0026] A first installation package decompression module, configured to decompress the to-be-decompressed files in the first installation package into a first target file by using multiple threads according to the decompression control field in the incremental package;

[0027] A second target file obtaining module, used for synthesizing the incremental file with the first target file to obtain a second target file;

[0028] A second target file compression module, used to compress the second target file into a specified file by using multiple threads according to the compression control field in the incremental packet;

[0029] The file copy module is used to copy the files to be copied in the first installation package to the designated file according to the copy control field in the incremental package, and the designated file including the files to be copied and the compressed second target file is the second installation package.

[0030] In a fourth aspect, an embodiment of the present application provides a file processing device, the file processing device comprising:

[0031] a module for acquiring files to be processed, used to acquire files to be decompressed in a first installation package of an application, files to be decompressed in a second installation package, and files to be copied in the first installation package and the second installation package, wherein the files to be copied refer to files that have no difference between the first installation package and the second installation package;

[0032] A first position acquisition module, used to acquire the starting position and the ending position of the file to be decompressed in the first installation package, the starting position and the ending position of the file to be copied in the first installation package, the starting position and the ending position of the file to be decompressed in the second installation package, and the starting position and the ending position of the file to be copied in the second installation package;

[0033] A file decompression module, used to decompress the files to be decompressed in the first installation package and the files to be decompressed in the second installation package, decompress the files to be decompressed in the first installation package into a first target file, and decompress the files to be decompressed in the second installation package into a second target file;

[0034] A second position acquisition module, used for acquiring a starting position and an ending position of a file to be decompressed in the first installation package in the first target file after being decompressed, and a starting position and an ending position of a file to be decompressed in the second installation package in the second target file after being decompressed, wherein the starting position and the ending position of a file to be decompressed in the second installation package in the second target file after being decompressed refer to the starting position and the ending position of a file to be compressed in the second target file, and the starting position and the ending position of a file to be decompressed in the second installation package refer to the starting position and the ending position of a file to be compressed in the second target file in the second installation package after being compressed;

[0035] A first position recording module, used for recording the starting position and the ending position of a file to be decompressed in the first installation package and the starting position and the ending position of the file to be decompressed in the first target file after decompression in a set of decompression control fields;

[0036] A second position recording module, used for recording the starting position and the ending position of a file to be compressed in the second target file and the starting position and the ending position of the file to be compressed in the second installation package after compression in a group of compression control fields;

[0037] A third position recording module, used for recording a starting position and an ending position of a file to be copied in the first installation package, and a starting position and an ending position of a file to be copied in the second installation package in a set of copy control fields;

[0038] A difference processing module, used for obtaining, according to a preset difference algorithm, an incremental file of the to-be-decompressed file after decompression in the first target file and the to-be-decompressed file after decompression in the second target file;

[0039] The incremental packet processing module is used to compress the incremental file, obtain the incremental packet, and insert a decompression control field, a compression control field and a copy control field into the incremental packet.

[0040] In a fifth aspect, an embodiment of the present application provides a mobile terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the file processing method described in the first aspect above are implemented.

[0041] In a sixth aspect, an embodiment of the present application provides a server, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the file processing method described in the second aspect above are implemented.

[0042] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, it implements the steps of the file processing method described in the first aspect above; or when the computer program is executed by a processor, it implements the steps of the file processing method described in the second aspect above.

[0043] In an eighth aspect, an embodiment of the present application provides a computer program product, which, when the computer program product is running on a mobile terminal, enables the mobile terminal to execute the steps of the file processing method described in the first aspect above; or when the computer program product is running on a server, enables the server to execute the steps of the file processing method described in the second aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0045] Figure 1 This is a schematic diagram of the implementation process of the file processing method provided in Example 1 of the present application;

[0046] Figure 2 This is a schematic diagram of the implementation flow of the file processing method provided in Example 2 of the present application;

[0047] Figure 3 is a structural schematic diagram of a file processing device provided in Embodiment 3 of the present application;

[0048] Figure 4 is a structural schematic diagram of a file processing device provided in Embodiment 4 of the present application;

[0049] Figure 5 is a structural diagram of a mobile terminal provided in Embodiment 5 of the present application;

[0050] Figure 6 It is a structural diagram of the server provided in Example 6 of the present application. DETAILED DESCRIPTION

[0051] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0052] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0053] In addition, in the description of the present specification and the appended claims, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0054] It should also be understood that the size of the serial numbers of the steps in this embodiment 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 embodiment of this application.

[0055] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.

[0056] See also Figure 1 , is a schematic diagram of the implementation flow of the file processing method provided in the first embodiment of the present application. The file processing method is applied to a mobile terminal. As shown in the figure, the file processing method may include the following steps:

[0057] Step S101, obtaining an incremental package of an application.

[0058] The incremental packet includes a decompression control field, a compression control field and a copy control field.

[0059] In an embodiment of the present application, the mobile terminal can periodically poll to detect whether there is an update to the installed application. When it is detected that at least one of the installed applications has an update, the incremental package of each application in the above at least one application is obtained from the server or the designated device. For example, the mobile terminal periodically sends an update query request message to the designated device. After receiving the update query request message, the designated device detects whether there is an update to the application installed by the mobile terminal. If there is an update, the incremental package of the application with the update is sent to the mobile terminal. Among them, the application in step S101 refers to the application with an update in the application installed by the mobile terminal. The installation package of the application installed in the mobile terminal can be called the old installation package, and the installation package of the application after the update is called the new installation package. The incremental package is the difference package between the new installation package of the application and the old installation package. The new installation package can be obtained based on the difference package and the old installation package. It should be noted that the version of the new installation package is usually higher than the version of the old installation package, and the version of the application can be upgraded from the old version to the new version through the incremental package. Among them, the server can refer to the device that generates the incremental package, and the designated device can refer to the device that stores the incremental package.

[0060] Step S102, decompress the incremental package to obtain an incremental file.

[0061] Among them, the incremental package is a compressed package, and the incremental file is the real incremental file obtained by decompressing the incremental package. It is the difference file between the new installation package and the old installation package of the application, and does not include information such as decompression control field, compression control field, and copy control field.

[0062] Optionally, after obtaining the incremental package of the application, also include:

[0063] Verifying the incremental package;

[0064] Correspondingly, decompressing the incremental package to obtain the incremental file includes:

[0065] If the incremental package verification succeeds, the incremental package is decompressed to obtain the incremental file.

[0066] Optionally, the verifying the incremental package includes:

[0067] Obtaining an actual checksum value of the incremental packet;

[0068] Obtaining a target checksum value of the incremental package from a specified device or incremental package;

[0069] If the actual checksum value of the incremental packet is the same as the target checksum value of the incremental packet, it is determined that the verification of the incremental packet is successful;

[0070] If the actual verification value of the incremental packet is different from the target verification value of the incremental packet, it is determined that the verification of the incremental packet has failed.

[0071] In an embodiment of the present application, the target check value of the incremental package can be stored in the incremental package, or the target check value of the incremental package can be stored in the designated device. After the mobile terminal obtains the incremental package, the target check value can be obtained from the incremental package or the designated device. The mobile terminal calculates the actual check value of the incremental package obtained, and compares the actual check value with the target check value. If the actual check value is the same as the target check value, it is determined that the incremental package verification is successful, and the incremental package obtained by the mobile terminal is correct, and the application currently installed on the mobile terminal can be updated according to the incremental package; if the actual check value is not the same as the target check value, it is determined that the incremental package verification fails, and the mobile terminal can perform a full download at this time, thereby realizing the update of the application currently installed on the mobile terminal. Among them, the target check value of the incremental package can refer to the check value of the incremental package obtained from the incremental package or the designated device. For example, after the server obtains the incremental package according to the preset differential algorithm, it calculates the check value of the incremental package and adds the check value to the incremental package, or when uploading the incremental package to the designated device, it also uploads the check value of the incremental package. The actual check value of the incremental package may refer to the check value of the incremental package calculated by the mobile terminal, and the check value of the incremental package calculated by the mobile terminal may refer to the check value calculated based on the content in the incremental package other than the check value. Among them, the above check values ​​include but are not limited to MD5 values, cyclic redundancy check values, etc., and the check algorithm used when calculating the actual check value and the target check value is the same. The message digest algorithm (Message Digest Algorithm, MD5) is a cryptographic hash function that can generate a 128-bit (16-byte) hash value to ensure the integrity and consistency of information transmission.

[0072] Step S103: obtaining a first installation package of the application.

[0073] In an embodiment of the present application, the mobile terminal can obtain the first installation package of the application from its own memory. The first installation package of the application is the installation package of the application currently installed on the mobile terminal, which can also be called an old installation package.

[0074] Step S104, decompressing the to-be-decompressed files in the first installation package into a first target file using multiple threads according to the decompression control field in the incremental package.

[0075] In an embodiment of the present application, according to the decompression control field in the incremental package, the files to be decompressed in the first installation package can be obtained, and the decompression task of the files to be decompressed in the first installation package can be assigned to multiple threads. Using multiple threads to decompress the files to be decompressed in the first installation package at the same time can improve the decompression speed of the first installation package. Among them, using multiple threads to decompress the files to be decompressed in the first installation package can refer to using multiple threads to concurrently execute the decompression task of multiple files to be decompressed in the first installation package. The first target file is a file obtained after decompressing the files to be decompressed in the first installation package, including the decompressed files.

[0076] Optionally, a group of decompression control fields records a starting position and an ending position of a file to be decompressed in the first installation package and a starting position and an ending position of the file to be decompressed in the first target file after the file to be decompressed is decompressed, and decompressing the file to be decompressed in the first installation package using multiple threads according to the decompression control fields in the incremental package, and decompressing the file to be decompressed to the first target file includes:

[0077] When the incremental package includes multiple groups of decompression control fields, obtaining multiple files to be decompressed in the first installation package according to the starting positions and ending positions of multiple files to be decompressed in the first installation package recorded by the multiple groups of decompression control fields;

[0078] Allocating the decompression tasks of the multiple files to be decompressed to multiple threads;

[0079] Decompress the multiple files to be decompressed using the multiple threads, and store the decompressed multiple files to be decompressed in a specified position in the first target file, wherein the specified position in the first target file is determined by the starting position and the ending position of the multiple files to be decompressed recorded in the multiple groups of decompression control fields in the first target file after decompression.

[0080] In an embodiment of the present application, a group of decompression control fields records the starting position and ending position of a file to be decompressed in the first installation package. According to a group of decompression control fields, a file to be decompressed in the first installation package can be obtained. If there are multiple groups of decompression control fields in the incremental package, multiple files to be decompressed in the first installation package can be obtained. The decompression tasks of the multiple files to be decompressed are assigned to multiple threads. The decompression tasks of the multiple files to be decompressed are executed concurrently by multiple threads, which can improve the decompression speed of the multiple files to be decompressed in the first installation package. A group of decompression control fields also records the starting position and ending position of a file to be decompressed in the first target file after decompression. According to the starting position and ending position of a file to be decompressed in the first target file after decompression, a file to be decompressed can be stored in the first target file after decompression. Among them, the first target file includes the files obtained after all the files to be decompressed in the first installation package are decompressed. For example, the first installation package has two files to be decompressed, namely file A and file B, and the first target file includes the decompressed file A and the decompressed file B.

[0081] Step S105, synthesizing the incremental file with the first target file to obtain a second target file.

[0082] The second target file is a file synthesized from the incremental file and the first target file, and the second target file includes the incremental file and the first target file.

[0083] Step S106, compressing the second target file into a designated file using multi-threading according to the compression control field in the incremental packet.

[0084] In an embodiment of the present application, according to the compression control field in the incremental packet, the files to be compressed in the second target file can be obtained, and the compression tasks of the files to be compressed in the second target file can be assigned to multiple threads. The files to be compressed in the second target file are compressed using multiple threads at the same time, which can improve the compression speed of the second target file. Among them, using multiple threads to compress the files to be compressed in the second target file can refer to using multiple threads to concurrently execute the compression tasks of multiple files to be compressed in the second target file. The designated file is a compressed package obtained after compressing the files to be compressed in the second target file, including compressed files.

[0085] Optionally, a group of compression control fields records a starting position and an ending position of a file to be compressed in the second target file and a starting position and an ending position of the file to be compressed in the second installation package after compression, and the compressing the second target file using multiple threads according to the compression control field in the incremental package to a specified file includes:

[0086] When the incremental packet includes multiple groups of compression control fields, obtaining multiple files to be compressed in the second target file according to the starting positions and ending positions of multiple files to be compressed in the second target file recorded by the multiple groups of compression control fields;

[0087] Allocating compression tasks of the plurality of files to be compressed to a plurality of threads;

[0088] The multiple files to be compressed are compressed using the multiple threads, and the compressed multiple files to be compressed are stored in a first designated position in the designated file, wherein the first designated position in the designated file is determined by the starting position and the ending position of the multiple files to be compressed in the second installation package recorded by the multiple groups of compression control fields.

[0089] In an embodiment of the present application, a group of compression control fields records the starting position and ending position of a file to be compressed in the second target file. According to the group of compression control fields, a file to be compressed in the second target file can be obtained. If there are multiple groups of compression control fields in the incremental package, multiple files to be compressed in the second target file can be obtained. The compression tasks of the multiple files to be compressed are assigned to multiple threads. By executing the compression tasks of the multiple files to be compressed concurrently by multiple threads, the compression speed of the multiple files to be compressed in the second target file can be improved. A group of compression control fields also records the starting position and ending position of a file to be compressed in the second installation package after compression. According to the starting position and ending position of a file to be compressed in the second installation package after compression, a file to be compressed can be compressed and stored in a specified file. Among them, according to the starting position and ending position of a file to be compressed in the second installation package after compression, the position of a file to be compressed in the designated file after compression can be determined (the starting position of a file to be compressed in the second installation package after compression is the starting position in the designated file, and the ending position in the second installation package is the ending position in the designated file). Then, according to the starting positions and ending positions of multiple files to be compressed in the second installation package after compression, the positions of multiple files to be compressed in the designated file after compression can be determined. The first designated position in the designated file includes the positions of multiple files to be compressed in the designated file.

[0090] Step S107, according to the copy control field in the incremental package, copy the files to be copied in the first installation package to the designated file, and the designated file including the files to be copied and the compressed second target file is the second installation package.

[0091] In the embodiment of the present application, according to the copy control field in the incremental package, the files to be copied in the first installation package can be obtained, and the files to be copied in the first installation package can be copied to the designated file. Alternatively, the copying task of the files to be copied in the first installation package can be assigned to multiple threads, and multiple threads can be used to copy multiple files to be copied in the first installation package at the same time, which can improve the copying speed of the files to be copied in the first installation package. Among them, the designated file including the files to be copied and the compressed second target file is the synthesized new version installation package (i.e., the second installation package synthesized in the mobile terminal).

[0092] Optionally, a group of copy control fields records a starting position and an ending position of a file to be copied in the first installation package and a starting position and an ending position in the second installation package, and copying the file to be copied in the first installation package to the designated file according to the copy control field in the incremental package includes:

[0093] When the incremental package includes multiple groups of copy control fields, obtaining multiple files to be copied in the first installation package according to the starting positions and ending positions of the multiple files to be copied in the first installation package recorded by the multiple groups of copy control fields;

[0094] Allocating the copying tasks of the multiple files to be copied to multiple threads;

[0095] Use the multiple threads to copy the multiple files to be copied to a second designated position in the designated file, wherein the second designated position in the designated file is determined by the starting positions and ending positions of the multiple files to be copied in the second installation package recorded by the multiple groups of copy control fields.

[0096] In an embodiment of the present application, a set of copy control fields records the starting position and ending position of a file to be copied in the first installation package. According to the set of copy control fields, a file to be copied in the first installation package can be obtained. If there are multiple sets of copy control fields in the incremental package, multiple files to be copied in the first installation package can be obtained. The copying tasks of the multiple files to be copied are assigned to multiple threads. The copying speed of the multiple files to be copied in the first installation package can be improved by concurrently executing the copying tasks of the multiple files to be copied through multiple threads. A set of copy control fields also records the starting position and ending position of a file to be copied in the second installation package. According to the starting position and ending position of a file to be copied in the second installation package, a file to be copied can be copied to a specified file, thereby obtaining a complete new version installation package. Among them, according to the starting position and ending position of a file to be copied in the second installation package, the position of a file to be copied in the designated file can be determined (the starting position of a file to be copied in the second installation package is the starting position in the designated file, and the ending position in the second installation package is the ending position in the designated file), then according to the starting positions and ending positions of multiple files to be copied in the second installation package, the positions of multiple files to be copied in the designated file can be determined, and the second designated position in the designated file includes the positions of multiple files to be copied in the designated file.

[0097] Optionally, after obtaining the second installation package, the embodiment of the present application further includes:

[0098] Install the second installation package.

[0099] In the embodiment of the present application, after obtaining the second installation package, the mobile terminal can automatically install the second installation package, or send a prompt message to prompt the user to obtain the second installation package. When receiving the installation instruction triggered by the user, the second installation package is installed to replace the first installation package in the mobile terminal, and the application is updated. For example, the first installation package and the second installation package of application A can replace the first installation package installed in the mobile terminal with the second installation package to complete the update of application A installed in the mobile terminal.

[0100] Optionally, before installing the second installation package, the method further includes:

[0101] Verifying the second installation package;

[0102] Correspondingly, installing the second installation package includes:

[0103] If the second installation package is verified successfully, installing the second installation package;

[0104] If the verification of the second installation package fails, the second installation package of the application is obtained from the designated device.

[0105] In an embodiment of the present application, before installing the synthesized second installation package on the mobile terminal, the second installation package can be verified first to verify whether the second installation package synthesized on the mobile terminal is consistent with the second installation package provided by the designated device, thereby ensuring that the second installation package installed on the mobile terminal is the correct second installation package, which is the second installation package uploaded by the server to the designated device.

[0106] Optionally, the verifying the second installation package includes:

[0107] Obtaining an actual verification value of the second installation package;

[0108] Obtaining a target checksum value of the second installation package from a designated device or the incremental package;

[0109] If the actual verification value of the second installation package is the same as the target verification value of the second installation package, it is determined that the verification of the second installation package is successful;

[0110] If the actual verification value of the second installation package is different from the target verification value of the second installation package, it is determined that the verification of the second installation package has failed.

[0111] In an embodiment of the present application, the mobile terminal can obtain the target check value of the second installation package from the designated device or the incremental package, the mobile terminal calculates the actual check value of the synthesized second installation package, and compares the actual check value of the second installation package with the target check value. If the actual check value of the second installation package is the same as the target check value, it is determined that the verification of the second installation package synthesized by the mobile terminal is successful, that is, the second installation package synthesized by the mobile terminal is correct; if the actual check value of the second installation package is not the same as the target check value, it is determined that the verification of the second installation package synthesized by the mobile terminal has failed, that is, the second installation package synthesized by the mobile terminal is incorrect. At this time, in order to implement the update of the application on the mobile terminal, the mobile terminal can download the entire amount from the designated device, that is, download the correct second installation package from the designated device. Among them, the verification algorithm used when calculating the actual check value and the target check value of the second installation package is the same, for example, it can be any one of the cyclic redundancy check algorithm and the message digest algorithm, or it can be other verification algorithms, which are not limited here.

[0112] The embodiment of the present application obtains an incremental package of an application to be updated through a mobile terminal, and synthesizes the incremental package with an old installation package of the application already installed on the mobile terminal, so as to obtain a new installation package of the application without the mobile terminal having to download the new installation package in full, thereby reducing the traffic consumption of the mobile terminal, and through the decompression control field and the compression control field inserted in the incremental package, multi-threaded decompression and compression can be implemented in the file synthesis process, thereby improving the compression and decompression speed in the synthesis process, thereby improving the synthesis speed of the incremental package.

[0113] See also Figure 2 , is a schematic diagram of the implementation flow of the file processing method provided in the second embodiment of the present application. The file processing method is applied to the server. As shown in the figure, the file processing method may include the following steps:

[0114] Step S201, obtaining files to be decompressed in a first installation package of an application, files to be decompressed in a second installation package, and files to be copied in the first installation package and the second installation package.

[0115] The files to be copied refer to files that have no differences between the first installation package and the second installation package.

[0116] In an embodiment of the present application, the server stores a first installation package (ie, old installation package) and a second installation package (ie, new installation package) of the application, and files to be decompressed and files to be copied can be obtained from the first installation package and the second installation package, respectively.

[0117] Optionally, the obtaining of the files to be decompressed in the first installation package of the application, the files to be decompressed in the second installation package, and the files to be copied in the first installation package and the second installation package includes:

[0118] Traversing the files in the first installation package and the second installation package of the application, obtaining a checksum value of each file in the first installation package and a checksum value of each file in the second installation package;

[0119] Obtain a file in the first installation package whose verification value is the same as that in the second installation package, and determine that the file is a file to be copied;

[0120] It is determined that the files in the first installation package other than the files to be copied are the files to be decompressed in the first installation package, and the files in the second installation package other than the files to be copied are the files to be decompressed in the second installation package.

[0121] In an embodiment of the present application, the file whose verification value in the first installation package is the same as the verification value in the second installation package, its file name and file content are usually the same in the first installation package and the second installation package, and there is no difference. When the mobile terminal synthesizes the second installation package, the files to be copied in the first installation package can be directly copied to the second installation package without obtaining the same files in the first installation package and the second installation package from a designated device or server.

[0122] Step S202, obtain the starting position and ending position of the files to be decompressed in the first installation package, the starting position and ending position of the files to be copied in the first installation package, the starting position and ending position of the files to be decompressed in the second installation package, and the starting position and ending position of the files to be copied in the second installation package.

[0123] Among them, the starting position and ending position of the files to be decompressed in the first installation package may refer to the starting position and ending position of the files to be decompressed in the first installation package, and the mobile terminal can obtain the files to be decompressed from the locally installed first installation package according to the above position; the starting position and ending position of the files to be decompressed in the second installation package may refer to the starting position and ending position of the files to be decompressed in the second installation package, and the mobile terminal can compress the files to be compressed to the corresponding positions of the second installation package according to the positions; the starting position and ending position of the files to be copied in the first installation package can enable the mobile terminal to obtain the files to be copied from the first installation package according to the above position, and copy the files to be copied obtained from the first installation package to the corresponding positions of the second installation package according to the starting position and ending position of the files to be copied in the second installation package.

[0124] Step S203, decompress the files to be decompressed in the first installation package and the files to be decompressed in the second installation package, decompress the files to be decompressed in the first installation package into a first target file, and decompress the files to be decompressed in the second installation package into a second target file.

[0125] In an embodiment of the present application, the files to be decompressed in the first installation package are decompressed into the first target file, and the starting position and ending position of the files to be decompressed in the first installation package in the first target file can be obtained; the files to be decompressed in the second installation package are decompressed into the second target file, and the starting position and ending position of the files to be decompressed in the second installation package in the second target file can be obtained.

[0126] Step S204, obtaining the starting position and ending position of the files to be decompressed in the first installation package in the first target file after being decompressed, and the starting position and ending position of the files to be decompressed in the second installation package in the second target file after being decompressed.

[0127] Among them, the starting position and ending position of the file to be decompressed in the second installation package in the second target file after decompression refer to the starting position and ending position of the file to be compressed in the second target file, and the starting position and ending position of the file to be decompressed in the second installation package refer to the starting position and ending position of the file to be compressed in the second target file in the second installation package after compression.

[0128] Step S205: Record the starting position and ending position of a file to be decompressed in the first installation package and the starting position and ending position of the file to be decompressed in the first target file after decompression in a set of decompression control fields.

[0129] Step S206: Record the starting position and the ending position of a file to be compressed in the second target file and the starting position and the ending position of the file to be compressed in the second installation package after compression in a set of compression control fields.

[0130] Step S207: Record the starting position and ending position of a file to be copied in the first installation package, and the starting position and ending position of a file to be copied in the second installation package in a set of copy control fields.

[0131] Step S208, according to a preset differential algorithm, obtaining an incremental file of the to-be-decompressed file after decompression in the first target file and the to-be-decompressed file after decompression in the second target file.

[0132] The incremental file may refer to a difference file between the first installation package and the second installation package of the application. The preset difference algorithm may refer to a preset algorithm capable of obtaining the incremental file between the first installation package and the second installation package of the application, including but not limited to the bsdiff algorithm.

[0133] Step S209, compress the incremental file to obtain an incremental package, and insert a decompression control field, a compression control field, and a copy control field into the incremental package.

[0134] In an embodiment of the present application, inserting a decompression control field, a compression control field, and a copy control field into the incremental package can facilitate the mobile terminal to implement multi-threaded compression, decompression, and copying according to these fields during the synthesis process of the first installation package and the incremental package, thereby improving the synthesis speed of the second installation package.

[0135] Optionally, after obtaining the incremental package, also include:

[0136] Combining the incremental package with the first installation package to obtain a composite package;

[0137] Verifying the synthesized package;

[0138] Correspondingly, inserting a decompression control field, a compression control field, and a copy control field into the incremental packet includes:

[0139] If the synthetic packet is successfully verified, a decompression control field, a compression control field and a copy control field are inserted into the incremental packet.

[0140] In an embodiment of the present application, before inserting the decompression control field, the compression control field, and the copy control field into the incremental package, the server may first synthesize the incremental package with the first installation package. By verifying the synthesized package, it can be determined whether the incremental package obtained by the server is correct. If the verification is successful, it is determined that the incremental package obtained by the server is correct. If the verification fails, it is determined that the incremental package obtained by the server is incorrect. The incorrect incremental package can be marked to prompt the server to re-obtain the incremental package of the application.

[0141] Optionally, the verifying the synthesized package includes:

[0142] Obtaining a checksum of the synthesized package;

[0143] Obtaining a verification value of the second installation package;

[0144] If the verification value of the composite package is the same as the verification value of the second installation package, it is determined that the verification of the composite package is successful;

[0145] If the verification value of the composite package is different from the verification value of the second installation package, it is determined that the verification of the composite package has failed.

[0146] The verification algorithm used to obtain the verification value of the synthetic package and the verification value of the second installation package is the same.

[0147] Optionally, after inserting the decompression control field, the compression control field, and the copy control field into the incremental packet, the embodiment of the present application further includes:

[0148] Upload the incremental package to the specified device.

[0149] In an embodiment of the present application, after the synthesis package of the incremental package is successfully verified and the decompression control field, the compression control field and the copy control field are inserted into the incremental package, the incremental package can be uploaded to a designated device to facilitate the mobile terminal to obtain the incremental package from the designated device, and multi-threaded compression, decompression and copying can be implemented in the new installation package synthesis process according to the control field in the incremental package, thereby improving the synthesis speed of the new installation package.

[0150] The embodiment of the present application can obtain the incremental package and the decompression control field, the compression control field and the copy control field by acquiring the files to be decompressed and the files to be copied in the new and old installation packages of the application stored in the server. Inserting these fields into the incremental package can facilitate the mobile terminal to perform multi-threaded compression, decompression and copying during the synthesis process of the new installation package, thereby improving the synthesis speed of the new installation package.

[0151] See also Figure 3 , is a schematic diagram of the structure of a file processing device provided in Embodiment 3 of the present application, which file processing device can be integrated into a mobile terminal. For ease of description, only the parts related to the embodiment of the present application are shown.

[0152] The file processing device comprises:

[0153] An incremental packet acquisition module 31 is used to acquire an incremental packet of an application, wherein the incremental packet includes a decompression control field, a compression control field, and a copy control field;

[0154] An incremental file acquisition module 32 is used to decompress the incremental package to obtain an incremental file;

[0155] A first installation package acquisition module 33, used to acquire a first installation package of the application;

[0156] A first installation package decompression module 34, configured to decompress the to-be-decompressed files in the first installation package into a first target file by using multiple threads according to the decompression control field in the incremental package;

[0157] A second target file obtaining module 35, used for synthesizing the incremental file with the first target file to obtain a second target file;

[0158] A second target file compression module 36, configured to compress the second target file into a designated file by using multiple threads according to the compression control field in the incremental packet;

[0159] The file copy module 37 is used to copy the files to be copied in the first installation package to the designated file according to the copy control field in the incremental package, and the designated file including the files to be copied and the compressed second target file is the second installation package.

[0160] Optionally, a group of decompression control fields records the starting position and the ending position of a file to be decompressed in the first installation package and the starting position and the ending position of the file to be decompressed in the first target file after decompression, and the first installation package decompression module 34 is specifically used for:

[0161] When the incremental package includes multiple groups of decompression control fields, obtaining multiple files to be decompressed in the first installation package according to the starting positions and ending positions of multiple files to be decompressed in the first installation package recorded by the multiple groups of decompression control fields;

[0162] Allocating the decompression tasks of the multiple files to be decompressed to multiple threads;

[0163] Decompress the multiple files to be decompressed using the multiple threads, and store the decompressed multiple files to be decompressed in a specified position in the first target file, wherein the specified position in the first target file is determined by the starting position and the ending position of the multiple files to be decompressed recorded in the multiple groups of decompression control fields in the first target file after decompression.

[0164] Optionally, a group of compression control fields records the starting position and the ending position of a file to be compressed in the second target file and the starting position and the ending position of the file to be compressed in the second installation package after compression. The second target file compression module 36 is specifically used for:

[0165] When the incremental packet includes multiple groups of compression control fields, obtaining multiple files to be compressed in the second target file according to the starting positions and ending positions of multiple files to be compressed in the second target file recorded by the multiple groups of compression control fields;

[0166] Allocating compression tasks of the plurality of files to be compressed to a plurality of threads;

[0167] The multiple files to be compressed are compressed using the multiple threads, and the compressed multiple files to be compressed are stored in a first designated position in the designated file, wherein the first designated position in the designated file is determined by the starting position and the ending position of the multiple files to be compressed in the second installation package recorded by the multiple groups of compression control fields.

[0168] Optionally, a group of copy control fields records a starting position and an ending position of a file to be copied in the first installation package and a starting position and an ending position in the second installation package, and the file copy module 47 is specifically used to:

[0169] When the incremental package includes multiple groups of copy control fields, obtaining multiple files to be copied in the first installation package according to the starting positions and ending positions of the multiple files to be copied in the first installation package recorded by the multiple groups of copy control fields;

[0170] Allocating the copying tasks of the multiple files to be copied to multiple threads;

[0171] Use the multiple threads to copy the multiple files to be copied to a second designated position in the designated file, wherein the second designated position in the designated file is determined by the starting positions and ending positions of the multiple files to be copied in the second installation package recorded by the multiple groups of copy control fields.

[0172] Optionally, the file processing device further includes:

[0173] An installation module, used to install the second installation package;

[0174] An installation package verification module, used to verify the second installation package;

[0175] Accordingly, the installation module is specifically used for:

[0176] If the second installation package is verified successfully, the second installation package is installed.

[0177] Optionally, the installation package verification module is specifically used to:

[0178] Obtaining an actual verification value of the second installation package;

[0179] Obtaining a target checksum value of the second installation package from a designated device or the incremental package;

[0180] If the actual verification value of the second installation package is the same as the target verification value of the second installation package, it is determined that the verification of the second installation package is successful;

[0181] If the actual verification value of the second installation package is different from the target verification value of the second installation package, it is determined that the verification of the second installation package has failed.

[0182] Optionally, the file processing device further includes:

[0183] The second installation package obtaining module is used to obtain the second installation package of the application from a designated device if the verification of the second installation package fails.

[0184] Optionally, the file processing device further includes:

[0185] The incremental packet verification module is used to verify the incremental packet.

[0186] Optionally, the incremental file acquisition module 32 is specifically used for:

[0187] If the incremental package verification succeeds, the incremental package is decompressed to obtain the incremental file.

[0188] Optionally, the incremental packet verification module is specifically used to:

[0189] Obtaining an actual checksum value of the incremental packet;

[0190] Obtaining a target checksum value of the incremental package from a specified device or incremental package;

[0191] If the actual checksum value of the incremental packet is the same as the target checksum value of the incremental packet, it is determined that the verification of the incremental packet is successful;

[0192] If the actual verification value of the incremental packet is different from the target verification value of the incremental packet, it is determined that the verification of the incremental packet has failed.

[0193] The file processing device provided in the embodiment of the present application can be applied in the aforementioned embodiment 1. For details, please refer to the description of the aforementioned embodiment 1, which will not be repeated here.

[0194] See also Figure 4 , is a schematic diagram of the structure of a file processing device provided in Embodiment 4 of the present application, and the file processing device can be integrated into a server. For ease of description, only the parts related to the embodiment of the present application are shown.

[0195] The file processing device comprises:

[0196] The to-be-processed file acquisition module 41 is used to acquire the to-be-decompressed files in the first installation package of the application, the to-be-decompressed files in the second installation package, and the to-be-copied files in the first installation package and the second installation package, wherein the to-be-copied files refer to the files that have no difference between the first installation package and the second installation package;

[0197] A first position acquisition module 42, used to acquire the starting position and the ending position of the file to be decompressed in the first installation package, the starting position and the ending position of the file to be copied in the first installation package, the starting position and the ending position of the file to be decompressed in the second installation package, and the starting position and the ending position of the file to be copied in the second installation package;

[0198] A file decompression module 43, configured to decompress the files to be decompressed in the first installation package and the files to be decompressed in the second installation package, decompress the files to be decompressed in the first installation package into a first target file, and decompress the files to be decompressed in the second installation package into a second target file;

[0199] A second position acquisition module 44 is used to acquire the starting position and the ending position of the file to be decompressed in the first target file after being decompressed in the first installation package, and the starting position and the ending position of the file to be decompressed in the second target file after being decompressed in the second installation package, wherein the starting position and the ending position of the file to be decompressed in the second target file after being decompressed in the second installation package refer to the starting position and the ending position of the file to be compressed in the second target file, and the starting position and the ending position of the file to be decompressed in the second installation package refer to the starting position and the ending position of the file to be compressed in the second target file in the second installation package after being compressed;

[0200] A first position recording module 45, configured to record the starting position and the ending position of a file to be decompressed in the first installation package and the starting position and the ending position of the file to be decompressed in the first target file after decompression in a set of decompression control fields;

[0201] A second position recording module 46, configured to record the starting position and the ending position of a file to be compressed in the second target file and the starting position and the ending position of the file to be compressed in the second installation package after compression in a set of compression control fields;

[0202] A third position recording module 47, configured to record a starting position and an ending position of a file to be copied in the first installation package, and a starting position and an ending position of a file to be copied in the second installation package in a set of copy control fields;

[0203] The difference processing module 48 is used to obtain, according to a preset difference algorithm, an incremental file of the to-be-decompressed file after decompression in the first target file and the to-be-decompressed file after decompression in the second target file;

[0204] The incremental packet processing module 49 is used to compress the incremental file, obtain the incremental packet, and insert a decompression control field, a compression control field and a copy control field into the incremental packet.

[0205] Optionally, the to-be-processed file acquisition module 41 is specifically used for:

[0206] Traversing the files in the first installation package and the second installation package of the application, obtaining a checksum value of each file in the first installation package and a checksum value of each file in the second installation package;

[0207] Obtain a file in the first installation package whose verification value is the same as that in the second installation package, and determine that the file is a file to be copied;

[0208] It is determined that the files in the first installation package other than the files to be copied are the files to be decompressed in the first installation package, and the files in the second installation package other than the files to be copied are the files to be decompressed in the second installation package.

[0209] Optionally, the incremental packet processing module 49 is specifically used to:

[0210] Combining the incremental package with the first installation package to obtain a composite package;

[0211] Verifying the synthesized package;

[0212] If the synthetic packet is successfully verified, a decompression control field, a compression control field and a copy control field are inserted into the incremental packet.

[0213] Optionally, the incremental packet processing module 49 is specifically used to:

[0214] Obtaining a checksum of the synthesized package;

[0215] Obtaining a verification value of the second installation package;

[0216] If the verification value of the composite package is the same as the verification value of the second installation package, it is determined that the verification of the composite package is successful;

[0217] If the verification value of the composite package is different from the verification value of the second installation package, it is determined that the verification of the composite package has failed.

[0218] Optionally, the file processing device further includes:

[0219] The incremental package uploading module is used to upload the incremental package to a designated device.

[0220] The file processing device provided in the embodiment of the present application can be applied in the aforementioned embodiment 2. For details, please refer to the description of the aforementioned embodiment 2, which will not be repeated here.

[0221] Figure 5 : is a structural diagram of a mobile terminal provided in Embodiment 5 of the present application. As shown in the figure, the mobile terminal may include: one or more processors 501 (only one is shown in the figure); one or more input devices 502 (only one is shown in the figure), one or more output devices 503 (only one is shown in the figure) and a memory 504. The above-mentioned processor 501, input device 502, output device 503 and memory 504 are connected via a bus 505. The memory 504 is used to store instructions, and when the processor 501 executes the instructions stored in the memory 504, the steps of the file processing method in the above-mentioned Embodiment 1 are implemented.

[0222] The mobile terminal may be a mobile phone, a notebook, a PDA, a desktop computer or the like.

[0223] It should be understood that in the embodiment of the present application, the processor 501 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0224] The input device 502 may include a touch panel, a fingerprint sensor (for collecting the user's fingerprint information and fingerprint direction information), a microphone, a data receiving interface, etc. The output device 503 may include a display (LCD, etc.), a speaker, a data sending interface, etc.

[0225] The memory 504 may include a read-only memory and a random access memory, and provide instructions and data to the processor 501. A portion of the memory 504 may also include a non-volatile random access memory. For example, the memory 504 may also store information about the device type.

[0226] In a specific implementation, the processor 501, input device 502, output device 503 and memory 504 described in the embodiments of the present application can execute the implementation method described in the embodiment of the file processing method provided in Embodiment 1 of the present application, and can also execute the implementation method described in the file processing device described in Embodiment 3, which will not be repeated here.

[0227] Figure 6 6 is a schematic diagram of the structure of the server provided in Example 6 of the present application. As shown in the figure, the server may include: one or more processors 601 (only one is shown in the figure); one or more input devices 602 (only one is shown in the figure), one or more output devices 603 (only one is shown in the figure) and a memory 604. The above-mentioned processor 601, input device 602, output device 603 and memory 604 are connected via a bus 605. The memory 604 is used to store instructions, and when the processor 601 executes the instructions stored in the memory 604, the steps of the file processing method in the above-mentioned Example 2 are implemented.

[0228] The server may be a cloud server for computing or storing resources.

[0229] It should be understood that in the embodiment of the present application, the processor 601 may be a central processing unit CPU, or other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0230] The input device 602 may include a touch panel, a fingerprint sensor (for collecting the user's fingerprint information and fingerprint direction information), a microphone, a data receiving interface, etc. The output device 603 may include a display (LCD, etc.), a speaker, a data sending interface, etc.

[0231] The memory 604 may include a read-only memory and a random access memory, and provide instructions and data to the processor 601. A portion of the memory 604 may also include a non-volatile random access memory. For example, the memory 604 may also store information about the device type.

[0232] In a specific implementation, the processor 601, input device 602, output device 603 and memory 604 described in the embodiments of the present application can execute the implementation method described in the embodiment of the file processing method provided in Embodiment 2 of the present application, and can also execute the implementation method described in the file processing device described in Embodiment 4, which will not be repeated here.

[0233] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0234] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

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

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

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

[0238] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0239] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0240] The present application implements all or part of the processes in the above-mentioned embodiment method, and may also be completed through a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0241] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person 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 application, and should all be included in the protection scope of the present application.

Claims

1. A file processing method, characterized in that: The file processing method comprises: Obtaining an incremental package of the application, wherein the incremental package includes a decompression control field, a compression control field, and a copy control field; Decompressing the incremental package to obtain an incremental file; Obtaining a first installation package of the application; Decompress the to-be-decompressed files in the first installation package into a first target file using multiple threads according to the decompression control field in the incremental package; Synthesize the incremental file with the first target file to obtain a second target file; According to the compression control field in the incremental packet, compressing the second target file into a designated file by using multiple threads; According to the copy control field in the incremental package, the files to be copied in the first installation package are copied to the designated file, and the designated file including the files to be copied and the compressed second target file is the second installation package.

2. The file processing method according to claim 1, characterized in that: A group of decompression control fields records a starting position and an ending position of a file to be decompressed in the first installation package and a starting position and an ending position of the file to be decompressed in the first target file after being decompressed, and decompressing the file to be decompressed in the first installation package using multiple threads according to the decompression control fields in the incremental package, and decompressing the file to be decompressed to the first target file includes: When the incremental package includes multiple groups of decompression control fields, obtaining multiple files to be decompressed in the first installation package according to the starting positions and ending positions of multiple files to be decompressed in the first installation package recorded by the multiple groups of decompression control fields; Allocating the decompression tasks of the multiple files to be decompressed to multiple threads; Decompress the multiple files to be decompressed using the multiple threads, and store the decompressed multiple files to be decompressed in a specified position in the first target file, wherein the specified position in the first target file is determined by the starting position and the ending position of the multiple files to be decompressed recorded in the multiple groups of decompression control fields in the first target file after decompression.

3. The file processing method according to claim 1, characterized in that: A group of compression control fields records the starting position and the ending position of a file to be compressed in the second target file and the starting position and the ending position of the file to be compressed in the second installation package after compression, and the compressing the second target file using multithreading according to the compression control field in the incremental package to a specified file includes: When the incremental packet includes multiple groups of compression control fields, obtaining multiple files to be compressed in the second target file according to the starting positions and ending positions of multiple files to be compressed in the second target file recorded by the multiple groups of compression control fields; Allocating compression tasks of the plurality of files to be compressed to a plurality of threads; The multiple files to be compressed are compressed using the multiple threads, and the compressed multiple files to be compressed are stored in a first designated position in the designated file, wherein the first designated position in the designated file is determined by the starting position and the ending position of the multiple files to be compressed in the second installation package recorded by the multiple groups of compression control fields.

4. The file processing method according to claim 1, characterized in that: A set of copy control fields records a starting position and an ending position of a file to be copied in the first installation package and a starting position and an ending position in the second installation package, and the copying of the file to be copied in the first installation package to the designated file according to the copy control field in the incremental package includes: When the incremental package includes multiple groups of copy control fields, obtaining multiple files to be copied in the first installation package according to the starting positions and ending positions of the multiple files to be copied in the first installation package recorded by the multiple groups of copy control fields; Allocating the copying tasks of the multiple files to be copied to multiple threads; Use the multiple threads to copy the multiple files to be copied to a second designated position in the designated file, wherein the second designated position in the designated file is determined by the starting positions and ending positions of the multiple files to be copied in the second installation package recorded by the multiple groups of copy control fields.

5. The file processing method according to claim 1, characterized in that: Also includes: Install the second installation package.

6. The file processing method according to claim 5, characterized in that: Before installing the second installation package, the method further includes: Verifying the second installation package; Correspondingly, installing the second installation package includes: If the second installation package is verified successfully, the second installation package is installed.

7. The file processing method according to claim 6, characterized in that: The verifying the second installation package includes: Obtaining an actual verification value of the second installation package; Obtaining a target checksum value of the second installation package from a designated device or the incremental package; If the actual verification value of the second installation package is the same as the target verification value of the second installation package, it is determined that the verification of the second installation package is successful; If the actual verification value of the second installation package is different from the target verification value of the second installation package, it is determined that the verification of the second installation package has failed.

8. The file processing method according to claim 6, characterized in that: Also includes: If the verification of the second installation package fails, the second installation package of the application is obtained from the designated device.

9. The file processing method according to any one of claims 1 to 8, characterized in that: After getting the incremental package of the application, also include: Verifying the incremental package; Correspondingly, decompressing the incremental package to obtain the incremental file includes: If the incremental package verification succeeds, the incremental package is decompressed to obtain the incremental file.

10. The file processing method according to claim 9, characterized in that: The verifying the incremental package comprises: Obtaining an actual checksum value of the incremental packet; Obtaining a target checksum value of the incremental package from a specified device or incremental package; If the actual checksum value of the incremental packet is the same as the target checksum value of the incremental packet, it is determined that the verification of the incremental packet is successful; If the actual verification value of the incremental packet is different from the target verification value of the incremental packet, it is determined that the verification of the incremental packet has failed.

11. A file processing method, characterized in that: The file processing method comprises: Obtaining files to be decompressed in a first installation package of the application, files to be decompressed in a second installation package, and files to be copied in the first installation package and the second installation package, wherein the files to be copied refer to files that have no difference between the first installation package and the second installation package; Obtaining the starting position and ending position of the file to be decompressed in the first installation package, the starting position and ending position of the file to be copied in the first installation package, the starting position and ending position of the file to be decompressed in the second installation package, and the starting position and ending position of the file to be copied in the second installation package; Decompress the files to be decompressed in the first installation package and the files to be decompressed in the second installation package, decompress the files to be decompressed in the first installation package into a first target file, and decompress the files to be decompressed in the second installation package into a second target file; Obtaining the starting position and ending position of the file to be decompressed in the first target file after being decompressed in the first installation package, and the starting position and ending position of the file to be decompressed in the second target file after being decompressed in the second installation package, wherein the starting position and ending position of the file to be decompressed in the second target file after being decompressed in the second installation package refer to the starting position and ending position of the file to be compressed in the second target file, and the starting position and ending position of the file to be decompressed in the second installation package refer to the starting position and ending position of the file to be compressed in the second target file in the second installation package after being compressed; Recording the starting position and the ending position of a file to be decompressed in the first installation package and the starting position and the ending position of the file to be decompressed in the first target file after decompression in a set of decompression control fields; Recording the starting position and the ending position of a file to be compressed in the second target file and the starting position and the ending position of the file to be compressed in the second installation package after compression in a set of compression control fields; Recording a starting position and an ending position of a file to be copied in the first installation package, and a starting position and an ending position of a file to be copied in the second installation package in a set of copy control fields; According to a preset difference algorithm, obtaining an incremental file of the to-be-decompressed file after decompression in the first target file and the to-be-decompressed file after decompression in the second target file; The incremental file is compressed to obtain an incremental package, and a decompression control field, a compression control field and a copy control field are inserted into the incremental package.

12. The file processing method according to claim 11, characterized in that: The step of obtaining the files to be decompressed in the first installation package of the application, the files to be decompressed in the second installation package, and the files to be copied in the first installation package and the second installation package includes: Traversing the files in the first installation package and the second installation package of the application, obtaining a checksum value of each file in the first installation package and a checksum value of each file in the second installation package; Obtain a file in the first installation package whose verification value is the same as that in the second installation package, and determine that the file is a file to be copied; It is determined that the files in the first installation package other than the files to be copied are the files to be decompressed in the first installation package, and the files in the second installation package other than the files to be copied are the files to be decompressed in the second installation package.

13. The file processing method according to claim 11, characterized in that: After getting the incremental package, it also includes: Combining the incremental package with the first installation package to obtain a composite package; Verifying the synthesized package; Correspondingly, inserting a decompression control field, a compression control field, and a copy control field into the incremental packet includes: If the synthetic packet is successfully verified, a decompression control field, a compression control field and a copy control field are inserted into the incremental packet.

14. The file processing method according to claim 13, characterized in that: The verifying the synthesized packet comprises: Obtaining a checksum of the synthesized package; Obtaining a verification value of the second installation package; If the verification value of the composite package is the same as the verification value of the second installation package, it is determined that the verification of the composite package is successful; If the verification value of the composite package is different from the verification value of the second installation package, it is determined that the verification of the composite package has failed.

15. The file processing method according to any one of claims 11 to 14, characterized in that: After inserting the decompression control field, the compression control field and the copy control field into the incremental packet, the method further includes: Upload the incremental package to the specified device.

16. A file processing device, characterized in that: The file processing device comprises: An incremental package acquisition module, used to acquire an incremental package of an application, wherein the incremental package includes a decompression control field, a compression control field, and a copy control field; An incremental file acquisition module, used to decompress the incremental package to obtain an incremental file; A first installation package acquisition module, used to acquire a first installation package of the application; A first installation package decompression module, configured to decompress the to-be-decompressed files in the first installation package into a first target file by using multiple threads according to the decompression control field in the incremental package; A second target file obtaining module, used for synthesizing the incremental file with the first target file to obtain a second target file; A second target file compression module, used to compress the second target file into a specified file by using multiple threads according to the compression control field in the incremental packet; The file copy module is used to copy the files to be copied in the first installation package to the designated file according to the copy control field in the incremental package, and the designated file including the files to be copied and the compressed second target file is the second installation package.

17. A file processing device, characterized in that: The file processing device comprises: a module for acquiring files to be processed, used to acquire files to be decompressed in a first installation package of an application, files to be decompressed in a second installation package, and files to be copied in the first installation package and the second installation package, wherein the files to be copied refer to files that have no difference between the first installation package and the second installation package; A first position acquisition module, used to acquire the starting position and the ending position of the file to be decompressed in the first installation package, the starting position and the ending position of the file to be copied in the first installation package, the starting position and the ending position of the file to be decompressed in the second installation package, and the starting position and the ending position of the file to be copied in the second installation package; A file decompression module, used to decompress the files to be decompressed in the first installation package and the files to be decompressed in the second installation package, decompress the files to be decompressed in the first installation package into a first target file, and decompress the files to be decompressed in the second installation package into a second target file; A second position acquisition module, used for acquiring a starting position and an ending position of a file to be decompressed in the first installation package in the first target file after being decompressed, and a starting position and an ending position of a file to be decompressed in the second installation package in the second target file after being decompressed, wherein the starting position and the ending position of a file to be decompressed in the second installation package in the second target file after being decompressed refer to the starting position and the ending position of a file to be compressed in the second target file, and the starting position and the ending position of a file to be decompressed in the second installation package refer to the starting position and the ending position of a file to be compressed in the second target file in the second installation package after being compressed; A first position recording module, used for recording the starting position and the ending position of a file to be decompressed in the first installation package and the starting position and the ending position of the file to be decompressed in the first target file after decompression in a set of decompression control fields; A second position recording module, used for recording the starting position and the ending position of a file to be compressed in the second target file and the starting position and the ending position of the file to be compressed in the second installation package after compression in a group of compression control fields; a third position recording module, configured to record a starting position and an ending position of a file to be copied in the first installation package, and a starting position and an ending position of a file to be copied in the second installation package in a set of copy control fields; A difference processing module, used for obtaining, according to a preset difference algorithm, an incremental file of the to-be-decompressed file after decompression in the first target file and the to-be-decompressed file after decompression in the second target file; The incremental packet processing module is used to compress the incremental file, obtain the incremental packet, and insert a decompression control field, a compression control field and a copy control field into the incremental packet.

18. A mobile 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 processing method according to any one of claims 1 to 10 are implemented.

19. A server 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 processing method according to any one of claims 11 to 15 are implemented.

20. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the computer program implements the steps of the file processing method as described in any one of claims 1 to 10; or when the computer program is executed by a processor, the computer program implements the steps of the file processing method as described in any one of claims 11 to 15.

Citation Information

Patent Citations

  • Method for implementing OTA upgrading of television system based on version number subsection control

    CN107301058A

  • Installation package synthesis method and device, terminal and storage medium

    CN109697071A