Method of installing an application and electronic device

By processing the upper-layer installation and lower-layer optimization processes in parallel within electronic devices, the problem of long batch application installation times is solved, improving installation speed and user experience.

CN113971034BActive Publication Date: 2026-01-09HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010713889.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-23
Publication Date
2026-01-09
Estimated Expiration
2040-07-23

AI Technical Summary

Technical Problem

When installing applications on electronic devices in batches, the upper-level installation process and the lower-level optimization process are carried out sequentially, which results in the installation process taking a lot of time and reducing the user experience.

Method used

By running the application's upper-layer installation process and lower-layer optimization process in parallel, and by utilizing task queue management and thread scheduling, the task queue is optimized to achieve parallel processing, thus avoiding the impact of the lower-layer optimization process on the upper-layer installation.

Benefits of technology

It improves the speed of batch application installation on electronic devices and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113971034B_ABST
    Figure CN113971034B_ABST
Patent Text Reader

Abstract

The application provides a method for installing an application and an electronic device, the method is applied to the electronic device, and the method comprises the following steps: detecting that a user triggers an operation of installing a first application program and a second application program; in response to the operation, copying and scanning a first application package, the first application package being an application package corresponding to the first application program; within a first time period after the copying and scanning of the first application package, copying and scanning a second application package, the second application package being an application package corresponding to the second application program; within a second time period after the copying and scanning of the first application package, performing optimization on the first application program; and the first time period and the second time period at least partially overlap. The technical scheme of the embodiment of the application accelerates the installation speed when multiple applications are installed, and improves the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of electronics, and in particular to a method for installing an application and an electronic device. BACKGROUND

[0002] When an electronic device installs an application (App), there are generally an upper-layer installation process and a lower-layer optimization process. For example, when the electronic device installs a plurality of Apps in batches or restores a plurality of Apps through cloning backup, the number of Apps to be installed is large. Since the upper-layer installation process and the lower-layer optimization process of the plurality of Apps are performed sequentially, and the lower-layer optimization process of the Apps occupies a relatively long time, the installation process consumes a large amount of time, and the user experience is reduced.

[0003] Therefore, how to quickly and efficiently install Apps in batches has become a technical problem to be solved. SUMMARY

[0004] The present application provides a method for installing an application and an electronic device, which is beneficial to improve the installation speed of the electronic device for installing a plurality of applications, thereby improving the user experience.

[0005] In a first aspect, a method for installing an application is provided. The method is applied to an electronic device, and includes: detecting that a user triggers an operation of installing a first application program and a second application program; in response to the operation, copying and scanning a first application package, the first application package being an application package corresponding to the first application program; within a first time period after the copying and scanning of the first application package, copying and scanning a second application package, the second application package being an application package corresponding to the second application program; within a second time period after the copying and scanning of the first application package, performing optimization on the first application program; and wherein the first time period and the second time period at least partially overlap.

[0006] Based on the technical solution, when the electronic device installs an application, the upper-layer installation process and the lower-layer optimization process of the application are performed in parallel, which is beneficial to improve the installation speed of the electronic device for installing a plurality of applications, thereby improving the user experience.

[0007] In combination with the first aspect, in some implementations of the first aspect, the method further includes: detecting that a user triggers an operation of installing a third application program and a fourth application program; within a third time period after the copying and scanning of the first application package, copying and scanning a third application package, the third application package being an application package corresponding to the third application program; and wherein when a time length of the second time period is greater than a sum of time lengths of the first time period and the third time period, a starting time of copying and scanning the fourth application package is later than or equal to a starting time of performing optimization on the second application program.

[0008] Based on the technical scheme, when the bottom-layer optimization process of an application takes a long time to execute, the technical scheme is beneficial to avoid too many optimization tasks from being accumulated in the bottom-layer optimization queue.

[0009] With reference to the first aspect, in some implementations of the first aspect, the method further includes: detecting that a user triggers an operation of installing a third application program; detecting a temperature of a central processing unit (CPU) of the electronic device when the copying and scanning of the second application program package are completed; determining that the temperature is greater than or equal to a preset value; pausing for a first preset time period when the optimization of the second application program ends; and copying and scanning a third application program package after the first preset time period, the third application program package being an application program package corresponding to a third application program.

[0010] Based on the technical scheme, during the installation of multiple application programs, the temperature of the electronic device is monitored, and when the temperature of the electronic device is too high, the bottom-layer optimization task is rested for a period of time, which is beneficial to reduce the phenomenon that the temperature of the electronic device is too high for a short time.

[0011] Based on the technical scheme, when the temperature of the electronic device is abnormal, the optimization task being executed is not stopped immediately, but is stopped after the execution of the optimization task is completed, which is beneficial to avoid the problem that the electronic device has insufficient application stability.

[0012] With reference to the first aspect, in some implementations of the first aspect, before the optimization of the first application program is executed, the optimization of a fourth application program is executed, and the determination that the temperature is greater than or equal to a preset value includes: determining that the temperature is greater than or equal to the preset value and a fourth time period is greater than or equal to a second preset time period, wherein the fourth time period is the same as a second time period, or when a time interval between the second time period and a fifth time period is less than or equal to a third preset time period, the fourth time period is a sum of the second time period and the fifth time period, and the fifth time period is a time period during which the electronic device executes the optimization of the fourth application program.

[0013] Based on the technical scheme, when the temperature of the electronic device is abnormal, it is determined whether the bottom-layer optimization task has been executed for a long time, and the scheme is beneficial to determine whether the temperature abnormality of the electronic device is caused by the bottom-layer optimization application.

[0014] With reference to the first aspect, in some implementations of the first aspect, the optimization of the first application program in the second time period after the copying and scanning of the first application program package includes: adding a first optimization task to a first task queue, the first optimization task being used to optimize the first application program; starting a first thread, the first thread being used to take the first optimization task out of the first task queue; and calling a first interface, the first interface being used to start a second thread, the second thread being used to execute the first optimization task.

[0015] In the technical solution, when installing applications in batches on the electronic device, the optimization task corresponding to the application can be put into the task queue, and the first thread manages to schedule the task queue, that is, the first thread takes the optimization task from the task queue, at this time, the first interface is called to start the second thread to really execute the optimization task of the application, so that the underlying optimization of the application does not affect the upper installation of the application, that is, the upper installation of the application and the underlying optimization process can be processed in parallel, thereby the installation speed of the batch application can be accelerated, and the user experience can be improved.

[0016] In a second aspect, an electronic device is provided, and has the characteristics that it includes one or more processors, one or more memories, and the one or more memories store one or more computer programs including instructions, which, when executed by the one or more processors, cause the electronic device to perform the following steps: detecting that a user triggers an operation of installing a first application program and a second application program; in response to the operation, copying and scanning a first application package, the first application package being an application package corresponding to the first application program; within a first time period after the copying and scanning of the first application package, copying and scanning a second application package, the second application package being an application package corresponding to the second application program; within a second time period after the copying and scanning of the first application package, performing optimization on the first application program; and the first time period and the second time period at least partially overlap.

[0017] With reference to the second aspect, in some implementations of the second aspect, when the instructions are executed by the one or more processors, the electronic device performs the following steps: detecting that a user triggers an operation of installing a third application program and a fourth application program; within a third time period after the copying and scanning of the first application package, copying and scanning a third application package, the third application package being an application package corresponding to the third application program; and when a length of the second time period is greater than a sum of lengths of the first time period and the third time period, a starting time of copying and scanning the fourth application package is later than or equal to a starting time of performing optimization on the second application program.

