Application cutting method, system and related device of swan lightweight system

By decompressing and deleting the bytecode files in the application installation package through the tailoring script, the problem of the large installation package space is solved and the installation efficiency is improved.

CN120631383APending Publication Date: 2025-09-12SHENZHEN XINGUODU TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510478654.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Some installation packages contain a large number of files, which takes up a lot of space. When installed on the terminal, more resources are required for parsing, resulting in reduced installation efficiency.

Method used

By trimming the script, the application installation package is decompressed and the bytecode file is deleted to form a new application installation package suitable for terminals with the Hongmeng lightweight system.

Benefits of technology

This reduces the consumption of file system resources by application installation packages and improves installation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120631383A_ABST
    Figure CN120631383A_ABST
Patent Text Reader

Abstract

The invention discloses an application cutting method and system for a light-weight system of a swan gap and a related device, which are used for reducing the space occupation of an application installation package in the light-weight system of the swan gap and improving the installation efficiency of the application installation package. The method comprises the following steps: obtaining a to-be-installed application installation package, wherein the application installation package is an installation package suitable for a light-weight system of the swan Mongolia; calling a cutting script to decompress the application installation package and delete bytecode files in the application installation package, and compressing the installation files obtained after decompression and deletion operation into a new application installation package; and the new application installation package is installed in the terminal carrying the swan-gap lightweight system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an application tailoring method, system and related devices for a HarmonyOS lightweight system. Background Art

[0002] Intelligence plays a central role in today's technological development. It enables applications to deliver highly personalized services and experiences based on user behavior, preferences, and usage scenarios. It also intelligently allocates system resources, rationally allocating CPU, memory, and other resources based on application usage frequency and current load, improving overall system performance and responsiveness. The development of intelligence has revolutionized our lives, significantly enhanced user experience, and driven continuous innovation and development across the entire information technology industry.

[0003] As a vehicle for software delivery, the installation package provides the foundation for intelligent applications. It packages and integrates complex intelligent algorithms, data models, and a rich set of functional modules. By installing and running the installation package, all files and components are accurately deployed to the designated location on the system. Configuration is also completed, such as registering file associations and creating shortcuts, allowing the software to be launched and used on the terminal, thus realizing intelligent applications.

[0004] However, some installation packages contain a large number of files such as all necessary files and configuration information of the software, which takes up a large amount of space. When installed on the terminal, more resources are required for parsing, resulting in reduced installation efficiency. Summary of the Invention

[0005] In order to solve the above technical problems, the present application provides an application tailoring method, system and related devices for a HarmonyOS lightweight system.

[0006] The technical solution provided in this application is described below:

[0007] In a first aspect, the present application provides an application tailoring method for a Hongmeng lightweight system, the method comprising:

[0008] Obtain an application installation package to be installed, where the application installation package is an installation package suitable for the Hongmeng lightweight system;

[0009] Calling a tailoring script to decompress the application installation package and delete the bytecode files in the application installation package, and compressing the installation files obtained after the decompression and deletion operations into a new application installation package;

[0010] Install the new application installation package into the terminal equipped with the Hongmeng lightweight system.

[0011] Optionally, calling the tailoring script to decompress the application installation package and delete the bytecode files in the application installation package includes:

[0012] Calling the tailoring script to create a temporary folder, and decompressing the application installation package to the temporary folder to obtain the installation file;

[0013] The tailoring script is called to delete the bytecode file in the installation file.

[0014] Optionally, calling the tailoring script to delete the bytecode file in the installation file includes:

[0015] Calling the clipping script to traverse the file directory of the temporary folder;

[0016] According to the file directory, the trimming script is called to recursively delete the bytecode files.

[0017] Optionally, before calling the clipping script, the method further includes:

[0018] The parsing mode of the meta-capability cross-platform execution environment ACE in the Hongmeng lightweight system is fixed from the dynamic parsing mode to the js parsing mode.

