Method for accelerating starting speed of Android system

By scanning and parsing prefabricated APKs using Python scripts during the Android system firmware compilation stage, generating a pre_package.xml file, and directly reading the file when the system starts, the problem of extended startup time of the Android system is solved, and faster startup speed and better user experience is achieved.

CN119645503APending Publication Date: 2025-03-18SICHUAN CHANGHONG ELECTRIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411681334.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

When the existing Android system starts, the startup time is extended and the user experience is affected.

Method used

During the Android system firmware compilation stage, Python scripts are used to scan and parse the prefabricated APK, extract key information and store it in the pre_package.xml file. When the system starts, directly read the information in the pre_package.xml file to avoid repeated scanning and parsing.

Benefits of technology

It significantly reduces the startup time of the Android system, reduces the CPU and memory usage, and improves overall performance and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645503A_ABST
    Figure CN119645503A_ABST
Patent Text Reader

Abstract

The invention discloses a method for accelerating the starting speed of an Android system, which effectively avoids repeated scanning when the system is started by moving the scanning and analysis work of an APK (Android Package) to a firmware compiling stage, so that the time required for starting is remarkably shortened, and the user experience is improved. According to the method, occupation of CPU and memory resources in the starting process is reduced, the system burden is reduced, and the operation efficiency of equipment is improved. Through the mode, the user can access the application program more quickly when starting the equipment, so that the use experience of the user is improved, the market attraction and competitiveness of the equipment are enhanced, and the optimization strategy has important significance for improving the satisfaction of the user and the performance of the equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Android operating system startup process, and in particular to a method for accelerating the startup speed of an Android system. Background Art

[0002] In modern Android operating systems, the management and loading of applications (APK) is a key factor affecting system boot time and user experience. The traditional system boot process involves scanning and parsing pre-made APK files one by one, which is time-consuming and causes users to face significant delays when the device boots up. As the number of pre-installed applications on the device increases, the complexity of scanning and parsing increases, further extending the boot time.

[0003] To address this challenge, developers have tried to use multithreading to parallelize the scanning and parsing of APKs. Although this approach improves efficiency, it fails to completely eliminate startup delays. Resource competition between threads and the overhead of context switching may cause system instability and affect user experience.

[0004] Another optimization strategy is the priority classification method, which classifies APKs according to the frequency and importance of application usage and prioritizes parsing of high-priority applications. This method shortens the startup time, but if users need to use low-priority applications, they still need to wait for parsing to complete, affecting the user experience.

[0005] With the popularity of smart devices and the increasing expectations of users for startup speed, existing technical means are difficult to meet market demand. Users expect to quickly access applications when the device starts up, rather than waiting for a long time. Therefore, new technical solutions are urgently needed to optimize the APK processing flow, reduce startup delays, and improve system response speed and user experience. Summary of the invention

[0006] The purpose of the present invention is to provide a method for accelerating the startup speed of the Android system in order to solve the above problems. The present invention scans and parses the prefabricated APK during the Android system firmware compilation stage, uses a Python script to scan and parse the prefabricated APK, and stores the extracted information in the pre_package.xml file. When the Android system starts, the system directly reads the parsed pre_package.xml file without scanning and parsing the APK again. This preprocessing mechanism can effectively reduce the startup time of the Android system, while reducing the usage of memory and CPU, improving overall performance, and enhancing user experience.

[0007] The present invention achieves the above-mentioned purpose through the following technical solutions:

[0008] A method for accelerating the startup speed of an Android system comprises the following steps:

[0009] Step 1, APK scanning and analysis: During the Android system firmware compilation phase, use Python scripts to scan all pre-made APK files, and perform scanning and analysis operations on the pre-made APKs;

[0010] Use Python scripts to extract key information from the APK, including package name, version, and permissions, and then store the extracted information in a structured form in the pre-package.xml file;

[0011] Step 2, information storage location: Package the generated pre_package.xml file into the system firmware and store it in a non-erasable partition. This ensures that the file will not be deleted by the user when the system is restored to factory settings, thereby ensuring that the parsed APK information can always be obtained when the system starts;

[0012] Step 3, system startup optimization: During the Android system startup process, the system directly reads the information in the pre_package.xml file and no longer scans and parses the APK in real time; this process greatly reduces the I / O operations and CPU burden at startup, significantly improving the startup speed;

[0013] Step 4, application self-upgrade: When the system application is self-upgraded, since the components in AndroidManifest.xml are updated, the background service updates the pre_package.xml file by listening to the broadcast;

[0014] Step 5, Firmware Update Management: The system will re-scan and parse the file during the next firmware compilation to ensure the timeliness and accuracy of the pre_package.xml file.