[0018] With reference to the second aspect, in some implementations of the second aspect, when the instructions are executed by the one or more processors, the electronic device performs the following steps: detecting that a user triggers an operation of installing a third application program; detecting a temperature of a CPU of the electronic device when the copying and scanning of the second application package is completed; determining that the temperature is greater than or equal to a preset value; pausing for a first preset time period when the optimization of the second application program is completed; and after the first preset time period, copying and scanning a third application package, the third application package being an application package corresponding to the third application program.

[0019] With reference to the second aspect, in some implementations of the second aspect, before performing the optimization on the first application, the optimization on the fourth application is performed, and the electronic device is specifically configured to: determine that the temperature is greater than or equal to a preset value and a fourth time period is greater than or equal to a second preset time length; wherein the fourth time period and the second time period are the same; or when a time interval between the second time period and the fifth time period is less than or equal to a third preset time length, the fourth time period is a sum of the second time period and a fifth time period, and the fifth time period is a time period during which the electronic device performs the optimization on the fourth application.

[0020] With reference to the second aspect, in some implementations of the second aspect, the electronic device is specifically configured to: add a first optimization task for optimizing the first application into a first task queue; start a first thread, the first thread being used to take out the first optimization task from the first task queue; and call a first interface, the first interface being used to start a second thread, the second thread being used to execute the first optimization task.

[0021] The third aspect provides a computer readable storage medium, the computer readable storage medium storing computer instructions, when the computer instructions are run on an electronic device, the computer instructions make the electronic device execute the method for installing an application in the first aspect and any possible implementation of the first aspect.

[0022] The fourth aspect provides a computer program product, when the computer program product is run on a computer, the computer program product makes the computer execute the method for installing an application in the first aspect and any possible implementation of the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0023] Figure 1 FIG. 1 is a structural schematic diagram of an electronic device 100 to which embodiments of the present application can be applied.

[0024] Figure 2 FIG. 3 is a software structure block diagram of the electronic device 100 of the embodiments of the present application.

[0025] Figure 3 FIG. 6 is a schematic diagram of a group of GUIs provided by the embodiments of the present application.

[0026] Figure 4 FIG. 8 is a flowchart of a process of installing an application provided by the embodiments of the present application.

[0027] Figure 5 FIG. 10 is a timing flowchart of a process of installing an application inside a PMS provided by the embodiments of the present application.

[0028] Figure 6is another timing flow diagram of installing an application provided by an embodiment of the present application.

[0029] Figure 7 is a method flow diagram of installing an application provided by an embodiment of the present application.

[0030] Figure 8 is a timing diagram of installing an application provided by an embodiment of the present application.

[0031] Figure 9 is another timing diagram of installing an application provided by an embodiment of the present application.

[0032] Figure 10 is a method flow diagram of installing an application provided by an embodiment of the present application.

[0033] Figure 11 is a timing flow diagram of a temperature control strategy method of installing an application provided by an embodiment of the present application.

[0034] Figure 12 is a flow diagram of a temperature control strategy method of installing an application provided by an embodiment of the present application.

[0035] Figure 13 is an optimization control flow diagram of a temperature control strategy provided by an embodiment of the present application.

[0036] Figure 14 is a schematic flow diagram of a method of installing an application provided by an embodiment of the present application. DETAILED DESCRIPTION

[0037] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " represents the meaning of or, for example, A / B can represent A or B; in this document, "and / or" is only a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0038] Hereinafter, the terms "first" and "second" are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more of the features.

[0039] The method for installing an application provided in the embodiments of the present application can be applied to electronic devices such as a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), and the like. The embodiments of the present application do not limit the specific type of the electronic device.

[0040] Exemplarily, Figure 1 A structural schematic diagram of the electronic device 100 is shown. The electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a loudspeaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, and the like. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.

[0041] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0042] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices or integrated in one or more processors.

[0043] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.

[0044] The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that the processor 110 has just used or repeatedly uses. If the processor 110 needs to use the instructions or data again, it can directly call from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.

[0045] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0046] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 can contain multiple sets of I2C bus. The processor 110 can be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces respectively. For example, the processor 110 can be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface, and the touch function of the electronic device 100 is realized.

[0047] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can contain multiple sets of I2S bus. The processor 110 can be coupled to the audio module 170 through the I2S bus, and communication between the processor 110 and the audio module 170 is realized. In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the I2S interface, and the function of answering a phone through a Bluetooth headset is realized.

[0048] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled through the PCM bus interface. In some embodiments, the audio module 170 can also deliver audio signals to the wireless communication module 160 through the PCM interface, and the function of answering a phone through a Bluetooth headset is realized. Both the I2S interface and the PCM interface can be used for audio communication.

[0049] The UART interface is a universal serial data bus, which is used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is usually used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface, and the Bluetooth function is realized. In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the UART interface, and the function of playing music through a Bluetooth headset is realized.

[0050] The MIPI interface can be used to connect the processor 110 and the display screen 194, the camera 193 and other peripheral devices. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), and the like. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to implement the photographing function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.

[0051] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 and the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.

[0052] The USB interface 130 is an interface that conforms to the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transmit data between the electronic device 100 and a peripheral device. It can also be used to connect a headset to play audio through the headset. The interface can also be used to connect other electronic devices, such as AR devices and the like.

[0053] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection methods or combinations of multiple interface connection methods in the above embodiments.

[0054] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through the wireless charging coil of the electronic device 100. The charging management module 140 can charge the battery 142 while also providing power to the electronic device through the power management module 141.

[0055] The power management module 141 is configured to connect the battery 142 and the charging management module 140 to the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 can also be configured to monitor parameters such as the battery capacity, the number of battery cycles, the battery health status (leakage, impedance), and the like. In some embodiments, the power management module 141 can also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.

[0056] The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, and the like.

[0057] The antenna 1 and the antenna 2 are configured to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be configured to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in combination with a tuning switch.

[0058] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G and the like applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter, amplify, and the like the received electromagnetic waves, and transmit the processed signals to the modem processor for demodulation. The mobile communication module 150 can also amplify signals modulated by the modem processor and radiate the signals as electromagnetic waves through the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 can be disposed in the same device.

[0059] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a microphone 170B, etc.), or displays an image or a video through the display 194. In some embodiments, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of the processor 110 and disposed in the same device as the mobile communication module 150 or other functional modules.

[0060] The wireless communication module 160 can provide a wireless communication solution including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates and filters the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, modulate it, amplify it, and convert it into electromagnetic wave radiation via the antenna 2.

[0061] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS can include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidu navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation systems (SBAS).

[0062] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.

[0063] The display screen 194 is configured to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diodes (QLED), or the like. In some embodiments, the electronic device 100 can include one or N display screens 194, where N is a positive integer greater than 1.

[0064] The electronic device 100 can implement the photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor.

[0065] The ISP is configured to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing to convert it into an image visible to the naked eye. The ISP can also optimize the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature, and other parameters of the shooting scene. In some embodiments, the ISP can be disposed in the camera 193.

[0066] The camera 193 is configured to capture still images or videos. An object generates an optical image through a lens and projects it onto a photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the electronic device 100 can include one or N cameras 193, where N is a positive integer greater than 1.

[0067] The digital signal processor is used to process digital signals, in addition to being able to process digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.

[0068] The video codec is used to compress or decompress digital video. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.

[0069] The NPU is a neural-network (NN) calculation processor, which can quickly process input information by drawing on the structure of a biological neural network, such as drawing on the transmission mode between human brain neurons, and can also constantly self-learn. Through the NPU, the electronic device 100 can realize intelligent cognition applications such as image recognition, face recognition, voice recognition, text understanding, etc.

[0070] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to realize data storage functions. For example, music, video, etc. Files are saved in the external memory card.

[0071] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various function applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), etc.

