Upgrade compiling method and device, electronic equipment and readable storage medium

By creating and managing action queues in the system virtual partition, skipping the compilation process to complete the upgrade, and continuing to perform compilation in the system background, the problem of upgrading compilation in the existing technology requires a long wait, and improving the user experience of new versions of applications and fluency.

CN119440540APending Publication Date: 2025-02-14VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411770360.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The existing upgraded compilation solution requires a long time to wait in the foreground, resulting in poor user experience. Turning off the compilation function directly will cause problems such as lag and power consumption in the new version of the application.

Method used

Create an executor, download an action queue, verify an action queue, a first compile action queue, and a second compile action queue in the system virtual partition, and perform an upgrade through the executor. After the download and verification action queue is completed, skip the first compilation action queue and confirm that the upgrade is successful. Then, after the system upgrade is completed, the second compilation action queue is pushed into the executor and the compilation is continued in the system background.

Benefits of technology

Complete the upgrade by skipping the compilation process, avoiding users waiting for a long time; continue to perform compilation in the system background, improve the user experience and fluency of the new version of the application, and avoid lag and power consumption problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440540A_ABST
    Figure CN119440540A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computers, and particularly relates to an upgrade compiling method and device, electronic equipment and a readable storage medium. The method comprises the following steps: creating an actuator, a downloading action queue, a verification action queue, a first compiling action queue and a second compiling action queue in a system virtual partition; pushing the downloading action queue, the verification action queue and the first compiling action queue into an executor, and executing upgrading through the executor; and after the downloading action queue and the verification action queue are completed, skipping the first compiling action queue, pushing the second compiling action queue into the executor under the condition that system upgrading is completed and restart preparation operation is executed, and executing compiling in the system virtual partition through the executor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and specifically relates to an upgrade compilation method, device, electronic device and readable storage medium. Background Art

[0002] The existing system upgrade process includes the process of compiling the new version of the application. The existing upgrade compilation solution must wait until the compilation is completed before restarting to complete the upgrade. However, the compilation process will take up a lot of upgrade time, causing users to have to wait in the foreground all the time, resulting in a poor user experience and failure to upgrade to the new version in time. If the compilation function is turned off directly, the application will not be compiled after the new version is upgraded, resulting in problems such as lag and high power consumption. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide an upgrade compilation method, device, electronic device and readable storage medium, which can solve the problem that the existing upgrade compilation solution requires a long time of waiting in the foreground.

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

[0005] In the system virtual partition, an executor, a download action queue, a verification action queue, a first compile action queue, and a second compile action queue are created;

[0006] Pushing the download action queue, the verification action queue and the first compile action queue into the executor, and performing the upgrade through the executor;

[0007] After the downloading action queue and the verifying action queue are completed, skipping the first compiling action queue;

[0008] When the system upgrade is completed and a restart preparation operation is performed, the second compilation action queue is pushed into the executor, and the compilation is performed in the system virtual partition through the executor.

[0009] In a second aspect, an embodiment of the present application provides an upgrade compilation device, the device comprising:

[0010] A creation module, used to create an executor, a download action queue, a verification action queue, a first compilation action queue and a second compilation action queue in a system virtual partition;

[0011] A first execution module, used for pushing the download action queue, the verification action queue and the first compile action queue into the executor, and performing the upgrade through the executor;

[0012] A second execution module is used to skip the first compilation action queue after the download action queue and the verification action queue are completed, and determine that the upgrade is successful;

[0013] The third execution module is used to push the second compilation action queue into the executor when the system upgrade is completed and the restart preparation operation is performed, and perform compilation in the system virtual partition through the executor.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0015] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0016] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0017] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0018] In an embodiment of the present application, the download action queue, the verification action queue, and the first compilation action queue are first pushed into the executor, and after the download action queue and the verification action queue are completed, the first compilation action queue is skipped to determine that the upgrade is successful, that is, the original logic of the upgrade program is completed by skipping the compilation, so that the system foreground will exit the upgrade interface according to the completion of the upgrade, avoiding long waiting times for users; then, the second compilation action queue is pushed into the executor, and the compilation is performed in the system virtual partition through the executor, that is, after the upgrade program logic is completed, the compilation process continues to be executed in the system background, and the compilation of the new version of the application is completed without affecting the user's use, thereby improving the user experience and fluency of the new version of the application. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a flowchart of the upgrade compilation method provided in the embodiment of the present application;