[0015] A further solution is that in step 1, after the prefabricated APK is packaged, a Python script is used to scan the directories where the prefabricated APK is stored, including system / app, system / pri-app, system_ext / app system_ext / pri-app, and vendor / app, to ensure a comprehensive scan of the prefabricated APK.

[0016] A further solution is that in step 1, for all scanned prefabricated APKs, a Python script is used to decompress them, and for the decompressed prefabricated APK files, the AndroidMainifest.xml file is parsed to extract relevant information and store it in the pre-package.xml file. This process is a key part of implementing the method, ensuring the effective extraction and storage of key APK information.

[0017] A further solution is that in step 2, the generated pre_package.xml file is packaged into the system firmware to ensure that it is stored in a non-erasable partition. This operation is a necessary means to ensure that the APK parsing information can be stably obtained when the system starts. The setting of the non-erasable partition ensures that the file is retained when restoring the factory settings.

[0018] A further solution is that in step 3, when the generated Android system firmware is burned to the device and started, the PKMS (Package Manager Service) scanning process is optimized and adjusted, and the pre-package.xml file is directly read for the pre-made applications under the directories of system / app, system / pri-app, system_ext / app system_ext / pri-app, and vendor / app. For the non-system pre-made applications under data / app, the normal parsing process is followed to decompress and extract information. Burning the generated Android system firmware to the device and starting it is a necessary link in the actual device operation of this method, and optimizing the PKMS scanning process at startup for different types of applications (pre-made applications and non-pre-made applications) is a key measure to improve the startup speed. This differentiated processing method is an important embodiment of ensuring the efficiency of system startup and correctly handling different types of applications.

[0019] A further solution is that in step 4, application changes are monitored through PACKAGE_ADDED, PACKAGE_REPLACED, and PACKAGE_REMOVED, and whether it is a prefabricated application is determined through PackageManager. If it is a prefabricated application, the pre-package.xml file is updated. By monitoring PACKAGE_ADDED, PACKAGE_REPLACED, and PACKAGE_REMOVED broadcasts to determine whether it is a prefabricated application, and then using PackageManager to update the pre-package.xml file, this whole process is a necessary mechanism to ensure the accuracy of the pre-package.xml file information in the application self-upgrade scenario.

[0020] A further solution is that in step 5, when the Android system firmware is updated, the above process is repeated to ensure the real-time and accuracy of the pre_package.xml file; repeating the above process when the Android system firmware is updated is a necessary operation to maintain the real-time and accuracy of the pre-package.xml file, ensuring the normal operation of the entire system after the firmware update and the optimization of the startup speed.

[0021] The beneficial effects of the present invention are:

[0022] The present invention provides a method for accelerating the startup speed of an Android system, which effectively avoids repeated scanning when the system is started by moving the scanning and parsing work of APK to the firmware compilation stage, thereby significantly reducing the time required for startup and improving the user experience. This method reduces the occupation of CPU and memory resources during the startup process, reduces the system burden, and improves the operating efficiency of the device. In this way, users can access applications faster when starting the device, which not only improves the user experience, but also enhances the market appeal and competitiveness of the device. This optimization strategy is of great significance for improving user satisfaction and device performance. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0024] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION

[0025] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0026] In any embodiment, if Figure 1 As shown, a method for accelerating the startup speed of an Android system of the present invention comprises:

[0027] APK scanning and parsing: During the Android system firmware compilation phase, a Python script is used to scan and parse all pre-made APK files. The script extracts key information of the APK, including package name, version, permissions, etc., and stores this information in a structured manner in the pre_package.xml file.

[0028] Information storage location: Store the generated pre_package.xml file in a non-erasable partition to ensure that it will not be deleted by the user when the system is restored to factory settings, thereby ensuring that the parsed APK information can always be accessed when the system starts.

[0029] System startup optimization: During the Android system startup process, the system directly reads the information in the pre_package.xml file instead of scanning and parsing the APK in real time. This process greatly reduces the I / O operations and CPU burden during startup, significantly improving the startup speed.

[0030] Application self-upgrade: For system application self-upgrade, the components in AndroidManifest.xml are updated, and the background service updates the pre_package.xml file by listening to the broadcast

[0031] Firmware update management: The system will re-scan and parse the file during the next firmware compilation to ensure the timeliness and accuracy of the pre_package.xml file.

[0032] Through the above steps, the system startup time is significantly shortened, while the memory and CPU usage are reduced, thereby improving the overall system performance and user experience.

[0033] In a specific embodiment, Figure 1 As shown, a method for accelerating the startup speed of an Android system of the present invention comprises the following steps:

[0034] Compile Android system firmware;

[0035] After the pre-made APK is packaged, use the Python script to scan the directory where the pre-made APK is stored (for example: system / app, system / pri-app, system_ext / app system_ext / pri-app, vendor / app, etc.);

[0036] Decompress all scanned pre-made APKs using Python scripts;

[0037] For the decompressed pre-made APK file, parse the AndroidMainifest.xml file, extract relevant information (such as package name, version number, version name, permissions, components, application icon, application name, etc.) and store it in the pre_package.xml file. The pre_package.xml file is stored in the non-erasable partition.

[0038] Package the generated pre_package.xml file into the system firmware, making sure it is stored in a non-erasable partition

[0039] Burn the generated Android system firmware to the device and start it

[0040] Optimize and adjust the PKMS scanning process. For pre-made applications in directories such as system / app, system / pri-app, system_ext / appsystem_ext / pri-app, and vendor / app, directly read the pre_package.xml file. For non-system pre-made applications in data / app, decompress and extract information according to the normal parsing process.

[0041] Monitor application changes through PACKAGE_ADDED, PACKAGE_REPLACED, and PACKAGE_REMOVED and use PackageManager to determine whether it is a prefabricated application. If it is a prefabricated application, update the pre_package.xml file

[0042] For Android system firmware update, repeat the above process.

[0043] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims. It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not further explain various possible combinations. In addition, the various different embodiments of the present invention can also be combined arbitrarily, as long as they do not violate the concept of the present invention, they should also be regarded as the contents disclosed by the present invention.

Claims

1. A method for accelerating the startup speed of an Android system, characterized in that: The following steps are involved: Step 1, APK scanning and analysis: During the Android system firmware compilation phase, use Python scripts to scan all pre-made APK files, and perform scanning and analysis operations on the pre-made APKs; Use Python scripts to extract key information from the APK, including package name, version, and permissions, and then store the extracted information in a structured form in the pre-package.xml file; Step 2, information storage location: Package the generated pre_package.xml file into the system firmware and store it in a non-erasable partition. This ensures that the file will not be deleted by the user when the system is restored to factory settings, thereby ensuring that the parsed APK information can always be obtained when the system starts; Step 3, system startup optimization: During the Android system startup process, the system directly reads the information in the pre_package.xml file and no longer scans and parses the APK in real time; this process greatly reduces the I / O operations and CPU burden at startup, significantly improving the startup speed; Step 4, application self-upgrade: When the system application is self-upgraded, since the components in AndroidManifest.xml are updated, the background service updates the pre_package.xml file by listening to the broadcast; Step 5, Firmware Update Management: The system will re-scan and parse the file during the next firmware compilation to ensure the timeliness and accuracy of the pre_package.xml file.

2. A method for accelerating the startup speed of an Android system as claimed in claim 1, characterized in that: In the step 1, after the prefabricated APK is packaged, a Python script is used to scan the directories where the prefabricated APK is stored, including system / app, system / pri-app, system_ext / app system_ext / pri-app, and vendor / app, to ensure a comprehensive scan of the prefabricated APK.

3. A method for accelerating the startup speed of an Android system as claimed in claim 1, characterized in that: In the step 1, all scanned prefabricated APKs are decompressed using a Python script, and the AndroidMainifest.xml file is parsed for the decompressed prefabricated APK files to extract relevant information and store it in the pre-package.xml file.

4. A method for accelerating the startup speed of an Android system as claimed in claim 1, characterized in that: In step 2, the generated pre_package.xml file is packaged into the system firmware, ensuring that it is stored in a non-erasable partition.

5. A method for accelerating the startup speed of an Android system as claimed in claim 1, characterized in that: In step 3, when the generated Android system firmware is burned to the device and started, the PKMS scanning process is optimized and adjusted, and the pre-package.xml file is directly read for the pre-made applications in the directories of system / app, system / pri-app, system_ext / app system_ext / pri-app, and vendor / app. For the non-system pre-made applications in data / app, the normal parsing process is used to decompress and extract information.

6. A method for accelerating the startup speed of an Android system as claimed in claim 1, characterized in that: In step 4, application changes are monitored through PACKAGE_ADDED, PACKAGE_REPLACED, and PACKAGE_REMOVED, and whether it is a prefabricated application is determined through PackageManager. If it is a prefabricated application, the pre_package.xml file is updated.

7. A method for accelerating the startup speed of an Android system as claimed in claim 1, characterized in that: In step 5, the above process is repeated when the Android system firmware is updated to maintain the real-time and accuracy of the pre-package.xml file, ensuring the normal operation of the entire system after the firmware update and the optimization of the startup speed.