WO2024046237A1 - Application hot start method and electronic device - Google Patents
Application hot start method and electronic device Download PDFInfo
- Publication number
- WO2024046237A1 WO2024046237A1 PCT/CN2023/115081 CN2023115081W WO2024046237A1 WO 2024046237 A1 WO2024046237 A1 WO 2024046237A1 CN 2023115081 W CN2023115081 W CN 2023115081W WO 2024046237 A1 WO2024046237 A1 WO 2024046237A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- interface
- application
- electronic device
- transparent
- mobile phone
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 92
- 230000000694 effects Effects 0.000 claims description 48
- 230000015654 memory Effects 0.000 claims description 34
- 230000006870 function Effects 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 17
- 238000003860 storage Methods 0.000 claims description 9
- 230000004044 response Effects 0.000 claims description 3
- 230000001960 triggered effect Effects 0.000 claims description 2
- 230000008569 process Effects 0.000 abstract description 38
- 238000004904 shortening Methods 0.000 abstract description 2
- 238000004891 communication Methods 0.000 description 20
- 238000007726 management method Methods 0.000 description 14
- 238000012545 processing Methods 0.000 description 13
- 238000010586 diagram Methods 0.000 description 12
- 238000005516 engineering process Methods 0.000 description 12
- 238000010295 mobile communication Methods 0.000 description 11
- 210000000988 bone and bone Anatomy 0.000 description 5
- 229920001621 AMOLED Polymers 0.000 description 4
- 238000013461 design Methods 0.000 description 4
- 230000001133 acceleration Effects 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 230000000007 visual effect Effects 0.000 description 3
- 239000011230 binding agent Substances 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 239000010985 leather Substances 0.000 description 2
- 238000003825 pressing Methods 0.000 description 2
- 230000005855 radiation Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 239000008186 active pharmaceutical agent Substances 0.000 description 1
- 230000003321 amplification Effects 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000003416 augmentation Effects 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 238000010009 beating Methods 0.000 description 1
- 230000036772 blood pressure Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000003199 nucleic acid amplification method Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000002096 quantum dot Substances 0.000 description 1
- 239000004984 smart glass Substances 0.000 description 1
- 230000003238 somatosensory effect Effects 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
- 230000001755 vocal effect Effects 0.000 description 1
- 238000010792 warming Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44568—Immediately runnable code
- G06F9/44578—Preparing or optimising for loading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Definitions
- the present application relates to the field of terminal technology, and in particular to an application hot start method and electronic equipment.
- the startup of the application is a hot start.
- This application provides an application hot start method and electronic equipment to solve the problem of slow application hot start.
- this application provides a method for applying hot start, which method can be applied to electronic equipment.
- the method includes: the electronic device detects a first operation of starting a first application, and the first application is a background application. Then, in response to the first operation, and when it is determined that the first interface is a transparent interface, the target activity of the first application is directly started. Finally, the electronic device can draw a second interface corresponding to the target activity and start the first application.
- the first operation includes any one of the following operations: a click operation on the application icon of the first application; a click operation on the window of the first application in a multi-tasking window; and a voice-triggered operation.
- the interface corresponding to the target can be directly drawn, which can shorten the application hot start time and improve the application hot start efficiency.
- determining that the first interface is a transparent interface includes: the electronic device obtains an interface transparency parameter of the first interface, and then determines that the first interface is a transparent interface based on the interface transparency parameter.
- the electronic device can determine whether the interface is a transparent interface based on the interface transparency parameter, and then directly draw the target interface when it is determined that the interface is a transparent interface, thereby shortening the application hot start time.
- the electronic device determines that the first interface is a transparent interface according to the interface transparency parameter, including:
- the electronic device determines that the interface transparency parameter is less than or equal to the transparency threshold, it determines that the first interface is a transparent interface.
- the interface transparency parameter of the first interface can be compared with the transparency threshold, thereby determining whether the first interface is a transparent interface.
- the electronic device obtaining the interface transparency parameter of the first interface includes: the electronic device determines the transparency parameter of the first interface according to the setAlpha() function.
- the method before starting the target activity of the first application, the method further includes: the electronic device skips creation of the first interface.
- the application when the application detects a transparent interface during the hot start process, it can skip the creation of the transparent interface and directly start the target activity. This can reduce the creation time of the transparent interface, shorten the application hot start time, and improve the application Hot start efficiency.
- the method before the electronic device detects the first operation, the method further includes:
- the electronic device displays a second interface of the first application, where the second interface is the interface displayed before the first application is switched to background running. Then, when detecting the second operation of switching the first application to the background, the electronic device responds to the second operation and switches the first application from the foreground to the background.
- the second operation includes any one of the following operations: switching from the first application to the second application; and returning to the main interface.
- the first application can be switched from running in the foreground to running in the background, so that when the first operation is detected, the hot start process of the first application can be started.
- the present application provides an electronic device, which includes a display screen; one or more processors; one or more memories; one or more sensors; multiple applications; and one or more computer programs ; wherein the one or more computer programs are stored in the one or more memories, the one or more computer programs include instructions, and when the instructions are called and executed by the one or more processors,
- the electronic device is caused to perform the above-mentioned first aspect and any possible designed method of the first aspect thereof.
- the present application also provides an electronic device, which includes modules/units that perform the method of the first aspect or any possible design of the first aspect; these modules/units can be implemented by hardware, or can The corresponding software implementation is executed through hardware.
- the present application also provides a computer-readable storage medium in which instructions are stored.
- the electronic device When the instructions are run on an electronic device, the electronic device causes the electronic device to execute the first aspect and the method thereof.
- any possible design applies the hot start method.
- the present application also provides a computer program product.
- the computer program product When the computer program product is run on an electronic device, it causes the electronic device to execute the first aspect of the embodiment of the present application and any possible design of the first aspect. Apply the warm start method.
- Figure 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
- Figure 2 is a software structure block diagram provided by an embodiment of the present application.
- Figure 3 is a flow chart of an application hot start method provided by an embodiment of the present application.
- Figure 4 is a flow chart of another application hot start method provided by the embodiment of the present application.
- FIG. 5 is a schematic structural diagram of another electronic device provided by an embodiment of the present application.
- Application referred to as application, it is a software program that can realize one or more specific functions.
- multiple applications can be installed in an electronic device.
- camera applications text messaging applications, email applications, video applications, music applications, etc.
- the applications mentioned below may be applications installed when the electronic device leaves the factory, or may be applications downloaded from the Internet or obtained by the user from other electronic devices during the use of the electronic device.
- Application hot start When an application has been opened, the application will generally run in the foreground. When the user returns to the desktop or switches to other programs by pressing the return key, home key, swiping up, etc., the application switches to a background application. When the user reopens the application, there is already a process for the application in the background. At this time, the application can be started from the existing process. The application switches from a background application to a foreground application. This startup method is called a hot start.
- Foreground applications and background applications Depending on whether the application can directly interact with the user, applications can be divided into: foreground applications and background applications. Among them, the foreground application is an application placed in the foreground by the user and can be directly interacted with, and the background application is an application placed in the background by the user and cannot be directly interacted with. In this embodiment of the present application, it can be determined whether the application is a foreground application or a background application based on whether the application is directly visible.
- the application When the application is visible, it is a foreground application, and when the application is not visible, it is a background application.
- the application when the interface of the application is displayed on the screen of the electronic device, the application is a foreground application; when the interface of the application is not displayed on the screen of the electronic device, the application is a background application.
- the application interface does not include the top status bar and notification bar of the operating system.
- Activity A component in system components, an application component that provides a screen with which users can interact in order to complete a task. in a In an application, an Activity is usually a separate screen, which can display some controls and can also listen to and process user events to respond.
- the application hot start method provided by the embodiment of the present application can be applied to any electronic device with a display screen, such as mobile phones, tablet computers, wearable devices (for example, watches, bracelets, smart helmets, smart glasses, etc. ), vehicle-mounted equipment, augmented reality (AR)/virtual reality (VR) equipment, notebook computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants , PDA), etc., are not limited by the embodiments of this application.
- exemplary embodiments of electronic devices include, but are not limited to, equipped with Harmony Or other electronic devices with operating systems.
- the mobile phone 100 may 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, and a battery 142.
- SIM subscriber identification module
- the sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air 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, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
- the processor 110 may include one or more processing units.
- the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) wait.
- different processing units can be independent devices or integrated in one or more processors.
- the controller may be the nerve center and command center of the mobile phone 100 .
- the controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
- the processor 110 may also be provided with a memory for storing instructions and data.
- the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
- the USB interface 130 is an interface that complies with the USB standard specification, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
- the USB interface 130 can be used to connect a charger to charge the mobile phone 100, and can also be used to transmit data between the mobile phone 100 and peripheral devices.
- the charging management module 140 is used to receive charging input from the charger.
- the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
- the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, wireless communication module 160, etc.
- the wireless communication function of the mobile phone 100 can be realized through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
- Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
- Each antenna in mobile phone 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be reused as a diversity antenna for a wireless LAN. In other embodiments, antennas may be used in conjunction with tuning switches.
- the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the mobile phone 100.
- the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
- the mobile communication module 150 can receive electromagnetic waves through the antenna 1, perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation.
- the mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 1 for radiation.
- at least part of the functional modules of the mobile communication module 150 may be disposed in the processor 110 .
- at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
- the wireless communication module 160 can provide applications on the mobile phone 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (bluetooth, BT), and global navigation satellite system. (global navigation satellite system, GNSS), frequency modulation (FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
- WLAN wireless local area networks
- BT Bluetooth
- GNSS global navigation satellite system
- FM frequency modulation
- NFC near field communication technology
- infrared technology infrared, IR
- the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
- the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
- the wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for
- the antenna 1 of the mobile phone 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology.
- the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), Long term evolution (LTE), the fifth generation (5G) mobile communication system, future communication systems, such as the sixth generation (6th generation, 6G) system, etc., BT, GNSS, WLAN, NFC, FM and/or IR technology, etc.
- GSM global system for mobile communications
- GPRS general packet radio service
- CDMA code division multiple access
- WCDMA broadband Code division multiple access
- WCDMA wideband code division multiple access
- TD-SCDMA time division code division multiple access
- LTE Long term evolution
- the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
- GPS global positioning system
- GLONASS global navigation satellite system
- BDS Beidou navigation satellite system
- QZSS quasi-zenith satellite system
- SBAS satellite based augmentation systems
- the display screen 194 is used to display the display interface of the application, etc.
- Display 194 includes a display panel.
- the display panel can use a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode).
- LED organic light-emitting diode
- AMOLED organic light-emitting diode
- FLED flexible light-emitting diode
- Miniled MicroLed, Micro-oLed, quantum dot light emitting diode (QLED), etc.
- the mobile phone 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
- the display screen 194 can be used to display an application interface.
- Camera 193 is used to capture still images or video.
- the camera 193 may include a front camera and a rear camera.
- Internal memory 121 may be used to store computer executable program code, which includes instructions.
- the processor 110 executes instructions stored in the internal memory 121 to execute various functional applications and data processing of the mobile phone 100 .
- the internal memory 121 may include a program storage area and a data storage area.
- the stored program area can store the operating system and the software code of at least one application program (such as iQiyi application, WeChat application, etc.).
- the storage data area can store data (such as images, videos, etc.) generated during the use of the mobile phone 100.
- the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
- 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 mobile phone 100.
- the external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, save pictures, videos, etc. files on an external memory card.
- the mobile phone 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playback, recording, etc.
- the pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals.
- pressure sensor 180A may be disposed on display screen 194 .
- the gyro sensor 180B can be used to determine the movement posture of the mobile phone 100 .
- the angular velocity of the phone 100 about three axes ie, x, y, and z axes
- the gyro sensor 180B can be used to determine the movement posture of the mobile phone 100 .
- the angular velocity of the phone 100 about three axes may be determined by the gyro sensor 180B.
- the gyro sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyro sensor 180B detects the angle at which the mobile phone 100 shakes, and calculates the distance that the lens module needs to compensate based on the angle, so that the lens can offset the shake of the mobile phone 100 through reverse movement to achieve anti-shake.
- the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
- Air pressure sensor 180C is used to measure air pressure.
- the mobile phone 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
- Magnetic sensor 180D includes a Hall sensor.
- the mobile phone 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case.
- the mobile phone 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Then, based on the detected opening and closing status of the leather case or the opening and closing status of the flip cover, features such as automatic unlocking of the flip cover are set.
- the acceleration sensor 180E can detect the acceleration of the mobile phone 100 in various directions (generally three axes). When the mobile phone 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices and be used in horizontal and vertical screen switching, pedometer and other applications.
- the mobile phone 100 can measure distance via infrared or laser. In some embodiments, when shooting a scene, the mobile phone 100 can use the distance sensor 180F to measure distance to achieve fast focusing.
- Proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode.
- the light emitting diode may be an infrared light emitting diode.
- the mobile phone 100 emits infrared light through the light emitting diode.
- Cell phone 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the mobile phone 100 .
- the mobile phone 100 can determine that there is no object near the mobile phone 100 .
- the mobile phone 100 can use the proximity light sensor 180G to detect when the user is holding the mobile phone 100 close to the ear for talking, so as to automatically turn off the screen to save power.
- the proximity light sensor 180G can also be used in holster mode, and pocket mode automatically unlocks and locks the screen.
- the ambient light sensor 180L is used to sense ambient light brightness.
- the mobile phone 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
- the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
- the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the mobile phone 100 is in the pocket to prevent accidental touching.
- Fingerprint sensor 180H is used to collect fingerprints. Mobile 100 You can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application lock, fingerprint photo taking, fingerprint answering incoming calls, etc.
- Temperature sensor 180J is used to detect temperature.
- the mobile phone 100 uses the temperature detected by the temperature sensor 180J to execute the temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the mobile phone 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the mobile phone 100 heats the battery 142 to prevent the low temperature from causing the mobile phone 100 to shut down abnormally. In some other embodiments, when the temperature is lower than another threshold, the mobile phone 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
- Touch sensor 180K also called “touch panel”.
- the touch sensor 180K can be disposed on the display screen 194.
- the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen”.
- the touch sensor 180K is used to detect a touch operation on or near the touch sensor 180K.
- the touch sensor can pass the detected touch operation to the application processor to determine the touch event type.
- Visual output related to the touch operation may be provided through display screen 194 .
- the touch sensor 180K may also be disposed on the surface of the mobile phone 100 in a position different from that of the display screen 194 .
- the touch sensor 180K can detect the user's touch operation on the display screen, for example, it can detect the user's click operation on the application icon on the display screen 194, and then the mobile phone 100 can respond to the click operation to open the application. .
- the touch sensor 180K can detect a sliding operation from bottom to upward on the application interface, and then the mobile phone 100 can respond to the sliding operation and return to the main interface.
- Bone conduction sensor 180M can acquire vibration signals.
- the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human body's vocal part.
- the bone conduction sensor 180M can also contact the human body's pulse and receive blood pressure beating signals.
- the buttons 190 include a power button, a volume button, etc.
- Key 190 may be a mechanical key. It can also be a touch button.
- the mobile phone 100 can receive key input and generate key signal input related to user settings and function control of the mobile phone 100 .
- the motor 191 can generate vibration prompts.
- the motor 191 can be used for vibration prompts for incoming calls and can also be used for touch vibration feedback. For example, touch operations for different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects.
- the indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, or may be used to indicate messages, missed calls, notifications, etc.
- the SIM card interface 195 is used to connect a SIM card.
- the SIM card can be connected to and separated from the mobile phone 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 .
- the components shown in Figure 1 do not constitute a specific limitation to the mobile phone.
- the mobile phone may also include more or fewer components than shown in the figure, or some components may be combined, or some components may be separated, or may be different component layout.
- the mobile phone 100 shown in FIG. 1 is taken as an example for introduction.
- the software system of the above-mentioned mobile phone 100 can adopt a layered architecture, including an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
- the embodiment of this application takes the Android system with a layered architecture as an example to illustrate the software structure of the mobile phone 100 . It should be understood that the system in the embodiments of this application can also be the Hongmeng system, and this application does not limit this.
- FIG. 2 is a software structure block diagram of the mobile phone 100 according to the embodiment of the present application.
- the layered architecture divides the software into several layers, and each layer has clear roles and division of labor.
- the layers communicate through software interfaces.
- the Android system consists of an application layer, an application framework layer, an Android runtime (ART) and a native C/C++ library, a hardware abstraction layer (HAL) and Kernel layer.
- the application layer can include a series of application packages. As shown in Figure 2, desktop, music, Huawei video and other applications can be installed in the application layer.
- the application framework layer provides an application programming interface (API) and programming framework for applications in the application layer.
- API application programming interface
- the application framework layer includes some predefined functions.
- the application framework layer can include activity manager, window manager, content provider, view system, resource manager, notification manager, input manager, etc.
- the Activity Manager can provide Activity Management Service (AMS), which can be used for the startup, switching, and scheduling of system components (such as activities, services, content providers, and broadcast receivers) as well as the management and scheduling of application processes. .
- AMS Activity Management Service
- AMS can be used to skip the creation process of a transparent Activity and directly create a real Activity when it is detected that the application interface is a transparent interface.
- the window manager provides window management service (Window Manager Service, WMS).
- WMS can be used for window management, window animation management, surface management, and as a transfer station for the input system. It should be understood that both AMS and WMS belong to system service processes.
- Content providers are used to store and retrieve data and make this data accessible to applications.
- This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
- the view system includes visual controls, such as controls that display text, controls that display pictures, etc.
- a view system can be used to build applications.
- the display interface can be composed of one or more views.
- a display interface including a text message notification icon may include a visual display of text. Figure and view showing the image.
- the resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, etc.
- the notification manager allows applications to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction.
- the notification manager is used to notify download completion, message reminders, etc.
- the notification manager can also be notifications that appear in the status bar at the top of the system in the form of charts or scroll bar text, such as notifications for applications running in the background, or notifications that appear on the screen in the form of conversation windows. For example, text information is prompted in the status bar, a beep sounds, the electronic device vibrates, the indicator light flashes, etc.
- the input manager can provide input management service (Input Manager Service, IMS).
- IMS can be used to manage system input, such as touch screen input, key input, sensor input, etc.
- IMS takes out events from the input device node and distributes the events to appropriate windows through interaction with WMS.
- the Android runtime includes core libraries and Android runtime.
- the Android runtime is responsible for converting source code into machine code.
- the Android runtime mainly includes the use of ahead of time (ahead or time, AOT) compilation technology and just in time (just in time, JIT) compilation technology.
- the core library is mainly used to provide basic Java class library functions, such as basic data structures, mathematics, IO, tools, databases, networks and other libraries.
- the core library provides APIs for users to develop Android applications.
- Native C/C++ libraries can include multiple function modules. For example: surface manager (surface manager), media framework (Media Framework), libc, OpenGL ES, SQLite, Webkit, etc.
- the surface manager is used to manage the display subsystem and provides the integration of 2D and 3D layers for multiple applications.
- the media framework supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc.
- the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
- OpenGL ES provides the drawing and manipulation of 2D graphics and 3D graphics in applications. SQLite provides a lightweight relational database for electronic device 100 applications.
- the hardware abstraction layer HAL runs in user space, encapsulates the kernel layer driver, and provides a calling interface to the upper layer.
- HAL can include display module, audio module, Bluetooth module, etc.
- the kernel layer is the layer between hardware and software.
- the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
- At least one of the following embodiments includes one or more; wherein, multiple means greater than or equal to two.
- words such as “first” and “second” are only used for the purpose of differentiating the description.
- FIG. 3 it is a flow chart of an application hot start method provided by the embodiment of the present application.
- the method may include the following steps:
- S301 The mobile phone 100 detects the first operation on the first application.
- the first application is a background application
- the first operation may be an operation for the user to trigger the startup of the first application, for example, it may be a click operation on an application icon of the first application.
- start the first application For example, you can slide up on the display screen to trigger the display of the multitasking window, and then click on the interface of the first application in the multitasking window, or you can also trigger operations by voice, etc. This application does not limit this.
- the mobile phone 100 may display the second interface of the first application before detecting the first operation.
- the mobile phone 100 may respond to the second operation and switch the first application from running in the foreground to running in the background.
- the second operation may be an operation of sliding up to return to the desktop (main interface).
- S302 The mobile phone 100 responds to the first operation and obtains the interface transparency parameter of the first interface.
- the transparent interface may correspond to the transparent Activity below; the real interface may correspond to the target Activity below.
- the mobile phone 100 can obtain the interface transparency parameter of the first interface, and then determine whether the first interface is a transparent interface based on the interface transparency parameter.
- S303 The mobile phone 100 determines whether the first interface is a transparent interface according to the interface transparency parameter of the first interface. If the first interface is transparent If the interface is clear, continue to execute S304.
- the mobile phone 100 can determine whether the interface is a transparent interface according to the interface transparency parameter. Specifically, when the interface transparency parameter is greater than the transparency threshold, the interface can be considered to be a non-transparent interface; when the interface transparency parameter is less than or equal to the transparency threshold, the interface can be considered to be a transparent interface. For example, assume that the interface transparency parameter ranges from 0 to 1, with 0 indicating that the interface is completely transparent and 1 indicating that the interface is completely opaque. For example, if the transparency threshold is 0, then when the interface transparency parameter is greater than 0, the interface is a non-transparent interface; when the interface transparency parameter is less than or equal to 0, the interface is a transparent interface.
- the mobile phone 100 can determine that the interface is a transparent interface; when the interface transparency parameter is greater than or equal to 10, The mobile phone 100 can determine that the interface is a non-transparent interface.
- the above example is only an example.
- the interface transparency parameter when the interface transparency parameter is greater than the transparency threshold, the interface is a transparent interface; when the interface transparency parameter is less than or equal to the transparency threshold, the interface is a non-transparent interface. This application does not limit this.
- the mobile phone 100 can determine whether the first interface is a transparent interface according to the setAlpha() function.
- the first interface is a transparent interface
- the first application is an application that will have a transparent interface during the startup process; if the first interface is not a transparent interface, then the first application will not have a transparent interface during the startup process. application.
- S304 Mobile phone 100 starts the target activity.
- the mobile phone 100 can skip the process of creating the transparent interface and directly start the target activity (Activity).
- the mobile phone 100 does not need to create a transparent Activity. Compared with the existing technology, one fewer Activity can be created and the application hot start time can be shortened.
- S305 The mobile phone 100 draws the second interface and starts the first application.
- the second interface is the interface displayed by the first application before switching to the background application.
- the first application is Application
- the user has opened the Huawei official website through the Baidu application and is browsing the homepage of the Huawei official website. If the user slides up to return to the main interface at this time, the Baidu application can run in the background. Then, when the user opens the Baidu application again, if the first interface is a transparent interface, the mobile phone 100 can directly display the second interface, which is the interface corresponding to the homepage of Huawei's official website, thereby completing the hot start process of the Baidu application.
- the mobile phone 100 when the mobile phone 100 determines that the first interface is a transparent interface, it can skip the process of creating the transparent interface, without creating a transparent Activity, and directly start the target Activity, and the interface corresponding to the target Activity is the second interface. If according to the solution of the existing technology, the mobile phone 100 does not determine whether the first interface is a transparent interface, and before S304, the mobile phone 100 also needs to create a transparent Activity. However, the solution of the embodiment of the present application can reduce transparency compared to the existing technology. The creation of Activity shortens the time of application hot start and accelerates the process of application hot start.
- the application hot start method in the embodiment of the present application will be introduced below in combination with the software architecture. As shown in Figure 4, it is a flow chart of an application hot start method provided by an embodiment of the present application. Referring to Figure 4, the method may include:
- S401 The first application receives the first operation.
- the first application is a background application
- the first operation is a triggering operation for starting the first application, which may be, for example, a user's click operation on an application icon of the first application on the desktop.
- the first operation can also be other operations, such as clicking the window corresponding to the first application in the multi-tasking window, or it can also be opening the first application through the voice assistant.
- the user can issue the command "Xiaoyi Xiaoyi" , open XX application", etc., this application does not limit this.
- the first application before receiving the first operation, may switch from foreground running to background running.
- the first application may receive a second operation to switch the first application to the background, and then the mobile phone 100 may respond to the second operation and switch the first application from running in the foreground to running in the background.
- the second operation may be an operation of sliding up to return to the desktop (main interface).
- S402 The desktop application notifies AMS to start the activity of the first application.
- the process of the desktop application can call the startActivity() function and send a message to AMS through the inter-process communication mechanism Binder mechanism, so that AMS starts the Activity of the first application. . Since the first application is a background application and has an application process, AMS does not need to create an application process again.
- S403 AMS determines whether the first interface is a transparent interface.
- the AMS can obtain the interface transparency parameter of the first interface, and then determine whether the first interface is a transparent interface based on the interface transparency parameter. If the interface transparency parameter of the first interface is greater than the transparency threshold, the first interface is a non-transparent interface; if the interface transparency parameter of the first interface is less than or equal to the transparency threshold, the first interface is a transparent interface.
- the above determination method is only an example. For example, when the interface transparency parameter of the first interface is less than the transparency threshold, it is determined that the first interface is a transparent interface; when the transparency parameter of the first interface is greater than or equal to the transparency threshold, it is determined that The first interface is a non-transparent interface.
- S404 AMS skips the creation of transparent interfaces.
- the AMS can notify the first application process to execute the ActivityPause() function through the Binder mechanism to intercept the transparent Activity. That is to say, if AMS identifies a transparent Activity during the hot start of the first application, the creation of the transparent Activity is skipped.
- S405 AMS starts the target Activity.
- AMS skips the creation of transparent Activity and can directly start the target Activity and execute the life cycle methods of the target Activity, such as onstart(), onresume() and other methods.
- S406 The first application draws the second interface and completes the hot start.
- the second interface is the interface displayed by the first application before switching to the background application.
- the first application may draw a second interface corresponding to the target Activity, and then display the second interface, thereby completing the hot start process of the first application.
- AMS when AMS recognizes that the first interface is a transparent interface, it can actively skip the creation of the transparent interface, which can shorten the application hot start time and improve the efficiency of application hot start.
- the method provided by the embodiments of the present application is introduced from the perspective of the electronic device as the execution subject.
- the electronic device may include a hardware structure and/or a software module to implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above functions is performed as a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
- the electronic device 500 includes: a display screen 501; one or more processors 502; one or more memories 503; one or more sensors 504 (not shown in the figure), and multiple applications 505 (not shown in the figure); and one or more computer programs 506 (not shown in the figure), each of the above devices can be connected through one or more communication buses 507.
- the display screen 501 is used to display a display interface of an application in the electronic device.
- One or more computer programs are stored in the memory 503, and the one or more computer programs include instructions; the processor 502 calls the instructions stored in the memory 503, so that the electronic device 500 can apply the hot start method in the above embodiment.
- the electronic device 500 can perform the following steps: detect a first operation of starting a first application; wherein the first application is a background application; respond In the first operation, when it is determined that the first interface is a transparent interface, start the target activity of the first application; draw a second interface corresponding to the target activity and start the first application.
- the processor 502 may be a general processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, which can be implemented Or execute the disclosed methods, steps and logical block diagrams in the embodiments of this application.
- a general-purpose processor may be a microprocessor or any conventional processor, etc.
- the steps of the methods disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor.
- the software module may be located in the memory 503.
- the processor 502 reads the program instructions in the memory 503 and completes the steps of the above method in combination with its hardware.
- the memory 503 may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or it may be a volatile memory (volatile memory).
- RAM volatile memory
- Memory may also be, but is not limited to, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
- the memory in the embodiment of the present application can also be a circuit or any other device capable of realizing a storage function, used to store instructions and/or data.
- this application also provides a computer storage medium in which a computer program is stored.
- the computer program is executed by the computer, the computer is caused to execute the application hot start method provided by the above embodiment.
- An embodiment of the present application also provides a computer program product, which includes instructions that, when run on a computer, cause the computer to execute the application hot start method provided in the above embodiments.
- Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by instructions. These instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that instructions executed by the processor of the computer or other programmable data processing device produce for implementation means a function specified in a process or processes in a flowchart and/or in a block or blocks in a block diagram.
- These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions
- the device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
- These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device.
- Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- User Interface Of Digital Computer (AREA)
- Telephone Function (AREA)
Abstract
Provided in the present application are an application hot start method and an electronic device, which are applied to the technical field of terminals. In the method, when it is detected that a transparent interface is present during a hot start process of an application, the creation of a transparent interface is skipped, and a target interface is directly created, thus shortening the application hot start time, and improving application hot start efficiency.
Description
相关申请的交叉引用Cross-references to related applications
本申请要求在2022年09月02日提交中国专利局、申请号为202211073836.5、申请名称为“一种应用热启动方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application submitted to the China Patent Office on September 2, 2022, with the application number 202211073836.5 and the application name "A hot start method and electronic equipment", the entire content of which is incorporated herein by reference. Applying.
本申请涉及终端技术领域,尤其涉及一种应用热启动方法及电子设备。The present application relates to the field of terminal technology, and in particular to an application hot start method and electronic equipment.
当应用被打开后,如果用户进行操作,比如按下返回键或者Home键等,使得该应用在后台运行,然后当用户再次打开该应用时,该应用的启动即为热启动。After the application is opened, if the user performs an operation, such as pressing the return key or the home key, so that the application runs in the background, and then when the user opens the application again, the startup of the application is a hot start.
目前,电子设备上的部分应用在热启动时,会先创建一个透明活动(Activity),然后在该透明Activity销毁之后再创建带有真实界面的Activity,并根据该Activity进行显示。由此,部分应用在热启动时候会创建两个Activity,从而导致应用热启动比较慢。Currently, some applications on electronic devices will first create a transparent activity (Activity) during hot start, and then create an Activity with a real interface after the transparent Activity is destroyed, and display it according to the Activity. As a result, some applications will create two activities during hot start, resulting in a slower hot start of the application.
发明内容Contents of the invention
本申请提供一种应用热启动方法及电子设备,用以解决应用热启动慢的问题。This application provides an application hot start method and electronic equipment to solve the problem of slow application hot start.
第一方面,本申请提供一种应用热启动方法,该方法可应用于电子设备。具体的,该方法包括:电子设备检测到启动第一应用的第一操作,该第一应用为后台应用。然后响应该第一操作,并在确定第一界面为透明界面时,直接启动第一应用的目标活动。最后,电子设备可绘制对应目标活动的第二界面,启动第一应用。In a first aspect, this application provides a method for applying hot start, which method can be applied to electronic equipment. Specifically, the method includes: the electronic device detects a first operation of starting a first application, and the first application is a background application. Then, in response to the first operation, and when it is determined that the first interface is a transparent interface, the target activity of the first application is directly started. Finally, the electronic device can draw a second interface corresponding to the target activity and start the first application.
其中,所述第一操作包括如下操作中的任意一项:对所述第一应用的应用图标的点击操作;在多任务窗口中对所述第一应用的窗口的点击操作;语音触发操作。Wherein, the first operation includes any one of the following operations: a click operation on the application icon of the first application; a click operation on the window of the first application in a multi-tasking window; and a voice-triggered operation.
通过上述技术方案,当应用在热启动过程中检测到存在透明界面时,可直接绘制目标对应的界面,这样可缩短应用热启动的时间,提高应用热启动效率。Through the above technical solution, when the application detects the existence of a transparent interface during the hot start process, the interface corresponding to the target can be directly drawn, which can shorten the application hot start time and improve the application hot start efficiency.
在一种可能的实现中,确定所述第一界面为透明界面,包括:电子设备获取第一界面的界面透明度参数,然后根据所述界面透明度参数确定第一界面为透明界面。In a possible implementation, determining that the first interface is a transparent interface includes: the electronic device obtains an interface transparency parameter of the first interface, and then determines that the first interface is a transparent interface based on the interface transparency parameter.
通过上述技术方案,电子设备可以基于界面透明度参数判断界面是否为透明界面,进而在确定界面为透明界面时直接绘制目标界面,缩短应用热启动的时间。Through the above technical solution, the electronic device can determine whether the interface is a transparent interface based on the interface transparency parameter, and then directly draw the target interface when it is determined that the interface is a transparent interface, thereby shortening the application hot start time.
在一种可能的实现中,电子设备根据所述界面透明度参数确定所述第一界面为透明界面,包括:In a possible implementation, the electronic device determines that the first interface is a transparent interface according to the interface transparency parameter, including:
当电子设备确定所述界面透明度参数小于或等于透明度阈值时,确定所述第一界面为透明界面。When the electronic device determines that the interface transparency parameter is less than or equal to the transparency threshold, it determines that the first interface is a transparent interface.
通过上述技术方案,可以将第一界面的界面透明度参数与透明度阈值进行比较,从而判断第一界面是否为透明界面。Through the above technical solution, the interface transparency parameter of the first interface can be compared with the transparency threshold, thereby determining whether the first interface is a transparent interface.
在一种可能的实现中,所述电子设备获取所述第一界面的界面透明度参数,包括:电子设备根据setAlpha()函数,确定第一界面的透明度参数。In a possible implementation, the electronic device obtaining the interface transparency parameter of the first interface includes: the electronic device determines the transparency parameter of the first interface according to the setAlpha() function.
在一种可能的实现中,启动第一应用的目标活动之前,所述方法还包括:所述电子设备跳过所述第一界面的创建。In a possible implementation, before starting the target activity of the first application, the method further includes: the electronic device skips creation of the first interface.
通过上述技术方案,当应用在热启动过程中检测到透明界面时,可跳过透明界面的创建,直接启动目标活动,这样可减少透明界面的创建时间,缩短应用热启动的时间,能够提升应用热启动效率。Through the above technical solution, when the application detects a transparent interface during the hot start process, it can skip the creation of the transparent interface and directly start the target activity. This can reduce the creation time of the transparent interface, shorten the application hot start time, and improve the application Hot start efficiency.
在一种可能的实现中,电子设备检测到第一操作之前,所述方法还包括:In a possible implementation, before the electronic device detects the first operation, the method further includes:
电子设备显示第一应用的第二界面,所述第二界面为所述第一应用在切换到后台运行之前显示的界面。然后,电子设备在检测到将第一应用切换到后台的第二操作时,响应第二操作,将所述第一应用从前台切换到后台运行。The electronic device displays a second interface of the first application, where the second interface is the interface displayed before the first application is switched to background running. Then, when detecting the second operation of switching the first application to the background, the electronic device responds to the second operation and switches the first application from the foreground to the background.
其中,所述第二操作包括如下操作中的任意一项:从所述第一应用切换到第二应用的操作;返回主界面的操作。The second operation includes any one of the following operations: switching from the first application to the second application; and returning to the main interface.
通过上述技术方案,可将第一应用从前台运行切换到后台运行,这样在检测到第一操作时,才能启动第一应用的热启动流程。
Through the above technical solution, the first application can be switched from running in the foreground to running in the background, so that when the first operation is detected, the hot start process of the first application can be started.
第二方面,本申请提供一种电子设备,所述电子设备包括显示屏;一个或多个处理器;一个或多个存储器;一个或多个传感器;多个应用;以及一个或多个计算机程序;其中所述一个或多个计算机程序被存储在所述一个或多个存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器调用执行时,使得所述电子设备执行上述第一方面及其第一方面任一可能设计的方法。In a second aspect, the present application provides an electronic device, which includes a display screen; one or more processors; one or more memories; one or more sensors; multiple applications; and one or more computer programs ; wherein the one or more computer programs are stored in the one or more memories, the one or more computer programs include instructions, and when the instructions are called and executed by the one or more processors, The electronic device is caused to perform the above-mentioned first aspect and any possible designed method of the first aspect thereof.
第三方面,本申请还提供一种电子设备,该电子设备包括执行第一方面或者第一方面的任意一种可能的设计的方法的模块/单元;这些模块/单元可以通过硬件实现,也可以通过硬件执行相应的软件实现。In a third aspect, the present application also provides an electronic device, which includes modules/units that perform the method of the first aspect or any possible design of the first aspect; these modules/units can be implemented by hardware, or can The corresponding software implementation is executed through hardware.
第四方面,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在电子设备上运行时,使得所述电子设备执行第一方面及其第一方面任一可能设计的应用热启动方法。In a fourth aspect, the present application also provides a computer-readable storage medium in which instructions are stored. When the instructions are run on an electronic device, the electronic device causes the electronic device to execute the first aspect and the method thereof. In the first aspect any possible design applies the hot start method.
第五方面,本申请还提供一种计算机程序产品,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行本申请实施例第一方面及其第一方面任一可能设计的应用热启动方法。In a fifth aspect, the present application also provides a computer program product. When the computer program product is run on an electronic device, it causes the electronic device to execute the first aspect of the embodiment of the present application and any possible design of the first aspect. Apply the warm start method.
上述第二方面至第五方面中的各个方面以及各个方面可能达到的技术效果请参照上述针对第一方面中的各种可能方案可以达到的技术效果说明,这里不再重复赘述。Please refer to the above description of the technical effects that can be achieved by various possible solutions in the first aspect for each aspect from the second to fifth aspects and the technical effects that may be achieved by each aspect, and they will not be repeated here.
图1为本申请实施例提供的一种电子设备的结构示意图;Figure 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图2为本申请实施例提供的一种软件结构框图;Figure 2 is a software structure block diagram provided by an embodiment of the present application;
图3为本申请实施例提供的一种应用热启动方法流程图;Figure 3 is a flow chart of an application hot start method provided by an embodiment of the present application;
图4为本申请实施例提供的另一种应用热启动方法流程图;Figure 4 is a flow chart of another application hot start method provided by the embodiment of the present application;
图5为本申请实施例提供的另一种电子设备的结构示意图。FIG. 5 is a schematic structural diagram of another electronic device provided by an embodiment of the present application.
下面将结合本申请以下实施例中的附图,对本申请实施例中的技术方案进行详尽描述。The technical solutions in the embodiments of this application will be described in detail below with reference to the accompanying drawings in the following embodiments of this application.
为了便于理解,下面先对本申请实施例涉及的相关术语及相关概念进行介绍。In order to facilitate understanding, the relevant terms and concepts involved in the embodiments of this application are first introduced below.
1、应用程序(application,APP):简称应用,为能够实现某项或多项特定功能的软件程序。通常,电子设备中可以安装多个应用。比如,相机应用、短信应用、邮箱应用、视频应用、音乐应用等。下文中提到的应用,可以是电子设备出厂时已安装的应用,也可以是用户在使用电子设备的过程中从网络下载或其他电子设备获取的应用。1. Application (APP): referred to as application, it is a software program that can realize one or more specific functions. Typically, multiple applications can be installed in an electronic device. For example, camera applications, text messaging applications, email applications, video applications, music applications, etc. The applications mentioned below may be applications installed when the electronic device leaves the factory, or may be applications downloaded from the Internet or obtained by the user from other electronic devices during the use of the electronic device.
2、应用热启动:当应用已经被打开,该应用一般会处于前台运行。而当用户通过按下返回键、Home键、上滑等方式回到桌面或者切换到其他程序之后,该应用切换为后台应用。当用户再重新打开该应用时,后台已经有该应用的进程,此时可以从已经有的进程中启动该应用。该应用又从后台应用切换为前台应用,这种启动方式叫做热启动。2. Application hot start: When an application has been opened, the application will generally run in the foreground. When the user returns to the desktop or switches to other programs by pressing the return key, home key, swiping up, etc., the application switches to a background application. When the user reopens the application, there is already a process for the application in the background. At this time, the application can be started from the existing process. The application switches from a background application to a foreground application. This startup method is called a hot start.
3、前台应用、后台应用:根据应用程序是否可以直接与用户交互,可以将应用程序分为包括:前台应用、后台应用。其中,前台应用为用户放置在前台的、可以直接交互的应用程序,后台应用为用户放置在后台的、不可以直接交互的应用程序。在本申请实施例中,可以根据应用程序是否直接可见,确定该应用是前台应用或后台应用。3. Foreground applications and background applications: Depending on whether the application can directly interact with the user, applications can be divided into: foreground applications and background applications. Among them, the foreground application is an application placed in the foreground by the user and can be directly interacted with, and the background application is an application placed in the background by the user and cannot be directly interacted with. In this embodiment of the present application, it can be determined whether the application is a foreground application or a background application based on whether the application is directly visible.
当应用程序可见时为前台应用,当应用程序不可见时为后台应用。例如,当电子设备的屏幕上显示应用的界面时,该应用为前台应用;当电子设备的屏幕上没有显示应用的界面时,该应用为后台应用。其中,应用的界面不包括操作系统的顶部状态栏、通知栏。如在上述应用热启动中的说明,响应于用户的操作,一个应用程序可以在前台应用和后台应用之间进行转换。When the application is visible, it is a foreground application, and when the application is not visible, it is a background application. For example, when the interface of the application is displayed on the screen of the electronic device, the application is a foreground application; when the interface of the application is not displayed on the screen of the electronic device, the application is a background application. Among them, the application interface does not include the top status bar and notification bar of the operating system. As explained in Application Warming above, an application can transition between a foreground application and a background application in response to user actions.
4、活动(Activity):系统组件中的组件之一,为一个应用程序组件,提供一个屏幕,用户可以用来交互为了完成某项任务。在一个应用中,一个Activity通常就是一个单独的屏幕,它上面可以显示一些控件,也可以监听并处理用户的事件做出响应。4. Activity: A component in system components, an application component that provides a screen with which users can interact in order to complete a task. in a In an application, an Activity is usually a separate screen, which can display some controls and can also listen to and process user events to respond.
需要说明的是,本申请实施例提供的应用热启动方法,可以适用于具有显示屏的任何电子设备,诸如手机、平板电脑、可穿戴设备(例如,手表、手环、智能头盔,智能眼镜等)、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等,本申请实施例不作限定。并且,电子设备的示例性实施例包括但不限于搭载
Harmony或者其它操作系统的电子设备。It should be noted that the application hot start method provided by the embodiment of the present application can be applied to any electronic device with a display screen, such as mobile phones, tablet computers, wearable devices (for example, watches, bracelets, smart helmets, smart glasses, etc. ), vehicle-mounted equipment, augmented reality (AR)/virtual reality (VR) equipment, notebook computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants , PDA), etc., are not limited by the embodiments of this application. Also, exemplary embodiments of electronic devices include, but are not limited to, equipped with Harmony Or other electronic devices with operating systems.
下面以手机为例,介绍电子设备的结构。Let’s take a mobile phone as an example to introduce the structure of electronic equipment.
如图1所示,手机100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。As shown in Figure 1, the mobile phone 100 may 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, and a battery 142. Antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, Display 194, and subscriber identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air 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, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是手机100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) wait. Among them, different processing units can be independent devices or integrated in one or more processors. Among them, the controller may be the nerve center and command center of the mobile phone 100 . The controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions. The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为手机100充电,也可以用于手机100与外围设备之间传输数据。充电管理模块140用于从充电器接收充电输入。电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。The USB interface 130 is an interface that complies with the USB standard specification, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the mobile phone 100, and can also be used to transmit data between the mobile phone 100 and peripheral devices. The charging management module 140 is used to receive charging input from the charger. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, wireless communication module 160, etc.
手机100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。手机100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。The wireless communication function of the mobile phone 100 can be realized through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor. Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in mobile phone 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be reused as a diversity antenna for a wireless LAN. In other embodiments, antennas may be used in conjunction with tuning switches.
移动通信模块150可以提供应用在手机100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the mobile phone 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least part of the functional modules of the mobile communication module 150 may 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 may be provided in the same device.
无线通信模块160可以提供应用在手机100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide applications on the mobile phone 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (bluetooth, BT), and global navigation satellite system. (global navigation satellite system, GNSS), frequency modulation (FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
在一些实施例中,手机100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得手机100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(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),第五代(the fifth generation,5G)移动通信系统,未来通信系统,如第六代(6th generation,6G)系统等,BT,GNSS,WLAN,NFC,FM和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the mobile phone 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), Long term evolution (LTE), the fifth generation (5G) mobile communication system, future communication systems, such as the sixth generation (6th generation, 6G) system, etc., BT, GNSS, WLAN, NFC, FM and/or IR technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
显示屏194用于显示应用的显示界面等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,手机100可以包括1个或N个显示屏194,N为大于1的正整数。在本申请实施例中,显示屏194可用于显示应用界面。The display screen 194 is used to display the display interface of the application, etc. Display 194 includes a display panel. The display panel can use a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode). emitting diode (AMOLED), flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diode (QLED), etc. In some embodiments, the mobile phone 100 may include 1 or N display screens 194, where N is a positive integer greater than 1. In this embodiment of the present application, the display screen 194 can be used to display an application interface.
摄像头193用于捕获静态图像或视频。摄像头193可以包括前置摄像头和后置摄像头。Camera 193 is used to capture still images or video. The camera 193 may include a front camera and a rear camera.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行手机100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,以及至少一个应用程序(例如爱奇艺应用,微信应用等)的软件代码等。存储数据区可存储手机100使用过程中所产生的数据(例如图像、视频等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。Internal memory 121 may be used to store computer executable program code, which includes instructions. The processor 110 executes instructions stored in the internal memory 121 to execute various functional applications and data processing of the mobile phone 100 . The internal memory 121 may include a program storage area and a data storage area. Among them, the stored program area can store the operating system and the software code of at least one application program (such as iQiyi application, WeChat application, etc.). The storage data area can store data (such as images, videos, etc.) generated during the use of the mobile phone 100. In addition, the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展手机100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将图片,视频等文件保存在外部存储卡中。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 mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, save pictures, videos, etc. files on an external memory card.
手机100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The mobile phone 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playback, recording, etc.
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。陀螺仪传感器180B可以用于确定手机100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定手机100围绕三个轴(即,x,y和z轴)的角速度。The pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, pressure sensor 180A may be disposed on display screen 194 . The gyro sensor 180B can be used to determine the movement posture of the mobile phone 100 . In some embodiments, the angular velocity of the phone 100 about three axes (ie, x, y, and z axes) may be determined by the gyro sensor 180B.
陀螺仪传感器180B可以用于确定手机100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定手机100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测手机100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消手机100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。The gyro sensor 180B can be used to determine the movement posture of the mobile phone 100 . In some embodiments, the angular velocity of the phone 100 about three axes (ie, x, y, and z axes) may be determined by the gyro sensor 180B. The gyro sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyro sensor 180B detects the angle at which the mobile phone 100 shakes, and calculates the distance that the lens module needs to compensate based on the angle, so that the lens can offset the shake of the mobile phone 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
气压传感器180C用于测量气压。在一些实施例中,手机100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。磁传感器180D包括霍尔传感器。手机100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当手机100是翻盖机时,手机100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。加速度传感器180E可检测手机100在各个方向上(一般为三轴)加速度的大小。当手机100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。Air pressure sensor 180C is used to measure air pressure. In some embodiments, the mobile phone 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation. Magnetic sensor 180D includes a Hall sensor. The mobile phone 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the mobile phone 100 is a flip phone, the mobile phone 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Then, based on the detected opening and closing status of the leather case or the opening and closing status of the flip cover, features such as automatic unlocking of the flip cover are set. The acceleration sensor 180E can detect the acceleration of the mobile phone 100 in various directions (generally three axes). When the mobile phone 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices and be used in horizontal and vertical screen switching, pedometer and other applications.
距离传感器180F,用于测量距离。手机100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,手机100可以利用距离传感器180F测距以实现快速对焦。接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。手机100通过发光二极管向外发射红外光。手机100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定手机100附近有物体。当检测到不充分的反射光时,手机100可以确定手机100附近没有物体。手机100可以利用接近光传感器180G检测用户手持手机100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。Distance sensor 180F for measuring distance. The mobile phone 100 can measure distance via infrared or laser. In some embodiments, when shooting a scene, the mobile phone 100 can use the distance sensor 180F to measure distance to achieve fast focusing. Proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The mobile phone 100 emits infrared light through the light emitting diode. Cell phone 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the mobile phone 100 . When insufficient reflected light is detected, the mobile phone 100 can determine that there is no object near the mobile phone 100 . The mobile phone 100 can use the proximity light sensor 180G to detect when the user is holding the mobile phone 100 close to the ear for talking, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in holster mode, and pocket mode automatically unlocks and locks the screen.
环境光传感器180L用于感知环境光亮度。手机100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测手机100是否在口袋里,以防误触。指纹传感器180H用于采集指纹。手机100
可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The ambient light sensor 180L is used to sense ambient light brightness. The mobile phone 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the mobile phone 100 is in the pocket to prevent accidental touching. Fingerprint sensor 180H is used to collect fingerprints. Mobile 100 You can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application lock, fingerprint photo taking, fingerprint answering incoming calls, etc.
温度传感器180J用于检测温度。在一些实施例中,手机100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,手机100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,手机100对电池142加热,以避免低温导致手机100异常关机。在其他一些实施例中,当温度低于又一阈值时,手机100对电池142的输出电压执行升压,以避免低温导致的异常关机。Temperature sensor 180J is used to detect temperature. In some embodiments, the mobile phone 100 uses the temperature detected by the temperature sensor 180J to execute the temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the mobile phone 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the mobile phone 100 heats the battery 142 to prevent the low temperature from causing the mobile phone 100 to shut down abnormally. In some other embodiments, when the temperature is lower than another threshold, the mobile phone 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于手机100的表面,与显示屏194所处的位置不同。在本申请一些实施例中,触摸传感器180K可检测到用户在显示屏上的触摸操作,比如可检测到用户在显示屏194上对应用图标的点击操作,然后手机100可响应该点击操作开启应用。或者当显示屏194显示应用界面时,触摸传感器180K可检测到在应用界面上的由下向上的滑动操作,然后手机100可响应该滑动操作,返回主界面。Touch sensor 180K, also called "touch panel". The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation on or near the touch sensor 180K. The touch sensor can pass the detected touch operation to the application processor to determine the touch event type. Visual output related to the touch operation may be provided through display screen 194 . In other embodiments, the touch sensor 180K may also be disposed on the surface of the mobile phone 100 in a position different from that of the display screen 194 . In some embodiments of the present application, the touch sensor 180K can detect the user's touch operation on the display screen, for example, it can detect the user's click operation on the application icon on the display screen 194, and then the mobile phone 100 can respond to the click operation to open the application. . Or when the display screen 194 displays an application interface, the touch sensor 180K can detect a sliding operation from bottom to upward on the application interface, and then the mobile phone 100 can respond to the sliding operation and return to the main interface.
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。Bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human body's vocal part. The bone conduction sensor 180M can also contact the human body's pulse and receive blood pressure beating signals.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。手机100可以接收按键输入,产生与手机100的用户设置以及功能控制有关的键信号输入。马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和手机100的接触和分离。The buttons 190 include a power button, a volume button, etc. Key 190 may be a mechanical key. It can also be a touch button. The mobile phone 100 can receive key input and generate key signal input related to user settings and function control of the mobile phone 100 . The motor 191 can generate vibration prompts. The motor 191 can be used for vibration prompts for incoming calls and can also be used for touch vibration feedback. For example, touch operations for different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. The indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, or may be used to indicate messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the mobile phone 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 .
可以理解的是,图1所示的部件并不构成对手机的具体限定,手机还可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。以下的实施例中,以图1所示的手机100为例进行介绍。It can be understood that the components shown in Figure 1 do not constitute a specific limitation to the mobile phone. The mobile phone may also include more or fewer components than shown in the figure, or some components may be combined, or some components may be separated, or may be different component layout. In the following embodiments, the mobile phone 100 shown in FIG. 1 is taken as an example for introduction.
上述手机100的软件系统可以采用分层架构,包括事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明手机100的软件结构。应理解,本申请实施例中的系统也可以为鸿蒙系统,本申请对此不作限定。The software system of the above-mentioned mobile phone 100 can adopt a layered architecture, including an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of this application takes the Android system with a layered architecture as an example to illustrate the software structure of the mobile phone 100 . It should be understood that the system in the embodiments of this application can also be the Hongmeng system, and this application does not limit this.
图2是本申请实施例的手机100的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,Android系统从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime,ART)和原生C/C++库,硬件抽象层(Hardware Abstract Layer,HAL)以及内核层。Figure 2 is a software structure block diagram of the mobile phone 100 according to the embodiment of the present application. The layered architecture divides the software into several layers, and each layer has clear roles and division of labor. The layers communicate through software interfaces. In some embodiments, the Android system consists of an application layer, an application framework layer, an Android runtime (ART) and a native C/C++ library, a hardware abstraction layer (HAL) and Kernel layer.
应用程序层可以包括一系列应用程序包。如图2所示,应用程序层内可以安装桌面、音乐、华为视频等应用程序。The application layer can include a series of application packages. As shown in Figure 2, desktop, music, Huawei video and other applications can be installed in the application layer.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图2所示,应用程序框架层可以包括活动管理器,窗口管理器,内容提供器,视图系统,资源管理器,通知管理器,输入管理器等。As shown in Figure 2, the application framework layer can include activity manager, window manager, content provider, view system, resource manager, notification manager, input manager, etc.
活动管理器可以提供活动管理服务(Activity Manager Service,AMS),AMS可以用于系统组件(例如活动、服务、内容提供者、广播接收器)的启动、切换、调度以及应用进程的管理和调度工作。在本申请一些实施例中,AMS可用于在检测到应用界面为透明界面时,跳过透明Activity的创建流程,直接创建真实的Activity。The Activity Manager can provide Activity Management Service (AMS), which can be used for the startup, switching, and scheduling of system components (such as activities, services, content providers, and broadcast receivers) as well as the management and scheduling of application processes. . In some embodiments of this application, AMS can be used to skip the creation process of a transparent Activity and directly create a real Activity when it is detected that the application interface is a transparent interface.
窗口管理器提供窗口管理服务(Window Manager Service,WMS),WMS可以用于窗口管理、窗口动画管理、surface管理以及作为输入系统的中转站。应理解,AMS和WMS都属于系统服务进程。The window manager provides window management service (Window Manager Service, WMS). WMS can be used for window management, window animation management, surface management, and as a transfer station for the input system. It should be understood that both AMS and WMS belong to system service processes.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。该数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make this data accessible to applications. This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视
图以及显示图片的视图。The view system includes visual controls, such as controls that display text, controls that display pictures, etc. A view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text message notification icon may include a visual display of text. Figure and view showing the image.
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, etc.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager allows applications to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be notifications that appear in the status bar at the top of the system in the form of charts or scroll bar text, such as notifications for applications running in the background, or notifications that appear on the screen in the form of conversation windows. For example, text information is prompted in the status bar, a beep sounds, the electronic device vibrates, the indicator light flashes, etc.
输入管理器可以提供输入管理服务(Input Manager Service,IMS),IMS可以用于管理系统的输入,例如触摸屏输入、按键输入、传感器输入等。IMS从输入设备节点取出事件,通过和WMS的交互,将事件分配至合适的窗口。The input manager can provide input management service (Input Manager Service, IMS). IMS can be used to manage system input, such as touch screen input, key input, sensor input, etc. IMS takes out events from the input device node and distributes the events to appropriate windows through interaction with WMS.
安卓运行时包括核心库和安卓运行时。安卓运行时负责将源代码转换为机器码。安卓运行时主要包括采用提前(ahead or time,AOT)编译技术和及时(just in time,JIT)编译技术。The Android runtime includes core libraries and Android runtime. The Android runtime is responsible for converting source code into machine code. The Android runtime mainly includes the use of ahead of time (ahead or time, AOT) compilation technology and just in time (just in time, JIT) compilation technology.
核心库主要用于提供基本的Java类库的功能,例如基础数据结构、数学、IO、工具、数据库、网络等库。核心库为用户进行安卓应用开发提供了API。The core library is mainly used to provide basic Java class library functions, such as basic data structures, mathematics, IO, tools, databases, networks and other libraries. The core library provides APIs for users to develop Android applications.
原生C/C++库可以包括多个功能模块。例如:表面管理器(surface manager),媒体框架(Media Framework),libc,OpenGL ES、SQLite、Webkit等。Native C/C++ libraries can include multiple function modules. For example: surface manager (surface manager), media framework (Media Framework), libc, OpenGL ES, SQLite, Webkit, etc.
其中,表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体框架支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。OpenGL ES提供应用程序中2D图形和3D图形的绘制和操作。SQLite为电子设备100的应用程序提供轻量级关系型数据库。Among them, the surface manager is used to manage the display subsystem and provides the integration of 2D and 3D layers for multiple applications. The media framework supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. OpenGL ES provides the drawing and manipulation of 2D graphics and 3D graphics in applications. SQLite provides a lightweight relational database for electronic device 100 applications.
硬件抽象层HAL运行于用户空间(user space),对内核层驱动进行封装,向上层提供调用接口。其中,HAL可包括显示模块、音频模块、蓝牙模块等。The hardware abstraction layer HAL runs in user space, encapsulates the kernel layer driver, and provides a calling interface to the upper layer. Among them, HAL can include display module, audio module, Bluetooth module, etc.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
以下实施例以应用在图1所示的手机100所示的架构中为例进行描述。The following embodiments are described by taking the architecture of the mobile phone 100 shown in FIG. 1 as an example.
此外,下述实施例涉及的至少一个,包括一个或者多个;其中,多个是指大于或者等于两个。另外,需要理解的是,在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的。In addition, at least one of the following embodiments includes one or more; wherein, multiple means greater than or equal to two. In addition, it should be understood that in the description of this application, words such as "first" and "second" are only used for the purpose of differentiating the description.
如图3所示,为本申请实施例提供的一种应用热启动方法流程图,参阅图3所示,该方法可包括如下步骤:As shown in Figure 3, it is a flow chart of an application hot start method provided by the embodiment of the present application. Referring to Figure 3, the method may include the following steps:
S301:手机100检测到对第一应用的第一操作。S301: The mobile phone 100 detects the first operation on the first application.
其中,第一应用为后台应用,第一操作可以为用户触发第一应用启动的操作,比如可以为对第一应用的应用图标的点击操作。当然,启动第一应用的方式有多种,比如还可以在显示屏上上滑,触发显示多任务窗口,然后在多任务窗口中点击第一应用的界面,或者还可以为语音触发操作等,本申请对此不作限定。Wherein, the first application is a background application, and the first operation may be an operation for the user to trigger the startup of the first application, for example, it may be a click operation on an application icon of the first application. Of course, there are many ways to start the first application. For example, you can slide up on the display screen to trigger the display of the multitasking window, and then click on the interface of the first application in the multitasking window, or you can also trigger operations by voice, etc. This application does not limit this.
在一些实施例中,手机100在检测到第一操作之前,可显示第一应用的第二界面。当手机100在第二界面上检测到将第一应用切换到后台的第二操作时,可响应该第二操作,将第一应用从前台运行切换为后台运行。比如,第二操作可以为上滑返回桌面(主界面)的操作。In some embodiments, the mobile phone 100 may display the second interface of the first application before detecting the first operation. When the mobile phone 100 detects the second operation of switching the first application to the background on the second interface, it may respond to the second operation and switch the first application from running in the foreground to running in the background. For example, the second operation may be an operation of sliding up to return to the desktop (main interface).
S302:手机100响应第一操作,获取第一界面的界面透明度参数。S302: The mobile phone 100 responds to the first operation and obtains the interface transparency parameter of the first interface.
由于应用在启动过程中是否有透明界面和开发人员在应用开发阶段所设置的逻辑有关,当应用本身设置了在启动过程中先创建透明界面,后创建真实界面,则这类应用在启动过程中就会存在透明界面。应理解,该透明界面可以对应于下文的透明Activity;该真实界面可以对应于下文的目标Activity。Since whether the application has a transparent interface during the startup process is related to the logic set by the developer during the application development stage, when the application itself is set to create a transparent interface first during the startup process and then create a real interface, then this type of application will There will be a transparent interface. It should be understood that the transparent interface may correspond to the transparent Activity below; the real interface may correspond to the target Activity below.
当应用本身没有设置在启动过程中先创建透明界面,后创建真实界面,即直接创建真实界面,则这类应用在启动过程就不会存在透明界面。When the application itself is not set to create a transparent interface first during the startup process, and then create the real interface, that is, directly create the real interface, then such applications will not have a transparent interface during the startup process.
在现有技术中,手机的应用中可能只有部分应用在启动过程中会存在透明界面,而当用户触发应用的开启操作之后,对于手机而言并不知道用户开启的应用是否会存在透明界面。因此,基于本申请各实施例提供的方法,手机100可以获取第一界面的界面透明度参数,然后基于界面透明度参数判断该第一界面是否是透明界面。In the existing technology, only some of the mobile phone applications may have a transparent interface during the startup process. When the user triggers the opening operation of the application, the mobile phone does not know whether the application opened by the user will have a transparent interface. Therefore, based on the methods provided by various embodiments of the present application, the mobile phone 100 can obtain the interface transparency parameter of the first interface, and then determine whether the first interface is a transparent interface based on the interface transparency parameter.
S303:手机100根据第一界面的界面透明度参数判断第一界面是否为透明界面。若第一界面为透
明界面,则继续执行S304。S303: The mobile phone 100 determines whether the first interface is a transparent interface according to the interface transparency parameter of the first interface. If the first interface is transparent If the interface is clear, continue to execute S304.
在一些实施例中,手机100可以根据界面透明度参数判断界面是否为透明界面。具体的,当界面透明度参数大于透明度阈值时,可以认为界面为非透明界面;当界面透明度参数小于或等于透明度阈值时,可以认为界面为透明界面。示例性的,假设界面透明度参数为0~1,0表示界面完全透明,1表示界面完全不透明。比如透明度阈值为0,那么当界面透明度参数大于0时,界面为非透明界面,当界面透明度参数小于或等于0时,界面为透明界面。In some embodiments, the mobile phone 100 can determine whether the interface is a transparent interface according to the interface transparency parameter. Specifically, when the interface transparency parameter is greater than the transparency threshold, the interface can be considered to be a non-transparent interface; when the interface transparency parameter is less than or equal to the transparency threshold, the interface can be considered to be a transparent interface. For example, assume that the interface transparency parameter ranges from 0 to 1, with 0 indicating that the interface is completely transparent and 1 indicating that the interface is completely opaque. For example, if the transparency threshold is 0, then when the interface transparency parameter is greater than 0, the interface is a non-transparent interface; when the interface transparency parameter is less than or equal to 0, the interface is a transparent interface.
另一示例,假设透明度参数的取值范围为0~255,透明度阈值为10,那么当界面透明度参数小于10时,手机100可以确定该界面为透明界面;当界面透明度参数大于或等于10时,手机100可以确定该界面为非透明界面。As another example, assuming that the value range of the transparency parameter is 0 to 255 and the transparency threshold is 10, then when the interface transparency parameter is less than 10, the mobile phone 100 can determine that the interface is a transparent interface; when the interface transparency parameter is greater than or equal to 10, The mobile phone 100 can determine that the interface is a non-transparent interface.
应理解,上述示例仅是一种举例,在实际应用中,也可以为当界面透明度参数大于透明度阈值时,界面为透明界面;当界面透明度参数小于或等于透明度阈值时,界面为非透明界面,本申请对此不作限定。It should be understood that the above example is only an example. In actual applications, when the interface transparency parameter is greater than the transparency threshold, the interface is a transparent interface; when the interface transparency parameter is less than or equal to the transparency threshold, the interface is a non-transparent interface. This application does not limit this.
在一些实施例中,手机100可以根据setAlpha()函数,判断第一界面是否为透明界面。In some embodiments, the mobile phone 100 can determine whether the first interface is a transparent interface according to the setAlpha() function.
应理解,如果第一界面为透明界面,那么第一应用就是在启动过程中会存在透明界面的应用;如果第一界面不是透明界面,那么第一应用就是在启动过程中不会存在透明界面的应用。It should be understood that if the first interface is a transparent interface, then the first application is an application that will have a transparent interface during the startup process; if the first interface is not a transparent interface, then the first application will not have a transparent interface during the startup process. application.
S304:手机100启动目标活动。S304: Mobile phone 100 starts the target activity.
在一些实施例中,当第一界面为透明界面时,手机100可跳过创建该透明界面的过程,直接启动目标活动(Activity)。手机100可以不创建透明Activity,相比于现有技术可减少一个Activity的创建,能够缩短应用热启动的时间。In some embodiments, when the first interface is a transparent interface, the mobile phone 100 can skip the process of creating the transparent interface and directly start the target activity (Activity). The mobile phone 100 does not need to create a transparent Activity. Compared with the existing technology, one fewer Activity can be created and the application hot start time can be shortened.
S305:手机100绘制第二界面,启动第一应用。S305: The mobile phone 100 draws the second interface and starts the first application.
其中,第二界面为第一应用在切换为后台应用之前显示的界面。示例性的,假设第一应用为应用,比如用户通过百度应用打开了华为官网,并正在浏览华为官网的主页。如果此时用户通过上滑回到主界面,该百度应用可进入后台运行。接着,当用户再次打开百度应用时,如果第一界面为透明界面,则手机100可直接显示第二界面,该第二界面为华为官网的主页对应的界面,从而完成百度应用的热启动流程。The second interface is the interface displayed by the first application before switching to the background application. For example, assuming that the first application is Application, for example, the user has opened the Huawei official website through the Baidu application and is browsing the homepage of the Huawei official website. If the user slides up to return to the main interface at this time, the Baidu application can run in the background. Then, when the user opens the Baidu application again, if the first interface is a transparent interface, the mobile phone 100 can directly display the second interface, which is the interface corresponding to the homepage of Huawei's official website, thereby completing the hot start process of the Baidu application.
本申请实施例中,手机100在确定第一界面为透明界面时,可跳过创建该透明界面的过程,不创建透明Activity,直接启动目标Activity,该目标Activity对应的界面为第二界面。如果按照现有技术的方案,手机100并不判断第一界面是否为透明界面,并且在S304之前,手机100还需要创建透明Activity,而本申请实施例的方案相比于现有技术可减少透明Activity的创建,缩短应用热启动的时间,加速应用热启动的过程。In the embodiment of the present application, when the mobile phone 100 determines that the first interface is a transparent interface, it can skip the process of creating the transparent interface, without creating a transparent Activity, and directly start the target Activity, and the interface corresponding to the target Activity is the second interface. If according to the solution of the existing technology, the mobile phone 100 does not determine whether the first interface is a transparent interface, and before S304, the mobile phone 100 also needs to create a transparent Activity. However, the solution of the embodiment of the present application can reduce transparency compared to the existing technology. The creation of Activity shortens the time of application hot start and accelerates the process of application hot start.
下面结合软件架构对本申请实施例中的应用热启动方法进行介绍。如图4所示,为本申请实施例提供的一种应用热启动方法流程图,参阅图4所示,该方法可包括:The application hot start method in the embodiment of the present application will be introduced below in combination with the software architecture. As shown in Figure 4, it is a flow chart of an application hot start method provided by an embodiment of the present application. Referring to Figure 4, the method may include:
S401:第一应用接收到第一操作。S401: The first application receives the first operation.
其中,第一应用为后台应用,第一操作为启动第一应用的触发操作,例如可以为用户在桌面上对第一应用的应用图标的点击操作。当然,第一操作还可以为其它的操作,比如在多任务窗口中点击第一应用对应的窗口的操作,或者还可以为通过语音助手开启第一应用,例如用户可发出指令“小艺小艺,打开XX应用”等,本申请对此不作限定。Wherein, the first application is a background application, and the first operation is a triggering operation for starting the first application, which may be, for example, a user's click operation on an application icon of the first application on the desktop. Of course, the first operation can also be other operations, such as clicking the window corresponding to the first application in the multi-tasking window, or it can also be opening the first application through the voice assistant. For example, the user can issue the command "Xiaoyi Xiaoyi" , open XX application", etc., this application does not limit this.
在一些实施例中,第一应用接收到第一操作之前,可从前台运行切换为后台运行。比如,第一应用可接收到将第一应用切换到后台的第二操作,然后手机100可响应该第二操作,将第一应用从前台运行切换为后台运行。示例性的,第二操作可以为上滑返回桌面(主界面)的操作。In some embodiments, before receiving the first operation, the first application may switch from foreground running to background running. For example, the first application may receive a second operation to switch the first application to the background, and then the mobile phone 100 may respond to the second operation and switch the first application from running in the foreground to running in the background. For example, the second operation may be an operation of sliding up to return to the desktop (main interface).
S402:桌面应用通知AMS启动第一应用的Activity。S402: The desktop application notifies AMS to start the activity of the first application.
在一些实施例中,当用户在桌面上点击第一应用之后,桌面应用的进程可调用startActivity()函数,并通过进程间通信机制Binder机制发送消息给AMS,以使AMS启动第一应用的Activity。由于第一应用为后台应用,存在应用进程,因此,AMS无需再次创建应用进程。In some embodiments, after the user clicks the first application on the desktop, the process of the desktop application can call the startActivity() function and send a message to AMS through the inter-process communication mechanism Binder mechanism, so that AMS starts the Activity of the first application. . Since the first application is a background application and has an application process, AMS does not need to create an application process again.
应理解,第一应用在切换为后台应用之前,用户打开第一应用使其作为前台应用时,AMS已经创建过该应用的应用进程,因此,当用户再次打开第一应用时,就无需再次创建应用进程。It should be understood that before the first application is switched to a background application and the user opens the first application as a foreground application, AMS has already created the application process of the application. Therefore, when the user opens the first application again, there is no need to create it again. application process.
S403:AMS判断第一界面是否是透明界面。
S403: AMS determines whether the first interface is a transparent interface.
在一些实施例中,当第一界面是透明界面时,继续执行S404。In some embodiments, when the first interface is a transparent interface, continue to execute S404.
在一些实施例中,AMS可获取第一界面的界面透明度参数,然后根据界面透明度参数判断第一界面是否为透明界面。若第一界面的界面透明度参数大于透明度阈值,则第一界面为非透明界面;若第一界面的界面透明度参数小于或等于透明度阈值,则第一界面为透明界面。当然,上述判断方式仅是一种举例,例如也可以在第一界面的界面透明度参数小于透明度阈值时,确定第一界面为透明界面;当第一界面的透明度参数大于或等于透明度阈值时,确定第一界面为非透明界面。In some embodiments, the AMS can obtain the interface transparency parameter of the first interface, and then determine whether the first interface is a transparent interface based on the interface transparency parameter. If the interface transparency parameter of the first interface is greater than the transparency threshold, the first interface is a non-transparent interface; if the interface transparency parameter of the first interface is less than or equal to the transparency threshold, the first interface is a transparent interface. Of course, the above determination method is only an example. For example, when the interface transparency parameter of the first interface is less than the transparency threshold, it is determined that the first interface is a transparent interface; when the transparency parameter of the first interface is greater than or equal to the transparency threshold, it is determined that The first interface is a non-transparent interface.
S404:AMS跳过透明界面的创建。S404: AMS skips the creation of transparent interfaces.
本申请实施例中,如果AMS确定第一界面为透明界面,那么AMS可通过Binder机制通知第一应用进程执行ActivityPause()函数,拦截透明Activity。也就是说,如果AMS在第一应用的热启动过程中识别出透明Activity,则跳过该透明Activity的创建。In the embodiment of this application, if the AMS determines that the first interface is a transparent interface, the AMS can notify the first application process to execute the ActivityPause() function through the Binder mechanism to intercept the transparent Activity. That is to say, if AMS identifies a transparent Activity during the hot start of the first application, the creation of the transparent Activity is skipped.
S405:AMS启动目标Activity。S405: AMS starts the target Activity.
在一些实施例中,AMS跳过透明Activity的创建,可直接启动目标Activity,执行目标Activity的生命周期方法,比如onstart()、onresume()等方法。In some embodiments, AMS skips the creation of transparent Activity and can directly start the target Activity and execute the life cycle methods of the target Activity, such as onstart(), onresume() and other methods.
S406:第一应用绘制第二界面,完成热启动。S406: The first application draws the second interface and completes the hot start.
其中,第二界面为第一应用在切换为后台应用前显示的界面。The second interface is the interface displayed by the first application before switching to the background application.
在一些实施例中,第一应用可绘制对应目标Activity的第二界面,然后显示第二界面,从而完成第一应用的热启动过程。In some embodiments, the first application may draw a second interface corresponding to the target Activity, and then display the second interface, thereby completing the hot start process of the first application.
通过上述实施例,AMS在识别出第一界面为透明界面时,可主动跳过该透明界面的创建,这样可缩短应用热启动的时间,提高应用热启动的效率。Through the above embodiments, when AMS recognizes that the first interface is a transparent interface, it can actively skip the creation of the transparent interface, which can shorten the application hot start time and improve the efficiency of application hot start.
上述本申请提供的实施例中,从电子设备作为执行主体的角度对本申请实施例提供的方法进行了介绍。为了实现上述本申请实施例提供的方法中的各功能,电子设备可以包括硬件结构和/或软件模块,以硬件结构、软件模块、或硬件结构加软件模块的形式来实现上述各功能。上述各功能中的某个功能以硬件结构、软件模块、还是硬件结构加软件模块的方式来执行,取决于技术方案的特定应用和设计约束条件。In the above-mentioned embodiments provided by the present application, the method provided by the embodiments of the present application is introduced from the perspective of the electronic device as the execution subject. In order to implement each function in the method provided by the above embodiments of the present application, the electronic device may include a hardware structure and/or a software module to implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above functions is performed as a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
如图5所示,本申请另外一些实施例公开了一种电子设备,该电子设备可以是具有显示屏的电子设备。参阅图5所示,所述电子设备500包括:显示屏501;一个或多个处理器502;一个或多个存储器503;一个或多个传感器504(图中未示出)、多个应用505(图中未示出);以及一个或多个计算机程序506(图中未示出),上述各器件可以通过一个或多个通信总线507连接。As shown in FIG. 5 , other embodiments of the present application disclose an electronic device, which may be an electronic device with a display screen. Referring to Figure 5, the electronic device 500 includes: a display screen 501; one or more processors 502; one or more memories 503; one or more sensors 504 (not shown in the figure), and multiple applications 505 (not shown in the figure); and one or more computer programs 506 (not shown in the figure), each of the above devices can be connected through one or more communication buses 507.
其中,显示屏501用于显示电子设备中的应用的显示界面。存储器503中存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令;处理器502调用存储器503中存储的所述指令,使得电子设备500可以上述实施例的应用热启动方法。The display screen 501 is used to display a display interface of an application in the electronic device. One or more computer programs are stored in the memory 503, and the one or more computer programs include instructions; the processor 502 calls the instructions stored in the memory 503, so that the electronic device 500 can apply the hot start method in the above embodiment.
示例性的,当所述指令在电子设备500上运行时,使得所述电子设备500可执行如下步骤:检测到启动第一应用的第一操作;其中,所述第一应用为后台应用;响应所述第一操作,并在确定第一界面为透明界面时,启动第一应用的目标活动;绘制对应所述目标活动的第二界面,启动所述第一应用。Exemplarily, when the instruction is run on the electronic device 500, the electronic device 500 can perform the following steps: detect a first operation of starting a first application; wherein the first application is a background application; respond In the first operation, when it is determined that the first interface is a transparent interface, start the target activity of the first application; draw a second interface corresponding to the target activity and start the first application.
在本申请实施例中,处理器502可以是通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储器503中,处理器502读取存储器503中的程序指令,结合其硬件完成上述方法的步骤。In this embodiment of the present application, the processor 502 may be a general processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, which can be implemented Or execute the disclosed methods, steps and logical block diagrams in the embodiments of this application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor. The software module may be located in the memory 503. The processor 502 reads the program instructions in the memory 503 and completes the steps of the above method in combination with its hardware.
在本申请实施例中,存储器503可以是非易失性存储器,比如硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)等,还可以是易失性存储器(volatile memory),例如RAM。存储器还可以是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本申请实施例中的存储器还可以是电路或者其它任意能够实现存储功能的装置,用于存储指令和/或数据。In this embodiment of the present application, the memory 503 may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or it may be a volatile memory (volatile memory). For example RAM. Memory may also be, but is not limited to, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory in the embodiment of the present application can also be a circuit or any other device capable of realizing a storage function, used to store instructions and/or data.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the devices and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.
基于以上实施例,本申请还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机程序,
所述计算机程序被计算机执行时,使得所述计算机执行以上实施例提供的应用热启动方法。Based on the above embodiments, this application also provides a computer storage medium in which a computer program is stored. When the computer program is executed by the computer, the computer is caused to execute the application hot start method provided by the above embodiment.
本申请实施例中还提供一种计算机程序产品,包括指令,当其在计算机上运行时,使得计算机执行以上实施例提供的应用热启动方法。An embodiment of the present application also provides a computer program product, which includes instructions that, when run on a computer, cause the computer to execute the application hot start method provided in the above embodiments.
本申请实施例是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by instructions. These instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that instructions executed by the processor of the computer or other programmable data processing device produce for implementation means a function specified in a process or processes in a flowchart and/or in a block or blocks in a block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions The device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device. Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
Claims (11)
- 一种应用热启动方法,其特征在于,包括:An application hot start method is characterized by including:电子设备检测到启动第一应用的第一操作;其中,所述第一应用为后台应用;The electronic device detects a first operation of starting a first application; wherein the first application is a background application;所述电子设备响应所述第一操作,并在确定第一界面为透明界面时,启动第一应用的目标活动;The electronic device responds to the first operation, and when determining that the first interface is a transparent interface, starts the target activity of the first application;所述电子设备绘制对应所述目标活动的第二界面,启动所述第一应用。The electronic device draws a second interface corresponding to the target activity and starts the first application.
- 如权利要求1所述的方法,其特征在于,确定所述第一界面为透明界面,包括:The method of claim 1, wherein determining the first interface to be a transparent interface includes:所述电子设备获取所述第一界面的界面透明度参数;The electronic device obtains the interface transparency parameter of the first interface;所述电子设备根据所述界面透明度参数确定所述第一界面为透明界面。The electronic device determines that the first interface is a transparent interface according to the interface transparency parameter.
- 如权利要求2所述的方法,其特征在于,所述电子设备根据所述界面透明度参数确定所述第一界面为透明界面,包括:The method of claim 2, wherein the electronic device determines that the first interface is a transparent interface based on the interface transparency parameter, including:当所述电子设备确定所述界面透明度参数小于或等于透明度阈值时,确定所述第一界面为透明界面。When the electronic device determines that the interface transparency parameter is less than or equal to the transparency threshold, it determines that the first interface is a transparent interface.
- 如权利要求2所述的方法,其特征在于,所述电子设备获取所述第一界面的界面透明度参数,包括:The method of claim 2, wherein the electronic device obtains the interface transparency parameter of the first interface, including:所述电子设备根据setAlpha()函数,确定第一界面的透明度参数。The electronic device determines the transparency parameter of the first interface according to the setAlpha() function.
- 如权利要求1至4任一项所述的方法,其特征在于,所述电子设备启动第一应用的目标活动之前,所述方法还包括:The method according to any one of claims 1 to 4, characterized in that before the electronic device starts the target activity of the first application, the method further includes:所述电子设备跳过所述第一界面的创建。The electronic device skips creation of the first interface.
- 如权利要求1至5任一项所述的方法,其特征在于,电子设备检测到第一操作之前,所述方法还包括:The method according to any one of claims 1 to 5, characterized in that before the electronic device detects the first operation, the method further includes:所述电子设备显示所述第一应用的所述第二界面;The electronic device displays the second interface of the first application;所述电子设备检测到将所述第一应用切换到后台的第二操作;The electronic device detects a second operation of switching the first application to the background;所述电子设备响应所述第二操作,将所述第一应用从前台切换到后台运行。In response to the second operation, the electronic device switches the first application from the foreground to the background.
- 如权利要求1所述的方法,其特征在于,所述第二界面为所述第一应用在切换到后台运行之前显示的界面。The method of claim 1, wherein the second interface is an interface displayed by the first application before switching to background running.
- 如权利要求1所述的方法,其特征在于,所述第一操作包括如下操作中的任意一项:The method of claim 1, wherein the first operation includes any one of the following operations:对所述第一应用的应用图标的点击操作;Click operation on the application icon of the first application;在多任务窗口中对所述第一应用的窗口的点击操作;Click operation on the window of the first application in the multi-tasking window;语音触发操作。Voice triggered actions.
- 如权利要求6所述的方法,其特征在于,所述第二操作包括如下操作中的任意一项:The method of claim 6, wherein the second operation includes any one of the following operations:从所述第一应用切换到第二应用的操作;The operation of switching from the first application to the second application;返回主界面的操作。Return to the main interface operation.
- 一种电子设备,其特征在于,所述电子设备包括显示屏;一个或多个处理器;一个或多个存储器;一个或多个传感器;多个应用;以及一个或多个计算机程序;An electronic device, characterized in that the electronic device includes a display screen; one or more processors; one or more memories; one or more sensors; multiple applications; and one or more computer programs;其中所述一个或多个计算机程序被存储在所述一个或多个存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器调用执行时,使得所述电子设备执行如权利要求1至9任一项所述的方法。wherein the one or more computer programs are stored in the one or more memories, the one or more computer programs include instructions that, when called for execution by the one or more processors, cause The electronic device performs the method according to any one of claims 1 to 9.
- 一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,其特征在于,当所述指令在电子设备上运行时,使得所述电子设备执行如权利要求1至9任一项所述的方法。 A computer-readable storage medium with instructions stored in the computer-readable storage medium, characterized in that when the instructions are run on an electronic device, the electronic device is caused to execute any one of claims 1 to 9 the method described.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211073836.5A CN117687707A (en) | 2022-09-02 | 2022-09-02 | Application hot start method and electronic equipment |
CN202211073836.5 | 2022-09-02 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024046237A1 true WO2024046237A1 (en) | 2024-03-07 |
Family
ID=90100334
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/115081 WO2024046237A1 (en) | 2022-09-02 | 2023-08-25 | Application hot start method and electronic device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN117687707A (en) |
WO (1) | WO2024046237A1 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106598572A (en) * | 2016-11-17 | 2017-04-26 | 武汉斗鱼网络科技有限公司 | Application exiting method and apparatus |
CN110569080A (en) * | 2019-07-30 | 2019-12-13 | 华为技术有限公司 | application control method and electronic equipment |
CN112346831A (en) * | 2019-08-09 | 2021-02-09 | 华为技术有限公司 | Method and device for managing abnormal application |
CN114443156A (en) * | 2021-12-24 | 2022-05-06 | 荣耀终端有限公司 | Application processing method and electronic equipment |
-
2022
- 2022-09-02 CN CN202211073836.5A patent/CN117687707A/en active Pending
-
2023
- 2023-08-25 WO PCT/CN2023/115081 patent/WO2024046237A1/en unknown
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106598572A (en) * | 2016-11-17 | 2017-04-26 | 武汉斗鱼网络科技有限公司 | Application exiting method and apparatus |
CN110569080A (en) * | 2019-07-30 | 2019-12-13 | 华为技术有限公司 | application control method and electronic equipment |
CN112346831A (en) * | 2019-08-09 | 2021-02-09 | 华为技术有限公司 | Method and device for managing abnormal application |
CN114443156A (en) * | 2021-12-24 | 2022-05-06 | 荣耀终端有限公司 | Application processing method and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN117687707A (en) | 2024-03-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021057868A1 (en) | Interface switching method and electronic device | |
JP7142783B2 (en) | Voice control method and electronic device | |
WO2021063097A1 (en) | Display method and electronic equipment | |
WO2021036571A1 (en) | Desktop editing method and electronic device | |
WO2020134869A1 (en) | Electronic device operating method and electronic device | |
US20230384919A1 (en) | File Dragging Method and Electronic Device | |
WO2021037223A1 (en) | Touch control method and electronic device | |
CN116360725B (en) | Display interaction system, display method and device | |
WO2021057452A1 (en) | Method and device for presenting atomic service | |
CN114363462B (en) | Interface display method, electronic equipment and computer readable medium | |
US20220358089A1 (en) | Learning-Based Keyword Search Method and Electronic Device | |
WO2022057512A1 (en) | Split-screen method and apparatus, and electronic device | |
WO2021218429A1 (en) | Method for managing application window, and terminal device and computer-readable storage medium | |
WO2022161119A1 (en) | Display method and electronic device | |
WO2023088459A1 (en) | Device collaboration method and related apparatus | |
CN114115618A (en) | Application window display method and electronic equipment | |
EP4228233A1 (en) | Method for adding operation sequence, electronic device, and system | |
WO2023078088A1 (en) | Display method and electronic device | |
WO2023029983A1 (en) | Control content dragging method and system, and electronic device | |
WO2024046237A1 (en) | Application hot start method and electronic device | |
WO2023207683A1 (en) | Application compression method, decompression method, and electronic device | |
WO2024120296A1 (en) | Display method for thematic content, and electronic device | |
WO2023226922A1 (en) | Widget management method, electronic device, and computer-readable storage medium | |
WO2023207682A1 (en) | Text editing method and electronic device | |
WO2024169427A1 (en) | Communication mode switching method, and electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23859269 Country of ref document: EP Kind code of ref document: A1 |