[0020] Figure 2 This is one of the application flow diagrams provided in the embodiments of the present application;

[0021] Figure 3This is the second application flow diagram provided in the embodiment of the present application;

[0022] Figure 4 It is a structural diagram of an upgrade compilation device provided in an embodiment of the present application;

[0023] Figure 5 It is one of the structural schematic diagrams of the electronic device provided in the embodiment of the present application;

[0024] Figure 6 This is the second structural schematic diagram of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0026] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0027] In order to better understand the technical solution of this application, the following contents are first introduced:

[0028] Android Virtual AB (V-AB) upgrade is an Over-the-Air (OTA) upgrade solution in the Android system, which aims to improve the reliability and user experience of the upgrade process. Compared with the traditional A / B upgrade solution, the virtual AB upgrade solution does not need to allocate two physical partitions for each image, but divides two logical partitions inside a special super partition, but there is only one image entity. This means that at any given time, only one partition (A-SLOT or B-SLOT) contains image data, while the other partition is empty. When the device runs on one SLOT, the system will upgrade the other SLOT in the background. The virtual AB upgrade solution further reduces the required storage space by performing snapshot merging in user space. The advantage of this solution is that it combines the advantages of seamless upgrade and rollback upgrade while reducing the storage space requirements. The virtual AB upgrade solution is implemented by copying only the partition used by the bootloader, thereby minimizing the use of additional space.

[0029] Compiling the application (for example, using the dex2oat program to compile) can improve the fluency of the application and improve its performance. If the application is not compiled, it will run in the verify mode. Running in verify mode is prone to lag and temperature rise. After compilation, it will run in the speed-profile mode. In speed-profile mode, the application runs faster and saves more power.

[0030] The virtual AB upgrade process includes the pre-compilation of the new version of the application, but the compilation will take up a lot of upgrade time, and long-term high-frequency running of dex2oat will cause overheating and fast power consumption. Users need to wait in the foreground and can only restart after the compilation is completed. Compilation errors will directly lead to upgrade errors and then cause upgrade failure. Directly turning off the upgrade compilation will cause losses to the performance and power consumption of the new version of the application.

[0031] The upgrade compilation method provided by the embodiment of the present application is described in detail below through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0032] See also Figure 1 , the embodiment of the present application provides an upgrade compilation method, the method comprising:

[0033] Step 101: In a system virtual partition, create an executor, a download action queue, a verification action queue, a first compile action queue, and a second compile action queue;

[0034] Step 102: Push the download action queue, the verification action queue and the first compile action queue into the executor, and perform the upgrade through the executor;

[0035] Step 103: After the download action queue and the verification action queue are completed, skip the first compilation action queue;

[0036] Step 104: When the system upgrade is completed and the restart preparation operation is performed, the second compilation action queue is pushed into the executor, and the compilation is performed in the system virtual partition through the executor.

[0037] The above-mentioned system virtual partition can be understood as a system virtual partition that is loaded after the upgrade is started when the virtual AB upgrade solution introduced above is adopted. The system virtual partition is used to run in the system background.

[0038] It should be noted that the virtual AB upgrade described above is only an optional technical application scenario. The embodiments of the present application mainly use this scenario as an example to describe the solution, but it does not mean that the technical solution of the present application can only be applied to this technical scenario. The technical solution of the present application can also be applied to other technical scenarios.

[0039] The download action queue may specifically be DownloadAction, which is used for downloading and displaying the download in the foreground;

[0040] The verification action queue may specifically be FilesystemVerifierAction, which is used for verification and installation display in the foreground;

[0041] The first compilation action queue and the second compilation action queue may specifically be PostinstallRunnerAction, which is used for compilation and displaying the installation in the foreground).