[0019] Optionally, calling the tailoring script to decompress the application installation package and delete the bytecode files in the application installation package includes:

[0020] A tailoring script adapted to the js parsing mode is called to decompress the application installation package and delete the bytecode files in the application installation package.

[0021] Optionally, after calling the tailoring script to decompress the application installation package and delete the bytecode files in the application installation package, and compressing the installation files obtained after the decompression and deletion operations into a new application installation package, the method further includes:

[0022] Calling the simulator to perform a pre-installation test on the new application installation package, and determining whether the pre-installation test is successful based on the test result;

[0023] If so, the new application installation package is installed into the terminal equipped with the Hongmeng lightweight system.

[0024] Optionally, the method further includes:

[0025] Record the deletion log and display the space occupied by the new application installation package.

[0026] A second aspect of the present application provides an application tailoring system for a Hongmeng lightweight system, the system comprising:

[0027] An acquisition unit, configured to acquire an application installation package to be installed, wherein the application installation package is an installation package applicable to the Hongmeng lightweight system;

[0028] a calling unit, configured to call a tailoring script to decompress the application installation package and delete the bytecode files in the application installation package, and compress the installation files obtained after the decompression and deletion operations into a new application installation package;

[0029] The installation unit is used to install the new application installation package into a terminal equipped with the Hongmeng lightweight system.

[0030] Optionally, the calling unit is specifically configured to:

[0031] Calling the tailoring script to create a temporary folder, and decompressing the application installation package to the temporary folder to obtain the installation file;

[0032] The tailoring script is called to delete the bytecode file in the installation file.

[0033] Optionally, the calling unit is specifically configured to:

[0034] Calling the clipping script to traverse the file directory of the temporary folder;

[0035] According to the file directory, the trimming script is called to recursively delete the bytecode files.

[0036] Optionally, a fixing unit is further included, specifically used for:

[0037] The parsing mode of the meta-capability cross-platform execution environment ACE in the Hongmeng lightweight system is fixed from the dynamic parsing mode to the js parsing mode.

[0038] Optionally, the calling unit is specifically configured to:

[0039] A tailoring script adapted to the js parsing mode is called to decompress the application installation package and delete the bytecode files in the application installation package.

[0040] Optionally, a test unit is also included, specifically for:

[0041] Calling the simulator to perform a pre-installation test on the new application installation package, and determining whether the pre-installation test is successful based on the test result;

[0042] If so, the new application installation package is installed into the terminal equipped with the Hongmeng lightweight system.

[0043] Optionally, a recording unit is also included, specifically used to:

[0044] Record the deletion log and display the space occupied by the new application installation package.

[0045] A third aspect of the present application provides an application tailoring device for a Hongmeng lightweight system, the device comprising:

[0046] processor, memory, input and output units, and buses;

[0047] The processor is connected to the memory, the input and output unit, and the bus;

[0048] The memory stores a program, and the processor calls the program to execute the first aspect and any optional method in the first aspect.

[0049] In a fourth aspect, the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, the program executes the first aspect and any optional method in the first aspect.

[0050] It can be seen from the above technical solutions that this application has the following advantages:

[0051] The bytecode files in the application installation package to be installed are deleted through a trimming script, and then the deleted files are recompressed to obtain a new application installation package. By using the trimming script to identify the file format and delete the bytecode files in the installation package, the installation package can be effectively trimmed, reducing the application installation package's consumption of file system resources in the HarmonyOS lightweight system and improving installation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in this application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0053] Figure 1 A flowchart of an embodiment of the application tailoring method for the Hongmeng lightweight system provided in this application;

[0054] Figure 2 A schematic diagram of an embodiment of the process of decompressing an application installation package in the application tailoring method of the Hongmeng lightweight system provided in this application;

[0055] Figure 3 A flowchart of an embodiment of recursively deleting bytecode files in the application tailoring method of the Hongmeng lightweight system provided in this application;