[0072] The electronic device 100 can realize audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc. For example, music playing, recording, etc.

[0073] The audio module 170 is configured to convert digital audio information into an analog audio signal output, and to convert an analog audio input into a digital audio signal. The audio module 170 can also be configured to encode and decode audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some of the functions of the audio module 170 can be disposed in the processor 110.

[0074] The speaker 170A, also referred to as a "loudspeaker", is configured to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or a hands-free call through the speaker 170A.

[0075] The receiver 170B, also referred to as a "earpiece", is configured to convert an audio electrical signal into a sound signal. When the electronic device 100 is engaged in a call or a voice message, a user can listen to the voice through the receiver 170B by placing the receiver 170B close to the ear.

[0076] The microphone 170C, also referred to as a "microphone", "microphone", is configured to convert a sound signal into an electrical signal. When making a call or sending a voice message, a user can make a sound through the mouth close to the microphone 170C, and input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, in addition to collecting sound signals, it can also realize the function of noise reduction. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, which can realize the functions of collecting sound signals, noise reduction, identifying sound sources, realizing directional recording, etc.

[0077] The earphone interface 170D is configured to connect a wired earphone. The earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0078] The pressure sensor 180A is configured to sense a pressure signal, and can convert the pressure signal into an electrical signal.

[0079] The gyroscope sensor 180B can be configured to determine the motion posture of the electronic device 100. The barometer sensor 180C is configured to measure air pressure. The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of a flip cover. The acceleration sensor 180E can detect the acceleration of the electronic device 100 in each direction (generally three axes).

[0080] The distance sensor 180F is configured to measure distance. The electronic device 100 can measure distance by infrared or laser.

[0081] The proximity light sensor 180G can include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode can be an infrared light emitting diode. The electronic device 100 emits infrared light outwardly through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using the photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that a user is holding the electronic device 100 close to the ear for a call, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used for automatic unlocking and locking of the screen in a case mode or a pocket mode.

[0082] The ambient light sensor 180L is configured to sense ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light brightness.

[0083] The fingerprint sensor 180H is configured to collect a fingerprint.

[0084] The temperature sensor 180J is configured to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to implement a temperature handling strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 implements a performance reduction of a processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection.

[0085] The touch sensor 180K, also known as a "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also known as a "touch screen".

[0086] The bone conduction sensor 180M can obtain a vibration signal.

[0087] The key 190 includes a power-on key, a volume key, and the like. The key 190 can be a mechanical key. It can also be a touch key. The electronic device 100 can receive a key input and generate a key signal input related to user settings and function control of the electronic device 100.

[0088] The motor 191 can generate a vibration prompt.

[0089] The indicator 192 can be an indicator light, which can be used to indicate a charging state, a power change, and can also be used to indicate a message, a missed call, a notification, and the like.

[0090] The SIM card interface 195 is used to connect a SIM card.

[0091] The software system of the electronic device 100 can employ a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. Embodiments of the present application take the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100.

[0092] Figure 2 is a software structure block diagram of the electronic device 100 of embodiments of the present application. The layered architecture divides the software into several layers, each of which has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer. The application layer can include a series of application packages.

[0093] As shown in Figure 2 , the application packages can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0094] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions.

[0095] As shown in Figure 2 , the application framework layer can include a package manager service (PMS), a window manager, a content provider, a view system, a resource manager, a notification manager, etc.

[0096] The PMS is used to manage the installation and uninstallation of various software.

[0097] The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, and take screenshots, etc.

[0098] The content provider is used to store and obtain data, and make the data accessible to the applications. The data can include videos, images, audios, dialed and received calls, browsing history and bookmarks, phone books, etc.

[0099] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures.

[0100] The resource manager provides various resources for the application program, such as localized strings, icons, pictures, layout files, video files, and the like.

[0101] The notification manager enables the application program to display notification information in the status bar, which can be used to convey a notification type of message, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloading, message reminders, and the like. The notification manager can also be a notification in the form of a chart or a scroll bar text appearing in the top status bar of the system, such as a notification of an application program running in the background, and can also be a notification in the form of a dialogue window appearing on the screen. For example, a text information is prompted in the status bar, a prompt sound is emitted, the electronic device is vibrated, an indicator light is blinked, and the like.

[0102] The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0103] The core library contains two parts: one part is a function function that the java language needs to call, and the other part is the core library of Android.

[0104] The application program layer and the application program framework layer run in the virtual machine. The virtual machine executes the java files of the application program layer and the application program framework layer into binary files. The virtual machine is used to perform the management of the object life cycle, the management of the stack, the management of the thread, the management of the security and the exception, and the garbage collection, and the like.

[0105] The system library can include a plurality of functional modules. For example: installd, media libraries, three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), and the like.

[0106] The kernel layer is a layer between hardware and software. The kernel layer at least contains display drivers, camera drivers, storage drivers, sensor drivers, and the like.

[0107] For ease of understanding, the following embodiments of the present application will take an electronic device with the structure shown in Figure 1 and Figure 2 as an example, and the method for installing an application provided by the embodiments of the present application will be specifically described in combination with the drawings and application scenarios.

[0108] Before describing the method for installing an application of the embodiments of the present application, first, the terms in the embodiments of the present application are simply introduced.

[0109] 1、Android application package (APK): is a kind of application package file format used by Android operating system, used for distributing and installing mobile applications and middleware. The code of an Android application wants to run on an Android device must be compiled first, and then packaged into a file that can be recognized by the Android system before it can be run, and this file format that can be recognized and run by the Android system is "APK". APK is composed of xml, resource files and dex (binary bytecode) files.

[0110] 2、Blocking call: the current thread is suspended before the call result is returned.

[0111] 3、dexopt thread: used to execute dexopt tasks, dexopt is a process of verifying and optimizing dex files to generate executable odex files. This process can improve application startup and component loading performance.

[0112] 4、dex2oat thread: used to execute dex2oat work tasks, dex2oat is a process of optimizing APK files to generate oat files. oat files are a kind of Android private elf file format, which not only contains native machine instructions translated from dex files, but also contains original dex file contents. For APK, oat files are actually a package of odex files, that is, oat = odex.

[0113] 5、dex2oat work task queue management thread: used to manage the dex2oat work task queue, used to take dex2oat work tasks from the dex2oat work task queue.

[0114] Figure 3 is a schematic diagram of a group of graphical user interfaces (GUIs) provided by an embodiment of the present application. The embodiment of the present application takes the example of a user installing multiple applications on a mobile phone. Among them, (a) to (d) in Figure 3 show the process of the user installing multiple applications at a time.

[0115] Referring to (a) in Figure 3 , the GUI is the desktop 200 of the mobile phone. When the mobile phone detects the user's operation of clicking the icon 210 of the application market on the desktop 200, it can display the GUI as shown in (b) in Figure 3 .

[0116] Referring to (a) in Figure 3(b) in FIG. 1C, which is a GUI of an application market where a user can download various applications, for example, a plurality of applications at a time, and when the phone detects that the user clicks the download controls 220, 230, and 240 in sequence, the phone starts to download the applications, and can display a GUI as shown in Figure 3 (c) in FIG. 1C.

[0117] Referring to Figure 3 (c) in FIG. 1C, the phone can display the progress of the plurality of applications being downloaded on the interface.

[0118] Referring to Figure 3 (d) in FIG. 1C, when the plurality of applications are downloaded and installed, the phone can display icons of the plurality of applications on the desktop 220 of the phone.

[0119] Figure 4 is a flowchart of installing an application provided in an embodiment of the present application. Take an electronic device based on an Android system as an example, the electronic device installs an application through a package installer interface. As shown in Figure 4 , the step includes steps 101 to 107.