[0042] In the existing native virtual AB upgrade logic, when the user actively updates the version, clicks on the system update. After the upgrade starts, an executor will be created to load another system virtual partition and create three action queues, namely DownloadAction, FilesystemVerifierActionPostinstallRunnerAction. These three action queues are pushed into the executor and executed sequentially. Only after all three queues are executed can the execution end function ProcessingDone() be called and all partitions are uninstalled. At this time, the status is updated according to the return code of the upgrade. For example, if the code is that the upgrade failed, the upgrade status is set to idle and the next installation can be performed again. If the code is that the upgrade is successful, the upgrade status is set to the restart required status and the system can be updated after the restart.

[0043] In the embodiment of the present application, the download action queue, the verification action queue and the first compilation action queue are pushed into the executor, and the upgrade is performed by the executor, that is, one of the two compilation actions created is first pushed into the executor, and the other compilation action is not placed in the executor.

[0044] After the download action queue and the verification action queue are completed, the first compilation action queue is skipped to determine that the upgrade is successful. That is, the executor performs download-verification in the logical order of the upgrade. When executing the native compilation action, the actual content of the queue is directly skipped, that is, the compilation of the new version of the application is skipped, and the executor is notified that the queue has been executed. At this time, the execution end function is called, the upgrade success flag is written, and all partitions are not uninstalled temporarily.

[0045] It should be noted that since the upgrade success flag is written, the upgrade is completed for the upgrade program logic (although no actual compilation is performed). At this time, the system foreground will exit the upgrade interface according to the completion of the upgrade, so that the user does not need to wait in the foreground and can use each application normally.

[0046] Then, the second compilation action queue is pushed into the executor, and the compilation is performed in the system virtual partition through the executor, that is, another PostinstallRunnerAction created previously is pushed into the executor to start the real compilation optimization operation. The compilation runs in the system background without affecting the normal use of the user foreground.

[0047] Optionally, after the upgrade is determined to be successful, the upgrade state may be set to optimizing, and when the system is in the optimizing state, the step 104 is performed.

[0048] In an embodiment of the present application, the download action queue, the verification action queue, and the first compilation action queue are first pushed into the executor, and after the download action queue and the verification action queue are completed, the first compilation action queue is skipped to determine that the upgrade is successful, that is, the original logic of the upgrade program is completed by skipping the compilation, so that the system foreground will exit the upgrade interface according to the completion of the upgrade, avoiding long waiting times for users; then, the second compilation action queue is pushed into the executor, and the compilation is performed in the system virtual partition through the executor, that is, after the upgrade program logic is completed, the compilation process continues to be executed in the system background, and the compilation of the new version of the application is completed without affecting the user's use, thereby improving the user experience and fluency of the new version of the application.

[0049] In an optional embodiment, the method further includes:

[0050] When a restart instruction is obtained or the first preset time is reached, the compilation is interrupted, the system virtual partition is unloaded, and the restart is executed.

[0051] The above restart instruction can be understood as the user manually performing a restart operation, that is, after the above confirmation that the upgrade is successful, the system foreground has exited the upgrade interface, after which the user can choose to restart at any time.

[0052] The above-mentioned first preset time refers to a specific pre-set time, which can be set by the user independently or use the system factory default setting. Its function is to perform automatic restart at a specific time. Specifically, a function called "Smart Upgrade" can be set (this name is only for example and is not limited to the specific name). The user can turn on this function to instruct the system to restart when the first preset time is reached.

[0053] It should be noted that when the above-mentioned restart is executed, the compilation of the system background will be directly interrupted and the system virtual partition will be unloaded. After the restart, the system has been upgraded to the new version. The applications that have not been compiled before will continue to complete the application upgrade based on the existing method under the new version system. This application does not limit the application compilation and upgrade method after the restart.

[0054] It is understandable that the present application does not limit the restart time point after a successful upgrade, that is, the user can restart immediately after a successful upgrade. In this case, you can choose to skip the above step 104, that is, directly skip the compilation process in the system background, and choose to upgrade the application based on the existing method after restarting.

[0055] In an optional implementation, executing the compilation in the system virtual partition by the executor includes:

[0056] (1) Obtaining the usage time of the application within the first preset period;

[0057] (2) Based on usage time, the executor compiles each application in the system virtual partition.