[0056] Figure 4 A flowchart of another embodiment of the application tailoring method for the Hongmeng lightweight system provided in this application;

[0057] Figure 5 A flowchart of an embodiment of the pre-installation test in the application tailoring method of the Hongmeng lightweight system provided in this application;

[0058] Figure 6 A schematic diagram of the structure of an embodiment of the application tailoring system of the Hongmeng lightweight system provided in this application;

[0059] Figure 7 A structural diagram of an embodiment of the application tailoring device of the HarmonyOS lightweight system provided in this application. DETAILED DESCRIPTION

[0060] The present application provides an application tailoring method, system and related devices for a HarmonyOS lightweight system, which are used to reduce the space occupied by application installation packages in the HarmonyOS lightweight system and improve the installation efficiency of application installation packages.

[0061] It should be noted that the application tailoring method for a HarmonyOS lightweight system provided in this application can be applied to a terminal as well as a system or server. For the sake of convenience, this application uses a terminal as the execution subject for example.

[0062] See also Figure 1 , this application first provides an embodiment of an application tailoring method for a Hongmeng lightweight system, which includes:

[0063] S101. Obtain an installation package for the application to be installed, where the application installation package is an installation package suitable for the Hongmeng lightweight system;

[0064] HarmonyOS's lightweight system features a microkernel architecture, low power consumption, high performance, and multi-tasking scheduling. It is suitable for a variety of embedded devices in areas such as smart homes, smart wearables, and the Industrial Internet of Things. It is a lightweight implementation of the HarmonyOS system for resource-constrained scenarios. HarmonyOS is typically used for resource-constrained terminals, such as some IoT terminals (such as POS terminals) and low-power chips, so the corresponding application installation packages have special features.

[0065] There are many ways to obtain the application installation package, such as downloading it from a designated software repository, reading a pre-stored application installation package file from local storage, or obtaining it from a server via network transmission. The obtained application installation package is an installation package for the HarmonyOS lightweight system. It is a compressed file that may contain application code, configuration files, and other related resources.

[0066] S102: Calling a tailoring script to decompress the application installation package and delete the bytecode files in the application installation package, and compressing the installation files obtained after the decompression and deletion operations into a new application installation package;

[0067] The various codes and resource files contained in application installation packages make them relatively large. HarmonyOS Lightweight OS primarily runs on terminals with limited resources such as memory and storage. Installing a complete application installation package on a terminal equipped with HarmonyOS Lightweight OS will occupy a significant amount of file system resources during installation, impacting the normal operation of the system and other applications. By trimming the application installation package, unnecessary portions such as unused code and redundant resources can be removed. This reduces the size of the application installation package and its use of terminal resources while ensuring the normal operation of the application's core functions. This allows the application to run stably and efficiently on resource-constrained terminals.

[0068] The trimming script is a pre-written program code that can be written in a variety of programming languages, such as Python, C or Java, according to the developer's choice and the support of the system environment. The trimming in the trimming script in this application is mainly aimed at deleting files of specific file formats in the application installation package. By calling the trimming script, specific processing operations can be performed on the application installation package, including decompressing the obtained application installation package, deleting the bytecode (bc) file in the decompressed installation file, and recompressing the deleted installation file to obtain a new application installation package. The memory usage of the new application installation package will be smaller than that of the original application installation package, and after processing according to the preset trimming script, it does not contain the deleted bytecode files, which is more suitable for terminals equipped with the Hongmeng lightweight system.

[0069] S103. Install the new application installation package into the terminal equipped with the HarmonyOS lightweight system.

[0070] After the new application installation package has been processed by the tailoring script, it will be transmitted to the terminal equipped with the HarmonyOS lightweight system via a specific transmission protocol, such as the TCP / IP-based file transfer protocol or the HTTP / HTTPS-based file download method. Then, according to the installation mechanism provided by the HarmonyOS lightweight system, the new application installation package will be installed. During the installation process, the HarmonyOS lightweight system will decompress the files in the application installation package to the designated directory of the terminal, perform configuration and initialization operations, and enable the application to start and run normally on the terminal.

