A compiling method, a compiling device and a storage medium
By resetting the watchdog timer of the dex2oat compilation tool in the Android runtime environment, and classifying the compilation scenarios into first and second categories, the system restart problem caused by the compilation process holding lock was resolved, thus improving system stability and user experience.
Patent Information
- Application Number
- CN202110152449.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-03
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2041-02-03
AI Technical Summary
When using the dex2oat compilation tool in the Android runtime environment, the compilation process holding a lock causes system services to wait for a long time, triggering the watchdog timer and causing the system to restart.
By resetting the compilation process to trigger the watchdog compilation duration, different compilation scenarios are divided into Category 1 and Category 2 scenarios, with different monitoring times for each. This ensures that the compilation process completes or releases the lock before the lock duration for system service processes reaches a certain time, thus avoiding system restarts.
This effectively avoids the system service process triggering the watchdog timer due to the compilation process holding locks for too long, thus improving system stability and user experience.
Smart Images

Figure CN114860242B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of system control, and particularly relates to a compiling method, a compiling device and a storage medium. BACKGROUND
[0002] With the development of science and technology, the application field of compiling technology is more and more extensive, and the conversion of bytecodes in an application program is a common use method of the compiling technology.
[0003] In the related art, a dex2oat (dexfile to oat file) compiling tool needs to be used in an Android runtime environment (ART) to compile a compilable file of an application program to obtain an executable file in an executable and linkable format (ELF). The dex2oat compiling tool is a tool for optimizing a bytecode (dex) file into a binary format file. However, in the compiling process, a related method in a package manager service (PMS) holds a lock (mInstallLock), so that other operations that need to call the method in the PMS to hold the lock cannot be executed. Even the lock time of a system service (system_server) and the like is too long, a watchdog is triggered, and the system is restarted. SUMMARY
[0004] To overcome the problems in the related art, the present disclosure provides a compiling method, a compiling device and a storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, a compiling method is provided, comprising:
[0006] determining a current compiling scenario corresponding to a current compiling process; when the current compiling scenario is a first type of compiling scenario, monitoring the current compiling process using a first time; the first time is a compiling time length of a compiling process triggering a watchdog, and the first time is less than a second time, and the second time is a lock waiting time length of a system service process triggering the watchdog.
[0007] In an implementation manner, the compiling method further comprises: when the current compiling scenario is a second type of compiling scenario, monitoring the compiling process using a native time of a compiling process triggering a watchdog.
[0008] In an implementation manner, monitoring the current compiling process using the first time comprises: in response to the current compiling process completing compiling before the first time or the current compiling process not completing compiling at the first time, controlling the current compiling process to release a lock.
[0009] In an implementation, after the current compiling process is controlled to release the lock, the method further comprises: in response to a system service process contending for the lock, before the second time, controlling the system service process to hold the lock.
[0010] In an implementation, the first type of compiling scenario comprises one or a combination of: a compiling scenario in which a bytecode file is dynamically loaded by an application; and a compiling scenario in an application installation.
[0011] In an implementation, the second type of compiling scenario comprises one or a combination of: a compiling scenario in a system idle state; a compiling scenario in a system startup process; a compiling scenario of a build service in a system build process; a compiling scenario in a system program library pre-build process; and a compiling scenario in a debugging mode.
[0012] According to a second aspect of the embodiments of the present disclosure, a compiling apparatus is provided, comprising:
[0013] A determining unit is configured to determine a current compiling scenario corresponding to a current compiling process; a monitoring unit is configured to monitor the current compiling process using a first time when the current compiling scenario is a first type of compiling scenario; the first time is a compiling duration in which a compiling process triggers a watchdog, and the first time is less than a second time, the second time being a lock waiting duration in which a system service process triggers the watchdog.
[0014] In an implementation, the monitoring unit is further configured to monitor the compiling process using a native time in which a compiling process triggers a watchdog when the current compiling scenario is a second type of compiling scenario.
[0015] In an implementation, the monitoring unit monitors the current compiling process using the first time in the following manner: in response to the current compiling process completing compiling before the first time, or the current compiling process not completing compiling at the first time, the current compiling process is controlled to release the lock.
[0016] In an implementation, the monitoring unit is further configured to, after the current compiling process is controlled to release the lock, in response to a system service process contending for the lock, before the second time, control the system service process to hold the lock.
[0017] In an implementation, the first type of compiling scenario comprises one or a combination of: a compiling scenario in which a bytecode file is dynamically loaded by an application; and a compiling scenario in an application installation.
[0018] In an implementation, the second type of compiling scenario comprises one or a combination of: a compiling scenario in a system idle state; a compiling scenario in a system startup process; a compiling scenario of a build service in a system build process; a compiling scenario in a system program library pre-build process; and a compiling scenario in a debugging mode.
[0019] According to a third aspect of the embodiments of the present disclosure, a compiling device is provided, comprising:
[0020] a processor; a memory for storing processor-executable instructions;
[0021] The processor is configured to execute the compiling method in the first aspect or any one of the implementations of the first aspect.
[0022] According to a fourth aspect of the embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, when the instructions in the storage medium are executed by the processor of the mobile terminal, the mobile terminal can execute the compiling method in the first aspect or any one of the implementations of the first aspect.
[0023] The technical solutions provided by the embodiments of the present disclosure can include the following beneficial effects: when the current compiling scenario corresponding to the current compiling process is the first type of compiling scenario, the current compiling process is monitored at a first time. The first time is the compiling duration of the compiling process triggering the watchdog, and the first time is less than a second time. The second time is the lock waiting duration of the system service process triggering the watchdog. Therefore, the system restart phenomenon occurring in the system service lock contention process in the compiling process can be improved by the present disclosure.
[0024] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0025] The accompanying drawings, which are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure.
[0026] Figure 1 is a flowchart of a compiling method according to an exemplary embodiment.
[0027] Figure 2 is a flowchart of a compiling method according to an exemplary embodiment.
[0028] Figure 3 shows a dex2oat common scenario division schematic diagram provided in an implementation of the embodiments of the present disclosure.
[0029] Figure 4 is a flowchart of a compiling method according to an exemplary embodiment.
[0030] Figure 5 is a flowchart of a compiling method based on the first type of scenario according to an exemplary embodiment.
[0031] Figure 6FIG. 1 is a flow diagram of a compiling method based on a first type of compiling scenario according to an example embodiment.
[0032] Figure 7 FIG. 2 is a compiling device block diagram according to an example embodiment.
[0033] Figure 8 FIG. 3 is a block diagram of a device for compiling according to an example embodiment. DETAILED DESCRIPTION
[0034] The example embodiments will be described in detail herein with reference to the attached drawings. The following description is made with reference to the accompanying drawings, in which like reference numerals refer to like elements throughout the several views. The following description is made with reference to the accompanying drawings, in which like reference numerals refer to like elements throughout the several views. The implementations described in the following example embodiments are not meant to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0035] The compiling method provided by the embodiments of the present disclosure can be applied to a compiling scenario of a terminal application. For example, the embodiments of the present disclosure can be applied to a scenario of compiling a compilable file in a terminal such as a mobile phone.
[0036] In the related art, a compiling tool is used to compile a compilable file of an application program, so as to obtain an executable file that can be directly invoked. For example, in ART, a dex2oat compiling tool is used to compile a bytecode file (dex file) of an application program, so as to obtain an ELF executable file. In order to ensure backward compatibility, the Android runtime environment continues to use the same dex file, that is, the dex file is retained in the application program directory for calling by an old program, and the executable file (.odex) file is replaced with the ELF executable file. The Android runtime environment uses the dex2oat tool to compile an application. Once a program is compiled by the dex2oat command of the Android runtime environment, the program will be run through the ELF executable file.
[0037] In the related art, a method for compiling a compilable file of an application program by using a compiling tool can recompile all bytecodes into machine code during installation of the application program. The compiled application program can be directly run by calling an executable file of the machine code without real-time compiling work. The running efficiency of the application program is greatly improved, the power consumption of the mobile phone is reduced, and the garbage collection mechanism is greatly improved. In the compiling process of the related method, the related method in the service management module holds a lock (mInstallLock) until the dex2oat compilation is completed and returned after the dex2oat task is triggered. However, due to the complexity of some applications, the compilation time is relatively long, and thus some operations cannot be performed or the system may be restarted. Figure 1 is a flowchart of a compiling method according to an example embodiment. As shown in Figure 1 PackageManagerService.mInstallLock when dex2oat is compiling. The time for triggering the watchdog by the native facility compiling process is 9.5 minutes, and when the dex2oat can complete the compilation within 9.5 minutes, the compiling process will return and release the lock after the compilation is completed. When the dex2oat cannot complete the compilation within 9.5 minutes, the compiling process will trigger the watchdog and release the lock at 9.5 minutes. If the system service process or other processes contend for the lock during the compilation of the compiling process, the shorter compilation time can release the lock faster when the system service process or other processes contend for the lock, and thus does not affect the system service process or other processes. However, the longer compilation time may cause the system service process or other processes to be unable to obtain the lock. For example, when the system service process needs to contend for the lock and the waiting time of the system service process for the lock is 1 minute, the waiting time of the system service process for the lock is 1 minute, the watchdog is triggered, and thus the system is restarted. For another example, when other processes access the method in the service package management and need to obtain the lock, the lock cannot be released due to the long compilation time of the compiling process, and thus the other processes are not responded in time after waiting for a long time. The above situations will affect the user experience.
[0038] Therefore, the present disclosure provides a compiling method. In the compiling method, in a scenario in which a system service or other operations may contend for a lock, the compilation time for triggering a watchdog by a compiling process is reset, and the compiling process is monitored based on the reset compilation time, so as to improve the phenomenon that the system service contends for the lock during the compiling process and triggers the watchdog to cause the system to restart.
[0039] Figure 2is a flowchart of a compiling method according to an exemplary embodiment, as Figure 2 As shown, the compiling method includes the following steps.
[0040] In step S11, a current compiling scenario corresponding to a current compiling process is determined.
[0041] The current compiling scenario in the embodiment of the present disclosure can be a compiling scenario determined by a current state of a terminal such as a mobile phone. For example, the current compiling scenario can be determined by a current use state of the mobile phone. In an example, a reader capable of distinguishing compiling scenarios is provided in the terminal.
[0042] The compiling scenario in which the compiling process is triggered to reset the watchdog compiling duration in the embodiment of the present disclosure is referred to as a first type of compiling scenario. The first type of compiling scenario can be a compiling scenario pre-set to include one or more compiling processes. In the first type of compiling scenario, the compiling process can be in a situation in which other processes are highly likely to contend for a lock in the compiling process, and the compiling duration for compiling is relatively short, usually less than a lock duration triggered by a system service to contend for a lock.
[0043] In step S12, if the current compiling scenario is the first type of compiling scenario, the first time is used to monitor the current compiling process.
[0044] For the convenience of description, the compiling duration of the watchdog triggered by resetting the compiling process corresponding to the first type of compiling scenario is referred to as the first time. If the current compiling scenario is the first type of compiling scenario, the first time is used to monitor the current compiling process. That is, if the compiling duration of the compiling process corresponding to the first type of compiling scenario reaches the first time, the watchdog is triggered, and the system is restarted.
[0045] In the embodiment of the present disclosure, to avoid the situation in which the compiling duration of the system service lock is too long in the compiling process of the first type of compiling scenario, the first time can be set to be less than the lock duration of the system service process triggered by the watchdog. For the convenience of description, the lock duration of the system service process triggered by the watchdog is referred to as the second time. For example, the second time can be 1 minute.
[0046] In the embodiment of the present disclosure, to improve the system restart phenomenon caused by the system service lock in the compiling process of the compiling process, the first time can be set to be less than the second time, for example, the first time can be set to 55 seconds.
[0047] In the embodiment of the present disclosure, the first time is less than the second time. When the current compilation scenario is the first type of compilation scenario, the first time is used to monitor the current compilation process. Therefore, before the system service process is locked for a duration of the second time to trigger the watchdog, the compilation process has completed the compilation to release the lock or the compilation process has not completed to trigger the watchdog to release the lock, and thus the system service can hold the lock before triggering the watchdog, avoiding the system service process triggering the watchdog to cause the system to restart.
[0048] In the embodiment of the present disclosure, to ensure that the compilation process in the first type of compilation scenario can complete the compilation with a high probability, the compilation duration of each compilation process included in the first type of compilation scenario is counted, and the first time is set to be greater than the maximum compilation duration in the first type of compilation scenario.
[0049] In the related art, the compilation duration of some complex applications during compilation can be relatively long, and the compilation duration can be greater than the first time. In the case where the compilation duration of the compilation process is greater than the first time, the compilation method provided by the embodiment of the present disclosure can cause the compilation process to be killed all the time and cannot complete the compilation. Therefore, in one embodiment of the present disclosure, the compilation scenarios of commonly used compilation processes are divided into the first type of compilation scenario and the second type of compilation scenario.
[0050] In the first type of compilation scenario, the compilation duration of the compilation process triggering the watchdog is the first time that is reset, for example, 55 seconds set as described above. In the second type of compilation scenario, the compilation duration of the compilation process triggering the watchdog remains the original time. The original time can be, for example, the original set time of triggering the watchdog, which is 9.5 minutes.
[0051] Figure 3 A schematic diagram of the division of the dex2oat common scenario provided in one embodiment of the present disclosure is shown. Figure 3 To avoid the case that some complex applications perform dex2oat for too long and are killed all the time, so that the compilation is not completed all the time, affecting the running performance, the original value of triggering the watchdog in the idle state is reserved to ensure that the application can be compiled when the device is in the idle state. The time value of triggering the watchdog by dex2oat in the prebuilt process of the build server, the system program function (so) library, and the debug mode is reserved to ensure that the build is not interrupted by the error caused by the killing of dex2oat. In addition to the above cases of reserving the original value, when the application program (APP) dynamically loads dex, the APP is installed, and dex2oat is compiled in other scenarios, the value of triggering the watchdog is modified to 55s<1min to ensure that the lock is obtained before the system server triggers the watchdog.
[0052] Figure 4 is a flow chart of a compiling method according to an exemplary embodiment, as shown in Figure 4 The compiling method comprises the following steps.
[0053] In step S21, a current compiling scenario corresponding to a current compiling process is determined.
[0054] In step S22a, if the current compiling scenario is a first type of compiling scenario, the first time is used to monitor the current compiling process.
[0055] In the embodiment of the present disclosure, the current compiling scenario is the first type of compiling scenario, the native setting of watchdog in the dex2oat code is modified according to different scenarios, and in the idle scenario, the system build process, the prebuilt process of the system so library, and other scenarios in the debug mode, the watchdog time triggered by the dex2oat compiling task is modified to 55s, so that before the system service process is locked for a second time to trigger the watchdog, the compiling process has completed the compiling and released the lock or the compiling process has not completed the triggering of the watchdog to release the lock, thereby reducing the probability of the phenomenon of no response of other processes accessing the lock method in the PMS due to long time waiting, and avoiding the situation that the system_server process is restarted due to the failure to obtain the lock.
[0056] In step S22b, if the current compiling scenario is a second type of compiling scenario, the native time of the compiling process triggering the watchdog is used to monitor the compiling process.
[0057] In the embodiment of the present disclosure, the current compiling scenario is the second type of compiling scenario, and the native time of 9.5 minutes of the compiling process triggering the watchdog is used to monitor the compiling process. Among them, the watchdog time triggered by the dex2oat compiling task is 9.5 minutes. The upper PMS holds the lock, and the lock must be released after the dex2oat task is completed and returned. If other processes access the lock method in the PMS during this process, they must wait and will appear the phenomenon of no response. If the system_server process needs to obtain the lock at this time, and the waiting time reaches 1 minute, the watchdog of the system_server will be triggered, the system_server process will be killed, and the system will be restarted.
[0058] The embodiment of the present disclosure selects a suitable editing process trigger time based on different types of compilation scenarios. For example, based on the common compilation scenarios in a terminal such as a mobile phone, the first type of compilation scenario and the second type of compilation scenario can be divided, and the watchdog trigger time of the compilation process is reset to the first time for the first type of compilation scenario, and the watchdog trigger time of the original compilation process is retained for the second type of compilation scenario.
[0059] In an implementation manner, the first type of compilation scenario includes one or a combination of the following: a compilation scenario of applying dynamic loading of a bytecode file, and a compilation scenario in application installation.
[0060] In an implementation manner, the second type of compilation scenario includes one or a combination of the following: a compilation scenario in a system idle state, a compilation scenario in a system startup process, a compilation scenario of a build service in a system build process, a compilation scenario in a system program library pre-build process, and a compilation scenario in a debugging mode.
[0061] In an example, in the second type of compilation scenario, the watchdog trigger time set by the dex2oat compilation tool is used to monitor the compilation process. The watchdog trigger time set by the dex2oat compilation tool is 9.5 minutes. In another example, in the first type of compilation scenario, the watchdog trigger time of the dex2oat compilation tool is modified to 55 seconds. Since the watchdog trigger time of the system service process response is 1 minute, the watchdog trigger time of the dex2oat compilation tool in this type of scenario is less than the watchdog trigger time of the system service process response, and the system service process response will not trigger the watchdog. The method of setting the watchdog trigger time of the dex2oat compilation tool to 55 seconds in this type of scenario can not only make the dex2oat compilation tool complete the compilation work with high probability, but also make the watchdog of the system service process response free from triggering.
[0062] The embodiment of the present disclosure will be described below in combination with the actual application of the compilation method related to the above-mentioned embodiment.
[0063] Figure 5 is a compilation method flowchart based on a first type of scenario according to an example embodiment. As shown in Figure 5 The steps S31 and S32 in the compilation method provided by the embodiment of the present disclosure are similar to the steps S11 and S12 in the execution method shown in Figure 2 The steps S31 and S32 in the compilation method provided by the embodiment of the present disclosure are similar to the steps S11 and S12 in the execution method shown in
[0064] In step S33, in response to the current compilation process completing the compilation before the first time or the current compilation process not completing the compilation at the first time, the lock of the current compilation process is released.
[0065] In the embodiments of the present disclosure, in response to the current compilation process completing the compilation before the first time or the current compilation process not completing the compilation at the first time, the current compilation process is controlled to release the lock. Among them, the related method in the PMS will release the lock after the dex2oat compilation is completed or the dex2oat compilation triggers the watchdog. Since the time when the dex2oat compilation task triggers the watchdog is set to 55 seconds, the lock holding time of the related method in the PMS will not exceed 55 seconds corresponding to the compilation task of the dex2oat.
[0066] The embodiments of the present disclosure are described below for the case that the system service process competes for the lock in the compilation process of the editing process.
[0067] In the embodiments of the present disclosure, in response to the system service process competing for the lock, the system service process is controlled to hold the lock before the second time.
[0068] In step S34, in response to the system service process competing for the lock, the system service process is controlled to hold the lock before the second time.
[0069] The embodiments of the present disclosure ensure that the system service process can obtain the lock before the lock of the system service process times out, and prevent the system from restarting due to the watchdog triggered by the lock of the system service process timing out.
[0070] Figure 6 It is a flowchart of a compilation method based on a first type of compilation scenario according to an exemplary embodiment. As shown in Figure 6 The time when the dex2oat compilation process in the first type of compilation scenario triggers the watchdog is modified to 55 seconds. When the dex2oat performs the compilation, the PackageManagerService.performDexOptInternalWithDependenciesLi holds the lock of the PackageManagerService.mInstallLock. When the system service process or other processes access the PMS method and need to obtain the lock, the dex2oat will release the lock when the compilation is completed or the compilation time reaches the trigger time of the watchdog. At this time, the system service process will not trigger the watchdog responded by the system service process due to the lock timeout, and other processes will also continue to execute due to obtaining the lock in time.
[0071] In an embodiment of the present disclosure, a dex2oat compilation task is started, a system log (adblogcat) is obtained to observe dex2oat process records (log), and when the compilation time reaches the trigger watchdog time, the dex2oat process is killed and the following log is printed: 08-26 10:19:33.764 5265 5265 I dex2oat:dex2oat did not finish after 55 seconds. The embodiment of the present disclosure can be understood as that the system confirms that the compilation process does not complete the compilation trigger watchdog and records the specific time of triggering the watchdog.
[0072] The compilation method provided by the embodiment of the present disclosure avoids the situation that the system service process triggers the watchdog due to slow compilation and long lock holding time, and improves the stability of the system based on the adjustment of the watchdog time triggered by the compilation process in the first type of scene. Through the present disclosure, the probability of other operations being unresponsive due to long lock holding time of the compilation process can be reduced, and the user experience is improved.
[0073] Based on the same concept, the embodiment of the present disclosure also provides a compilation device.
[0074] It can be understood that the compilation device provided by the embodiment of the present disclosure includes hardware structures and / or software modules corresponding to the execution of each function in order to achieve the above functions. In combination with the units and algorithm steps of each example disclosed in the embodiment of the present disclosure, the embodiment of the present disclosure can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solution of the present disclosure.
[0075] Figure 7 is a block diagram of a compilation device according to an exemplary embodiment. Referring to Figure 7 The device 100 includes a determination unit 101 and a monitoring unit 102.
[0076] The determination unit 101 is configured to determine a current compilation scene corresponding to a current compilation process. The monitoring unit 102 is configured to monitor the current compilation process using a first time when the current compilation scene is a first type of compilation scene. The first time is a compilation time of the compilation process triggering the watchdog, and the first time is less than a second time, and the second time is a lock waiting time of the system service process triggering the watchdog.
[0077] In an implementation, the monitoring unit 102 is further configured to: in the case that the current compilation scenario is a second type of compilation scenario, use the native time of the compilation process to trigger the watchdog to monitor the compilation process.
[0078] In an implementation, the monitoring unit 102 uses the first time to monitor the current compilation process in the following manner:
[0079] In response to the current compilation process completing the compilation before the first time, or the current compilation process not completing the compilation before the first time, the control unit controls the current compilation process to release the lock.
[0080] In an implementation, the monitoring unit 102 is further configured to: after the control unit controls the current compilation process to release the lock, in response to the system service process contending for the lock, control the system service process to hold the lock before the second time.
[0081] In an implementation, the first type of compilation scenario includes one or a combination of the following: a compilation scenario in which a dynamic loading of a bytecode file is applied. And a compilation scenario in which an installation is applied.
[0082] In an implementation, the second type of compilation scenario includes one or a combination of the following: a compilation scenario in which the system is in an idle state. A compilation scenario in which the system is in a startup process. A compilation scenario in which the system is in a build process of a build service. A compilation scenario in which the system is in a program library pre-build process. And a compilation scenario in which the system is in a debugging mode.
[0083] As to the apparatus in the above-described embodiments, specific manners in which various modules perform operations have been described in detail in the embodiments of the method, and thus will not be described in detail here.
[0084] Figure 8 is a block diagram of an apparatus 200 for compilation according to an example embodiment. The apparatus 200 can be, for example, a mobile phone, a computer, a digital broadcast terminal, a message communication device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
[0085] Referring to Figure 8 , the apparatus 200 can include one or more of the following components: a processing component 202, a memory 204, a power supply component 206, a multimedia component 208, an audio component 210, an input / output (I / O) interface 212, a sensor component 214, and a communication component 216.
[0086] The processing component 202 generally controls the overall operations of the device 200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 202 can include one or more processors 220 to execute instructions delivered from the memory 204 to complete all or part of the steps of the methods described above. In addition, the processing component 202 can include one or more modules to facilitate the interaction between the processing component 202 and other components. For example, the processing component 202 can include a multimedia module to facilitate the interaction between the multimedia component 208 and the processing component 202.
[0087] The memory 204 is configured to store various types of data to support the operations of the device 200. Examples of these data include instructions for any application or method operating on the device 200, contact data, phonebook data, messages, pictures, videos, and the like. The memory 204 can be implemented by any type of volatile or non-volatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0088] The power component 206 provides power to the various components of the device 200. The power component 206 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 200.
[0089] The multimedia component 208 includes a screen providing an output interface between the device 200 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes the touch panel, the screen can be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense a touch, a slide, and a gesture on the touch panel. The touch sensors can not only sense a boundary of a touching or sliding action, but also detect duration and pressure related to the touching or sliding action. In some embodiments, the multimedia component 208 includes a front camera and / or a back camera. The front camera and / or the back camera can receive external multimedia data when the device 200 is in an operation mode, such as a shooting mode or a video mode. Each of the front and back cameras can be a fixed optical lens system or have a focal length and optical zoom capability.
[0090] The audio component 210 is configured to output and / or input audio signals. For example, the audio component 210 includes a microphone (MIC) that is configured to receive an external audio signal when the device 200 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 204 or transmitted via the communication component 216. In some embodiments, the audio component 210 also includes a speaker for outputting audio signals.
[0091] The I / O interface 212 provides an interface between the processing component 202 and peripheral interface modules, which can include a keypad, a click wheel, buttons, and so on. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0092] The sensor component 214 includes one or more sensors for providing status assessments of various aspects of the device 200. For example, the sensor component 214 can detect an open / closed position of the device 200, relative positioning of components, such as a display and a keypad of the device 200, a change of position of the device 200 or a component of the device 200, presence or absence of user contact with the device 200, orientation or acceleration / deceleration / g-force and temperature of the device 200. The sensor component 214 can include an orientation sensor, an altimeter, a proximity sensor, an accelerometer, a gyroscope, a magnetometer, a pressure sensor or a temperature sensor.
[0093] The communication component 216 is configured to facilitate wired or wireless communication between the device 200 and other devices. The device 200 can access a wireless network based on a corresponding communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an example embodiment, the communication component 216 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an example embodiment, the communication component 216 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) techniques, infrared data association (IrDA) techniques, ultra-wideband (UWB) techniques, Bluetooth (BT) techniques, and other techniques.
[0094] In exemplary embodiments, the apparatus 200 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic elements, for executing the above-described methods.
[0095] In exemplary embodiments, a non-transitory computer-readable storage medium including instructions, such as the memory 204 including instructions, is also provided, which can be executed by the processor 220 of the apparatus 200 to complete the above-described methods. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0096] It can be understood that, in the present disclosure, “multiple” refers to two or more, and other quantifiers are similar thereto. “And / or” describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character “ / ” generally represents that the associated objects before and after it are in an “or” relationship. The singular form “a”, “said” and “the” are also intended to include the plural form, unless the context clearly indicates otherwise.
[0097] It can be further understood that the terms “first”, “second”, and the like are used to describe various information, but these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other, and do not indicate a particular order or importance. In fact, the expressions of “first”, “second”, and the like can be completely interchangeable. For example, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information without departing from the scope of the present disclosure.
[0098] It can be further understood that, unless otherwise specified, “connection” includes direct connection between two elements without other components, and also includes indirect connection between two elements with other elements.
[0099] It can be further understood that, although the operations are described in a specific order in the embodiments of the present disclosure in the accompanying drawings, it should not be understood as requiring the operations to be performed in the specific order or in a serial order, or requiring all the shown operations to be performed to obtain the desired results. In a specific environment, multi-tasking and parallel processing can be advantageous.
[0100] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features disclosed herein. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
[0101] It should be understood that the present disclosure is not limited to the precise structures as herein described and illustrated in the drawings, and that various modifications and changes can be made without departing from its scope. The scope of the present disclosure is limited only by the claims that follow.
Claims
1. A method of compiling, characterized by, The compiling method comprises: determining a current compiling scenario corresponding to a current compiling process; when the current compiling scenario is a first type of compiling scenario, monitoring the current compiling process using a first time; the first type of compiling scenario comprises one or a combination of: a compiling scenario in which a dynamic loading bytecode file is applied; and a compiling scenario in an application installation; the first time is a compiling duration in which a compiling process triggers a watchdog, and the first time is less than a second time, the second time being a lock waiting duration in which a system service process triggers a watchdog.
2. The compiling method of claim 1, wherein, The compiling method further comprises: when the current compiling scenario is a second type of compiling scenario, monitoring the compiling process using a native time in which a compiling process triggers a watchdog.
3. The compiling method according to claim 1 or 2, characterized in that, monitoring the current compiling process using the first time comprises: in response to the current compiling process completing compiling before the first time or the current compiling process not completing compiling at the first time, controlling the current compiling process to release a lock.
4. The compiling method of claim 3, wherein, after controlling the current compiling process to release the lock, the method further comprises: in response to a system service process contending for a lock, controlling the system service process to hold the lock before the second time.
5. The compiling method of claim 2, wherein, the second type of compiling scenario comprises one or a combination of: a compiling scenario in a system idle state; a compiling scenario in a system startup process; a compiling scenario of a build service in a system build process; a compiling scenario of a system program function library pre-build process; and a compiling scenario in a debugging mode. The compiling apparatus comprises:
6. A compiling apparatus characterized by comprising: a determining unit configured to determine a current compiling scenario corresponding to a current compiling process; a monitoring unit configured to monitor the current compiling process using a first time when the current compiling scenario is a first type of compiling scenario; the first type of compiling scenario comprises one or a combination of: a compiling scenario in which a dynamic loading bytecode file is applied; and a compiling scenario in an application installation; the first time is a compiling duration in which a compiling process triggers a watchdog, and the first time is less than a second time, the second time being a lock waiting duration in which a system service process triggers a watchdog. The monitoring unit is further configured to:
7. The apparatus of claim 6, wherein, monitor the compiling process using a native time in which a compiling process triggers a watchdog when the current compiling scenario is a second type of compiling scenario. The monitoring unit monitors the current compiling process using the first time in the following manner:
8. The compiling apparatus according to claim 6 or 7, characterized by, in response to the current compiling process completing compiling before the first time or the current compiling process not completing compiling at the first time, controlling the current compiling process to release a lock. The monitoring unit is further configured to:
9. The apparatus of claim 8, wherein, after controlling the current compiling process to release the lock, in response to a system service process contending for a lock, controlling the system service process to hold the lock before the second time. the second type of compiling scenario comprises one or a combination of:
10. The apparatus of claim 7, wherein, a compiling scenario in a system idle state; a compiling scenario in a system startup process; a compiling scenario of a build service in a system build process; a compiling scenario of a system program function library pre-build process; and a compiling scenario in a debugging mode. comprises: a processor; 11. A compiling apparatus characterized by comprising: a memory for storing processor-executable instructions; wherein the processor is configured to execute the compiling method of any one of claims 1 to 5. 12. A non-transitory computer readable storage medium, when instructions in the storage medium are executed by a processor of a mobile terminal, enable the mobile terminal to perform the compiling method of any one of claims 1 to 5.
Citation Information
Patent Citations
Method and device for controlling hot update of application program, storage medium and mobile terminal
CN108388431A