[0058] In the embodiment of the present application, considering that users have different usage rates for different applications, the user experience requirements for frequently used applications will be higher. Therefore, when performing compilation, applications with higher usage rates are compiled first.

[0059] Specifically, the usage time of applications within a certain time range (which can be for all applications in the system or for applications involved in this system upgrade, and the embodiments of the present application are not limited to this) can be obtained, such as the usage time within the most recent day, and sorted in order of usage time from long to short. Specifically, an application list can be generated, and compilation can be performed on each application in turn according to the application list.

[0060] In an optional implementation, compiling each application includes:

[0061] (1) When the first condition is met, compile each application;

[0062] (2) if the first condition is not met, confirming again whether the first condition is met after a second preset time;

[0063] Among them, the first condition is associated with the system operating status.

[0064] Before compiling each application, a first condition is judged. If the first condition is met, the compilation continues. If the first condition is not met, the compilation is paused and whether the first condition is met is judged after a period of time. For example, the waiting time can be 5 seconds, 10 seconds, etc. It can be set by the user or the system factory default setting can be used.

[0065] The above-mentioned first condition is related to the system operating status, for example, the temperature may be lower than the target temperature, the power level may be lower than the target power level, the screen may be off, etc. It is mainly used to determine whether the current system operating status is a low power consumption state or a non-working state.

[0066] In the embodiment of the present application, a low power consumption state or a non-working state is determined before each application is compiled. The purpose is to compile the application in a state with as low energy consumption as possible, thereby reducing energy consumption and saving electricity to a certain extent.

[0067] In an optional implementation, compiling each application includes:

[0068] If a compilation error occurs in the current application, the compilation of the current application is skipped and the compilation of the next application is executed.

[0069] In an embodiment of the present application, an application may report an error during the compilation process. In the existing upgrade compilation method, if an application reports a compilation error, it will directly lead to an upgrade error and then cause the upgrade to fail. In the present application, the application with the compilation error is skipped and the next application is compiled directly to avoid the entire upgrade compilation process being affected by individual applications.

[0070] It is understandable that for these applications that report compilation errors, they can be upgraded in the new version system based on the existing upgrade method after the system is restarted, and the embodiments of the present application do not specifically limit this.

[0071] In an optional implementation, executing the compilation in the system virtual partition by the executor further includes:

[0072] (1) Get the compilation time;

[0073] (2) when the time for the executor to execute the compilation is greater than or equal to the compilation time, determining that the compilation is completed;

[0074] The compilation time may be a time obtained online through a network, or the compilation time may be a preset time.

[0075] In the embodiment of the present application, considering that the overall energy consumption of compilation is relatively high, it is necessary to set a time limit for the overall compilation, that is, when the compilation time is exceeded, regardless of whether the compilation of all applications is actually completed at this time, the compilation is directly determined to be completed, and the upgrade state machine state is modified, and the upgrade can be completed by restarting the system later. For applications that have not completed compilation due to exceeding the compilation time, the application can be upgraded based on the existing upgrade method in the new version system after the system is restarted, and the embodiment of the present application does not make specific restrictions on this.

[0076] It is understandable that the above determination of whether the compilation time is exceeded can be performed after each application is compiled. This can avoid the compilation of a single application being interrupted due to exceeding the compilation time when the compilation is halfway through.

[0077] The above-mentioned compilation time can be the time obtained online, that is, when the online upgrade method is adopted, the network will send the compilation time synchronously when sending the upgrade package; the above-mentioned compilation time can also be a preset time, that is, when local upgrade is adopted, the compilation time sent from the receiving network cannot be received at this time, and the system default compilation time can be used for limitation.

[0078] The technical solution of the present application is described below in conjunction with application examples: It should be noted that in the embodiments of the present application, the device is specifically a mobile phone as an example for description, and the technical solution of the present application is also applicable to other types of devices.