[0071] In this embodiment, the application installation package to be installed is deleting the bytecode files in the application installation package through a tailoring script, and then recompressing the deleted files to obtain a new application installation package. By using the tailoring script to identify the file format and delete the bytecode files in the application installation package, the application installation package can be effectively tailored, reducing the application installation package's consumption of file system resources in the HarmonyOS lightweight system and improving installation efficiency.

[0072] In the above step S102, before calling the cropping script to perform the cropping operation on the bytecode files in the application installation package, the application installation package needs to be decompressed. Figure 2 , Figure 2 This is an embodiment of decompressing an application installation package in the application tailoring method of the Hongmeng lightweight system provided in this application, and the embodiment includes:

[0073] S201, calling the tailoring script to create a temporary folder, and decompressing the application installation package to the temporary folder to obtain the installation file;

[0074] The cropping script has the function of creating a temporary folder. Before performing decompression, the cropping script will open up an independent space in the project, namely the temporary folder in this application. The temporary folder is used to temporarily store the decompressed files to prevent other files from interfering with the application installation package during the decompression process. After the processing is completed, the temporary folder will be deleted.

[0075] When decompressing an application installation package, you can do so in steps. This can more efficiently manage system resources and avoid memory shortages or performance degradation caused by decompressing a large amount of data at once. First, the tailoring script creates a first temporary folder and decompresses the application installation package into it. Based on the compression format of the application installation package, such as ZIP or RAR, the tailoring script uses the corresponding decompression algorithm and tools to extract the files and folders within the application installation package and place them into the first temporary folder. After decompression is complete, you will obtain a zap-formatted installation package in the first temporary folder. The tailoring script then creates a second temporary folder. The second temporary folder serves a similar purpose to the first temporary folder, temporarily storing the decompressed files from the zap-formatted installation package. Finally, the tailoring script performs the decompression operation again, releasing all files and folders within the zap-formatted installation package into the second temporary folder to obtain the installation files.

[0076] S202: Call the trimming script to delete the bytecode file in the installation file.

[0077] When a temporary folder has been created by the cropping script and the application installation package has been decompressed to obtain the installation file, the cropping script is called to crop the installation file. The cropping script will determine whether it is a bytecode file based on the extension of the installation file. For files with a bytecode extension, the cropping script will delete it from the temporary folder. In some specific application scenarios, the operation of the application may only depend on the js file, so the bytecode file is redundant. By deleting these bytecode files, the size of the application installation package can be significantly reduced, thereby improving the deployment efficiency of the application on the terminal, reducing the storage space occupied, and may also improve the loading speed and running performance of the application, preparing for the subsequent installation of the installation file to the terminal of the HarmonyOS lightweight system.

[0078] In this embodiment, a tailoring script creates a temporary folder, decompresses the application installation package into the temporary folder, and obtains the installation files, reducing interference from other files during the decompression process. The tailoring script deletes the bytecode files in the installation files, reducing the size of the application installation package, improving deployment efficiency, and reducing space usage, providing a foundation for subsequent installation of the installation files on HarmonyOS lightweight system terminals.

[0079] In the above S202, the tailoring script is called to delete the bytecode file in the installation file. Figure 3 , Figure 3 This is an embodiment of recursively deleting bytecode files in the application tailoring method of the Hongmeng lightweight system provided by this application, and the embodiment includes:

[0080] S301, calling the clipping script to traverse the file directory of the temporary folder;

[0081] The temporary folder contains the decompressed installation files, which may contain multiple subfolders and many different types of files. By traversing the directory, the trimming script can identify the paths and names of the files and folders, constructing a detailed list of the file structure, providing a basis for subsequent file deletion operations.