[0120] Step 101, an application program layer creates a task.

[0121] In this embodiment, the application installation party creates a task through a package installer session (PIS).

[0122] Step 102, the task is submitted to a PMS in an application framework layer, and the PMS installs the application.

[0123] Step 103, the PMS installs the application.

[0124] In this embodiment, when the PMS installs the application, the PMS copies an APK file of the application from a download directory of the application to a system directory, and scans the APK file, and through the scanning process, the PMS parses the APK file to obtain information such as components and configuration files of the application.

[0125] Step 104, the PMS calls an installd interface of a system layer to perform dexopt to optimize the APK file.

[0126] In this embodiment, the PMS blocks the calling of the installd interface.

[0127] Step 105, the installd calls a dex2oat thread.

[0128] Wherein, installd internally calls the dex2oat thread to perform binary optimization on the APK file during dexopt, so as to improve the application startup speed and component loading performance.

[0129] Step 106, installd sends a message to PMS that the execution of the dex2oat thread is completed.

[0130] Step 107, PMS judges that the dexopt execution is completed, and then sends a message to the application installation party that the App installation is completed.

[0131] In the above application installation process, for a single application installation, the installation process needs to block and wait for the dex2oat optimization process, and the dex2oat optimization process generally takes a long time, for example, the installation time of a typical application WeChat (about 120MB in size) on an electronic device is 14s in total, and the dex2oat optimization process takes about 7s, accounting for about half of the entire application installation time.

[0132] Figure 5 is a time sequence flowchart of PMS internal application installation provided by the embodiment of the present application. As shown in the figure, Figure 5 the flowchart can include steps 201 to 206.

[0133] 201, PMS starts installing App1.

[0134] Wherein, PMS holds the mInstallLock lock when starting to install App1, and the mInstallLock lock is an installation lock protection file, which prevents other application installations when the current application installation is not completed.

[0135] 202, PMS submits the dexopt1 task.

[0136] Wherein, PMS submits the dexopt1 task to the package dex optimizer, and optimizes the APK file of App1.

[0137] 203, the package dex optimizer sends the dexopt1 task to installd.

[0138] Wherein, the process holds the mInstallLock lock again, and the installation lock protection file prevents other dexopt tasks from being performed when the current dexopt task is not completed.

[0139] 204, installd internally calls the dex2oat thread to perform the dex2oat work task to perform binary optimization on the APK file.

[0140] 205, after the dex2oat work task is executed, installd sends a message to PMS that the installation of App1 is completed.

[0141] 206, after receiving the message that the installation of App1 is completed, PMS sends the message to the application installation party.

[0142] 207, PMS starts the installation of App2.

[0143] It should be understood that after the execution of the dex2oat work task is completed, the mInstallLock lock is returned in turn, and during this period, the installation application is blocked and waits, and the installation request of other applications cannot be executed.

[0144] Therefore, during the batch application installation process, due to the existence of the mInstallLock lock, the installation of multiple applications and the dex2oat work task are sequentially and serially performed, resulting in slow multiple application installation process and poor user experience. Therefore, a method for quickly installing applications is needed to improve user experience.

[0145] It should be understood that the process of copying and scanning the APK file by PMS in the embodiments of the present application can be referred to as "upper layer" or "upper layer installation", and the optimization process of dexopt or dex2oat can be referred to as "bottom layer" or "bottom layer optimization".

[0146] As described above, during the batch installation of applications by the electronic device, the upper layer installation process and the bottom layer optimization process of multiple applications are sequentially and serially performed, resulting in slow multiple application installation process and poor user experience.

[0147] The present application provides a method for installing applications, which separates the execution process of the dex2oat work task, i.e., the bottom layer optimization process of the application, from the entire installation process during the batch installation of applications by the electronic device, so as to achieve parallel processing of the upper layer installation of the application and the bottom layer optimization of the application, thereby accelerating the installation speed during the installation of multiple applications and improving user experience.

[0148] Figure 6 is another time sequence flow diagram for installing applications internally provided by the PMS in the embodiments of the present application. As shown in Figure 6 the flow can include steps 201a to 206a.

[0149] 201a, PMS starts to install App1.

[0150] 202a, PMS submits the dex2oat work task of App1 to the optimizer.

[0151] In particular, the PMS submits the dex2oat work task into the dex2oat work task queue, which is managed by a dex2oat work task queue management thread.

[0152] 203a, the PMS sends a message to the application installation party that the installation of App1 is completed.

[0153] It should be understood that the steps 202a and 203a can be performed simultaneously.

[0154] 204a, the PMS starts installing App2.

[0155] 204b, the optimizer calls the installd interface.

[0156] In particular, the dex2oat work task queue management thread is used to take the dex2oat work task out of the queue.

[0157] 205b, after the dex2oat work task corresponding to the App1 is taken out, the installd interface internally calls the dex2oat thread to execute the dex2oat work task.

[0158] It should be understood that the steps 204b and 205b are performed in parallel with the step 204a, and the execution of the steps 204b and 205b does not affect the performance of the step 204a.

[0159] 205a, the PMS submits the dex2oat work task of App2 to the optimizer.

[0160] 206a, the PMS sends a message to the application installation party that the installation of App2 is completed.

[0161] 206b, after the execution of the step 205b is completed, the dex2oat work task management thread takes the dex2oat work task corresponding to App2 out of the queue and calls the installd interface.

[0162] 207b, the installd interface internally calls the dex2oat thread to execute the dex2oat work task corresponding to App2.

[0163] Similarly, the step 207b and the step 208b do not affect the installation of the next application.

[0164] In the embodiments of the present application, the upper-layer installation of the PMS and the lower-layer optimization process of the application are performed in parallel, and compared with the existing serial installation process, the technical solution can improve the installation speed when a batch of applications are installed, and improves the user experience.

[0165] Figure 7is a method flowchart for installing an application provided by an embodiment of the present application. As shown in Figure 7 The method can include steps 301 to 305.

[0166] 301, a user installs an application.

[0167] For example, the user downloads and installs multiple applications in an application market, or restores multiple applications using a clone backup.

[0168] 302, copy the APK file.

[0169] The application installation party copies the APK file to facilitate subsequent installation.

[0170] 303, scan the APK file.

[0171] The PMS scans the APK file to parse the APK file to obtain the components, configuration files, and other information of the application.

[0172] 304, submit a dex2oat work task.

[0173] The PMS calls the installd interface to perform dexopt optimization, and the installd internally calls the dex2oat thread to perform the dex2oat optimization process to optimize the APK file.

[0174] It should be understood that in the process of batch installing applications in the electronic device, each application corresponds to a dex2oat work task. The electronic device can form a queue of dex2oat work tasks corresponding to the applications according to the order of installing the applications. For example, the electronic device installs App1, App2, and App3 in sequence, and their respective dex2oat work tasks are dex2oat1, dex2oat2, and dex2oat3, respectively. The dex2oat work task queue is dex2oat1, dex2oat2, and dex2oat3. During the application installation process, the background dex2oat work task queue management thread takes the dex2oat work tasks from the task queue in sequence, and the installd internally calls the dex2oat thread to perform the dex2oat optimization process, so as not to hinder the execution of the installation process. This process separates the dex2oat work task execution process from the entire application installation process, and performs parallel processing of application installation and dex2oat execution process, so that batch applications can be quickly installed.

[0175] Specifically, this step 304 can include steps 3041 to 3046.

[0176] 3041, start a background dex2oat work task queue management thread.

[0177] The dex2oat work task queue management thread is used to manage the dex2oat work task queue, and the dex2oat work tasks are sequentially taken out from the dex2oat work task queue.

[0178] 3042, waiting for the dex2oat work task queue.