[0079] First, let me briefly introduce the native virtual AB upgrade logic. When the user actively updates the version, click System Update. After the upgrade starts, an executor will be created to load another system virtual partition and create three action queues, namely DownloadAction (download, download is displayed in the foreground), FilesystemVerifierAction (verification, installation is displayed in the foreground), and PostinstallRunnerAction (compilation, installation is displayed in the foreground). These three action queues are pushed into the executor and executed sequentially. After all three queues are executed, the execution end function ProcessingDone() is called and all partitions are uninstalled. At this time, the status is updated according to the return code of the upgrade. For example, if the code is that the upgrade failed, the upgrade status is set to idle and the next installation can be performed again. If the code is that the upgrade is successful, the upgrade status is set to the restart required status and the system can be updated after restarting.

[0080] The optimization process of this solution is to create a new compilation action queue (PostinstallRunnerAction) when creating three action queues, but not put it into the executor. When executing the native compilation action, directly skip the actual content of the queue (compiling the new version of the application, etc.), and notify the executor that the queue has been executed. At this time, call the execution end function, write the upgrade success flag, but temporarily do not uninstall all partitions, and notify the user that they can choose to restart immediately. If the user does not restart immediately, the upgrade status is set to optimizing (Optimizing). At this time, push the newly created PostinstallRunnerAction into the executor and start to perform the real compilation optimization operation. At this time, the executor does not accept the compilation error processing request returned by the compilation queue, and uniformly returns the compilation success to the upgrade code. After the operation is completed, directly process the upgrade completion operation and return. After the execution is completed, perform the uninstallation partition operation, and the upgrade status is set to the restart required state. When the upgrade status is optimizing, you can restart the phone at any time to update the system. At this time, the loaded partition will be automatically uninstalled and updated. If the user chooses to restart immediately, the optimization process will not be executed, and the partition will be directly uninstalled and the system will be updated.

[0081] In the specific compilation process, optimizations have also been made to facilitate better adjustment of the compilation process according to user usage. In the preparation stage of starting the compilation, the native will sort all applications according to the usage timestamp of the most recent day to avoid the situation where high-frequency applications cannot be compiled. The list of commonly used applications within seven days can be called and placed at the front of the pre-compiled list. At the same time, the logic of calling canrun to detect whether the conditions are met before each compilation is added in otapreopt_script.sh (pre-compiled script), such as whether the temperature is lower than the target temperature, whether the power is lower than the target power, whether the screen is on or off, etc. If the conditions are not met, wait for 5 seconds, and call done after waiting to detect whether the compilation stage has been completed. If completed, the compilation state is ended. If not completed, re-check whether the conditions are met. Add timeout detection logic in done, and the compilation time is sent online by the upgrade APP. At the same time, set the sending of 0 minutes to turn off the upgrade compilation to prevent fools. If the compilation stage exceeds the sending time, clear the pre-compiled application queue to complete the compilation stage and modify the upgrade state machine state.

[0082] An error may occur during compilation. In this case, the compilation error is not reported to the upgrade process. Instead, the application is skipped directly and the next application is compiled. After all packages are compiled or the scheduled compilation time is reached, success is returned to the upgrade process. The compilation process can be restarted at any time because the actual upgrade logic has been completed after the first three steps. The partition will be automatically unloaded and reloaded during the actual restart. For users, the foreground waiting time is greatly shortened (the actual compilation occurs in the background). The original download process remains unchanged when the user upgrades. Since the installation process previously included verification and compilation processes, the time is long and it will generate heat. After the modification, the compilation process is moved to the background after the user selects the night restart. The original installation process only includes the verification process, which greatly shortens the foreground installation time. After the user clicks the night restart, the compilation process continues to run in the background according to the conditions. If the user clicks Restart Now, the compilation process is interrupted and restarted directly.

[0083] The embodiment of the present application improves the compilation process during the virtual AB upgrade process, creates an independent new compilation process, and is located after all upgrade logics. The compilation process during the upgrade does not perform actual compilation. After running the upgrade logic, the new compilation process can be run according to the conditions to perform the actual application compilation operation, and the compilation optimization is completely hidden in the background. The system can be restarted and updated at any time during the compilation, which saves upgrade time. Compilation errors will not cause upgrade errors. After the user upgrades, the pre-compiled APP can be used more smoothly and stably.