[0082] S302: According to the file directory, call the trimming script to recursively delete the bytecode file.

[0083] After obtaining the complete directory information for the temporary folder, the trimming script is called again to recursively delete all bytecode files. During recursive deletion, the trimming script not only processes the bytecode files in the temporary folder's root directory, but also enters each subfolder, checking the file extension one by one. If a file has a .bc extension, it is removed from the temporary folder.

[0084] In some specific embodiments, after the tailoring script is called to process the application installation package, a deletion log is recorded and the space occupied by the new application installation package is displayed. The following is a detailed description:

[0085] After the cropping script is called to decompress the app installation package and delete bytecode files, it will record detailed information about the files deleted during the operation, including the full path, file name, file type, and deletion time, forming a deletion log to facilitate subsequent tracing and troubleshooting. After the cropping is complete, the total size of all remaining JS files is calculated and converted to units such as bytes, kilobytes, or megabytes to display the space usage of the new app installation package, thereby evaluating the effectiveness of the cropping operation.

[0086] In this embodiment, when calling the cropping script to delete bytecode files, the system first traverses the temporary folder's file directory and then recursively deletes the installation files in the temporary folder, deleting only the bytecode files. This reduces the size of the installation package and improves application execution efficiency. Recursive bytecode file deletion reduces the problem of bytecode files remaining in the temporary folder, achieving effective cropping. Furthermore, a deletion log is recorded during the cropping process to facilitate subsequent tracing. After obtaining a new application installation package, the space usage of the new application installation package is displayed, making it easier to understand the cropping effect.

[0087] Before calling the tailoring script, you also need to adjust the parsing mode of the meta-capability cross-platform execution environment ACE in the Hongmeng lightweight system and call the corresponding tailoring script according to the parsing mode. Figure 4 , Figure 4 Another embodiment of the application tailoring method for the Hongmeng lightweight system provided in this application includes:

[0088] S401. Fix the parsing mode of the meta-capability cross-platform execution environment ACE in the Hongmeng lightweight system from the dynamic parsing mode to the js parsing mode;

[0089] The meta-capability cross-platform execution environment (ACE) is used in HarmonyOS to support application execution. It has multiple parsing modes, including dynamic parsing mode, which allows for flexible selection of the appropriate parsing method for files in application installation packages at runtime based on different scenarios. In HarmonyOS, the ACE parsing mode is fixed from dynamic parsing mode to JS parsing mode, meaning that ACE can only use JS parsing mode to parse application installation packages.

[0090] S402: Call a cutting script adapted to the js parsing mode to decompress the application installation package and delete the bytecode files in the application installation package.

[0091] Since ACE's parsing mode is fixed to JS parsing mode, a tailored script must be called to match it. Once the tailoring script is called, it will identify the JS file and, based on the compression format of the application installation package, use the appropriate decompression algorithm and tools to decompress the JS file. The bytecode file is not used and is deleted by the tailoring script. Finally, the JS file is compressed again to form a new application installation package.

[0092] In this embodiment, the dynamic parsing mode of the HarmonyOS lightweight system meta-capability cross-platform execution environment ACE is fixed to the js parsing mode, so that ACE only parses js files, and then calls the tailoring script adapted to the js parsing mode to identify and decompress the js files in the application installation package, delete the bytecode files, reduce the occupancy of unnecessary files, and improve the targetedness and operating efficiency of the parsing.

[0093] After obtaining a new application installation package, a pre-installation test will be performed on the new application installation package. Figure 5 , Figure 5 This is an embodiment of the pre-installation test in the application tailoring method of the Hongmeng lightweight system provided by this application, which includes:

[0094] S501, calling the simulator to perform a pre-installation test on the new application installation package, and judging whether the pre-installation test is successful based on the test result;