[0179] For example, the electronic device sequentially installs App1, App2, and App3, and the dex2oat work tasks are dex2oat1, dex2oat2, and dex2oat3.

[0180] 3043, if the dex2oat work task idles for a timeout, the dex2oat work task queue management thread is ended.

[0181] The idle timeout can be understood as that the time for which no task in the dex2oat work task queue is executed is greater than a preset value, that is, it can be considered that the dex2oat work tasks in the dex2oat work task queue have all been executed and ended, at which time the system stops the work task queue management thread, which is beneficial to reduce the power consumption of the electronic device.

[0182] 3044, if the dex2oat does not idle, the dex2oat work task is obtained.

[0183] 3045, the dex2oat work task is executed.

[0184] The installd executes the dex2oat work task by calling the dex2oat thread to perform binary optimization on the APK file of the application.

[0185] 3046, the dex2oat work task execution is ended.

[0186] The dex2oat thread compiles the dex file into the oat file format, and the dex2oat work task of the application is ended.

[0187] It should be understood that the above process is the execution process of the dex2oat work task of an application, and after the dex2oat work task of the application is executed, the execution process of the dex2oat work task of the next application is the same as the above steps 3042 to 3046, and will not be repeated.

[0188] It should also be understood that the order of installing the application can be the order in which the electronic device completes downloading the application, or the order according to the preset priority, and the embodiments of the present application do not make specific limitations.

[0189] 305, the installation of the application is completed.

[0190] It should be understood that, in step 305, once the dex2oat work task corresponding to the application is submitted in step 304, it can be considered that the installation of the application is completed, that is, the installation of the next application can be performed, and the dex2oat work task corresponding to the application is transferred to background execution. At this time, the PMS sends a broadcast message to the application installation party that the installation of the application is completed.

[0191] For example, the application currently being installed is App1, and after the dex2oat1 corresponding to App1 is submitted in step 304, it can be considered that the installation of App1 is completed, and the installation of App2 can be performed, and at the same time of installing App2, dex2oat1 is executed in the background.

[0192] Based on the above technical solution, when installing applications in batches on the electronic device, the dex2oat work task corresponding to the application can be separated from the installation process, and the upper-layer application installation and the lower-layer dex2oat optimization process can be processed in parallel, so that the installation speed of the batch application can be accelerated, and the user experience can be improved.

[0193] Figure 8 is a timing diagram for installing an application provided by an embodiment of the present application. As shown in Figure 8 In the prior technical solution, when the electronic device installs applications in batches, the multiple applications are installed in series one by one. For example, before installing App2, the dex2oat work task of App1 must be executed, and similarly, before installing App3, the dex2oat work task of App2 must be executed. Therefore, the batch application installation is slow, which affects the user experience.

[0194] In the embodiment of the present application, as shown in Figure 8 In response to the operation of installing the application program triggered by the user, APK1 corresponding to the first application program (that is, installing App1 in the upper layer) is copied and scanned, APK2 corresponding to the second application program (that is, installing App2 in the upper layer) is copied and scanned within the first time period t1 after copying and scanning APK1 corresponding to the first application program, and the optimization of the first application program is performed within the second time period t2 after copying and scanning APK1 corresponding to the first application program, that is, dex2oat1 is executed within time t2, wherein the first time period t1 and the second time period t2 at least partially overlap.

[0195] As shown in Figure 8 The starting times of the first time period t1 and the second time period t2 are the same, and at this time, dex2oat1 and the upper-layer installation of App2 are performed in parallel, so that the installation speed of the application can be improved, and the user experience can be improved.

[0196] In another example, the start times of t1 and t2 can also be different. For example, the start time of t2 is earlier than the start time of t1, but the time periods of t1 and t2 overlap at least partially. This can also enable the parallel execution of the upper-level installation of App2 and the lower-level optimization of App1, thereby improving the installation speed of multiple applications.

[0197] In one possible implementation, the first optimization task corresponding to App1, namely the dex2oat task, can be added to the first task queue; the first thread can retrieve the first optimization task from the first task queue; and the first interface can be called to start the second thread to execute the first optimization task.

[0198] For example, the first task queue is the dex2oat task queue, the first thread is the dex2oat task queue management thread, the first interface is the installd interface, and the second thread is the dex2oat thread.

[0199] Based on the application installation method provided in this application embodiment, when installing App1 and App2, the time that can be optimized compared to the original application installation method is the sum of the time spent executing dex2oat1 and executing dex2oat2.

[0200] Figure 9 This is a timing diagram illustrating the installation of an application according to an embodiment of this application. In this embodiment, during batch application installation, the following situation may occur: the execution process of dex2oat1 corresponding to App1 takes a long time, such as... Figure 9 As shown in (a), after App1 is installed, App2 begins installation, and the underlying layer begins executing dex2oat1 on App1. After App2 is installed, dex2oat2 is added to the dex2oat task queue. Since dex2oat1 has not yet finished executing, dex2oat2 can only wait in the queue for execution. Then, App3 begins installation. After App3 is installed, dex2oat3 is added to the dex2oat task queue for execution. App4 begins installation. After App4 is installed, dex2oat4 is added to the dex2oat task queue for execution. At this point, dex2oat1 still has not finished executing. Therefore, the result is a backlog of tasks in the dex2oat task queue that are not actually executed. If the electronic device experiences an abnormal situation (e.g., shutdown or restart), some apps may not have executed their corresponding dex2oat tasks. In this case, when the user activates the application, it will start in normal mode.

[0201] It should be understood that dex2oat optimization of the App can improve the startup speed and component loading performance of the App, and the normal mode is not optimized for the App, and the App may be slow to start.

[0202] To address the above-mentioned situations, the embodiments of the present application provide a method that can control the number of backlog tasks in the dex2oat work task queue. As shown in (b) in FIG. 1, Figure 9 The method can include the following steps:

[0203] (1) The upper layer installation of App1 is completed, App2 is installed in the upper layer within a first time period t1 after the upper layer installation of App1 is completed, and optimization of App1 is performed within a second time period t2 after the upper layer installation of App1 is completed.

[0204] For example, the starting times of the first time period t1 and the second time period t2 are the same, that is, the lower layer starts to perform dex2oat1 on App1 at the same time as the upper layer installation of App2.

[0205] (2) App3 is installed in the upper layer within a third time period t3 after the upper layer installation of App1 is completed.

[0206] For example, the upper layer installation of App2 is completed, and dex2oat1 has not been completed, at which time, dex2oat2 corresponding to App2 is added to the waiting queue, and the upper layer starts to install App3.

[0207] (3) Optimization of App2 is performed within a fourth time period t4 after the upper layer installation of App1 is completed.

[0208] For example, dex2oat2 corresponding to App2 is added to the waiting queue and is executed within the fourth time period t4.

[0209] Specifically, the dex2oat work task queue management thread (i.e., the first thread) takes the dex2oat2 out of the queue, the PMS calls the installd interface for execution, and the installd internally starts the dex2oat thread (i.e., the third thread) to execute the dex2oat2.

[0210] (4) App4 is installed in the upper layer within a fifth time period t5 after the upper layer installation of App1 is completed, and when the length of the second time period t2 is greater than the sum of the lengths of the first time period t1 and the third time period t3, the starting time of copying and scanning the fourth application package (i.e., the starting time of t5) is later than or equal to the starting time of performing optimization on the second application (i.e., the time of t4).