[0084] In an optional implementation, a smart upgrade function can be set. When the user turns on the nighttime smart upgrade, the upgrade process remains basically the same as the optimization process described above, but the upgrade compilation is no longer enabled based on the user's choice, but is enabled by default. First, the upgrade package is automatically downloaded during idle time, and it does not restart after installation. It detects whether the upgrade APP has issued a compilation time. If the compilation time has not been issued, it will directly restart. If the compilation time is issued, it will first determine whether the compilation conditions are met, such as whether the temperature is lower than the target temperature, whether the battery level is lower than the target battery level, whether the screen is on or off, and other conditions. If it meets the requirements, the application ranked first in the pre-compiled application list will be loaded for compilation. After the compilation is completed, it will be determined whether the current time exceeds the time sent by the upgrade APP. If it exceeds, the pre-compilation list will be cleared, the compilation process will be terminated, and the system will be directly restarted. The partition switch update is successful. If the time has not arrived, the next application in the pre-compilation list will be loaded, and it will be determined whether it meets the compilation conditions. If it meets the requirements, it will be compiled. If it does not meet the requirements, it will wait for 5 seconds and continue to determine. If it does not meet the requirements, it will be paused until the agreed compilation time is exhausted, the compilation process will be terminated, and the phone will be restarted to complete the system update. See. Figure 2 , the specific process is as follows:

[0085] Step 201: The user selects nighttime smart upgrade;

[0086] Step 202: The system downloads the upgrade package in the background during idle time;

[0087] Step 203: The system performs automatic installation at night;

[0088] Step 204: Do not restart after installation is completed;

[0089] Step 205: Determine whether the upgrade APP sends the compilation time, if so, execute step 206, otherwise, execute step 210;

[0090] Step 206: Determine whether the compilation condition is met, if so, execute step 207, otherwise, wait for a period of time and then execute step 206 again;

[0091] Step 207: Run the compilation of an APP in the pre-compilation list;

[0092] Step 208: Determine whether the current time used exceeds the time for issuing the upgraded APP. If so, execute step 210; otherwise, execute step 209;

[0093] Step 209: Load the next application in the precompiled list, and then execute step 206;

[0094] Step 210: Restart to complete the system update, and the system upgrade is successful.

[0095] The embodiment of the present application realizes automatic upgrading at night, can customize the compilation time more reasonably, and control the temperature, power, etc. during the upgrade to ensure a smooth experience of using the new version of the application after the upgrade.

[0096] In an optional implementation, the user uses the local upgrade scenario, downloads the upgrade package to the local computer, and then clicks to start the upgrade. At this time, the process is similar to the optimization process described above. Three actions are created during the upgrade process: DownloadAction (download, decompression is displayed in the foreground under local upgrade), FilesystemVerifierAction (verification, installation is displayed in the foreground under local upgrade), and PostinstallRunnerAction (compile, not actually run, installation is displayed in the foreground). An independent PostinstallRunnerAction is additionally created to execute only the first three actions. At this time, all partitions are not uninstalled to ensure that the subsequent compilation process can be executed smoothly. At the same time, other upgrade completion flags are set normally. At this time, it is determined whether the user restarts. If the user does not restart immediately, the compilation process is executed to determine whether the compilation conditions are met. If they are met, an application in the compilation list is run. Since the local upgrade cannot accept the compilation time sent online by the upgrade APP, the system default compilation time will be used for limitation. After the timeout, the upgrade to the new system will be restarted. If it does not time out, the next application in the list will be loaded for compilation. See. Figure 3 , the specific process is as follows:

[0097] Step 301: The user selects local upgrade;

[0098] Step 302: The system decompresses the local upgrade package;

[0099] Step 303: Install the upgrade package;

[0100] Step 304: Determine whether the user reboots after the installation is complete. If so, execute step 309; otherwise, execute step 305;

[0101] Step 305: Determine whether the compilation condition is met, if so, execute step 306, otherwise, wait for a period of time and then execute step 305 again;

[0102] Step 306: Run the compilation of an APP in the pre-compilation list;

[0103] Step 307: Determine whether the current time used exceeds the default compilation time, if so, execute step 309, otherwise, execute step 308;

[0104] Step 308: Load the next application in the precompiled list, and then execute step 305;

[0105] Step 309: Restart to complete the system update, and the system upgrade is successful.