[0095] The simulator can simulate the operating environment of a terminal equipped with HarmonyOS Lightweight, including the hardware configuration and software version of HarmonyOS Lightweight. By calling the simulator, new application installation packages can be installed and tested without using a real terminal, which can save testing costs and time and improve the success rate of new application installation packages.

[0096] When attempting to install a new application package in the simulator, the simulator will simulate the conditions of a real terminal and check the file integrity of the installation package, its compatibility with the HarmonyOS lightweight system, and whether any errors occur during the installation process. For example, it will check whether the files in the installation package are damaged, whether necessary dependency files are missing, and whether there will be conflicts with existing software or configurations of the HarmonyOS lightweight system.

[0097] If the installation completes successfully without any errors, and the installed app launches and runs normally, a test result may be generated indicating that the pre-installation test is successful. Conversely, if problems such as file decompression failure or system conflicts occur during the installation process, preventing the app from installing or running normally, the test result will indicate that the pre-installation test failed.

[0098] S502. If yes, install the new application installation package into the terminal equipped with the Hongmeng lightweight system.

[0099] If the pre-installation test is successful, it means that the new application installation package can be installed and run normally in the simulated HarmonyOS lightweight system environment, and has the basic conditions for deployment to a real terminal. At this time, the new application installation package can be transferred to a real terminal equipped with HarmonyOS lightweight system, and the installation program can be launched on the terminal to install the application installation package.

[0100] In some specific embodiments, after the pre-installation test is determined to have failed based on the test results, other processing may be performed, as described in detail below:

[0101] If the pre-installation test fails, this indicates a possible error in the new app installation package. The package will no longer be transferred to the device running HarmonyOS Lite, and an error message, such as "Files are missing from the app installation package," may be generated. This error message allows users to selectively check for potential issues within the app installation package. Users can also browse and delete logs to determine if a problem occurred during the editing process, allowing them to make adjustments.

[0102] In this embodiment, before deploying a new application installation package to a terminal running the HarmonyOS Lightweight system, a pre-installation test is performed on the new application installation. The new application installation package is further inspected and verified, and different measures are taken for the new application installation package based on the failure or success of the pre-installation test. The pre-installation test can identify and resolve potential problems in the new application installation package in advance, improving the reliability of the tailoring and the success rate of the application installation package installation on terminals running the HarmonyOS Lightweight system.

[0103] See also Figure 6 , this application also provides an application tailoring system for the Hongmeng lightweight system, including:

[0104] An acquisition unit 601 is configured to acquire an application installation package to be installed, where the application installation package is an installation package applicable to the Hongmeng lightweight system;

[0105] The calling unit 602 calls the tailoring script to decompress the application installation package and delete the bytecode files in the application installation package, and compress the installation files obtained after the decompression and deletion operations into a new application installation package;

[0106] The installation unit 603 installs the new application installation package into the terminal equipped with the HarmonyOS lightweight system.

[0107] Optionally, the calling unit 602 is specifically configured to:

[0108] Call the trimming script to create a temporary folder, and decompress the application installation package to the temporary folder to obtain the installation file;

[0109] Call the trimming script to delete the bytecode files in the installation file.

[0110] Optionally, the calling unit 602 is specifically configured to:

[0111] Call the cropping script to traverse the file directory of the temporary folder;

[0112] Based on the file directory, call the trimming script to recursively delete the bytecode files.

[0113] Optionally, a fixing unit 604 is further included, specifically configured to:

[0114] The parsing mode of the meta-capability cross-platform execution environment ACE in the HarmonyOS lightweight system is fixed from the dynamic parsing mode to the js parsing mode.

[0115] Optionally, the calling unit 602 is specifically configured to:

[0116] Call the trimming script adapted to the js parsing mode to decompress the application installation package and delete the bytecode files in the application installation package.

[0117] Optionally, a testing unit 605 is further included, specifically configured to:

[0118] Call the simulator to perform a pre-installation test on the new application installation package, and determine whether the pre-installation test is successful based on the test results;