[0211] When the length of the second time period t2 is greater than the sum of the lengths of the first time period t1 and the third time period t3, it means that the underlying optimization task of App1 takes a long time, and if not controlled, multiple dex2oat work tasks may be accumulated in the underlying dex2oat work task queue. At this time, the PMS does not send the App3 installation completion broadcast to the application installation party, but waits for the underlying dex2oat1 to execute. At the same time when the underlying dex2oat1 executes, the dex2oat2 starts to execute, and at this time, the dex2oat3 corresponding to App3 is added to the dex2oat waiting queue, so that the dex2oat work task queue waits to execute is dex2oat3. At this time, the PMS sends the App3 installation completion message to the application installation party, and the upper layer starts to continue to install App4. At this time, the starting time of the optimization of App2 is equal to the starting time of the copying and scanning of App4, that is, the upper layer installs App4 and the underlying executes dex2oat2 at the same time.

[0212] It should be understood that the installation of subsequent more applications can refer to the above installation process, which will not be described in detail.

[0213] It should be understood that the above process is described by taking one dex2oat work task accumulated in the dex2oat work task queue as an example, but the embodiments of the present application are not limited thereto. The number of dex2oat work tasks accumulated in the dex2oat work task queue in the embodiments of the present application can also be two, three or more.

[0214] Based on the above technical solution, when installing a batch of applications, when the dex2oat execution process of a certain application takes a long time, the scheme can avoid too many dex2oat work tasks accumulated in the dex2oat work task queue.

[0215] Figure 10 is a method flow diagram provided by an embodiment of the present application for installing an application. The method can include steps 401 to 408.

[0216] 401, the user installs an application.

[0217] 402, copy the APK file.

[0218] 403, scan the APK file.

[0219] It should be understood that the above steps 401 to 403 can refer to the foregoing description, and will not be described in detail for brevity.

[0220] 404, submit a dex2oat work task.

[0221] PMS calls the installd interface to perform dexopt optimization, while installd internally calls the dex2oat thread to perform the dex2oat optimization process.

[0222] 405, Parallelize dex2oat worker tasks.

[0223] As mentioned above, the application installation method in this application embodiment allows for parallel processing of the upper-layer App installation and the lower-layer dex2oat task execution, thereby accelerating the application installation speed.

[0224] 406. If the dex2oat worker task waiting queue is not empty, then the blocking waiting queue will be cleared.

[0225] It should be understood that the dex2oat job waiting queue represents a queue of dex2oat jobs waiting to be executed, in addition to the currently executing dex2oat job.

[0226] During the application installation process, when the upper-layer app installation and the lower-layer dex2oat job tasks are processed in parallel, if the current dex2oat job task waiting queue is not empty, it means that the current dex2oat job task has not yet been completed. At this time, PMS will block and wait for the dex2oat job task to be completed before notifying the application installer that the application installation is complete.

[0227] For example, refer to Figure 9 In scenario (b), when the upper layer installs App3, and PMS submits dex2oat3, dex2oat1 has not yet finished executing. At this time, dex2oat2 is still waiting to be executed in the dex2oat task queue. Therefore, PMS does not send a message indicating that App3 has been installed to the application installer, but instead blocks and waits for dex2oat1 to finish executing. After dex2oat1 finishes executing, dex2oat2 begins execution, and the waiting queue is empty at this point.

[0228] 407. If the dex2oat job waiting queue is empty, submit the dex2oat job.

[0229] If the dex2oat job queue is empty, it means that there are no dex2oat jobs waiting to be executed in the dex2oat job queue. At this time, you can submit the dex2oat job for the application to the dex2oat job queue, that is, add the dex2oat job corresponding to the application to the dex2oat job waiting queue.

[0230] In one example, the dex2oat work task queue is not empty in step 406, and the PMS blocks and waits for the queue to be emptied. After the queue is emptied, the PMS submits the dex2oat work task of the application to the task queue. For example, referring to FIG. 6, after the dex2oat1 execution is completed, the dex2oat2 execution is started. At this time, the dex2oat waiting queue is empty, the PMS sends the App3 installation completion broadcast to the application installer, and the dex2oat3 corresponding to the App3 is added to the dex2oat waiting queue to wait for execution. Figure 9

[0231] In another example, the upper layer installs the App3, and the lower layer is executing the dex2oat2. At this time, there is no dex2oat work task waiting for execution in the dex2oat work queue, and the dex2oat3 is added to the dex2oat work task queue to wait for execution.

[0232] 408, the application installation is completed.

[0233] After the dex2oat work task of the current installation App is submitted to the dex2oat work task queue, the PMS sends the App installation completion broadcast to the application installer.

[0234] It should be understood that at this time, although the PMS sends the App installation completion broadcast to the application installer, the dex2oat work task corresponding to the App is still executed in the background or waits for execution.

[0235] Based on the above technical solutions, when a plurality of applications are installed, the scheme can avoid too many dex2oat work tasks in the dex2oat work task queue.

[0236] During the batch application installation process, the dex2oat work task of the application is executed in the local system of the electronic device. Since the dex2oat execution process is a high-computing process, there is relatively high power consumption, which causes the temperature of the electronic device to rise in a short time, thereby possibly affecting the stability of the electronic device. Therefore, the present application embodiment provides a temperature control strategy method to improve the above problems.

[0237] Figure 11 is a timing flow diagram of a method of an installation application temperature control strategy provided by the present application embodiment. As shown in FIG. 7, the method includes the following steps. Figure 11 ​As shown, the upper layer of the electronic device installs App1, the lower layer starts to execute dex2oat1, and the upper layer starts to install App2. When preparing to submit dex2oat2, that is, at T1, the temperature of the electronic device is monitored. The temperature can be the temperature of the entire electronic device or the temperature of the central processing unit (CPU) of the electronic device.

[0238] For example, a threshold range of the temperature can be set in advance. When the temperature is greater than a first threshold, it is considered that the temperature of the electronic device is abnormal, and when the temperature is less than or equal to the first threshold, it is considered that the temperature of the electronic device is normal. For example, the first threshold can be any value between 35 degrees and 40 degrees.

[0239] If the temperature of the electronic device is detected to be abnormal at T1, a first execution duration (that is, a fourth time period) is determined. The first execution duration is used to represent the duration for which the electronic device continuously executes the dex2oat work task. The first execution duration can be used to determine whether the dex2oat work task has been executed for a long time. If the dex2oat work task has been executed for a long time, the PMS does not send the App2 installation completion broadcast to the application installation party, and triggers to stop the dex2oat work task, that is, suspends the dex2oat work task queue management thread for a first preset duration, that is, suspends the scheduling of the dex2oat work task for the first preset duration. In other words, App3 is copied and scanned after the first preset duration. It should be noted that the execution process of the current dex2oat work task is not stopped immediately, but the dex2oat2 execution of App2 is completed before the dex2oat work task is stopped, as shown in T2 in FIG. 7. Figure 11 Because the scanning and dex2oat optimization process of the App is an installation process, it is tried to avoid separation and to avoid the problem of insufficient stability.

[0240] Alternatively, when the temperature of the electronic device is detected to be abnormal at T1, the dex2oat work task can be triggered to be stopped, that is, the dex2oat work task queue management thread is suspended for a first preset duration. Similarly, the dex2oat work task is stopped after the dex2oat2 execution of App2 is completed.

[0241] It should be understood that the temperature monitoring in the embodiments of the present application can be realized by a temperature sensor or other sensors with temperature monitoring function, and the embodiments of the present application do not make specific limitation thereto.

[0242] It should be understood that in the embodiments of the present application, whether the current dex2oat optimization process has been executed for a long time can be determined by counting the execution time of the current dex2oat optimization process. For example, if the execution time of the current dex2oat optimization process is greater than a preset value, it can be considered that the current dex2oat optimization process has been executed for a long time. The process of determining whether the current dex2oat optimization process has been executed for a long time will be described in detail below in conjunction with specific embodiments, which will not be described here in detail.