[0106] The upgrade compilation method provided in the embodiment of the present application can be executed by an upgrade compilation device. In the embodiment of the present application, the upgrade compilation device provided in the embodiment of the present application is described by taking the upgrade compilation method executed by the upgrade compilation device as an example.

[0107] See also Figure 4 , the embodiment of the present application provides an upgrade compilation device 400, the device comprising:

[0108] The creation module 401 is used to create an executor, a download action queue, a verification action queue, a first compile action queue and a second compile action queue in a system virtual partition;

[0109] A first execution module 402, used to push the download action queue, the verification action queue and the first compile action queue into the executor, and perform the upgrade through the executor;

[0110] The second module 403 is used to skip the first compile action queue after the download action queue and the verification action queue are completed;

[0111] The third execution module 404 is used to push the second compilation action queue into the executor when the system upgrade is completed and the restart preparation operation is performed, and perform compilation in the system virtual partition through the executor.

[0112] Optionally, the third execution module is used to:

[0113] Obtaining the usage time of the application within the first preset time;

[0114] Depending on the usage time, the executor performs compilation for each application in the system virtual partition.

[0115] Optionally, the third execution module is used to:

[0116] When the first condition is met, compiling each application program;

[0117] If the first condition is not met, confirming again whether the first condition is met after a second preset time;

[0118] The first condition is associated with the system operating status.

[0119] Optionally, the third execution module is used to:

[0120] If a compilation error occurs in the current application, the compilation of the current application is skipped and the compilation of the next application is executed.

[0121] Optionally, the second execution module is used to:

[0122] Get the compilation time;

[0123] When the time taken by the executor to execute the compilation is greater than or equal to the compilation time, it is determined that the compilation is completed.

[0124] Optionally, the device further comprises:

[0125] The fourth execution module is used to interrupt the compilation, uninstall the system virtual partition and execute the restart when the restart instruction is obtained or the first preset time is reached.

[0126] In an embodiment of the present application, the download action queue, the verification action queue, and the first compilation action queue are first pushed into the executor, and after the download action queue and the verification action queue are completed, the first compilation action queue is skipped to determine that the upgrade is successful, that is, the upgrade program logic is completed by skipping the compilation, so that the system foreground will exit the upgrade interface according to the completion of the upgrade, thereby avoiding long waiting times for the user; then, the second compilation action queue is pushed into the executor, and the compilation is performed in the system virtual partition through the executor, that is, after the upgrade program logic is completed, the compilation process continues to be performed in the system background, and the compilation of the new version of the application is completed without affecting the user's use, thereby improving the user experience and fluency of the new version of the application.

[0127] The upgrade compilation device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a palmtop computer, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtualreality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personalcomputer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0128] The upgrade compilation device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0129] The upgrade compilation device provided in the embodiment of the present application can achieve Figures 1 to 3 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0130] Alternatively, if Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501 and a memory 502, wherein the memory 502 stores programs or instructions that can be executed on the processor 501, and when the program or instructions are executed by the processor 501, the various steps of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.

[0131] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0132] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0133] The electronic device 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, and a processor 610.

[0134] Those skilled in the art will appreciate that the electronic device 600 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 610 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0135] The processor 610 is used to create an executor, a download action queue, a verification action queue, a first compile action queue, and a second compile action queue in a system virtual partition;

[0136] Processor 610, used for pushing the download action queue, the verification action queue and the first compile action queue into the executor, and performing the upgrade through the executor;

[0137] Processor 610, configured to skip the first compile action queue after the download action queue and the verification action queue are completed;

[0138] The processor 610 is used to push the second compilation action queue into the executor when the system upgrade is completed and the restart preparation operation is performed, and perform compilation in the system virtual partition through the executor.

[0139] Optionally, the processor 610 is configured to:

[0140] Obtaining the usage time of the application within the first preset time;

[0141] Depending on the usage time, the executor performs compilation for each application in the system virtual partition.

[0142] Optionally, the processor 610 is configured to:

[0143] When the first condition is met, compiling each application program;

[0144] If the first condition is not met, confirming again whether the first condition is met after a second preset time;

[0145] The first condition is associated with the system operating status.

[0146] Optionally, the processor 610 is configured to:

