Application installation package file processing method and device, equipment and storage medium
By decompressing and replacing the compression algorithm, recompressing the application installation package file, the problem of low processing efficiency in the existing technology is solved, and the effective reduction of the installation package volume and automatic compression format conversion are realized.
Patent Information
- Application Number
- CN202310700931.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-13
- Publication Date
- 2024-12-13
AI Technical Summary
In the prior art, application installation package file processing efficiency is low, and compressed packages with low compression rates cannot be automatically modified into compressed packages with high compression rates, which limits the volume reduction potential of the installation package.
By obtaining the compressed file collection of application installation packages, decompressing and replacing it with a higher compression ratio compression algorithm or a hybrid decompression algorithm, recompress the file directory and generate compressed files with higher compression ratio, realizing an automated compression format conversion and decompression process .
It effectively reduces the volume of the application installation package, improves the efficiency of installation package processing, and can automatically modify compressed files with low compression rates into compressed files with high compression rates without modifying business code.
Smart Images

Figure CN119127229A_ABST
Abstract
Description
Background Art
[0002] There are many resource compression packages in the application installation package. The purpose of the compression package is to reduce the size of the installation package. The compression method with a low compression rate used in the current related technology cannot reduce the size of the installation package to the greatest extent. After compressing the installation package with a high compression rate, the compressed package is placed in the packaging directory and then packaged. Many third-party SDKs (Software Development Kits) can only modify files with source code, and cannot automatically modify other compressed packages with low compression rates to compressed packages with high compression rates.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0004] The present disclosure provides a method, device, electronic device and computer-readable storage medium for processing application installation package files, which at least to some extent overcome the problem of low efficiency in processing application installation package files in related technologies.
[0005] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0006] According to one aspect of the present disclosure, a method for processing application installation package files is provided, including: obtaining a compressed file set corresponding to the application installation package; decompressing a first compressed file in the compressed file set into a file directory, wherein the first compressed file is a compressed file generated by a first compression algorithm; compressing the file directory by a second compression algorithm to generate a second compressed file, wherein the compression rate of the second compression algorithm is greater than the compression rate of the first compression algorithm; generating an installation package file of the application according to the second compressed file and a decompression algorithm, wherein the decompression algorithm includes: a second decompression algorithm or a hybrid decompression algorithm, and the hybrid decompression algorithm includes: a first decompression algorithm and the second decompression algorithm, the first decompression algorithm corresponds to the first compression algorithm; the second decompression algorithm corresponds to the second compression algorithm.
[0007] In one embodiment of the present disclosure, it also includes: manually or automatically replacing the first decompression algorithm with the second decompression algorithm or the hybrid decompression algorithm.
[0008] In one embodiment of the present disclosure, the obtaining of the compressed file set corresponding to the application installation package includes: obtaining the compressed file set corresponding to the application installation package during compilation.
[0009] In one embodiment of the present disclosure, generating the installation package file of the application based on the second compressed file and the decompression algorithm includes: when obtaining the compressed file set corresponding to the application installation package during compilation, sending the second compressed file and the decompression algorithm to the installation package directory; generating the installation package file of the application based on the installation package directory.
[0010] In one embodiment of the present disclosure, obtaining the compressed file set corresponding to the application installation package includes: decompressing the application installation package using a first decompression algorithm to obtain the compressed file set corresponding to the application installation package.
[0011] In one embodiment of the present disclosure, generating the installation package file of the application based on the second compressed file and the decompression algorithm includes: when the compressed file set corresponding to the application installation package is obtained by decompressing the application installation package, sending the second compressed file and the decompression algorithm to the installation package directory; re-compressing the installation package directory through the second compression algorithm, and signing to obtain the installation package file of the application.
[0012] In one embodiment of the present disclosure, it also includes: when the decompression algorithm is the second decompression algorithm, decompressing the installation package file of the application by using the second decompression algorithm; when the decompression of the installation package file of the application fails according to the second decompression algorithm, determining that the installation package file of the application corresponds to the first decompression algorithm.
[0013] In one embodiment of the present disclosure, it also includes: when the decompression algorithm is the hybrid decompression algorithm, and the decompression of the installation package file of the application program fails according to the second decompression algorithm in the hybrid decompression algorithm, the installation package file of the application program is decompressed by the first decompression algorithm in the hybrid decompression algorithm.
[0014] In one embodiment of the present disclosure, after decompressing the first compressed file in the compressed file set into a file directory, the method further includes: deleting the first compressed file in the compressed file set.
[0015] In one embodiment of the present disclosure, compressing the file directory by a second compression algorithm to generate a second compressed file includes: deleting a decompressed file corresponding to the first compressed file in the file directory.
[0016] According to another aspect of the present disclosure, there is also provided an application installation package file processing device, comprising:
[0017] A file acquisition module, which acquires a set of compressed files corresponding to the application installation package;
[0018] A file decompression module, decompressing a first compressed file in the compressed file set into a file directory, wherein the first compressed file is a compressed file generated by a first compression algorithm;
[0019] a file compression module, compressing the file directory by a second compression algorithm to generate a second compressed file, wherein the compression rate of the second compression algorithm is greater than the compression rate of the first compression algorithm;
[0020] A file generation module generates an installation package file of the application according to the second compressed file and a decompression algorithm.
[0021] According to another aspect of the present disclosure, an electronic device is also provided, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned application installation package file processing methods by executing the executable instructions.
[0022] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for processing an application installation package file described in any one of the above is implemented.
[0023] The application installation package file processing method, device, electronic device and computer-readable storage medium provided by the embodiments of the present disclosure obtain a compressed file set corresponding to the application installation package, decompress the first compressed file in the compressed file set into a file directory, wherein the first compressed file is a compressed file generated by a first compression algorithm, compresses the file directory by a second compression algorithm with a compression rate greater than the first compression algorithm to generate a second compressed file, replaces the first decompression algorithm with a second decompression algorithm or a hybrid decompression algorithm, generates an application installation package file according to the second compressed file and the second decompression algorithm, or the second compressed file and the hybrid decompression algorithm, can automatically modify a compressed file with a low compression rate into a compressed file with a high compression rate, and can efficiently decompress the application installation package file according to the corresponding decompression algorithm.
[0024] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0026] Figure 1 A flow chart of a method for processing application installation package files in an embodiment of the present disclosure is shown;
[0027] Figure 2 A flow chart of a method for compressing application installation package files in an embodiment of the present disclosure is shown;
[0028] Figure 3 A flow chart of another method for compressing application installation package files in an embodiment of the present disclosure is shown;
[0029] Figure 4 A flow chart of a method for decompressing an application installation package file in an embodiment of the present disclosure is shown;
[0030] Figure 5 A schematic diagram of a device for processing application installation package files in an embodiment of the present disclosure is shown;
[0031] Figure 6 A schematic diagram showing an exemplary system architecture of an application installation package file processing method or an application installation package file processing device that can be applied to an embodiment of the present disclosure; and
[0032] Figure 7 A structural block diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0034] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0035] The present exemplary implementation is described in detail below with reference to the accompanying drawings and embodiments.
[0036] First, an embodiment of the present disclosure provides a method for processing an application installation package file, which can be executed by any electronic device with computing and processing capabilities.
[0037] Figure 1 A flow chart of a method for processing an application installation package file in an embodiment of the present disclosure is shown as follows: Figure 1 As shown, the application installation package file processing method provided in the embodiment of the present disclosure includes the following steps:
[0038] S102, obtaining a compressed file set corresponding to the application installation package.
[0039] In one embodiment, the application installation package includes but is not limited to: a compilation-period application installation package and a compiled application installation package; the application installation package is a mobile terminal software installation package, and the mobile terminal includes but is not limited to: Android system, Apple iOS system and other terminals.
[0040] The compressed file collection is all compressed files in one or more compression formats corresponding to the application installation package.
[0041] S104: decompress a first compressed file in the compressed file set into a file directory, wherein the first compressed file is a compressed file generated by a first compression algorithm.
[0042] The file directory includes but is not limited to: a decompressed file set corresponding to the first compressed file and a corresponding file list directory.
[0043] In one embodiment, after decompressing the first compressed file in the compressed file set into the file directory, the process includes: deleting the first compressed file in the compressed file set, thereby reducing the size of the application installation package and saving resources.
[0044] S106, compressing the file directory using a second compression algorithm to generate a second compressed file, wherein the compression rate of the second compression algorithm is greater than the compression rate of the first compression algorithm.
[0045] In one embodiment, the first compression algorithm and the second compression algorithm include but are not limited to: zip compression algorithm, 7z compression algorithm, rar compression algorithm, etc. The compression rate of the second compression algorithm is greater than the compression rate of the first compression algorithm. The file directory is compressed by the second compression algorithm to generate a second compressed file, which can reduce the size of the application installation package.
[0046] In one embodiment, it is determined whether the compression rate of the second compression algorithm is greater than the compression rate of the first compression algorithm. If so, the file directory is compressed using the second compression algorithm to generate a second compressed file; otherwise, the file directory is not compressed using the second compression algorithm to generate a second compressed file, and the first compressed file corresponding to the first compression algorithm is stored in the application installation package.
[0047] In one embodiment, the file directory is compressed by a second compression algorithm, and after the second compressed file is generated, the following steps are included: deleting the decompressed file corresponding to the first compressed file in the file directory, which can reduce the size of the application installation package and save resources.
[0048] S108: Generate an installation package file of the application program according to the second compressed file and the decompression algorithm.
[0049] In one embodiment, the decompression algorithm includes: a second decompression algorithm or a hybrid decompression algorithm, the hybrid decompression algorithm includes: a first decompression algorithm and a second decompression algorithm, the first decompression algorithm corresponds to the first compression algorithm; the second decompression algorithm corresponds to the second compression algorithm; for example, the first compression algorithm is a zip compression algorithm, and the corresponding first decompression algorithm is a zip decompression algorithm, the second compression algorithm is a 7Z compression algorithm, and the corresponding second decompression algorithm is a 7z decompression algorithm, and the hybrid decompression algorithm is a decompression algorithm in which the zip decompression algorithm and the 7z decompression algorithm coexist.
[0050] In one embodiment, the compression algorithm code and source code corresponding to the compressed file are automatically or manually modified, the decompression algorithm code is replaced, etc.
[0051] In one embodiment, the first decompression algorithm is replaced with the second decompression algorithm or the hybrid decompression algorithm manually or automatically.
[0052] In one embodiment, the first decompression algorithm can be automatically replaced with the second decompression algorithm or the mixed decompression algorithm through bytecode instrumentation technology or other technologies.
[0053] In one embodiment, the time for manually or automatically replacing the first decompression algorithm with the second decompression algorithm or the hybrid decompression algorithm includes but is not limited to: during compilation, after compilation, etc. For example, during compilation, the first decompression algorithm is automatically replaced with the second decompression algorithm or the hybrid decompression algorithm through bytecode instrumentation technology or other technologies; the first decompression algorithm can also be automatically replaced with the second decompression algorithm or the hybrid decompression algorithm through bytecode instrumentation technology or other technologies when the compiled application installation package is decompiled for the second time.
[0054] For example, the first decompression algorithm is replaced with the second decompression algorithm or a hybrid decompression algorithm by manually modifying the code, or the first decompression algorithm is changed to the second decompression algorithm or a hybrid decompression algorithm by inserting bytecodes through automatic storage management ASM (automatic storage management), that is, the code that calls the first decompression algorithm is replaced with the code that calls the second decompression algorithm or the hybrid decompression algorithm, so that after encapsulation, the file can be decompressed by the second decompression algorithm or the hybrid decompression algorithm.
[0055] In one embodiment, when a compressed file set corresponding to the application installation package during compilation is obtained, the second compressed file and the decompression algorithm are sent to the installation package directory; the installation package directory is packaged to generate an installation package file of the application.
[0056] In one embodiment, when the application installation package is decompressed to obtain a compressed file set corresponding to the application installation package, the second compressed file and the decompression algorithm are sent to the installation package directory; the installation package directory is recompressed by the second compression algorithm, and signed to obtain the application installation package file.
[0057] The installation package directory includes but is not limited to: the second compressed file, the decompression algorithm corresponding to the second compressed file, the installation directory, etc.;
[0058] The installation directory includes at least one of the following:
[0059] sbin directory: stores scripts for starting or stopping Hadoop-related services in the distributed system infrastructure;
[0060] bin directory: stores scripts for operating Hadoop related services;
[0061] etc directory: hadoop configuration file directory, which stores hadoop configuration files;
[0062] Share directory: stores Hadoop's dependent jar packages and documents. The documents can be deleted.
[0063] lib directory: stores hadoop's local library (for data compression and decompression functions), etc.
[0064] In one embodiment, the bytecode is automatically implanted with a second decompression algorithm or a mixed decompression algorithm to represent the original first decompression algorithm through ASM plugging. If the installation package file of the application is successfully decompressed by the second decompression algorithm, the installation package file of the application is judged to be in the second compression format. If the installation package file of the application is not successfully decompressed by the second decompression algorithm, the installation package file of the application is judged to be in the first compression format.
[0065] In the above embodiment, the compression and decompression algorithms of the SDK library without source code can be modified. Through automated plug-in technology, during the compilation process of the application installation package or after the compilation is completed, the first compressed files generated by the first compression algorithm in the application installation package are automatically converted into second compressed files in batches, the compression format is automatically converted, and the second decompression algorithm or mixed algorithm code agent is automatically implanted to replace the original first decompression algorithm and encapsulate it. During decompression, it is automatically determined whether the file is in the first compression format or the second compression format, thereby realizing the entire decompression process and achieving the purpose of reducing the size of the installation package.
[0066] Figure 2 A flow chart of a method for compressing application installation package files in an embodiment of the present disclosure is shown as follows: Figure 2 As shown, the application installation package file compression method provided in the embodiment of the present disclosure includes the following steps:
[0067] S202, obtaining a compressed file set corresponding to the application installation package during compilation.
[0068] In one embodiment, a compressed file set corresponding to the application installation package is automatically obtained during compilation by a plug-in, wherein the compressed file set includes all compressed files after the resources are merged.
[0069] In one embodiment, the plug-in includes but is not limited to: a gradle plug-in, an xcode plug-in, etc.; the gradle plug-in and the xcode plug-in enable the Java source code to become part of the application build and the non-UI code of the application can be written in Java.
[0070] S204, when the compressed file set corresponding to the application installation package during the compilation period is obtained, the second compressed file and the decompression algorithm are sent to the installation package directory.
[0071] In one embodiment, after a first compressed file generated by a first compression algorithm in a compressed file set is decompressed into a file directory through a plug-in, the first compressed file in the compressed file set is deleted, and the file directory is compressed through a second compression algorithm to generate a second compressed file; for example, after a first compressed file in a zip format generated by a zip compression algorithm in a compressed file set is decompressed into a file directory through a plug-in, the first compressed file in the compressed file set is deleted, and the files in the file directory are compressed again through a 7z command corresponding to the 7z compression algorithm to generate a second compressed file in 7z format.
[0072] In one embodiment, a file list of an application installation package corresponding to a compressed file collection is obtained, the format of the compressed file is determined based on the file list of the application installation package, a first compressed file generated by a first compression algorithm is stored in a first newly created file collection, the first compressed file in the first newly created file collection is decompressed into a file directory through a plug-in, the first newly created file collection and the compressed file collection are deleted, the file directory is compressed through a second compression algorithm, and a second compressed file is generated.
[0073] S206: Generate an installation package file for the application according to the installation package directory.
[0074] In one embodiment, the second compressed file in the installation package directory is compressed using a second compression algorithm, a decompression algorithm, an installation directory, etc., to generate an installation package file of the application.
[0075] In the above embodiment, based on the automation plug-in, the compression algorithm of the compressed files in the application installation package is automatically modified during the compilation of the application installation package, and the first compression algorithm is automatically switched to the second compression algorithm in batches, and the second decompression algorithm or the mixed algorithm code replaces the original first decompression algorithm and is encapsulated. Decompression is achieved through an automated agent without modifying any original business code, thereby reducing the overall installation package size.
[0076] Figure 3 A flowchart of another method for compressing application installation package files in the embodiment of the present disclosure is shown. Figure 3 As shown, the application installation package file compression method provided in the embodiment of the present disclosure includes the following steps:
[0077] S302: decompress the application installation package using a first decompression algorithm to obtain a compressed file set corresponding to the application installation package.
[0078] In one embodiment, the compressed file set corresponding to the application installation package is obtained by using an automated plug-in command or manually decompressing the application installation package.
[0079] S304: When a compressed file set corresponding to the application installation package is obtained by decompressing the application installation package, the second compressed file and the decompression algorithm are sent to the installation package directory.
[0080] In one embodiment, all compressed files in a compressed file set corresponding to an application installation package are traversed, and after a first compressed file generated by a first compression algorithm in the compressed file set is decompressed into a file directory through a plug-in, the first compressed file in the compressed file set is deleted, and the file directory is compressed through a second compression algorithm to generate a second compressed file; for example, after a first compressed file in a zip format generated by a zip compression algorithm in the compressed file set is decompressed into a file directory through a plug-in, the first compressed file in the compressed file set is deleted, and the files in the file directory are compressed again through a 7z command corresponding to the 7z compression algorithm to generate a second compressed file in 7z format.
[0081] In one embodiment, a file list of an application installation package corresponding to a compressed file collection is obtained, the format of the compressed file is determined based on the file list of the application installation package, a first compressed file generated by a first compression algorithm is stored in a second newly created file collection, the first compressed file in the second newly created file collection is decompressed into a file directory through a plug-in, the second newly created file collection and the compressed file collection are deleted, the file directory is compressed through a second compression algorithm, and a second compressed file is generated.
[0082] S306: recompress the installation package directory using a second compression algorithm, and sign it to obtain the installation package file of the application.
[0083] In one embodiment, the files in the installation package directory are traversed, and the message digest of the files is calculated and encoded, and then the message digest is encrypted using a private key to generate a digital signature, and the file and the corresponding digital signature are sent to the recipient.
[0084] In the above embodiment, based on the automation plug-in, the compression algorithm of the compressed files in the compiled application installation package is automatically modified, the first compression algorithm is automatically switched to the second compression algorithm in batches, and the second decompression algorithm or mixed algorithm code is automatically implanted to replace the original first decompression algorithm and encapsulated. Decompression is achieved through an automated agent without modifying any original business code, thereby reducing the overall installation package size.
[0085] Figure 4 A flowchart of a method for decompressing an application installation package file in an embodiment of the present disclosure is shown. Figure 4 As shown, the method for decompressing the application installation package file provided in the embodiment of the present disclosure includes the following steps:
[0086] S402, when the decompression algorithm is the second decompression algorithm, decompress the installation package file of the application using the second decompression algorithm; when decompression of the installation package file of the application fails according to the second decompression algorithm, determine that the installation package file of the application corresponds to the first decompression algorithm.
[0087] In one embodiment, a first decompression algorithm corresponding to the first compression algorithm is determined according to the first compression algorithm; the first decompression algorithm is changed to a second decompression algorithm corresponding to the first decompression algorithm by modifying the bytecode through ASM plugging; an installation package file of the application is generated according to the second compressed file and the second decompression algorithm; when decompressing, the second decompression algorithm is obtained from the installation package file of the application, and the installation package file of the application is decompressed by the second decompression algorithm.
[0088] In one embodiment, when the second decompression algorithm fails to decompress the installation package file of the application, it is determined that the installation package file of the application corresponds to the first decompression algorithm and corresponding failure information is sent to prompt the user to obtain the first decompression algorithm.
[0089] S404, when the decompression algorithm is a hybrid decompression algorithm and decompression of the installation package file of the application program fails according to the second decompression algorithm in the hybrid decompression algorithm, decompress the installation package file of the application program according to the first decompression algorithm in the hybrid decompression algorithm.
[0090] In one embodiment, a first decompression algorithm corresponding to the first compression algorithm is determined according to the first compression algorithm; the first decompression algorithm is changed to a hybrid decompression algorithm corresponding to the first decompression algorithm by modifying the bytecode through ASM plugging, that is, an installation package file of the application is generated according to the second compressed file, the first decompression algorithm, and the second decompression algorithm.
[0091] In one embodiment, during decompression, the installation package file of the application is first decompressed by the second decompression algorithm. When the decompression of the installation package file of the application fails according to the second decompression algorithm, the installation package file of the application is decompressed by the first decompression algorithm. For example, the corresponding zip decompression algorithm is determined by the zip compression algorithm, the bytecode is modified by ASM plugging, and the zip decompression algorithm is replaced with a decompression algorithm that is a parallel decompression algorithm of the zip decompression algorithm and the 7z decompression algorithm, and is implanted into the installation package file of the application, that is, the installation package file of the application is generated according to the second compressed file, the zip decompression algorithm, and the zip decompression algorithm; during decompression, the installation package file of the application is first decompressed by the 7z decompression algorithm. When the decompression of the installation package file of the application fails according to the 7z decompression algorithm, the installation package file of the application is decompressed by the zip decompression algorithm.
[0092] In the above embodiment, the decompression code of the original compressed package is replaced by a code instrumentation agent, and a decompression algorithm with a higher compression ratio is dynamically implanted into the code of the application installation package without modifying the original code. The overall automatic compression and decompression method change is realized, and the size of the installation package is finally reduced.
[0093] Based on the same inventive concept, the present disclosure also provides an application installation package file processing device, such as the following embodiment. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0094] Figure 5 A schematic diagram of a device for processing application installation package files in an embodiment of the present disclosure is shown. Figure 5 As shown, the application installation package file processing device 5 includes: a file acquisition module 501, a file decompression module 502, a file compression module 503 and a file generation module 504;
[0095] The file acquisition module 501 acquires a set of compressed files corresponding to the application installation package;
[0096] In one embodiment, the file acquisition module 501 includes a first acquisition module that automatically acquires a compressed file set corresponding to the application installation package during compilation through a plug-in.
[0097] In one embodiment, the file acquisition module 501 includes a second acquisition module, which obtains a compressed file set corresponding to the application installation package through an automated plug-in command or manually decompressing the application installation package.
[0098] The file decompression module 502 decompresses a first compressed file in the compressed file set into a file directory, wherein the first compressed file is a compressed file generated by a first compression algorithm.
[0099] In one embodiment, a file list of an application installation package corresponding to a compressed file collection is obtained, a format of the compressed file is determined based on the file list of the application installation package, a first compressed file generated by a first compression algorithm is stored in a newly created file collection, the first compressed file in the newly created file collection is decompressed into a file directory through a plug-in, the newly created file collection and the compressed file collection are deleted, the file directory is compressed through a second compression algorithm, and a second compressed file is generated; wherein the newly created file collection includes: a first newly created file collection or a second newly created file collection.
[0100] The file compression module 503 compresses the file directory by using a second compression algorithm to generate a second compressed file, wherein the compression rate of the second compression algorithm is greater than the compression rate of the first compression algorithm;
[0101] The file generation module 504 generates an installation package file of the application program according to the second compressed file and the decompression algorithm.
[0102] In one embodiment, the file generation module 504 includes a first generation module, which is used to generate an installation package file of the application according to the second compressed file and the second decompression algorithm.
[0103] In one embodiment, the file generation module 504 includes a second generation module, which is used to generate an installation package file of the application according to the second compressed file and the hybrid decompression algorithm.
[0104] In one embodiment, the application installation package file processing device 5 also includes a file decompression module, which includes a first decompression module for obtaining a second decompression algorithm from the application installation package file during decompression, and decompressing the application installation package file using the second decompression algorithm.
[0105] In one embodiment, the file decompression module includes a second decompression module, which is used to first decompress the installation package file of the application using a second decompression algorithm. When the decompression of the installation package file of the application fails according to the second decompression algorithm, the installation package file of the application is decompressed by the first decompression algorithm.
[0106] In the above embodiment, there is no need to change the compressed package in the first compression format into a compressed package in the second compression format in advance. Through automated plug-in technology, the first compressed file in the third-party SDK is automatically converted into the second compressed file, the compression format is automatically converted, and the second decompression algorithm or hybrid algorithm code agent is automatically implanted to replace the original first decompression algorithm and encapsulate it. During decompression, it automatically determines whether it is a file in the first compression format or the second compression format, thereby realizing the entire decompression process and achieving the purpose of reducing the size of the installation package.
[0107] Figure 6 A schematic diagram showing an exemplary system architecture of an application installation package file processing method or an application installation package file processing device that can be applied to an embodiment of the present disclosure.
[0108] like Figure 6 As shown, the system architecture 600 may include terminal devices 601 , 602 , 603 , a network 604 and a server 605 .
[0109] The network 604 is a medium for providing a communication link between the terminal devices 601 , 602 , 603 and the server 605 , and may be a wired network or a wireless network.
[0110] Optionally, the wireless network or wired network described above uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a dedicated network or any combination of a virtual private network). In some embodiments, technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. are used to represent data exchanged through the network. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec) can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.
[0111] Terminal devices 601, 602, 603 may be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc., for displaying installation package files, compressed file collections, etc. of application programs.
[0112] Optionally, the client of the application installed in different terminal devices 601, 602, 603 is the same, or is a client of the same type of application based on different operating systems. Based on different terminal platforms, the specific form of the client of the application can also be different, for example, the application client can be a mobile client, a PC client, etc.
[0113] The server 605 may be a server that provides various services, such as a background management server that supports the devices operated by the user using the terminal devices 601, 602, and 603. The background management server may analyze and process the received request and other data, and feed back the processing results to the terminal device. For example, through the automated plug-in technology, during or after the compilation of the application installation package, the first compressed files generated by the first compression algorithm in the application installation package are automatically converted into second compressed files in batches, the compression format is automatically converted, and the code agent is automatically implanted to replace the original first decompression algorithm.
[0114] Optionally, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application.
[0115] Those skilled in the art will know that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration, and any number of terminal devices, networks and servers may be provided according to actual needs, and the embodiments of the present disclosure do not limit this.
[0116] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0117] Refer to the following Figure 7 An electronic device 700 according to this embodiment of the present disclosure is described. Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0118] like Figure 7 As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include but are not limited to: at least one processing unit 710, at least one storage unit 720, and a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710).
[0119] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 executes the steps described in the above “exemplary method” section of this specification according to various exemplary embodiments of the present disclosure.
[0120] For example, the processing unit 710 can execute the following steps of the above-mentioned method embodiment: obtain a compressed file set corresponding to the application installation package, decompress the first compressed file in the compressed file set to a file directory, wherein the first compressed file is a compressed file generated by a first compression algorithm, compress the file directory by a second compression algorithm with a compression rate greater than the first compression algorithm to generate a second compressed file, and generate an installation package file of the application according to the second compressed file and the decompression algorithm, wherein the decompression algorithm includes: a second decompression algorithm or a hybrid decompression algorithm, and the hybrid decompression algorithm includes: a first decompression algorithm and a second decompression algorithm, the first decompression algorithm corresponds to the first compression algorithm; the second decompression algorithm corresponds to the second compression algorithm.
[0121] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 7201 and / or a cache storage unit 7202 , and may further include a read-only storage unit (ROM) 7203 .
[0122] The storage unit 720 may also include a program / utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0123] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0124] The electronic device 700 may also communicate with one or more external devices 740 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0125] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0126] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the above method of the present disclosure is stored thereon. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.
[0127] For example, the program product in the embodiment of the present disclosure implements the following method when executed by a processor: obtaining a compressed file set corresponding to an application installation package, decompressing a first compressed file in the compressed file set into a file directory, wherein the first compressed file is a compressed file generated by a first compression algorithm, compressing the file directory by a second compression algorithm having a compression rate greater than that of the first compression algorithm to generate a second compressed file, and generating an installation package file of the application according to the second compressed file and the decompression algorithm, wherein the decompression algorithm includes: a second decompression algorithm or a hybrid decompression algorithm, and the hybrid decompression algorithm includes: a first decompression algorithm and a second decompression algorithm, the first decompression algorithm corresponds to the first compression algorithm; and the second decompression algorithm corresponds to the second compression algorithm.
[0128] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0129] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0130] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0131] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0132] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0133] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0134] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0135] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A method for processing an application installation package file, characterized in that: include: Get the compressed file set corresponding to the application installation package; Decompressing a first compressed file in the compressed file set into a file directory, wherein the first compressed file is a compressed file generated by a first compression algorithm; Compressing the file directory using a second compression algorithm to generate a second compressed file, wherein the compression rate of the second compression algorithm is greater than the compression rate of the first compression algorithm; An installation package file of the application is generated according to the second compressed file and the decompression algorithm, wherein the decompression algorithm includes: a second decompression algorithm or a hybrid decompression algorithm, and the hybrid decompression algorithm includes: a first decompression algorithm and the second decompression algorithm, the first decompression algorithm corresponds to the first compression algorithm; the second decompression algorithm corresponds to the second compression algorithm.
2. The method for processing application installation package files according to claim 1, characterized in that: Also includes: The first decompression algorithm is replaced with the second decompression algorithm or the hybrid decompression algorithm manually or automatically.
3. The method for processing application installation package files according to claim 1, characterized in that: The method of obtaining a compressed file set corresponding to the application installation package includes: The compressed file set corresponding to the application installation package during compilation is obtained.
4. The method for processing application installation package files according to claim 3, characterized in that: The step of generating the installation package file of the application according to the second compressed file and the decompression algorithm comprises: When the compressed file set corresponding to the application installation package during compilation is obtained, the second compressed file and the decompression algorithm are sent to the installation package directory; Generate an installation package file for the application according to the installation package directory.
5. The method for processing application installation package files according to claim 1, characterized in that: The method of obtaining a compressed file set corresponding to the application installation package includes: The application installation package is decompressed using a first decompression algorithm to obtain the compressed file set corresponding to the application installation package.
6. The method for processing application installation package files according to claim 5, characterized in that: The step of generating the installation package file of the application according to the second compressed file and the decompression algorithm comprises: When the compressed file set corresponding to the application installation package is obtained by decompressing the application installation package, the second compressed file and the decompression algorithm are sent to the installation package directory; The installation package directory is recompressed using the second compression algorithm, and signed to obtain the installation package file of the application.
7. The method for processing application installation package files according to claim 1, characterized in that: Also includes: When the decompression algorithm is the second decompression algorithm, decompressing the installation package file of the application program by using the second decompression algorithm; When decompression of the installation package file of the application fails according to the second decompression algorithm, it is determined that the installation package file of the application corresponds to the first decompression algorithm.
8. The method for processing application installation package files according to claim 1, characterized in that: Also includes: When the decompression algorithm is the hybrid decompression algorithm and the decompression of the installation package file of the application fails according to the second decompression algorithm in the hybrid decompression algorithm, the installation package file of the application is decompressed by the first decompression algorithm in the hybrid decompression algorithm.
9. An application installation package file processing device, characterized in that: include: A file acquisition module, which acquires a set of compressed files corresponding to the application installation package; A file decompression module, decompressing a first compressed file in the compressed file set into a file directory, wherein the first compressed file is a compressed file generated by a first compression algorithm; a file compression module, compressing the file directory by a second compression algorithm to generate a second compressed file, wherein the compression rate of the second compression algorithm is greater than the compression rate of the first compression algorithm; A file generation module generates an installation package file of the application according to the second compressed file and a decompression algorithm.
10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the application installation package file processing method according to any one of claims 1 to 8 by executing the executable instructions.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for processing an application installation package file according to any one of claims 1 to 8 is implemented.