[0243] At time T2, the dex2oat work task queue management thread is triggered to stop and rest for a period of time until time T3. The rest time interval can be a preset time length, for example, 5s or 10s or other values.

[0244] At time T3, the dex2oat work task has been suspended for a period of time t, the PMS sends an App2 installation end broadcast to the application installation party, and starts to install App3.

[0245] At time T4, the upper-layer installation of App3 is completed, and the lower-layer starts to execute dex2oat3.

[0246] It can be seen that from the time T2 when the dex2oat work task is triggered to stop to the time T4 when the dex2oat3 is started to execute, the rest time of the dex2oat work task is actually from T2 to T4, thereby effectively reducing the heating problem of the electronic device in the batch installation of applications in a short period of time.

[0247] It should be understood that the installation of more subsequent applications can refer to the above-mentioned times T1 to T4, and for the sake of brevity, will not be described here.

[0248] The following will be described in conjunction with Figure 12 The method for counting the execution time of the dex2oat work task in the embodiments of the present application.

[0249] Figure 12 is a flowchart of a process for counting the working time of the dex2oat work task provided by the embodiments of the present application. As Figure 12 shown, the method can include steps 501 to 509.

[0250] Step 501, a user installs an application.

[0251] Step 502, a dex2oat work task is submitted.

[0252] Step 503, the dex2oat work task starts to execute, and the time T1 is recorded.

[0253] Step 504, the dex2oat work task is executed, and the time T2 is recorded.

[0254] Step 505, record the dex2oat execution time of this time: dT = T2 - T1.

[0255] Step 506, calculate the time interval between the dex2oat task of this time and the dex2oat task of last time: AT = T1 - LT2.

[0256] Wherein, AT represents the time interval between the dex2oat task of this time and the dex2oat task of last time, and LT2 represents the time when the dex2oat task of last time is executed and completed.

[0257] Step 507, if AT ≤ MIN_INTER, the working time WT of dex2oat is the sum of the working time of this dex2oat and the working time of last dex2oat.

[0258] Wherein, WT represents the working time of dex2oat, and MIN_INTER represents the minimum time interval. It should be understood that the minimum time interval can be a pre-set value, for example, the minimum time interval can be 20s or 30s or other values.

[0259] If the time interval AT between the dex2oat task of this time and the dex2oat task of last time is less than or equal to the minimum time interval MIN_INTER of dex2oat, the dex2oat working time is accumulated.

[0260] Exemplarily, as shown in the figure, Figure 11 In the fifth time period t5 before copying and scanning the first application App1, the underlying optimization dex2oat0 of the fourth application App0 is executed, if at T1, the interval between the fifth time period t5 of executing dex2oat0 and the second time period of executing dex2oat1 is less than or equal to the minimum time interval (i.e. the third preset time length), then the working time WT of dex2oat (i.e. the fourth time period) is the sum of the time length of the fifth time period t5 and the second time period t2.

[0261] Step 508, if AT > MIN_INTER, the working time of dex2oat: WT = dT.

[0262] If the time interval AT between the dex2oat task of this time and the dex2oat task of last time is greater than the minimum time interval MIN_INTER of dex2oat, the execution time dT of this dex2oat is taken as the working time of dex2oat.

[0263] Exemplarily, as shown in the figure, Figure 11At the T1 moment shown, if the interval between the fifth time period t5 and the second time period t2 is greater than the third preset time length, the working time WT (the fourth time period) of dex2oat is the execution time of dex2oat1, that is, the first time period t1.

[0264] Step 509, LT2 = T2.

[0265] At the start of the next dex2oat working task, the time at which the current dex2oat working task is executed is taken as LT2.

[0266] It should be understood that the statistics of the working time of the next dex2oat working task or multiple dex2oat working tasks can refer to the above steps, and for the sake of brevity, will not be repeated.

[0267] The following will be described in combination with Figure 13 The method for optimizing the temperature control strategy of the embodiment of the present application.

[0268] Figure 13 is a temperature control strategy optimization process schematic diagram provided by the embodiment of the present application. As Figure 13 shown, the method can include steps 601 to 606.

[0269] Step 601, install App2.

[0270] It should be understood that before this step 601, the upper layer has installed App1, and the installation of App2 by the upper layer and the execution of the dex2oat working task by the bottom layer in this step are performed in parallel.

[0271] Step 602, submit a dex2oat working task.

[0272] Step 603, the system reads temperature information Temp according to the temperature monitoring result.

[0273] Among them, the system can monitor the temperature of the electronic device according to the temperature sensor, and the temperature can be the whole machine temperature of the electronic device or the temperature of the CPU.

[0274] Step 604, according to the temperature monitoring result in step 603, if the temperature Temp of the electronic device at this time is greater than MIN_TEMP, and the dex2oat working time WT is greater than MAX_WT, trigger the dex2oat working task to be suspended.

[0275] Wherein, MIN TEMP represents a threshold temperature, which is a critical temperature for determining whether the temperature of the electronic device is abnormal when installing an application, and MAX WT represents the longest working time. The value of MIN TEMP and the value of MAX WT can be achieved by system preset. As described above, the MIN TEMP can be any value between 35 degrees and 40 degrees, and the MAX WT can be any value between 20s and 30s.

[0276] It should be understood that the WT in the embodiments of the present application can obtain the working time of the dex2oat work task by the method of Figure 10

[0277] In step 604, although the dex2oat work task is triggered to stop, in order to avoid the stability problem in the application installation process, the dex2oat work task currently being executed is not stopped immediately, but the dex2oat2 of App2 is executed to completion before the dex2oat work task is stopped, as described above.

[0278] Step 605, dex2oat2 execution is completed.

[0279] After the dex2oat2 execution is completed, the dex2oat work task will stop for a period of time to avoid the problem of insufficient stability of the electronic device due to excessive temperature.

[0280] Step 606, WT zero processing.

[0281] When the dex2oat work task is triggered to stop, the working time WT of dex2oat is set to zero to facilitate the statistics of the working time of dex2oat in the next cycle.

[0282] Based on the above technical method, when installing a batch of applications, since there is more power consumption in the execution process of the dex2oat work task, the temperature control strategy optimization method in the embodiments of the present application can avoid the problem of insufficient stability of the electronic device due to excessive temperature.

[0283] Figure 14 is an exemplary flowchart of a method for installing an application provided by the embodiments of the present application. As Figure 14 shown, the method can include steps 710 to 740.

[0284] 710, the electronic device detects that the user triggers the operation of installing an application program.

[0285] For example, the user downloads and installs multiple applications at a time in the application market, or the user uses the electronic device to clone and restore multiple applications, clones multiple applications from one device to another device, etc.​

[0286] 720, in response to the operation, copying and scanning the first application package, the first application package being the application package corresponding to the first application.

[0287] The electronic device copies and scans the first application package in response to the operation of the user, that is, the electronic device installs the first application at the upper layer.

[0288] 730, within a first time period after copying and scanning the first application package, copying and scanning a second application package, the second application package being the application package corresponding to the second application;

[0289] The first time period can start immediately after the electronic device scans and copies the first application package, or can start after a period of time after the electronic device scans and copies the first application package.

[0290] 740, within a second time period after copying and scanning the first application package, performing optimization on the first application; wherein the first time period and the second time period at least partially overlap.

[0291] Optionally, the start times of the first time period and the second time period are the same, that is, the upper-layer installation of the second application and the bottom-layer optimization of the first application are performed simultaneously.

[0292] Optionally, the start times of the first time period and the second time period are different, for example, the start time of the first time period is later than the start time of the second time period, and at this time, the upper-layer installation of the first application and the second application on the electronic device is interval for a period of time, which is beneficial to reduce the heat phenomenon of the electronic device.