[0147] If a compilation error occurs in the current application, the compilation of the current application is skipped and the compilation of the next application is executed.

[0148] Optionally, the processor 610 is configured to:

[0149] Get the compilation time;

[0150] When the time taken by the executor to execute the compilation is greater than or equal to the compilation time, it is determined that the compilation is completed.

[0151] Optionally, the processor 610 is configured to interrupt the compilation, uninstall the system virtual partition and execute the restart when a restart instruction is obtained or a first preset time is reached.

[0152] In an embodiment of the present application, the download action queue, the verification action queue, and the first compilation action queue are first pushed into the executor, and after the download action queue and the verification action queue are completed, the first compilation action queue is skipped to determine that the upgrade is successful, that is, the upgrade program logic is completed by skipping the compilation, so that the system foreground will exit the upgrade interface according to the completion of the upgrade, thereby avoiding long waiting times for the user; then, the second compilation action queue is pushed into the executor, and the compilation is performed in the system virtual partition through the executor, that is, after the upgrade program logic is completed, the compilation process continues to be performed in the system background, and the compilation of the new version of the application is completed without affecting the user's use, thereby improving the user experience and fluency of the new version of the application.

[0153] It should be understood that in the embodiment of the present application, the input unit 604 may include a graphics processor (GPU) 6041 and a microphone 6042, and the graphics processor 6041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 607 includes a touch panel 6071 and at least one of other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0154] The memory 609 can be used to store software programs and various data. The memory 609 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 609 may include a volatile memory or a non-volatile memory, or the memory 609 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 609 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0155] The processor 610 may include one or more processing units; optionally, the processor 610 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 610.

[0156] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0157] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0158] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0159] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0160] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0161] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0162] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0163] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. An upgrade compilation method, characterized in that: The method comprises: In the system virtual partition, an executor, a download action queue, a verification action queue, a first compile action queue, and a second compile action queue are created; Pushing the download action queue, the verification action queue and the first compile action queue into the executor, and performing the upgrade through the executor; After the downloading action queue and the verifying action queue are completed, skipping the first compiling action queue; When the system upgrade is completed and a restart preparation operation is performed, the second compilation action queue is pushed into the executor, and the compilation is performed in the system virtual partition through the executor.

2. The method according to claim 1, characterized in that The executing the compilation in the system virtual partition by the executor includes: Obtaining the usage time of the application within the first preset time; The executor compiles each of the application programs in the system virtual partition according to the usage time.

3. The method according to claim 2, characterized in that The step of compiling each of the applications comprises: When the first condition is met, compiling each of the application programs; If the first condition is not met, confirming again whether the first condition is met after a second preset time; The first condition is associated with the system operating status.

4. The method according to claim 2, characterized in that: The step of compiling each of the applications comprises: If a compilation error occurs in the current application, the compilation of the current application is skipped and the compilation of the next application is executed.

5. The method according to claim 2, characterized in that: The executing of the compilation in the system virtual partition by the executor further includes: Get the compilation time; When the time taken by the executor to execute the compilation is greater than or equal to the compilation time, it is determined that the compilation is completed.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: When a restart instruction is obtained or a first preset time is reached, the compilation is interrupted, the system virtual partition is unloaded, and a restart is performed.

7. An upgrade compilation device, characterized in that: The device comprises: A creation module, used to create an executor, a download action queue, a verification action queue, a first compile action queue and a second compile action queue in a system virtual partition; A first execution module, used for pushing the download action queue, the verification action queue and the first compile action queue into the executor, and performing the upgrade through the executor; A second execution module, configured to skip the first compile action queue after the download action queue and the verification action queue are completed; The third execution module is used to push the second compilation action queue into the executor when the system upgrade is completed and the restart preparation operation is performed, and perform compilation in the system virtual partition through the executor.

8. The device according to claim 7, characterized in that The third execution module is used to: Get the usage time of all applications within the first preset time; The executor compiles each of the application programs in the system virtual partition in the order of the usage time from longest to shortest.

9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the upgrade compilation method according to any one of claims 1 to 6 are implemented.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the upgrade compilation method according to any one of claims 1 to 6 are implemented.