[0119] If so, install the new application installation package into the terminal equipped with the HarmonyOS lightweight system.

[0120] Optionally, a recording unit 606 is further included, specifically configured to:

[0121] Record deletion logs and display the space usage of new application installation packages.

[0122] Specific embodiment mode reference Figure 1-Figure 5 The embodiments are not described in detail here.

[0123] See also Figure 7 , this application also provides an application tailoring device for a Hongmeng lightweight system, including:

[0124] Processor 701, memory 702, input and output unit 703, bus 704;

[0125] The processor 701 is connected to the memory 702, the input and output unit 703 and the bus 704;

[0126] The memory 702 stores a program, and the processor 701 calls the program to execute any of the above methods.

[0127] The present application also relates to a computer-readable storage medium, on which a program is stored. When the program is run on a computer, the computer is caused to execute any of the above methods.

[0128] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0129] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, 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 an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

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

[0131] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0132] If the integrated 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 technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

Claims

1. A method for tailoring applications in a Hongmeng lightweight system, characterized in that: The method comprises: Obtain an application installation package to be installed, where the application installation package is an installation package suitable for the Hongmeng lightweight system; Calling a tailoring script to decompress the application installation package and delete the bytecode files in the application installation package, and compressing the installation files obtained after the decompression and deletion operations into a new application installation package; Install the new application installation package into the terminal equipped with the Hongmeng lightweight system.

2. The application tailoring method according to claim 1, characterized in that: The calling of the tailoring script to decompress the application installation package and delete the bytecode files in the application installation package includes: Calling the tailoring script to create a temporary folder, and decompressing the application installation package to the temporary folder to obtain the installation file; The tailoring script is called to delete the bytecode file in the installation file.

3. The application tailoring method according to claim 2, characterized in that: The calling of the tailoring script to delete the bytecode file in the installation file includes: Calling the clipping script to traverse the file directory of the temporary folder; According to the file directory, the trimming script is called to recursively delete the bytecode files.

4. The application tailoring method according to claim 1, characterized in that: Before calling the clipping script, the method further includes: The parsing mode of the meta-capability cross-platform execution environment ACE in the Hongmeng lightweight system is fixed from the dynamic parsing mode to the js parsing mode.

5. The application tailoring method according to claim 4, characterized in that: The calling of the tailoring script to decompress the application installation package and delete the bytecode files in the application installation package includes: A tailoring script adapted to the js parsing mode is called to decompress the application installation package and delete the bytecode files in the application installation package.

6. The application cutting method according to any one of claims 1 to 5, characterized in that: After calling the tailoring script to decompress the application installation package and delete the bytecode files in the application installation package, and compressing the installation files obtained after the decompression and deletion operations into a new application installation package, the method further includes: Calling the simulator to perform a pre-installation test on the new application installation package, and determining whether the pre-installation test is successful based on the test result; If so, the new application installation package is installed into the terminal equipped with the Hongmeng lightweight system.

7. The application cutting method according to any one of claims 1 to 5, characterized in that: The method further comprises: Record the deletion log and display the space occupied by the new application installation package.

8. An application tailoring system for a Hongmeng lightweight system, characterized in that: The system comprises: An acquisition unit, configured to acquire an application installation package to be installed, wherein the application installation package is an installation package applicable to the Hongmeng lightweight system; a calling unit, configured to call a tailoring script to decompress the application installation package and delete the bytecode files in the application installation package, and compress the installation files obtained after the decompression and deletion operations into a new application installation package; The installation unit is used to install the new application installation package into a terminal equipped with the Hongmeng lightweight system.

9. An application tailoring device for a Hongmeng lightweight system, characterized in that: The device comprises: processor, memory, input and output units, and buses; The processor is connected to the memory, the input and output unit, and the bus; The memory stores a program, and the processor calls the program to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a program stored thereon, wherein the program, when executed on a computer, performs the method according to any one of claims 1 to 7.