[0293] The above embodiments take the installation of two applications on the electronic device as an example for illustration, but this should not limit the present application in any way, and it should be understood that the installation process of more applications can refer to the above process.

[0294] The method for installing applications based on the embodiments of the present application performs the upper-layer installation process and the bottom-layer optimization process of the applications in parallel, which is beneficial to speed up the installation speed when the electronic device installs multiple applications, thereby improving the user experience.

[0295] It can be understood that, in order to achieve the above functions, the electronic device comprises hardware and / or software modules corresponding to the respective functions. The algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in hardware or a combination of hardware and computer software. Whether a certain function is implemented in 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 in conjunction with the embodiments, but such implementation should not be considered beyond the scope of the present application.

[0296] The embodiments can divide the functional modules of the electronic device according to the above method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The integrated module can be implemented in the form of hardware. It should be noted that the division of modules in the embodiments is illustrative and is only a logical functional division. Actual implementation can have another division manner.

[0297] The embodiments also provide a computer readable storage medium having computer instructions stored therein, and when the computer instructions run on an electronic device, the electronic device executes the above related method steps to implement the application installation method in the above embodiments.

[0298] The embodiments also provide a computer program product, which, when running on a computer, causes the computer to execute the above related steps to implement the application installation method in the above embodiments.

[0299] In addition, the embodiments of the present application also provide a device, which can be a chip, a component or a module. The device can include a processor and a memory connected to each other. The memory is used to store computer execution instructions. When the device is running, the processor can execute the computer execution instructions stored in the memory to enable the chip to execute the application installation method in the above method embodiments.

[0300] The electronic device, computer readable storage medium, computer program product or chip provided by the embodiments can be used to execute the corresponding methods provided above, and thus the beneficial effects achieved thereby can refer to those of the corresponding methods provided above, which will not be described here again.

[0301] Through the above description of the embodiments, those skilled in the art can understand that, for the convenience and brevity of description, only the above division of functional modules is exemplified. In actual application, the above functions can be completed by different functional modules according to needs, i.e. the internal structure of the device is divided into different functional modules to complete all or part of the above described functions.

[0302] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other manners. For example, the division of the apparatus embodiments is merely illustrative, and for example, the division of the modules or units can not mean physical division, and for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.

[0303] The units described as separate components may or can not be physically separate, and the components shown as units can be one physical unit or multiple physical units, i.e., can be located in one place, or can be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.

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

[0305] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the technical solutions of the embodiments of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The software product is stored in a storage medium, and includes a number of instructions for causing an apparatus (which can be a single-chip microcomputer, a chip, etc.) or a processor to perform all or part of the steps of the various embodiments of the method of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0306] The above is merely specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method of installing an application, characterized by, The method is applied to an electronic device, and the method comprises: detecting that a user triggers an operation of installing a first application and a second application; in response to the operation, copying and scanning a first application package, the first application package being an application package corresponding to the first application; within a first time period after the copying and scanning of the first application package, copying and scanning a second application package, the second application package being an application package corresponding to the second application; within a second time period after the copying and scanning of the first application package, performing optimization on the first application; wherein the first time period and the second time period at least partially overlap.

2. The method of claim 1, wherein, The method further comprises: detecting that a user triggers an operation of installing a third application and a fourth application; within a third time period after the copying and scanning of the first application package, copying and scanning a third application package, the third application package being an application package corresponding to the third application; wherein when a length of the second time period is greater than a sum of lengths of the first time period and the third time period, a starting time of copying and scanning the fourth application package is later than or equal to a starting time of performing optimization on the second application.

3. The method of claim 1, wherein, The method further comprises: detecting that a user triggers an operation of installing a third application; when the copying and scanning of the second application package is completed, detecting a temperature of a central processing unit (CPU) of the electronic device; determining that the temperature is greater than or equal to a preset value; when the optimization of the second application ends, pausing for a first preset time period; after the first preset time period, copying and scanning a third application package, the third application package being an application package corresponding to the third application.

4. The method of claim 3, wherein, Before the performing of the optimization on the first application, performing optimization on a fourth application, the determining that the temperature is greater than or equal to a preset value comprises: determining that the temperature is greater than or equal to a preset value and a length of a fourth time period is greater than or equal to a second preset time period; wherein the fourth time period and the second time period are the same; or when a time interval between the second time period and a fifth time period is less than or equal to a third preset time period, the fourth time period is a sum of the second time period and the fifth time period, and the fifth time period is a time period during which the electronic device performs the optimization on the fourth application.

5. The method according to any one of claims 1 to 4, characterized in that, The performing of the optimization on the first application comprises: adding a first optimization task to a first task queue, the first optimization task being used to optimize the first application; starting a first thread, the first thread being used to take the first optimization task out of the first task queue; calling a first interface, the first interface being used to start a second thread, the second thread being used to execute the first optimization task.

6. An electronic device, comprising: comprise: one or more processors; one or more memories; the one or more memories store one or more computer programs, the one or more computer programs comprising instructions that, when executed by the one or more processors, cause the electronic device to perform the following steps: detecting that a user triggers an operation of installing a first application and a second application; in response to the operation, copying and scanning a first application package, the first application package being an application package corresponding to the first application; in a first time period after the copying and scanning of the first application package, copying and scanning a second application package, the second application package being an application package corresponding to the second application; in a second time period after the copying and scanning of the first application package, performing optimization on the first application; wherein the first time period and the second time period at least partially overlap.

7. The electronic device of claim 6, wherein, When the instructions are executed by the one or more processors, the electronic device performs the following steps: detecting that a user triggers an operation of installing a third application and a fourth application; in a third time period after the copying and scanning of the first application package, copying and scanning a third application package, the third application package being an application package corresponding to the third application; wherein, when the length of the second time period is greater than the sum of the lengths of the first time period and the third time period, the starting time of copying and scanning the fourth application package is later than or equal to the starting time of performing optimization on the second application.

8. The electronic device of claim 6, wherein, When the instructions are executed by the one or more processors, the electronic device performs the following steps: detecting that a user triggers an operation of installing a third application; when the copying and scanning of the second application package is completed, detecting the temperature of the CPU of the electronic device; determining that the temperature is greater than or equal to a preset value; when the optimization of the second application ends, pausing for a first preset time period; after the first preset time period, copying and scanning a third application package, the third application package being an application package corresponding to the third application.

9. The electronic device of claim 8, wherein, Before the optimization of the first application is performed, the optimization of a fourth application is performed, and the electronic device is specifically configured to: determine that the temperature is greater than or equal to a preset value and the length of a fourth time period is greater than or equal to a second preset time period; wherein the fourth time period and the second time period are the same; or when the time interval between the second time period and a fifth time period is less than or equal to a third preset time period, the fourth time period is the sum of the second time period and the fifth time period, and the fifth time period is a time period during which the electronic device performs optimization on the fourth application.

10. The electronic device of any of claims 6-9, wherein, The electronic device is specifically configured to: add a first optimization task to a first task queue, the first optimization task being used to optimize the first application; start a first thread, the first thread being used to take the first optimization task out of the first task queue; call a first interface, the first interface being used to start a second thread, the second thread being used to execute the first optimization task.

11. A computer readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, when the computer instructions run on the electronic device, the electronic device performs the method of installing an application as claimed in any one of claims 1 to 5.

12. A computer program product, characterised in that, When the computer program product is run on a computer, it causes the computer to perform the method of installing an application as claimed in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method for optimizing startup application installation time based on Android system

    CN106708507A

  • Method and device for system application installation package, and terminal

    US20160378458A1

  • Setup procedures for an electronic device

    US20190373320A1