WO2021238387A1 - Application execution method and apparatus - Google Patents

Application execution method and apparatus Download PDF

Info

Publication number
WO2021238387A1
WO2021238387A1 PCT/CN2021/083899 CN2021083899W WO2021238387A1 WO 2021238387 A1 WO2021238387 A1 WO 2021238387A1 CN 2021083899 W CN2021083899 W CN 2021083899W WO 2021238387 A1 WO2021238387 A1 WO 2021238387A1
Authority
WO
WIPO (PCT)
Prior art keywords
execution
characteristic
mode
application
execution domain
Prior art date
Application number
PCT/CN2021/083899
Other languages
French (fr)
Chinese (zh)
Inventor
代海涛
Original Assignee
荣耀终端有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 荣耀终端有限公司 filed Critical 荣耀终端有限公司
Publication of WO2021238387A1 publication Critical patent/WO2021238387A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/482Application
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • This application relates to the field of terminals, and in particular to a method and device for executing applications.
  • the embodiments of the present application provide a method and device for executing applications, which are used to resolve the contradiction between battery life and user experience and functions.
  • an embodiment of the present application provides a method for executing an application.
  • the method includes: obtaining a category of an application; determining a first execution domain from a plurality of execution domains according to the category of the application;
  • the application is executed in the application; the multiple execution domains are different execution domains obtained by dividing the hardware, and the multiple execution domains include a high-power execution domain and a low-power execution domain.
  • the flexibility of system power consumption control can be improved, and the overall power consumption level of the system can be reduced.
  • some applications are allocated to execute in the low-power execution domain. Since the power consumption level of the low-power execution domain is significantly lower than that of the high-power execution domain, the overall power consumption level can be reduced.
  • Some applications are allocated to execute in the high-power execution domain, which can ensure user experience. Therefore, the contradiction between battery life and user experience and functions can be resolved.
  • the method further includes: controlling idle execution domains of the plurality of execution domains except for the first execution domain to enter an energy-saving state.
  • the energy-saving state includes at least one of a standby state, a sleep state, and a deep sleep state.
  • the method further includes: determining that the shared peripheral that the application needs to access is exclusively occupied by the first execution domain, and setting a global exclusive flag for the shared peripheral; and when the shared peripheral is accessed After completion, the global exclusive identification set for the shared peripheral is cleared.
  • the method further includes: detecting a preset event, the preset event is used to trigger a second mode, and the second mode is the first characteristic of the plurality of characteristics included in the application The mode; the application includes multiple features, each feature corresponds to a functional segment of the application, the first feature is one of the multiple features; the mode for controlling the first feature starts from the first The mode is switched to the second mode, and the first mode is the initial mode of the first characteristic.
  • Using the above method can improve the flexibility of system power consumption control, and can reduce the overall power consumption level of the system.
  • the mode of the first characteristic includes at least two of a high experience mode, a low power consumption mode, and an off mode.
  • the mode of controlling the first characteristic in the application may be switched from the first mode to the second mode in the following manner, but not limited to: controlling the first characteristic from the first execution
  • the domain is switched to a second execution domain for execution, wherein the first mode corresponds to the first execution domain, and the second mode corresponds to the second execution domain.
  • the above method avoids the fixed execution domain allocation method. According to the detected preset event, the characteristics in the application can be dynamically switched to the corresponding execution domain, which can improve the flexibility of system power consumption control and reduce the overall system Power consumption level.
  • an embodiment of the present application provides a method for executing an application.
  • the method includes: acquiring a category of a first characteristic, where the first characteristic is one of a plurality of characteristics included in an application, and each characteristic corresponds to all characteristics.
  • a functional segment of the application a first execution domain is determined from a plurality of execution domains according to the category of the first characteristic, and the first characteristic is executed in the first execution domain; the plurality of execution domains are pairs Different execution domains obtained by hardware division, and the multiple execution domains include a high power consumption execution domain and a low power consumption execution domain.
  • the method further includes: acquiring a category of a second characteristic, where the second characteristic is one of a plurality of characteristics included in the application, and the second characteristic is different from the first characteristic; Determine a second execution domain from a plurality of execution domains according to the category of the second characteristic, execute the second characteristic in the second execution domain, and the second execution domain is different from the first execution domain, And the first characteristic and the second characteristic communicate through an IPC device or pipe.
  • the method further includes: controlling idle execution domains of the plurality of execution domains except for the first execution domain and the second execution domain to enter an energy-saving state.
  • the energy-saving state includes at least one of a standby state, a sleep state, and a deep sleep state.
  • the method further includes: determining that the shared peripheral that needs to be accessed by the first feature is exclusively occupied by the first execution domain, and setting a global exclusive flag for the shared peripheral; After being accessed, the global exclusive identifier set for the shared peripheral is cleared.
  • the method further includes: detecting a preset event, the preset event is used to trigger a second mode, and the second mode is a mode of the first characteristic; The mode is switched from the first mode to the second mode, and the first mode is the initial mode of the first characteristic.
  • Using the above method can improve the flexibility of system power consumption control, and can reduce the overall power consumption level of the system.
  • the mode of the first characteristic includes at least two of a high experience mode, a low power consumption mode, and an off mode.
  • the mode of controlling the first characteristic to switch from the first mode to the second mode may adopt but not limited to the following manner: controlling the first characteristic to switch from the first execution domain to The third execution domain is executed, wherein the first mode corresponds to the first execution domain, and the second mode corresponds to the third execution domain.
  • the above method avoids the fixed execution domain allocation method. According to the detected preset event, the characteristics in the application can be dynamically switched to the corresponding execution domain, which can improve the flexibility of system power consumption control and reduce the overall system Power consumption level.
  • an embodiment of the present application provides a communication device, the device includes a module for executing any one of the first aspect and the first aspect; or the device includes a module for executing the second aspect And any of the possible design modules in the second aspect.
  • an embodiment of the present application provides a communication device, including a processor and an interface circuit, the interface circuit is used to receive signals from other communication devices other than the communication device and transmit them to the processor or The signal from the processor is sent to other communication devices other than the communication device, and the processor is used to implement any one of the first aspect and the first aspect through logic circuits or execution code instructions, Or realize any one of the possible designs of the second aspect and the second aspect.
  • an embodiment of the present application provides a wearable device, including a processor and a memory, the memory is used to store a program, and the processor invokes the memory to execute any one of the first aspect and the first aspect Possible design, or any one of the second aspect and the second aspect.
  • the processor is used to implement any one of the possible designs of the first aspect and the first aspect, or to implement any one of the second aspect and the second aspect, through a logic circuit or executing code instructions.
  • an embodiment of the present application provides a computer-readable storage medium in which a computer program or instruction is stored.
  • the computer program or instruction is executed by a communication device, the first aspect and the first aspect are implemented. Any one of the possible designs, or the realization of any one of the second aspect and the second aspect.
  • the embodiments of the present application provide a computer program product containing a program, which, when it runs on a communication device, enables the communication device to execute any one of the possible designs of the first aspect and the first aspect, or execute the first aspect Any one of the possible designs of the second aspect and the second aspect.
  • FIG. 1 is a schematic diagram of an example of a terminal device in an embodiment of the application
  • FIGS. 2(a) and 2(b) are schematic diagrams of the structure of the terminal device in the embodiment of the application;
  • FIG. 3 is one of the schematic diagrams of a method for executing an application in an embodiment of this application
  • FIG. 5 is one of the specific flowcharts of executing the application in the embodiment of this application.
  • FIG. 6 is the second specific flowchart of the application execution in the embodiment of this application.
  • FIG. 7 is a second schematic diagram of a method for executing an application in an embodiment of this application.
  • FIG. 8 is a schematic diagram of the correspondence between feature classification and execution domain classification in an embodiment of this application.
  • FIG. 9 is the third specific flowchart of the application execution in the embodiment of this application.
  • FIG. 10 is the fourth specific flowchart of the application execution in the embodiment of this application.
  • FIG. 11 is one of the schematic structural diagrams of a communication device in an embodiment of this application.
  • FIG. 12 is the second structural diagram of a communication device in an embodiment of this application.
  • the embodiments of the present application can be applied to various terminal devices 100, such as mobile phones, personal computers (PC), tablets, wearable devices, and so on.
  • terminal devices 100 such as mobile phones, personal computers (PC), tablets, wearable devices, and so on.
  • Fig. 2(a) shows one of the schematic structural diagrams of the terminal device 100.
  • the terminal device 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, a battery 142, an antenna 1, and an antenna 2.
  • Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • SIM Subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope 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 structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device 100.
  • the terminal device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an 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.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the terminal device 100.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the processor 110 may include one or more interfaces.
  • the interface can include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter (universal asynchronous transmitter) interface.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the I2C interface is a bidirectional synchronous serial bus, which includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may include multiple sets of I2C buses.
  • the processor 110 may couple the touch sensor 180K, charger, flash, camera 193, etc., respectively through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to implement the touch function of the terminal device 100.
  • the I2S interface can be used for audio communication.
  • the processor 110 may include multiple sets of I2S buses.
  • the processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170.
  • the audio module 170 may transmit audio signals to the wireless communication module 160 through an I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communication to sample, quantize and encode analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the UART interface is generally used to connect the processor 110 and the wireless communication module 160.
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function.
  • the audio module 170 may transmit audio signals to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices.
  • the MIPI interface includes camera serial interface (camera serial interface, CSI), display serial interface (display serial interface, DSI), etc.
  • the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the terminal device 100.
  • the processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the terminal device 100.
  • the GPIO interface can be configured through software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on.
  • the USB interface 130 can be used to connect a charger to charge the terminal device 100, and can also be used to transfer data between the terminal device 100 and peripheral devices. It can also be used to connect earphones and play audio through earphones. This interface can also be used to connect to other terminal devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely a schematic illustration, and does not constitute a structural limitation of the terminal device 100.
  • the terminal device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 140 may receive the charging input of the wired charger through the USB interface 130.
  • the charging management module 140 may receive the wireless charging input through the wireless charging coil of the terminal device 100. While the charging management module 140 charges the battery 142, it can also supply power to the terminal device through the power management module 141.
  • 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, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110.
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the terminal device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the terminal device 100.
  • the mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like.
  • the mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves 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 wave radiation via the antenna 1.
  • at least part of the functional modules of the mobile communication module 150 may be provided 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 modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
  • the demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is processed by the baseband processor and then passed to the application processor.
  • the application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194.
  • the modem processor may be an independent device.
  • the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the terminal device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • 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 may also receive a signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic waves to radiate through the antenna 2.
  • the antenna 1 of the terminal device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the terminal device 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), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), and the 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 terminal device 100 implements a display function through a GPU, a display screen 194, and an application processor.
  • the GPU is a microprocessor for image processing, connected to the display 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations and is used for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display screen 194 includes a display panel.
  • the display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the terminal device 100 may include one or N display screens 194, and N is a positive integer greater than one.
  • the terminal device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • the ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transfers the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the terminal device 100 may include one or N cameras 193, and N is a positive integer greater than one.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the terminal device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the terminal device 100 may support one or more video codecs. In this way, the terminal device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, and so on.
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • applications such as intelligent cognition of the terminal device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the processor 110 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 121.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the terminal device 100.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
  • UFS universal flash storage
  • the terminal device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
  • the speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the terminal device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also called a "handset" is used to convert audio electrical signals into sound signals.
  • the terminal device 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C.
  • the terminal device 100 may be provided with at least one microphone 170C.
  • the terminal device 100 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals.
  • the terminal device 100 may also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
  • the earphone interface 170D is used to connect wired earphones.
  • the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association
  • the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A may be provided on the display screen 194.
  • the capacitive pressure sensor may include at least two parallel plates with conductive materials. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes.
  • the terminal device 100 determines the strength of the pressure according to the change in capacitance.
  • the terminal device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the terminal device 100 may also calculate the touched position based on the detection signal of the pressure sensor 180A.
  • touch operations that act on the same touch position but have different touch operation intensities can correspond to different operation instructions. For example: when a touch operation whose intensity is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
  • the gyro sensor 180B may be used to determine the movement posture of the terminal device 100.
  • the angular velocity of the terminal device 100 around three axes ie, x, y, and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyroscope sensor 180B detects the shaking angle of the terminal device 100, and calculates the distance that the lens module needs to compensate according to the angle, so that the lens can counteract the shaking of the terminal device 100 through a reverse movement to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • the air pressure sensor 180C is used to measure air pressure.
  • the terminal device 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the terminal device 100 may use the magnetic sensor 180D to detect the opening and closing of the flip holster.
  • the terminal device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, features such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the terminal device 100 in various directions (generally three axes). When the terminal device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the terminal device, applied to applications such as horizontal and vertical screen switching, pedometer and so on.
  • the terminal device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the terminal device 100 may use the distance sensor 180F to measure the distance to achieve fast focusing.
  • the 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 terminal device 100 emits infrared light to the outside through the light emitting diode.
  • the terminal device 100 uses a photodiode 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 terminal device 100. When insufficient reflected light is detected, the terminal device 100 can determine that there is no object near the terminal device 100.
  • the terminal device 100 can use the proximity light sensor 180G to detect that the user holds the terminal device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in leather case mode, and the pocket mode will automatically unlock and lock the screen.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the terminal device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light.
  • 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 terminal device 100 is in a pocket to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the terminal device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
  • the temperature sensor 180J is used to detect temperature.
  • the terminal device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the terminal device 100 reduces the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection.
  • the terminal device 100 when the temperature is lower than another threshold, the terminal device 100 heats the battery 142 to avoid abnormal shutdown of the terminal device 100 due to low temperature.
  • the terminal device 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 may be provided on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K may also be disposed on the surface of the terminal device 100, which is different from the position of the display screen 194.
  • the 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 voice.
  • the bone conduction sensor 180M can also contact the human pulse and receive the blood pressure pulse signal.
  • the bone conduction sensor 180M may also be provided in the earphone, combined with the bone conduction earphone.
  • the audio module 170 can parse the voice signal based on the vibration signal of the vibrating bone block of the voice obtained by the bone conduction sensor 180M, and realize the voice function.
  • the application processor may analyze the heart rate information based on the blood pressure beating signal obtained by the bone conduction sensor 180M, and realize the heart rate detection function.
  • the button 190 includes a power-on button, a volume button, and so on.
  • the button 190 may be a mechanical button. It can also be a touch button.
  • the terminal device 100 may receive key input, and generate key signal input related to user settings and function control of the terminal device 100.
  • the motor 191 can generate vibration prompts.
  • the motor 191 can be used for incoming call vibration notification, and can also be used for touch vibration feedback.
  • touch operations that act on different applications can correspond to different vibration feedback effects.
  • Acting on touch operations in different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects.
  • Different application scenarios for example: time reminding, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
  • the SIM card interface 195 is used to connect to the SIM card.
  • the SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the terminal device 100.
  • the terminal device 100 may support 1 or N SIM card interfaces, and N is a positive integer greater than 1.
  • the SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
  • the same SIM card interface 195 can insert multiple cards at the same time. The types of the multiple cards can be the same or different.
  • the SIM card interface 195 can also be compatible with different types of SIM cards.
  • the SIM card interface 195 can also be compatible with external memory cards.
  • the terminal device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
  • the terminal device 100 adopts an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100.
  • Fig. 2(b) shows the second structural diagram of the terminal device 100.
  • the terminal device 100 has a processor 211, a memory 205, and various software loaded in the memory, including an operating system 201, a desktop program 202, a synthesizer 203, and a service program 204.
  • the terminal device 100 also has various peripherals, including communication devices 206 (such as bluetooth low energy (BLE), WiFi, modems, etc.), sensors 207 (such as gravity sensors, acceleration sensors, and angular velocity sensors).
  • communication devices 206 such as bluetooth low energy (BLE), WiFi, modems, etc.
  • sensors 207 such as gravity sensors, acceleration sensors, and angular velocity sensors.
  • Photoplethysmography (PPG) sensor such as keyboard, touch screen, etc.
  • memory 209 such as built-in non-removable memory, Removable library card, etc.
  • output device 210 such as printer, etc.
  • processor 211 such as ARM, X86, MIPS, etc.
  • vibration device 212 such as linear motor, eccentric motor, etc.
  • display device 213 such as liquid crystal display) (liquid crystal display, LCD) screen, organic light-emitting diode (OLED) screen, active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED screen, etc.
  • camera equipment 214 such as a front camera, a rear camera, a time of flight (TOF) camera, an infrared camera, etc.).
  • TOF time of flight
  • high experience means higher frequency central processing unit (CPU), graphics processing unit (GPU), and more complex calculations and graphics and image processing.
  • CPU central processing unit
  • GPU graphics processing unit
  • complex calculations and graphics and image processing In terminal devices, especially devices such as mobile phones and wearable devices, due to the limited battery capacity, terminal devices that pursue high experience will inevitably lead to a decrease in battery life.
  • Terminal devices pursuing long battery life may use specific hardware, such as ink screens (not active refresh, optional backlight), low-power memory (low working voltage), static memory (not active refresh), and low-power CPU (It may also be a microcontroller unit (MCU), low-power GPU (or GPU may be eliminated) to meet low power consumption at the hardware level, and at the same time cooperate with more stringent power management strategies at the software level (for example, global standby, hibernation) , Kill background processes by default, etc.) to achieve battery life goals.
  • the above hardware and software design strategies generally lead to a decline in user experience. For example, ink screens will cause serious refresh delays and do not support color. Low power Consuming logic devices (memory, CPU, GPU) will cause the system to respond slowly.
  • the software's aggressive standby or default killing process will cause the terminal device to become less responsive, and task switching is not very user-friendly (for example, applications placed in the background) After restoring to the foreground, the original state of the application cannot be restored).
  • the system is configured with a "low power consumption mode". After the system enters the "low power consumption mode", all functions are Running in the "low power consumption mode", the system will try to close the "excess” functions and special effects at this time. At the same time, the hardware and sensors that these functions depend on also enter the dormant or power-off state, and the main CPU and main memory are dynamically reduced. Operating frequency, the screen works at a lower brightness and color depth, try to reduce the number of screen refreshes and content refresh.
  • Using the above solution can extend the battery life to a certain extent, but because the hardware performance in the "low power mode” is very limited, and the functions are much less than in the normal mode, the user experience is also significantly reduced.
  • the prior art also proposes a solution: the system configures an "exclusive hardware mode".
  • the system only provides some functions to the user in the "exclusive hardware mode". All the underlying software (such as operating systems, drivers, file systems, etc.) that these functions depend on run on an exclusive extremely low-power processor.
  • the main CPU is completely powered off.
  • the functions provided by peripherals and sensors in this mode are turned on on demand.
  • Adopt the above-mentioned scheme first, because this scheme uses the exclusive hardware, therefore increases the cost of the system.
  • the performance of the exclusive hardware is very low, the functions in this mode are limited, only some basic functions are included, and the user experience is not as good as the normal mode.
  • the switching takes a long time.
  • the system is composed of an application, an application loader, and an execution domain.
  • the execution domain refers to a combination or range of hardware. In a specific execution domain, only hardware belonging to the execution domain can be accessed.
  • the system can divide the hardware into multiple execution domains.
  • the division of the execution domain described above may be pre-divided (that is, statically divided), or it may be dynamically divided.
  • the division of the execution domain described above may be divided in a physical way, or divided in a logical way.
  • the so-called physical division refers to the hardware entity corresponding to a specific execution domain
  • the so-called logical division refers to the determination of the execution domain through dynamic configuration and control.
  • the system may divide the hardware into a first execution domain and a second execution domain, where the first execution domain is used to execute applications or performance with lower power consumption requirements, or applications or performance with higher battery life requirements, or Experience less demanding applications or performance.
  • the second execution domain is used for applications or performance with higher power consumption requirements, or applications or performance with lower battery life requirements, or applications or performance with higher experience requirements.
  • the execution domain is built on a dual CPU (MCU+AP) hardware architecture.
  • MCU is weak in performance and low in power consumption, and it is a non-full-featured low-speed CPU.
  • Application processor (AP) is a full-featured high-speed CPU, most of which will also integrate GPU, Internet service provider (ISP), high-speed dynamic memory controller, etc., such as AP can be used as the main mobile phone CPU, high performance and high power consumption.
  • the system divides the hardware into 2 execution domains, including MCU domain and AP domain.
  • MCU domain the AP and the GPU on the AP side are used to provide users with a higher user experience, and the power consumption is higher.
  • AP is the main CPU of the AP domain.
  • MCU domain is used to provide users with basic functions and a lower user experience, with lower power consumption.
  • MCU is the main CPU of the MCU domain.
  • the number of execution domains may also be greater than 2, which is not limited in the embodiment of the present application.
  • Each execution domain can access shared peripherals, which can also be referred to as public peripherals, can also access their own exclusive peripherals, or can be referred to as dedicated peripherals.
  • the screen can be shared or exclusive.
  • typical shared peripherals include touch screens, linear acceleration sensors, angular velocity sensors, PPG sensors, external memory (such as fixed or pluggable memory), cameras and image sensors.
  • Typical exclusive peripherals include GPUs.
  • GPUs are exclusively occupied by high-power execution domains. It should be understood that the foregoing division of shared peripherals and exclusive peripherals is only an example, and is not a limitation of the embodiments of the present application. Among them, in terms of physical connection, peripherals are fixedly connected to the external bus of a specific processor.
  • the MCU has two roles: one is the main CPU in the low-power domain, and the other is the public IO Hub. Among them, because the MCU has very low power consumption and can always keep working, the MCU can be used as a public IO Hub.
  • the Bluetooth controller is connected to the external bus of the MCU. If the AP needs to transmit data via Bluetooth, it needs to transfer it through the MCU first. At the software and/or logic level, peripherals can be considered to work in different execution domains.
  • the application loader is used to load the executable image and the corresponding data, symbols and other additional information into the memory, and wait for the operating system (OS) to schedule the CPU to execute.
  • OS operating system
  • Typical application loader implementations include class loader in Java runtime, execve in Linux, ntdll.dll in windows, and so on.
  • a characteristic refers to a functional segment of an application or software.
  • An application can include multiple features.
  • the Home application includes features such as dial, weather, altitude, battery level, and Bluetooth status.
  • the dial feature is responsible for providing the display of the dial
  • the weather feature is responsible for displaying the weather information of the specified area on the dial
  • the altitude feature is responsible for displaying the altitude information of the specified area on the dial
  • the battery power and Bluetooth status are responsible for providing the display of the system status.
  • Dial features can also be divided into sub-features such as video dial, 3D dial, album dial, and standby dial.
  • video dial, 3D dial, album dial these features provide complex screen effects.
  • the album dial also needs to read image files from the system album.
  • the standby dial only provides a simple time display function, without complicated screen effects, and no need to obtain other system data.
  • various sports applications may also include features such as heart rate monitoring, wrist posture detection (such as raising the wrist to brighten the screen), and pressure monitoring.
  • the embodiment of the present application provides a method for executing an application to resolve the contradiction between battery life and user experience and functions.
  • the execution subject of this method may be a terminal device, as shown in FIG. 1, such as a mobile phone or a smart watch, or may also be an application loader in the system.
  • the following takes the application loader as an example for description.
  • the method includes:
  • the system provides a notification mechanism to let the outside know the loading status and events, for example, a callback, and the application loader can obtain application information through the callback.
  • a notification mechanism to let the outside know the loading status and events, for example, a callback, and the application loader can obtain application information through the callback.
  • the application information includes the category of the application.
  • applications are divided into multiple categories.
  • applications are divided into a first category of applications and a second category of applications, and the basis for dividing the applications may include factors such as battery life, power consumption, and experience.
  • applications can be divided into long battery life applications (also referred to as low experience applications) and high experience applications (also referred to as short battery life applications).
  • the application can be divided into a long battery life application and a short battery life application.
  • the application can be divided into a low-experience application and a high-experience application.
  • the application can be divided into a low power consumption application and a high power consumption application. It is understandable that the number of application categories can also be greater than 2, and the above examples are not limited to the embodiments of the present application.
  • typical long-endurance applications include various sports APPs (running, swimming, outdoor, etc.).
  • Typical high-experience applications include cool dials, interactive dials, video games, music playback, etc.
  • the number of execution domains and the number of application categories can be the same or different.
  • the number of classifications of applications may be greater than the number of execution domains, or the number of execution domains may be greater than the number of classifications of applications.
  • the system can further divide the low-power execution domain into more subdomains.
  • the application loader determines a first execution domain from multiple execution domains according to the category of the application, and executes the application in the first execution domain.
  • the application loader pulls up an application, according to the acquired category of the application, the execution domain corresponding to the category of the application is queried, that is, the first execution domain is determined, where the correspondence between the category of the application and the execution domain Can be configured in advance. After determining the first execution domain, the application loader allocates the application to the first execution domain for execution.
  • the application is a cool dial
  • the category of the cool dial is a high-experience application
  • the application loader determines an AP domain (that is, a high-power execution domain) for a high-experience application according to the category of the cool dial.
  • the application is a certain sports application
  • the category of the sports application is a long-life application
  • the application loader determines the MCU domain (ie, a low-power execution domain) according to the category of the sports application as a long-life application.
  • the application loader controls the idle execution domains other than the first execution domain to enter the energy-saving state.
  • the energy-saving state includes at least one of a standby state, a sleep state, and a deep sleep state.
  • the idle execution domain preferentially selects to enter the standby state.
  • the standby state means that the CPU is powered on and the memory is powered on. At this time, the CPU is working at a very low frequency. If it is a multi-core CPU, some of its cores will also be shut down. Since the CPU is always working, there is no need to restore the state, just increase the CPU working frequency and wake up other cores to work at full speed.
  • the sleep state means that the CPU is powered off and the memory is powered on. If you want to resume the CPU operation at this time, you need to wake up the CPU first, and then the CPU restores the state saved in the memory to its own register.
  • the deep sleep state means that both the CPU and memory are powered off. If you want the CPU to resume operation at this time, you need to reboot, that is, load the state and/or data of the CPU from the external memory.
  • the energy-saving state may also include other states, and the various states shown in the above examples may have different meanings in different systems.
  • the application loader can control the first execution domain to enter the energy-saving state.
  • the following takes Example 1 to Example 4 as examples for description.
  • Example 1 When the system detects that the user turns off the screen and the execution domain of the current application is a high-power execution domain, the application controller can control the high-power execution domain to enter the standby state.
  • Example 2 When the system detects that the user has not operated for a period of time (configurable, 5s by default), and the execution domain of the current application is a high-power execution domain, the application loader can control the high-power execution domain to enter the standby state.
  • Example 3 When the system detects that the current application is switched to the background by the user, and another application is started at the same time, the execution domain of the current application is a high-power execution domain, and the category of the newly started application is a long battery life application, then the newly started application The application is loaded into the low-power execution domain, and at this time the high-power execution domain has no other foreground applications, the application loader can control the high-power execution domain to enter the standby state.
  • Example 4 When the system detects that the current application is running with a low power consumption feature, and the execution domain of the current application is a high power consumption execution domain, the application loader can control the high power consumption execution domain to enter the standby state.
  • the Home application includes features such as dial, weather, altitude, battery level, and Bluetooth status.
  • the dial features can be divided into sub-features such as video dials, 3D dials, album dials, and standby dials. Among them, video dials, 3D dials, and album dials are high-experience features, and these features provide complex screen effects.
  • the album dial also needs to read image files from the system album.
  • the standby dial only provides a simple time display function, without complicated screen effects, and no need to obtain other system data. It is a feature of low power consumption. Therefore, when the dial feature is a standby dial, the application loader can control the high power consumption execution domain to enter the standby state.
  • the high power consumption execution domain when the high power consumption execution domain has been in the standby state for more than a period of time and has not exited, the high power consumption execution domain enters the sleep state.
  • the deep sleep state requires the user to perform an explicit switch, and recovery from the deep sleep state requires a reboot.
  • the application loader determines that the shared peripheral that the application needs to access is exclusively occupied by the first execution domain, and sets a global exclusive flag for the shared peripheral. After the shared peripheral is accessed, it clears the global exclusive flag set for the shared peripheral . Therefore, through this identification, other execution domains will not be able to obtain the control right of the peripheral, ensuring the exclusive access of the current execution domain to the peripheral, and avoiding data or status errors. It should be understood that for a CPU or Hub, peripherals are generally child nodes on the system and only support a single parent node. Therefore, regardless of whether a global exclusive flag is set, peripherals are generally exclusive. At the same time, peripherals can be time-division multiplexed or address multiplexed. Only one CPU can access during a multiplexing period.
  • the system when it detects a preset event, it queries the mode corresponding to the preset event, that is, determines the second mode, which is the mode of the first characteristic corresponding to the preset event, and controls the mode of the first characteristic in the application
  • the mode is switched from the first mode to the second mode, and the first mode is the initial mode of the first characteristic.
  • the application includes multiple characteristics, and the first characteristic is one of the multiple characteristics.
  • Mode can refer to a certain state of a feature, which can be expressed in terms of appearance, behavior, etc., in which a feature can have multiple modes.
  • the preset events may include but are not limited to the following events: "smart watch is removed from the wrist”, “user raises the wrist”, and “entering the night time period”.
  • the mode of the first characteristic includes at least two of a high experience mode, a low power consumption mode, and an off mode.
  • the mode of the first characteristic may also adopt other designs, which are not limited in the embodiment of the present application.
  • the mode of the characteristic has a corresponding relationship with the execution domain.
  • the modes of the first characteristic include a high experience mode and a low power consumption mode, the high experience mode corresponds to the high power consumption execution domain, and the low power consumption mode corresponds to the low power consumption execution domain.
  • the modes of the first characteristic include high experience mode, low power consumption mode, and shutdown mode.
  • the high experience mode corresponds to the high power execution domain
  • the low power mode corresponds to the low power execution domain
  • the shutdown mode does not correspond to any execution domain. .
  • the number of modes and the number of execution domains of the characteristic may be the same or different.
  • switching the mode of controlling the first characteristic in the application from the first mode to the second mode may refer to controlling the first characteristic to be executed from the first execution domain to the second execution domain, where the first mode corresponds to the first execution Domain, the second mode corresponds to the second execution domain.
  • the execution domain of the first characteristic is controlled to switch from the high power consumption execution domain to the low power consumption execution domain.
  • switching the mode of controlling the first characteristic in the application from the first mode to the second mode may refer to controlling the first characteristic to stop executing in the first execution domain, that is, turning off the first characteristic.
  • the mode of the first characteristic is switched from the high experience mode to the closed mode, the first characteristic is controlled to be turned off.
  • the system includes two execution domains, namely a low-power execution domain and a high-power execution domain.
  • the modes of the dial feature include high experience mode, low power consumption mode and off mode.
  • the initial execution domain of the dial feature is the low-power execution domain, and the initial mode of the dial feature is the low-power mode.
  • Scenario 1 The user raises his wrist.
  • the dial feature is switched from the low-power consumption mode to the high-experience mode, and accordingly, the dial feature is switched from the low-power execution domain to the high-power execution domain.
  • the AP in the high-power execution domain and the GPU on the AP side are responsible for the calculation and drawing of the 3D model, lighting, and interaction on the dial. Users get a cool dial experience with full functions and special effects, such as a pinball game or a rolex of light and shadow.
  • Scenario 2 The user puts down his wrist. After the system detects that the user puts down the wrist for 3 seconds (the specific time interval can be set), the system determines that the user puts down the wrist for more than the specified time interval, the dial feature switches from the high experience mode to the low power consumption mode, and accordingly, the dial feature changes from high power consumption
  • the execution domain switches to low-power execution domain execution. Due to the hardware capabilities of the low-power execution domain, the 3D model and lighting are not available, and the user gets a basic watch face that can check the time.
  • Scenario 3 The user takes the smart watch off the wrist. Scenario 3 is similar to scenario 2. The dial feature switches from a high experience mode to a low power consumption mode. Correspondingly, the dial feature switches from a high-power execution domain to a low-power execution domain.
  • Scenario 4 Enter the night time period. Since in most cases, the user has fallen asleep during the night time, it is unnecessary for the dial feature to execute in the low-power execution domain. Therefore, the dial feature is switched to the off mode, and the dial feature is no longer executed in any execution domain. Exemplarily, the dial and even the entire screen can be directly closed at this time.
  • FIGS. 4 and 5 are examples.
  • Step 501 Obtain the category of the application, and determine the first execution domain.
  • the category of the application is obtained, and the execution domain corresponding to the category of the application is queried according to the category of the application, and the first execution domain is determined.
  • Step 502 Wake up the first execution domain.
  • the time for waking up the first execution domain should not exceed 300 ms.
  • Step 503 Determine whether other execution domains are idle, that is, whether execution domains other than the first execution domain are idle, if yes, go to step 504, otherwise go to step 505.
  • Step 504 Control the idle execution domain to enter the energy-saving state.
  • the number of energy-saving states may also be more than one.
  • Step 505 Execute the application in the first execution domain.
  • the hardware units included in the first execution domain can work normally. Therefore, the context of the application is established in the first execution domain, the code of the application is loaded, and the application is executed immediately.
  • the context includes the initialization of each register, the initialization of the allocation domain of the runtime memory, and so on.
  • Step 506 Determine whether the application needs to access peripherals.
  • step 507 is executed, and if the peripheral is not needed to be accessed, the process ends.
  • Step 507 If the application needs to access the peripheral, it is further judged whether the peripheral is a shared peripheral, that is, whether the shared peripheral is exclusively occupied by the first execution domain, if so, go to step 508, otherwise go to step 509 .
  • Step 508 Set a global exclusive identifier.
  • Step 509 Perform normal peripheral reading and writing and control.
  • the application if the application needs to access the shared peripheral, it executes normal read, write and control of the shared peripheral until the access to the shared peripheral is completed. If the application needs to access the exclusive peripheral, the normal exclusive peripheral read and write and control are performed until the exclusive peripheral access is completed. If the application needs to access shared peripherals and exclusive peripherals, perform normal shared peripheral read, write and control until the shared peripheral access is completed, and perform normal shared peripheral read, write and control until the exclusive peripheral access is completed .
  • Step 510 Clear the global exclusive flag after the access to the shared peripheral is completed.
  • the flexibility of system power consumption control can be improved, and the overall power consumption level of the system can be reduced.
  • some applications are allocated to execute in the low-power execution domain. Since the power consumption level of the low-power execution domain is significantly lower than that of the high-power execution domain, the overall power consumption level can be reduced.
  • Some applications are allocated to execute in the high-power execution domain, which can ensure user experience. Therefore, the contradiction between battery life and user experience and functions can be resolved.
  • FIG. 6 As an example.
  • Step 601 Obtain the category of the application, and allocate the application to the first execution domain for execution.
  • the category of the application is obtained, and the execution domain corresponding to the category of the application is queried according to the category of the application, and the first execution domain is determined.
  • the application includes multiple characteristics, the first characteristic is one of the multiple characteristics, and the first mode is an initial mode of the first characteristic, which is associated with the first execution domain.
  • Step 602 Detect a preset event. If a preset event is detected, step 603 is executed, otherwise the process ends.
  • Step 603 Query the mode of the first characteristic corresponding to the preset event, determine the second mode, and switch the mode of the first characteristic from the first mode to the second mode.
  • Step 604 Switch the first characteristic from the first execution domain to the execution domain corresponding to the second mode according to the execution domain corresponding to the second mode.
  • Step 605 resume the execution of the first feature in the execution domain corresponding to the second mode.
  • Step 606 Determine whether the application is finished, if the execution is finished, the process is finished, otherwise, the preset event is continuously detected, and step 602 is returned.
  • the above method avoids the fixed execution domain allocation method. According to the detected preset event, the characteristics in the application can be dynamically switched to the corresponding execution domain, which can improve the flexibility of system power consumption control and reduce the overall system Power consumption level.
  • the embodiment of the present application provides a method for executing an application to resolve the contradiction between battery life and user experience and functions.
  • the execution subject of this method may be a terminal device or may be an application loader in the system.
  • the following takes the application loader as an example for description. As shown in Figure 7, the method includes:
  • the application loader obtains the category of the first characteristic, where the first characteristic is one of the multiple characteristics included in the application.
  • the application includes multiple features, and different features can communicate through inter-process communication (IPC) devices or pipes.
  • IPC inter-process communication
  • the characteristics are divided into a first category of characteristics and a second category of characteristics, and the basis for the classification of the characteristics may include factors such as battery life, power consumption, and experience. It is understandable that the number of application categories can also be greater than 2, and the above examples are not limited to the embodiments of the present application.
  • the characteristics can be divided into high experience characteristics and low power consumption characteristics, as shown in FIG. 4.
  • features that belong to the background computing category in the application can be used as the first Category features have become low-power features.
  • Features that require higher user experience in applications can be used as second category features, which can also be referred to as high-experience features.
  • UI interface switching transition various micro-motion effects, transition animation, etc.
  • micro-motion effects refer to animation effects built into a small range of UI elements.
  • dial features can also be divided into video dials, 3D dials, album dials, standby dials and other sub-characteristics. Among them, video dials, 3D dials, etc. Dials, photo album dials are high-experience features, and these features provide complex screen effects. The standby dial only provides a simple time display function, without complicated screen effects, and no need to obtain other system data. It is a feature of low power consumption.
  • the number of execution domains and the number of feature classifications can be the same or different.
  • the number of classifications of characteristics may be greater than the number of execution domains, or the number of execution domains may be greater than the number of classifications of characteristics.
  • the application loader determines a first execution domain from multiple execution domains according to the category of the first characteristic, and executes the first characteristic in the first execution domain.
  • the application loader when the application loader pulls up the application, it queries the execution domain corresponding to the first characteristic category according to the acquired first characteristic category, that is, determines the first execution domain, where the characteristic category corresponds to the execution domain The relationship can be configured in advance. After determining the first execution domain, the application loader assigns the first characteristic to the first execution domain for execution.
  • the application loader may also obtain the category of the second characteristic, determine the second execution domain from a plurality of execution domains according to the category of the second characteristic, and execute the second characteristic in the second execution domain.
  • the second execution domain is different from the first execution domain, and the first characteristic and the second characteristic are communicated through an IPC device or a pipe.
  • the second characteristic is one of a plurality of characteristics included in the application, and the second characteristic is different from the first characteristic.
  • the application loader allocates low power consumption features to the MCU domain for execution, and high experience features to the AP domain for execution.
  • the application loader can control the idle execution domains except the first execution domain and the second execution domain to enter the energy-saving state.
  • the energy-saving state includes at least one of a standby state, a sleep state, and a deep sleep state.
  • the energy-saving state please refer to the related content of part S302 in the embodiment shown in FIG. 3, and the repetition will not be repeated.
  • the application loader determines that the shared peripheral that needs to be accessed by the first feature is exclusively owned by the first execution domain, and sets a global exclusive flag for the shared peripheral. After the shared peripheral is accessed, it clears the global exclusive flag set for the shared peripheral . It should be understood that for a CPU or Hub, peripherals are generally child nodes on the system and only support a single parent node. Therefore, regardless of whether a global exclusive flag is set, peripherals are generally exclusive. At the same time, peripherals can be time-division multiplexed or address multiplexed. Only one CPU can access during a multiplexing period.
  • the system when it detects a preset event, it queries the mode corresponding to the preset event, that is, determines the second mode.
  • the second mode is the mode of the first characteristic corresponding to the preset event, and the mode of controlling the first characteristic is from the first One mode is switched to the second mode, and the first mode is the initial mode of the first characteristic.
  • the preset events may include but are not limited to the following events: "smart watch is removed from the wrist”, “user raises the wrist”, and “entering the night time period”.
  • the mode of the first characteristic includes at least two of a high experience mode, a low power consumption mode, and an off mode.
  • the mode of the first characteristic may also adopt other designs, which are not limited in the embodiment of the present application.
  • the mode of the characteristic has a corresponding relationship with the execution domain.
  • the modes of the first characteristic include a high experience mode and a low power consumption mode, the high experience mode corresponds to the high power consumption execution domain, and the low power consumption mode corresponds to the low power consumption execution domain.
  • the modes of the first characteristic include high experience mode, low power consumption mode, and shutdown mode.
  • the high experience mode corresponds to the high power execution domain
  • the low power mode corresponds to the low power execution domain
  • the shutdown mode does not correspond to any execution domain. .
  • the number of modes and the number of execution domains of the characteristic may be the same or different.
  • switching the mode of controlling the first characteristic from the first mode to the second mode may refer to controlling the first characteristic to be executed from the first execution domain to the third execution domain, wherein the first mode corresponds to the first execution domain, and the first mode corresponds to the first execution domain.
  • the second mode corresponds to the third execution domain.
  • the third execution domain here may be the second execution domain or other execution domains, which is not limited in the embodiment of the present application.
  • the mode of the first characteristic is switched from the high experience mode to the low power consumption mode, the execution domain of the first characteristic is controlled to switch from the high power consumption execution domain to the low power consumption execution domain.
  • switching the mode of controlling the first characteristic in the application from the first mode to the second mode may refer to controlling the first characteristic to stop executing in the first execution domain, that is, turning off the first characteristic.
  • the mode of the first characteristic is switched from the high experience mode to the closed mode, the first characteristic is controlled to be turned off.
  • FIGS. 8 and 9 are examples.
  • Step 901 Acquire the category of the first characteristic, and determine the first execution domain.
  • the category of the first characteristic is acquired.
  • the first characteristic may be heart rate detection, or some kind of micro-motion effect.
  • heart rate detection the category of the first characteristic is a low power consumption characteristic
  • micro-motion effect the category of the first characteristic is a high experience characteristic.
  • the application loader queries the execution domain corresponding to the category of the first characteristic according to the category of the first characteristic, and determines the first execution domain.
  • the first characteristic is heart rate detection
  • the category of the first characteristic is low power consumption
  • the application loader determines the MCU domain (that is, the low power execution domain) according to the low power consumption characteristic.
  • the application loader determines an AP domain (that is, a low-power execution domain) according to the high-experience characteristic.
  • Step 902 Wake up the first execution domain.
  • Step 903 Determine whether other execution domains are idle, that is, whether execution domains other than the first execution domain are idle, if yes, go to step 904, otherwise go to step 905.
  • Step 904 Control the idle execution domain to enter the energy-saving state.
  • the number of energy-saving states may also be more than one.
  • Step 905 Execute the first characteristic in the first execution domain.
  • Step 906 Determine whether the first feature needs to access peripherals.
  • step 907 is executed. If the peripheral is not needed to be accessed, the process ends.
  • Step 907 If the first feature requires access to the peripheral, it is further judged whether the peripheral is a shared peripheral, that is, whether the shared peripheral is exclusively occupied by the first execution domain, if so, go to step 908, otherwise go to step 909.
  • Step 908 Set a global exclusive identifier.
  • Step 909 Perform normal peripheral reading and writing and control.
  • the application if the application needs to access the shared peripheral, it executes normal read, write and control of the shared peripheral until the access to the shared peripheral is completed. If the application needs to access the exclusive peripheral, the normal exclusive peripheral read and write and control are performed until the exclusive peripheral access is completed. If the application needs to access shared peripherals and exclusive peripherals, perform normal shared peripheral read, write and control until the shared peripheral access is completed, and perform normal shared peripheral read, write and control until the exclusive peripheral access is completed .
  • Step 910 Clear the global exclusive identifier after the access to the shared peripheral is completed.
  • Step 911 Determine whether to communicate with other features. If the first feature needs to communicate with other features, perform step 912; otherwise, the process ends.
  • Step 912 Turn on the IPC device.
  • the first feature communicates with other features through the IPC device.
  • Step 913 Read and write the IPC device.
  • FIG. 10 uses FIG. 10 as an example to describe the embodiments of the present application in detail.
  • Step 1001 Acquire the category of the first characteristic, and assign the first characteristic to the first execution domain for execution.
  • the application loader when the application loader starts the application, it obtains the category of the first characteristic in the application, and according to the category of the first characteristic, queries the execution domain corresponding to the category of the first characteristic to determine the first execution domain.
  • the application includes a first characteristic, and the first mode is an initial mode of the first characteristic, and is associated with the first execution domain.
  • step 1002 to step 1006 reference may be made to the related content of the embodiment shown in FIG. 6, and the repetition will not be repeated.
  • the above method avoids the fixed execution domain allocation method. According to the detected preset event, the characteristics in the application can be dynamically switched to the corresponding execution domain, which can improve the flexibility of system power consumption control and reduce the overall power of the system. Consumption level.
  • the terminal device includes hardware structures and/or software modules corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application scenarios and design constraints of the technical solution.
  • FIG. 11 and FIG. 12 are schematic structural diagrams of possible communication devices provided by embodiments of this application. These communication devices can be used to implement the functions of the terminal equipment in the foregoing method embodiments, and therefore can also achieve the beneficial effects of the foregoing method embodiments.
  • the communication device may be a terminal device as shown in Fig. 1, a wearable device, or a module (such as a chip) applied to a terminal device.
  • the communication device 1100 includes a processing unit 1110 and a transceiving unit 1120.
  • the communication device 1100 is used to implement the functions of the terminal device in the method embodiments shown in FIG. 3, FIG. 4, FIG. 5, FIG. 6, FIG. 7, FIG. 8, FIG. 9 and FIG. 10.
  • the transceiving unit 1120 is used to obtain the category of the application; the processing unit 1110 is used to determine the first from multiple execution domains according to the category of the application. Execution domain, the application is executed in the first execution domain.
  • the transceiver unit 1120 is used to obtain the category of the first characteristic, and the first characteristic is one of the multiple characteristics included in the application. Each characteristic corresponds to a functional segment of the application; the processing unit 1110 is configured to determine a first execution domain from a plurality of execution domains according to the category of the first characteristic, and execute the first characteristic in the first execution domain.
  • processing unit 1110 and the transceiver unit 1120 can be obtained directly with reference to the relevant descriptions in the method embodiments shown in FIG. 3 and FIG. 7, and will not be repeated here.
  • the communication device 1200 includes a processor 1210 and an interface circuit 1220.
  • the processor 1210 and the interface circuit 1220 are coupled with each other.
  • the interface circuit 1220 may be a transceiver or an input/output interface.
  • the communication device 1200 may further include a memory 1230 for storing instructions executed by the processor 1210 or storing input data required by the processor 1210 to run the instructions or storing data generated after the processor 1210 runs the instructions.
  • the specific structure of the communication device may also be as shown in FIG. 2.
  • the processor 1210 is used to implement the function of the above-mentioned processing unit 1110
  • the interface circuit 1220 is used to implement the function of the above-mentioned transceiving unit 1120.
  • the terminal device chip implements the function of the terminal device in the foregoing method embodiment.
  • “at least one” refers to one or more, and “multiple” refers to two or more.
  • “And/or” describes the association relationship of the associated object, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone, where A, B can be singular or plural.
  • the character “/” generally indicates that the associated objects before and after are an “or” relationship; in the formula of this application, the character “/” indicates that the associated objects before and after are a kind of "division” Relationship.

Abstract

An application execution method and apparatus. Said method comprises: a terminal device acquiring the category of an application; determining, according to the category of the application, a first execution domain from a plurality of execution domains; and executing the application in the first execution domain. Said method can be used to divide hardware into different execution domains, and allocate different categories of applications to corresponding execution domains, thereby improving the flexibility of system power consumption control, and reducing the overall power consumption level of systems.

Description

一种执行应用的方法及装置Method and device for executing application
相关申请的交叉引用Cross-references to related applications
本申请要求在2020年05月29日提交中国专利局、申请号为202010479855.2、申请名称为“一种执行应用的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on May 29, 2020, with an application number of 202010479855.2. The application title is "a method and device for executing applications", the entire content of which is incorporated into this application by reference middle.
技术领域Technical field
本申请涉及终端领域,尤其涉及一种执行应用的方法及装置。This application relates to the field of terminals, and in particular to a method and device for executing applications.
背景技术Background technique
在穿戴类产品中,较好的用户体验和较为完备的功能意味着更短的续航时间。以某品牌的设备A为例,在正常使用状态下,只提供18个小时的续航时间。例如,在续航时间内看时间90次,看90次通知,使用应用(application,APP)45分钟,以及在60分钟运动中使用蓝牙播放音乐。另一方面,更长的续航时间意味着用户体验打折以及功能不完备。以某品牌的设备B为例,在正常使用状态下,续航时间为2周。而设备B的许多用户界面(user interface,UI)特效无法支持,例如,三维(three dimensional,3D)表盘、UI过渡、矢量绘制等。In wearable products, better user experience and more complete functions mean shorter battery life. Take a certain brand of device A as an example, under normal use, it only provides 18 hours of battery life. For example, watch the time 90 times during the battery life, watch 90 notifications, use the application (APP) for 45 minutes, and use Bluetooth to play music during 60 minutes of exercise. On the other hand, longer battery life means discounted user experience and incomplete features. Take device B of a certain brand as an example, under normal use, the battery life is 2 weeks. However, many user interface (UI) special effects of device B cannot be supported, for example, three-dimensional (3D) dials, UI transitions, vector rendering, and so on.
由上可知,系统无法在提供丰富炫酷的用户体验和/或完备功能的同时维持高续航时间,因此,如何解决续航时间和用户体验以及功能之间的矛盾是一个急需解决的问题。It can be seen from the above that the system cannot maintain a high battery life while providing a rich and cool user experience and/or complete functions. Therefore, how to solve the contradiction between battery life and user experience and functions is a problem that needs to be solved urgently.
发明内容Summary of the invention
本申请实施例提供一种执行应用的方法及装置,用于解决续航时间和用户体验以及功能之间的矛盾。The embodiments of the present application provide a method and device for executing applications, which are used to resolve the contradiction between battery life and user experience and functions.
第一方面,本申请实施例提供一种执行应用的方法,该方法包括:获取应用的类别;根据所述应用的类别从多个执行域中确定第一执行域,在所述第一执行域中执行所述应用;所述多个执行域为对硬件划分得到的不同执行域,所述多个执行域包括高功耗执行域和低功耗执行域。In the first aspect, an embodiment of the present application provides a method for executing an application. The method includes: obtaining a category of an application; determining a first execution domain from a plurality of execution domains according to the category of the application; The application is executed in the application; the multiple execution domains are different execution domains obtained by dividing the hardware, and the multiple execution domains include a high-power execution domain and a low-power execution domain.
采用上述方法,通过将硬件划分为不同执行域,并将不同类别的应用分配到对应的执行域上,可以提升系统功耗控制的灵活性,可以降低系统的总体功耗水平。相较于全部应用在高功耗执行域中执行的场景,一些应用被分配到低功耗执行域中执行。由于低功耗执行域的功耗水平显著低于高功耗执行域的功耗水平,因此可以实现降低总体功耗水平。一些应用被分配到高功耗执行域中执行,可以确保用户体验,因此,能够解决续航时间和用户体验以及功能之间的矛盾。Using the above method, by dividing the hardware into different execution domains and assigning different types of applications to the corresponding execution domains, the flexibility of system power consumption control can be improved, and the overall power consumption level of the system can be reduced. Compared with the scenario where all applications are executed in the high-power execution domain, some applications are allocated to execute in the low-power execution domain. Since the power consumption level of the low-power execution domain is significantly lower than that of the high-power execution domain, the overall power consumption level can be reduced. Some applications are allocated to execute in the high-power execution domain, which can ensure user experience. Therefore, the contradiction between battery life and user experience and functions can be resolved.
在一种可能的设计中,还包括:控制所述多个执行域中除所述第一执行域外的空闲执行域进入节能状态。In a possible design, the method further includes: controlling idle execution domains of the plurality of execution domains except for the first execution domain to enter an energy-saving state.
采用上述设计,可以实现降低系统的总体功耗水平。With the above design, the overall power consumption level of the system can be reduced.
在一种可能的设计中,所述节能状态包括待机状态、睡眠状态、深度睡眠状态中的至少一种。In a possible design, the energy-saving state includes at least one of a standby state, a sleep state, and a deep sleep state.
在一种可能的设计中,还包括:确定所述应用需要访问的共享外设被所述第一执行域独占,为所述共享外设设置全局性独占标识;在所述共享外设被访问完成后,清除为所述共享外设设置的所述全局性独占标识。In a possible design, the method further includes: determining that the shared peripheral that the application needs to access is exclusively occupied by the first execution domain, and setting a global exclusive flag for the shared peripheral; and when the shared peripheral is accessed After completion, the global exclusive identification set for the shared peripheral is cleared.
采用上述设计,通过设置全局性独占标识,其它执行域将无法获得该外设的控制权,保证当前执行域对该外设的独占访问,避免数据或状态错误。With the above design, by setting the global exclusive flag, other execution domains will not be able to obtain the control right of the peripheral, ensuring the exclusive access of the current execution domain to the peripheral, and avoiding data or status errors.
在一种可能的设计中,还包括:检测到预设事件,所述预设事件用于触发第二模式,所述第二模式为所述应用包括的所述多个特性中的第一特性的模式;所述应用包括多个特性,每个特性对应所述应用的一个功能片段,所述第一特性为所述多个特性中的一个特性;控制所述第一特性的模式从第一模式切换至第二模式,所述第一模式为所述第一特性的初始模式。In a possible design, the method further includes: detecting a preset event, the preset event is used to trigger a second mode, and the second mode is the first characteristic of the plurality of characteristics included in the application The mode; the application includes multiple features, each feature corresponds to a functional segment of the application, the first feature is one of the multiple features; the mode for controlling the first feature starts from the first The mode is switched to the second mode, and the first mode is the initial mode of the first characteristic.
采用上述方法可以提升系统功耗控制的灵活性,可以降低系统的总体功耗水平。Using the above method can improve the flexibility of system power consumption control, and can reduce the overall power consumption level of the system.
在一种可能的设计中,所述第一特性的模式包括高体验模式、低功耗模式和关闭模式中的至少两种。In a possible design, the mode of the first characteristic includes at least two of a high experience mode, a low power consumption mode, and an off mode.
在一种可能的设计中,控制所述应用中的第一特性的模式从所述第一模式切换至第二模式可以采用但不限于以下方式:控制所述第一特性从所述第一执行域切换至第二执行域执行,其中,所述第一模式对应所述第一执行域,所述第二模式对应所述第二执行域。In a possible design, the mode of controlling the first characteristic in the application may be switched from the first mode to the second mode in the following manner, but not limited to: controlling the first characteristic from the first execution The domain is switched to a second execution domain for execution, wherein the first mode corresponds to the first execution domain, and the second mode corresponds to the second execution domain.
采用上述方法避免了固定的执行域的分配方式,根据检测到的预设事件,应用中的特性可以动态切换到对应的执行域,进而可以提升系统功耗控制的灵活性,可以降低系统的总体功耗水平。The above method avoids the fixed execution domain allocation method. According to the detected preset event, the characteristics in the application can be dynamically switched to the corresponding execution domain, which can improve the flexibility of system power consumption control and reduce the overall system Power consumption level.
第二方面,本申请实施例提供一种执行应用的方法,该方法包括:获取第一特性的类别,所述第一特性为一个应用包括的多个特性中的一个特性,每个特性对应所述应用的一个功能片段;根据所述第一特性的类别从多个执行域中确定第一执行域,在所述第一执行域中执行所述第一特性;所述多个执行域为对硬件划分得到的不同执行域,所述多个执行域包括高功耗执行域和低功耗执行域。In a second aspect, an embodiment of the present application provides a method for executing an application. The method includes: acquiring a category of a first characteristic, where the first characteristic is one of a plurality of characteristics included in an application, and each characteristic corresponds to all characteristics. A functional segment of the application; a first execution domain is determined from a plurality of execution domains according to the category of the first characteristic, and the first characteristic is executed in the first execution domain; the plurality of execution domains are pairs Different execution domains obtained by hardware division, and the multiple execution domains include a high power consumption execution domain and a low power consumption execution domain.
采用上述方法,通过将硬件划分为不同执行域,并将不同类别的特性分配到对应的执行域上,可以提升系统功耗控制的灵活性,且能够实现较细力度的功耗控制,可以降低系统的总体功耗水平。Using the above method, by dividing the hardware into different execution domains and assigning different types of characteristics to the corresponding execution domains, the flexibility of system power consumption control can be improved, and more detailed power consumption control can be achieved, which can reduce The overall power consumption level of the system.
在一种可能的设计中,还包括:获取第二特性的类别,所述第二特性为所述应用包括的多个特性中的一个特性,所述第二特性与所述第一特性不同;根据所述第二特性的类别从多个执行域中确定第二执行域,在所述第二执行域中执行所述第二特性,所述第二执行域与所述第一执行域不同,且所述第一特性与所述第二特性通过IPC设备或管道进行通信。In a possible design, the method further includes: acquiring a category of a second characteristic, where the second characteristic is one of a plurality of characteristics included in the application, and the second characteristic is different from the first characteristic; Determine a second execution domain from a plurality of execution domains according to the category of the second characteristic, execute the second characteristic in the second execution domain, and the second execution domain is different from the first execution domain, And the first characteristic and the second characteristic communicate through an IPC device or pipe.
采用上述设计,不同类别的特性分配到对应的执行域上,可以提升系统功耗控制的灵活性,同时,在不同执行域中执行的特性可以通过IPC设备或管道进行通信。With the above design, different types of features are allocated to the corresponding execution domains, which can improve the flexibility of system power consumption control. At the same time, the features executed in different execution domains can communicate through IPC devices or pipes.
在一种可能的设计中,还包括:控制所述多个执行域中除所述第一执行域和所述第二执行域外的空闲执行域进入节能状态。In a possible design, the method further includes: controlling idle execution domains of the plurality of execution domains except for the first execution domain and the second execution domain to enter an energy-saving state.
采用上述设计,可以实现降低系统的总体功耗水平。With the above design, the overall power consumption level of the system can be reduced.
在一种可能的设计中,所述节能状态包括待机状态、睡眠状态、深度睡眠状态中的至少一种。In a possible design, the energy-saving state includes at least one of a standby state, a sleep state, and a deep sleep state.
在一种可能的设计中,还包括:确定所述第一特性需要访问的共享外设被所述第一执行域独占,为所述共享外设设置全局性独占标识;在所述共享外设被访问完成后,清除为 所述共享外设设置的所述全局性独占标识。In a possible design, the method further includes: determining that the shared peripheral that needs to be accessed by the first feature is exclusively occupied by the first execution domain, and setting a global exclusive flag for the shared peripheral; After being accessed, the global exclusive identifier set for the shared peripheral is cleared.
采用上述设计,通过设置全局性独占标识,其它执行域将无法获得该外设的控制权,保证当前执行域对该外设的独占访问,避免数据或状态错误。With the above design, by setting the global exclusive flag, other execution domains will not be able to obtain the control right of the peripheral, ensuring the exclusive access of the current execution domain to the peripheral, and avoiding data or status errors.
在一种可能的设计中,还包括:检测到预设事件,所述预设事件用于触发第二模式,所述第二模式为所述第一特性的模式;控制所述第一特性的模式从第一模式切换至所述第二模式,所述第一模式为所述第一特性的初始模式。In a possible design, the method further includes: detecting a preset event, the preset event is used to trigger a second mode, and the second mode is a mode of the first characteristic; The mode is switched from the first mode to the second mode, and the first mode is the initial mode of the first characteristic.
采用上述方法可以提升系统功耗控制的灵活性,可以降低系统的总体功耗水平。Using the above method can improve the flexibility of system power consumption control, and can reduce the overall power consumption level of the system.
在一种可能的设计中,所述第一特性的模式包括高体验模式、低功耗模式和关闭模式中的至少两种。In a possible design, the mode of the first characteristic includes at least two of a high experience mode, a low power consumption mode, and an off mode.
在一种可能的设计中,控制所述第一特性的模式从所述第一模式切换至第二模式可以采用但不限于以下方式:控制所述第一特性从所述第一执行域切换至第三执行域执行,其中,所述第一模式对应所述第一执行域,所述第二模式对应所述第三执行域。In a possible design, the mode of controlling the first characteristic to switch from the first mode to the second mode may adopt but not limited to the following manner: controlling the first characteristic to switch from the first execution domain to The third execution domain is executed, wherein the first mode corresponds to the first execution domain, and the second mode corresponds to the third execution domain.
采用上述方法避免了固定的执行域的分配方式,根据检测到的预设事件,应用中的特性可以动态切换到对应的执行域,进而可以提升系统功耗控制的灵活性,可以降低系统的总体功耗水平。The above method avoids the fixed execution domain allocation method. According to the detected preset event, the characteristics in the application can be dynamically switched to the corresponding execution domain, which can improve the flexibility of system power consumption control and reduce the overall system Power consumption level.
第三方面,本申请实施例提供一种通信装置,所述装置包括用于执行第一方面和第一方面中的任意一种可能的设计的模块;或者所述装置包括用于执行第二方面和第二方面中的任意一种可能的设计的模块。In a third aspect, an embodiment of the present application provides a communication device, the device includes a module for executing any one of the first aspect and the first aspect; or the device includes a module for executing the second aspect And any of the possible design modules in the second aspect.
第四方面,本申请实施例提供一种通信装置,包括处理器和接口电路,所述接口电路用于接收来自所述通信装置之外的其它通信装置的信号并传输至所述处理器或将来自所述处理器的信号发送给所述通信装置之外的其它通信装置,所述处理器通过逻辑电路或执行代码指令用于实现第一方面和第一方面中的任意一种可能的设计,或实现第二方面和第二方面中的任意一种可能的设计。In a fourth aspect, an embodiment of the present application provides a communication device, including a processor and an interface circuit, the interface circuit is used to receive signals from other communication devices other than the communication device and transmit them to the processor or The signal from the processor is sent to other communication devices other than the communication device, and the processor is used to implement any one of the first aspect and the first aspect through logic circuits or execution code instructions, Or realize any one of the possible designs of the second aspect and the second aspect.
第五方面,本申请实施例提供一种可穿戴设备,包括处理器和存储器,所述存储器用于存储程序,所述处理器调用所述存储器执行第一方面和第一方面中的任意一种可能的设计,或第二方面和第二方面中的任意一种可能的设计。In a fifth aspect, an embodiment of the present application provides a wearable device, including a processor and a memory, the memory is used to store a program, and the processor invokes the memory to execute any one of the first aspect and the first aspect Possible design, or any one of the second aspect and the second aspect.
所述处理器通过逻辑电路或执行代码指令用于实现第一方面和第一方面中的任意一种可能的设计,或实现第二方面和第二方面中的任意一种可能的设计。The processor is used to implement any one of the possible designs of the first aspect and the first aspect, or to implement any one of the second aspect and the second aspect, through a logic circuit or executing code instructions.
第六方面,本申请实施例提供一种计算机可读存储介质,所述存储介质中存储有计算机程序或指令,当所述计算机程序或指令被通信装置执行时,实现第一方面和第一方面中的任意一种可能的设计,或实现第二方面和第二方面中的任意一种可能的设计。In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium in which a computer program or instruction is stored. When the computer program or instruction is executed by a communication device, the first aspect and the first aspect are implemented. Any one of the possible designs, or the realization of any one of the second aspect and the second aspect.
第七方面,本申请实施例提供一种包含程序的计算机程序产品,当其在通信装置上运行时,使得通信装置执行第一方面和第一方面中的任意一种可能的设计,或执行第二方面和第二方面中的任意一种可能的设计。In the seventh aspect, the embodiments of the present application provide a computer program product containing a program, which, when it runs on a communication device, enables the communication device to execute any one of the possible designs of the first aspect and the first aspect, or execute the first aspect Any one of the possible designs of the second aspect and the second aspect.
附图说明Description of the drawings
图1为本申请实施例中终端设备的举例示意图;FIG. 1 is a schematic diagram of an example of a terminal device in an embodiment of the application;
图2(a)和图2(b)为本申请实施例中终端设备的结构示意图;2(a) and 2(b) are schematic diagrams of the structure of the terminal device in the embodiment of the application;
图3为本申请实施例中一种执行应用的方法示意图之一;FIG. 3 is one of the schematic diagrams of a method for executing an application in an embodiment of this application;
图4为本申请实施例中应用分类与执行域分类的对应关系示意图;4 is a schematic diagram of the correspondence between application classification and execution domain classification in an embodiment of this application;
图5为本申请实施例中执行应用的具体流程图之一;FIG. 5 is one of the specific flowcharts of executing the application in the embodiment of this application;
图6为本申请实施例中执行应用的具体流程图之二;FIG. 6 is the second specific flowchart of the application execution in the embodiment of this application;
图7为本申请实施例中一种执行应用的方法示意图之二;FIG. 7 is a second schematic diagram of a method for executing an application in an embodiment of this application;
图8为本申请实施例中特性分类与执行域分类的对应关系示意图;FIG. 8 is a schematic diagram of the correspondence between feature classification and execution domain classification in an embodiment of this application;
图9为本申请实施例中执行应用的具体流程图之三;FIG. 9 is the third specific flowchart of the application execution in the embodiment of this application;
图10为本申请实施例中执行应用的具体流程图之四;FIG. 10 is the fourth specific flowchart of the application execution in the embodiment of this application;
图11为本申请实施例中一种通信装置的结构示意图之一;FIG. 11 is one of the schematic structural diagrams of a communication device in an embodiment of this application;
图12为本申请实施例中一种通信装置的结构示意图之二。FIG. 12 is the second structural diagram of a communication device in an embodiment of this application.
具体实施方式Detailed ways
下面结合附图,对本申请的实施例进行描述。The embodiments of the present application will be described below in conjunction with the drawings.
如图1所示,本申请实施例可以应用于各种不同的终端设备100,例如手机、个人计算机(personal computer,PC)、平板、穿戴设备等。As shown in FIG. 1, the embodiments of the present application can be applied to various terminal devices 100, such as mobile phones, personal computers (PC), tablets, wearable devices, and so on.
如图2(a)所示为终端设备100的结构示意图之一。终端设备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等。Fig. 2(a) shows one of the schematic structural diagrams of the terminal device 100. The terminal device 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, a battery 142, an antenna 1, and an antenna 2. , Mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope 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.
可以理解的是,本发明实施例示意的结构并不构成对终端设备100的具体限定。在本申请另一些实施例中,终端设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units. For example, the processor 110 may include an 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, the different processing units may be independent devices or integrated in one or more processors.
其中,控制器可以是终端设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the terminal device 100. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接 口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface can include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter (universal asynchronous transmitter) interface. receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / Or Universal Serial Bus (USB) interface, etc.
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现终端设备100的触摸功能。The I2C interface is a bidirectional synchronous serial bus, which includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple sets of I2C buses. The processor 110 may couple the touch sensor 180K, charger, flash, camera 193, etc., respectively through different I2C bus interfaces. For example, the processor 110 may couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to implement the touch function of the terminal device 100.
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit audio signals to the wireless communication module 160 through an I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。The PCM interface can also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function. In some embodiments, the audio module 170 may transmit audio signals to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a Bluetooth headset.
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现终端设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现终端设备100的显示功能。The MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices. The MIPI interface includes camera serial interface (camera serial interface, CSI), display serial interface (display serial interface, DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the terminal device 100. The processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the terminal device 100.
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。The GPIO interface can be configured through software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on. The GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为终端设备100充电,也可以用于终端设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他终端设备,例如AR设备等。The USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on. The USB interface 130 can be used to connect a charger to charge the terminal device 100, and can also be used to transfer data between the terminal device 100 and peripheral devices. It can also be used to connect earphones and play audio through earphones. This interface can also be used to connect to other terminal devices, such as AR devices.
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对终端设备100的结构限定。在本申请另一些实施例中,终端设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely a schematic illustration, and does not constitute a structural limitation of the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也 可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过终端设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为终端设备供电。The charging management module 140 is used to receive charging input from the charger. Among them, the charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive the charging input of the wired charger through the USB interface 130. In some embodiments of wireless charging, the charging management module 140 may receive the wireless charging input through the wireless charging coil of the terminal device 100. While the charging management module 140 charges the battery 142, it can also supply power to the terminal device through the power management module 141.
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。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, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
终端设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the terminal device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。终端设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the terminal device 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 multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna can be used in combination with a tuning switch.
移动通信模块150可以提供应用在终端设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the terminal device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves 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 wave radiation via the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 may be provided 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.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal is processed by the baseband processor and then passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
无线通信模块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 terminal device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites. System (global navigation satellite system, GNSS), frequency modulation (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 may also receive a signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic waves to radiate through the antenna 2.
在一些实施例中,终端设备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),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 terminal device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the terminal device 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), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc. The GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), and the quasi-zenith satellite system (quasi). -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
终端设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The terminal device 100 implements a display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and is used for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏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的正整数。The display screen 194 is used to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). AMOLED, flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 100 may include one or N display screens 194, and N is a positive integer greater than one.
终端设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The terminal device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transfers the electrical signal to the ISP for processing and is converted into an image visible to the naked eye. ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193.
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,终端设备100可以包括1个或N个摄像头193,N为大于1的正整数。The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and is projected to the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal. ISP outputs digital image signals to DSP for processing. DSP converts digital image signals into standard RGB, YUV and other formats of image signals. In some embodiments, the terminal device 100 may include one or N cameras 193, and N is a positive integer greater than one.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当终端设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the terminal device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
视频编解码器用于对数字视频压缩或解压缩。终端设备100可以支持一种或多种视频编解码器。这样,终端设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The terminal device 100 may support one or more video codecs. In this way, the terminal device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现终端设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本 理解等。NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, for example, the transfer mode between human brain neurons, it can quickly process input information, and it can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the terminal device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展终端设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行终端设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储终端设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. Among them, the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function. The data storage area can store data (such as audio data, phone book, etc.) created during the use of the terminal device 100. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
终端设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The terminal device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。终端设备100可以通过扬声器170A收听音乐,或收听免提通话。The speaker 170A, also called "speaker", is used to convert audio electrical signals into sound signals. The terminal device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当终端设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the terminal device 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。终端设备100可以设置至少一个麦克风170C。在另一些实施例中,终端设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,终端设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。The microphone 170C, also called "microphone", "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C. The terminal device 100 may be provided with at least one microphone 170C. In other embodiments, the terminal device 100 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals. In other embodiments, the terminal device 100 may also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动终端设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The earphone interface 170D is used to connect wired earphones. The earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。终端设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,终端设备100根据压力传感器180A检测所述触摸操作强度。终端设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be provided on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors and so on. The capacitive pressure sensor may include at least two parallel plates with conductive materials. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The terminal device 100 determines the strength of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the terminal device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The terminal device 100 may also calculate the touched position based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch position but have different touch operation intensities can correspond to different operation instructions. For example: when a touch operation whose intensity is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
陀螺仪传感器180B可以用于确定终端设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定终端设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测终端设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消终端设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。The gyro sensor 180B may be used to determine the movement posture of the terminal device 100. In some embodiments, the angular velocity of the terminal device 100 around three axes (ie, x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyroscope sensor 180B detects the shaking angle of the terminal device 100, and calculates the distance that the lens module needs to compensate according to the angle, so that the lens can counteract the shaking of the terminal device 100 through a reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
气压传感器180C用于测量气压。在一些实施例中,终端设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。The air pressure sensor 180C is used to measure air pressure. In some embodiments, the terminal device 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
磁传感器180D包括霍尔传感器。终端设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当终端设备100是翻盖机时,终端设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。The magnetic sensor 180D includes a Hall sensor. The terminal device 100 may use the magnetic sensor 180D to detect the opening and closing of the flip holster. In some embodiments, when the terminal device 100 is a flip machine, the terminal device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, features such as automatic unlocking of the flip cover are set.
加速度传感器180E可检测终端设备100在各个方向上(一般为三轴)加速度的大小。当终端设备100静止时可检测出重力的大小及方向。还可以用于识别终端设备姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the magnitude of the acceleration of the terminal device 100 in various directions (generally three axes). When the terminal device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the terminal device, applied to applications such as horizontal and vertical screen switching, pedometer and so on.
距离传感器180F,用于测量距离。终端设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,终端设备100可以利用距离传感器180F测距以实现快速对焦。Distance sensor 180F, used to measure distance. The terminal device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the terminal device 100 may use the distance sensor 180F to measure the distance to achieve fast focusing.
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。终端设备100通过发光二极管向外发射红外光。终端设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定终端设备100附近有物体。当检测到不充分的反射光时,终端设备100可以确定终端设备100附近没有物体。终端设备100可以利用接近光传感器180G检测用户手持终端设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。The 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 terminal device 100 emits infrared light to the outside through the light emitting diode. The terminal device 100 uses a photodiode 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 terminal device 100. When insufficient reflected light is detected, the terminal device 100 can determine that there is no object near the terminal device 100. The terminal device 100 can use the proximity light sensor 180G to detect that the user holds the terminal device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode, and the pocket mode will automatically unlock and lock the screen.
环境光传感器180L用于感知环境光亮度。终端设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测终端设备100是否在口袋里,以防误触。The ambient light sensor 180L is used to sense the brightness of the ambient light. The terminal device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light. 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 terminal device 100 is in a pocket to prevent accidental touch.
指纹传感器180H用于采集指纹。终端设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 180H is used to collect fingerprints. The terminal device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
温度传感器180J用于检测温度。在一些实施例中,终端设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,终端设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,终端设备100对电池142加热,以避免低温导致终端设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,终端设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。The temperature sensor 180J is used to detect temperature. In some embodiments, the terminal device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the terminal device 100 reduces the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the terminal device 100 heats the battery 142 to avoid abnormal shutdown of the terminal device 100 due to low temperature. In some other embodiments, when the temperature is lower than another threshold, the terminal device 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所处的位置不同。Touch sensor 180K, also called "touch panel". The touch sensor 180K may be provided on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”. The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. The visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the terminal device 100, which is different from the position of the display screen 194.
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。The 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 voice. The bone conduction sensor 180M can also contact the human pulse and receive the blood pressure pulse signal. In some embodiments, the bone conduction sensor 180M may also be provided in the earphone, combined with the bone conduction earphone. The audio module 170 can parse the voice signal based on the vibration signal of the vibrating bone block of the voice obtained by the bone conduction sensor 180M, and realize the voice function. The application processor may analyze the heart rate information based on the blood pressure beating signal obtained by the bone conduction sensor 180M, and realize the heart rate detection function.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。终端设备100可以接收按键输入,产生与终端设备100的用户设置以及功能控制有关的键信号输入。The button 190 includes a power-on button, a volume button, and so on. The button 190 may be a mechanical button. It can also be a touch button. The terminal device 100 may receive key input, and generate key signal input related to user settings and function control of the terminal device 100.
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration notification, and can also be used for touch vibration feedback. For example, touch operations that act on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. Acting on touch operations in different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminding, receiving information, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和终端设备100的接触和分离。终端设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。终端设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,终端设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在终端设备100中,不能和终端设备100分离。The SIM card interface 195 is used to connect to the SIM card. The SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the terminal device 100. The terminal device 100 may support 1 or N SIM card interfaces, and N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. The same SIM card interface 195 can insert multiple cards at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The terminal device 100 interacts with the network through the SIM card to implement functions such as call and data communication. In some embodiments, the terminal device 100 adopts an eSIM, that is, an embedded SIM card. The eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100.
如图2(b)所示为终端设备100的结构示意图之二。终端设备100拥有处理器211,和内存205,以及加载在内存中的各种软件,包括操作系统201,桌面程序202,合成器203,以及服务程序204等。同时,终端设备100还拥有各种外设,包括通信设备206(如蓝牙低能耗(bluetooth low energy,BLE)、WiFi、调制解调器(Modem)等),传感器207(如重力传感器、加速度传感器、角速度传感器,光电容积脉搏波(photoplethysmography,PPG)传感器、全球定位系统传感器(global positioning system,GPS)传感器、指纹传感器等),输入设备208(如键盘、触摸屏等),存储器209(如内置不可拆卸存储器,可拆卸存库卡等),输出设备210(如打印机等),处理器211(如ARM、X86、MIPS等),震动设备212(如线性马达、偏心马达等),显示设备213(如液晶显示器(liquid crystal display,LCD))屏幕、有机电激光显示(organiclight-emitting diode,OLED)屏幕、有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light-emitting diode,AMOLED)屏幕等),相机设备214(如前置摄像头、后置摄像头、飞行时间(time of flight,TOF)摄像头、红外摄像头等)。Fig. 2(b) shows the second structural diagram of the terminal device 100. The terminal device 100 has a processor 211, a memory 205, and various software loaded in the memory, including an operating system 201, a desktop program 202, a synthesizer 203, and a service program 204. At the same time, the terminal device 100 also has various peripherals, including communication devices 206 (such as bluetooth low energy (BLE), WiFi, modems, etc.), sensors 207 (such as gravity sensors, acceleration sensors, and angular velocity sensors). , Photoplethysmography (PPG) sensor, global positioning system (GPS) sensor, fingerprint sensor, etc.), input device 208 (such as keyboard, touch screen, etc.), memory 209 (such as built-in non-removable memory, Removable library card, etc.), output device 210 (such as printer, etc.), processor 211 (such as ARM, X86, MIPS, etc.), vibration device 212 (such as linear motor, eccentric motor, etc.), display device 213 (such as liquid crystal display) (liquid crystal display, LCD) screen, organic light-emitting diode (OLED) screen, active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED screen, etc.), camera equipment 214 (such as a front camera, a rear camera, a time of flight (TOF) camera, an infrared camera, etc.).
一般而言,高体验意味着更高频的中央处理器(central processing unit,CPU)、图形处理器(graphics processing unit,GPU),以及更复杂的运算和图形图像处理。在终端设 备上,尤其是例如手机、可穿戴设备等设备上,由于电池容量有限,追求高体验的终端设备必然导致续航时间的下降。而追求长续航的终端设备可能会使用特定的硬件,如墨水屏(不主动刷新,背光可选)、低功耗内存(工作电压较低)、静态存储器(不主动刷新)、低功耗CPU(也可能是微控制单元(microcontroller unit,MCU),低功耗GPU(也可能取消GPU)来满足硬件层面的低功耗,同时配合软件层面更严格的电源管理策略(例如,全局待机、休眠、默认杀后台进程等),来达成续航目标。而上述这些硬件和软件设计策略,一般而言都会导致用户体验的下降,例如,墨水屏会导致严重的刷新延迟、也不支持彩色。低功耗逻辑器件(内存、CPU、GPU)会导致系统响应变慢。而软件激进待机或默认杀进程会导致终端设备的响应性变差,任务切换对用户也不太友好(例如放入后台的应用再恢复到前台后,应用原来的状态无法恢复)。Generally speaking, high experience means higher frequency central processing unit (CPU), graphics processing unit (GPU), and more complex calculations and graphics and image processing. In terminal devices, especially devices such as mobile phones and wearable devices, due to the limited battery capacity, terminal devices that pursue high experience will inevitably lead to a decrease in battery life. Terminal devices pursuing long battery life may use specific hardware, such as ink screens (not active refresh, optional backlight), low-power memory (low working voltage), static memory (not active refresh), and low-power CPU (It may also be a microcontroller unit (MCU), low-power GPU (or GPU may be eliminated) to meet low power consumption at the hardware level, and at the same time cooperate with more stringent power management strategies at the software level (for example, global standby, hibernation) , Kill background processes by default, etc.) to achieve battery life goals. The above hardware and software design strategies generally lead to a decline in user experience. For example, ink screens will cause serious refresh delays and do not support color. Low power Consuming logic devices (memory, CPU, GPU) will cause the system to respond slowly. The software's aggressive standby or default killing process will cause the terminal device to become less responsive, and task switching is not very user-friendly (for example, applications placed in the background) After restoring to the foreground, the original state of the application cannot be restored).
为了解决续航时间和用户体验以及功能之间的矛盾,现有技术中提出一种解决方案:系统配置一种“低功耗模式”,在系统进入该“低功耗模式”之后,所有功能都运行在“低功耗模式”下,此时系统尽量关闭“多余”的功能和特效,与此同时这些功能所依赖的硬件和传感器也都进入休眠或断电状态,主CPU和主内存动态降低运行频率,屏幕工作在较低的亮度和色深下,尽量减少屏幕的刷新次数和内容的刷新。采用上述方案可以一定程度延长续航时间,但由于“低功耗模式”下硬件性能非常有限,功能也比正常模式少很多,导致用户体验也显著下降。In order to solve the contradiction between battery life and user experience and functions, a solution is proposed in the prior art: the system is configured with a "low power consumption mode". After the system enters the "low power consumption mode", all functions are Running in the "low power consumption mode", the system will try to close the "excess" functions and special effects at this time. At the same time, the hardware and sensors that these functions depend on also enter the dormant or power-off state, and the main CPU and main memory are dynamically reduced. Operating frequency, the screen works at a lower brightness and color depth, try to reduce the number of screen refreshes and content refresh. Using the above solution can extend the battery life to a certain extent, but because the hardware performance in the "low power mode" is very limited, and the functions are much less than in the normal mode, the user experience is also significantly reduced.
此外,现有技术中还提出一种解决方案:系统配置一种“独占硬件模式”。系统在“独占硬件模式”下只提供给用户部分的功能,这些功能依赖的所有底层软件(如操作系统、驱动程序、文件系统等)都运行在一个独占的极低功耗处理器上。主CPU则完全断电。外设和传感器在该模式下所提供的功能按需开启。采用上述方案,首先,由于该方案使用了独占的硬件,因此增加了系统的成本。同时由于独占硬件的性能非常低下,所以该模式下的功能是受限的,只包含一些基本的功能,用户体验也不如正常模式。同时,为了当系统切换到正常模式,由于主CPU完全断电,因此切换耗时较长。In addition, the prior art also proposes a solution: the system configures an "exclusive hardware mode". The system only provides some functions to the user in the "exclusive hardware mode". All the underlying software (such as operating systems, drivers, file systems, etc.) that these functions depend on run on an exclusive extremely low-power processor. The main CPU is completely powered off. The functions provided by peripherals and sensors in this mode are turned on on demand. Adopt the above-mentioned scheme, first, because this scheme uses the exclusive hardware, therefore increases the cost of the system. At the same time, because the performance of the exclusive hardware is very low, the functions in this mode are limited, only some basic functions are included, and the user experience is not as good as the normal mode. At the same time, in order to switch the system to the normal mode, since the main CPU is completely powered off, the switching takes a long time.
以下对本申请实施例中涉及的技术概念进行简要说明。The following briefly describes the technical concepts involved in the embodiments of the present application.
在本申请实施例中,系统由应用、应用加载器和执行域构成。In this embodiment of the application, the system is composed of an application, an application loader, and an execution domain.
其中,执行域是指一种硬件的组合或范围,在特定的执行域中只能访问属于该执行域的硬件。系统可以将硬件划分为多个执行域。其中,上述执行域的划分可以是事先划分好的(即是静态划分的),也可以是动态划分的。上述执行域的划分可以是通过物理方式划分,也可以是通过逻辑方式划分。其中,所谓物理方式划分是指有硬件实体对应到特定的执行域,;所谓逻辑方式划分是指通过动态配置和控制的方式确定执行域。Among them, the execution domain refers to a combination or range of hardware. In a specific execution domain, only hardware belonging to the execution domain can be accessed. The system can divide the hardware into multiple execution domains. Wherein, the division of the execution domain described above may be pre-divided (that is, statically divided), or it may be dynamically divided. The division of the execution domain described above may be divided in a physical way, or divided in a logical way. Among them, the so-called physical division refers to the hardware entity corresponding to a specific execution domain, and the so-called logical division refers to the determination of the execution domain through dynamic configuration and control.
示例性地,系统可以将硬件划分为第一执行域和第二执行域,其中,第一执行域用于执行功耗需求较低的应用或性能,或者续航要求较高的应用或性能,或者体验要求较低的应用或性能。第二执行域用于功耗需求较高的应用或性能,或者续航要求较低的应用或性能,或者体验要求较高的应用或性能。Exemplarily, the system may divide the hardware into a first execution domain and a second execution domain, where the first execution domain is used to execute applications or performance with lower power consumption requirements, or applications or performance with higher battery life requirements, or Experience less demanding applications or performance. The second execution domain is used for applications or performance with higher power consumption requirements, or applications or performance with lower battery life requirements, or applications or performance with higher experience requirements.
示例性地,执行域构建在双CPU(MCU+AP)的硬件架构上。其中,MCU是性能较弱功耗很低,是一种非全功能低速CPU。应用处理器(applicaiton processor,AP)是一种全功能高速CPU,大部分也会集成GPU、互联网服务提供商(internet service provider,ISP),高速动态内存控制器等,比如AP可以作为手机的主CPU,性能很强功耗较高。Exemplarily, the execution domain is built on a dual CPU (MCU+AP) hardware architecture. Among them, MCU is weak in performance and low in power consumption, and it is a non-full-featured low-speed CPU. Application processor (AP) is a full-featured high-speed CPU, most of which will also integrate GPU, Internet service provider (ISP), high-speed dynamic memory controller, etc., such as AP can be used as the main mobile phone CPU, high performance and high power consumption.
系统将硬件划分为2个执行域,包括MCU域和AP域。其中,在AP域中,AP及AP侧的GPU用于为用户提供较高的用户体验,功耗较高。AP为AP域的主CPU。MCU域用于为用户提供基本的功能和较低的用户体验,功耗较低。MCU为MCU域的主CPU。执行域的数量也可以大于2,本申请实施例对此不作限定。The system divides the hardware into 2 execution domains, including MCU domain and AP domain. Among them, in the AP domain, the AP and the GPU on the AP side are used to provide users with a higher user experience, and the power consumption is higher. AP is the main CPU of the AP domain. The MCU domain is used to provide users with basic functions and a lower user experience, with lower power consumption. MCU is the main CPU of the MCU domain. The number of execution domains may also be greater than 2, which is not limited in the embodiment of the present application.
每个执行域既可以访问共享外设,又可称为公共外设,也可以访问各自独占外设,又可称为专用外设。作为外设的一种,屏幕可以是共享的,也可以是独占的。其中,典型的共享外设包括触摸屏、线性加速度传感器、角速度传感器、PPG传感器、外部存储器(如固定或可拔插的存储器)、相机和图像传感器等。典型的独占外设包括GPU,示例性地,GPU被高功耗执行域独占。应理解的是,上述针对共享外设和独占外设的划分仅为举例,不作为本申请实施例的限定。其中,在物理连接关系上,外设是固定连接在某个特定的处理器的外部总线上的。示例性地,MCU有2个角色:其一为低功耗域的主CPU,其二为公共的IO集线器(IO Hub)。其中,由于MCU功耗很低可以一直保持工作状态,因此,MCU可以作为公共的IO Hub。例如,蓝牙控制器连接在MCU的外部总线上。AP如果需要通过蓝牙传输数据,则需要先通过MCU中转。在软件和/或逻辑层面,外设可以认为在不同的执行域中工作。Each execution domain can access shared peripherals, which can also be referred to as public peripherals, can also access their own exclusive peripherals, or can be referred to as dedicated peripherals. As a kind of peripherals, the screen can be shared or exclusive. Among them, typical shared peripherals include touch screens, linear acceleration sensors, angular velocity sensors, PPG sensors, external memory (such as fixed or pluggable memory), cameras and image sensors. Typical exclusive peripherals include GPUs. Illustratively, GPUs are exclusively occupied by high-power execution domains. It should be understood that the foregoing division of shared peripherals and exclusive peripherals is only an example, and is not a limitation of the embodiments of the present application. Among them, in terms of physical connection, peripherals are fixedly connected to the external bus of a specific processor. Exemplarily, the MCU has two roles: one is the main CPU in the low-power domain, and the other is the public IO Hub. Among them, because the MCU has very low power consumption and can always keep working, the MCU can be used as a public IO Hub. For example, the Bluetooth controller is connected to the external bus of the MCU. If the AP needs to transmit data via Bluetooth, it needs to transfer it through the MCU first. At the software and/or logic level, peripherals can be considered to work in different execution domains.
应用加载器用于加载可执行镜像,以及相应的数据、符号等附加信息到内存,等待操作系统(operating system,OS)调度CPU执行。典型的应用加载器的实现包括Java runtime中的class loader,或linux中的execve,windows中的ntdll.dll等。The application loader is used to load the executable image and the corresponding data, symbols and other additional information into the memory, and wait for the operating system (OS) to schedule the CPU to execute. Typical application loader implementations include class loader in Java runtime, execve in Linux, ntdll.dll in windows, and so on.
在本申请实施例中,特性是指应用或软件的功能片段。一个应用可以包括多个特性。例如,Home应用包含了表盘、天气、海拔、电池电量、蓝牙状态等特性。其中,表盘特性负责提供表盘的显示,天气特性负责在表盘之上显示指定地区的天气信息,海拔特性负责在表盘之上显示指定地区的海拔信息,电池电量和蓝牙状态负责提供系统状态的显示。In the embodiments of the present application, a characteristic refers to a functional segment of an application or software. An application can include multiple features. For example, the Home application includes features such as dial, weather, altitude, battery level, and Bluetooth status. Among them, the dial feature is responsible for providing the display of the dial, the weather feature is responsible for displaying the weather information of the specified area on the dial, the altitude feature is responsible for displaying the altitude information of the specified area on the dial, and the battery power and Bluetooth status are responsible for providing the display of the system status.
表盘特性还可分为视频表盘、3D表盘、相册表盘、待机表盘等子特性,其中视频表盘、3D表盘、相册表盘,这些特性提供了复杂的屏幕效果。相册表盘还需要从系统相册中读取图像文件。而待机表盘则只提供了简单的时间显示功能,无需复杂的屏幕效果,也不需要获取其它系统数据。Dial features can also be divided into sub-features such as video dial, 3D dial, album dial, and standby dial. Among them, video dial, 3D dial, album dial, these features provide complex screen effects. The album dial also needs to read image files from the system album. The standby dial only provides a simple time display function, without complicated screen effects, and no need to obtain other system data.
又例如,各种运动应用(例如跑步、游泳、户外等)还可能包括心率监测、手腕姿势检测(例如,抬腕亮屏)、压力监测等特性。For another example, various sports applications (such as running, swimming, outdoor, etc.) may also include features such as heart rate monitoring, wrist posture detection (such as raising the wrist to brighten the screen), and pressure monitoring.
本申请实施例提供一种执行应用的方法,用以解决续航时间和用户体验以及功能之间的矛盾。该方法的执行主体可以为终端设备,如图1所示,例如手机或智能手表等设备,或也可以为系统中的应用加载器。以下以应用加载器为例进行说明。如图3所示,该方法包括:The embodiment of the present application provides a method for executing an application to resolve the contradiction between battery life and user experience and functions. The execution subject of this method may be a terminal device, as shown in FIG. 1, such as a mobile phone or a smart watch, or may also be an application loader in the system. The following takes the application loader as an example for description. As shown in Figure 3, the method includes:
S301:应用加载器获取应用的类别。S301: The application loader obtains the category of the application.
示例性地,系统提供了通知机制让外部获知加载状态和事件,例如,回调,应用加载器可以通过回调获取应用的信息。Exemplarily, the system provides a notification mechanism to let the outside know the loading status and events, for example, a callback, and the application loader can obtain application information through the callback.
应用的信息包括应用的类别。在本实施例中,应用被划分为多个类别。示例性地,应用被划分为第一类别应用和第二类别应用,应用的划分依据可以包括续航、功耗和体验等因素。例如,应用可以被分为长续航类应用(又可称为低体验类应用)和高体验类应用(又可称为短续航类应用)。或者,按照应用的续航特点,应用可以被分为长续航类应用和短续航类应用。或者,按照应用的体验特点,应用可以被分为低体验类应用和高体验类应用。 或者,按照应用的功耗特点,应用可以被分为低功耗类应用和高功耗类应用。可以理解的是,应用的分类数量也可以大于2,上述举例不作为本申请实施例的限定。The application information includes the category of the application. In this embodiment, applications are divided into multiple categories. Exemplarily, applications are divided into a first category of applications and a second category of applications, and the basis for dividing the applications may include factors such as battery life, power consumption, and experience. For example, applications can be divided into long battery life applications (also referred to as low experience applications) and high experience applications (also referred to as short battery life applications). Or, according to the battery life characteristics of the application, the application can be divided into a long battery life application and a short battery life application. Or, according to the experience characteristics of the application, the application can be divided into a low-experience application and a high-experience application. Or, according to the power consumption characteristics of the application, the application can be divided into a low power consumption application and a high power consumption application. It is understandable that the number of application categories can also be greater than 2, and the above examples are not limited to the embodiments of the present application.
其中,典型的长续航类应用有各种运动APP(跑步、游泳、户外等)。典型的高体验类应用包括酷炫表盘,交互式表盘,视频游戏、音乐播放等。Among them, typical long-endurance applications include various sports APPs (running, swimming, outdoor, etc.). Typical high-experience applications include cool dials, interactive dials, video games, music playback, etc.
可以理解的是,执行域的数量和应用的分类的数量可以相同,也可以不同。示例性地,应用的分类数量可以大于执行域的数量,或者执行域的数量可以大于应用的分类数量。例如,系统还可以把低功耗执行域进一步划分成更多的子域。It is understandable that the number of execution domains and the number of application categories can be the same or different. Exemplarily, the number of classifications of applications may be greater than the number of execution domains, or the number of execution domains may be greater than the number of classifications of applications. For example, the system can further divide the low-power execution domain into more subdomains.
S302:应用加载器根据应用的类别从多个执行域中确定第一执行域,在第一执行域中执行应用。S302: The application loader determines a first execution domain from multiple execution domains according to the category of the application, and executes the application in the first execution domain.
示例性地,当应用加载器拉起应用时,根据获取到的该应用的类别,查询该应用的类别对应的执行域,即确定第一执行域,其中,应用的类别与执行域的对应关系可以提前配置。在确定第一执行域后,应用加载器将应用其分配到第一执行域执行。Exemplarily, when the application loader pulls up an application, according to the acquired category of the application, the execution domain corresponding to the category of the application is queried, that is, the first execution domain is determined, where the correspondence between the category of the application and the execution domain Can be configured in advance. After determining the first execution domain, the application loader allocates the application to the first execution domain for execution.
例如,应用为酷炫表盘,酷炫表盘的类别为高体验类应用,应用加载器根据酷炫表盘的类别为高体验类应用确定AP域(即高功耗执行域)。又例如,应用为某运动应用,该运动应用的类别为长续航类应用,应用加载器根据该运动应用的类别为长续航类应用确定MCU域(即低功耗执行域)。For example, the application is a cool dial, the category of the cool dial is a high-experience application, and the application loader determines an AP domain (that is, a high-power execution domain) for a high-experience application according to the category of the cool dial. For another example, the application is a certain sports application, the category of the sports application is a long-life application, and the application loader determines the MCU domain (ie, a low-power execution domain) according to the category of the sports application as a long-life application.
同时,应用加载器控制除第一执行域外的空闲执行域进入节能状态。其中,节能状态包括待机状态、睡眠状态、深度睡眠状态中的至少一种。示例性地,空闲执行域优先选择进入待机状态。At the same time, the application loader controls the idle execution domains other than the first execution domain to enter the energy-saving state. Wherein, the energy-saving state includes at least one of a standby state, a sleep state, and a deep sleep state. Exemplarily, the idle execution domain preferentially selects to enter the standby state.
以linux系统为例,上述几个节能状态的含义具体如下:Taking the Linux system as an example, the meanings of the above-mentioned energy-saving states are as follows:
待机状态是指CPU上电、内存上电。此时CPU工作在非常低的频率,如果是多核CPU,也会关闭其中的一部分核心。由于CPU一直在工作状态,因此无需恢复状态,只需调高CPU工作频率唤醒其它核心即可全速工作。The standby state means that the CPU is powered on and the memory is powered on. At this time, the CPU is working at a very low frequency. If it is a multi-core CPU, some of its cores will also be shut down. Since the CPU is always working, there is no need to restore the state, just increase the CPU working frequency and wake up other cores to work at full speed.
睡眠状态是指CPU下电,内存上电。此时如果要恢复CPU运行,则需要先唤醒CPU,再由CPU将保存在内存中的状态恢复到自己的寄存器中。The sleep state means that the CPU is powered off and the memory is powered on. If you want to resume the CPU operation at this time, you need to wake up the CPU first, and then the CPU restores the state saved in the memory to its own register.
深度睡眠状态是指CPU和内存都下电。此时如果要CPU恢复运行,需要重新boot,即从外存加载CPU的状态和/或数据。The deep sleep state means that both the CPU and memory are powered off. If you want the CPU to resume operation at this time, you need to reboot, that is, load the state and/or data of the CPU from the external memory.
应理解的是,节能状态还可能包括其他状态,上述举例所示的各种状态在不同系统中含义可能不完全相同。It should be understood that the energy-saving state may also include other states, and the various states shown in the above examples may have different meanings in different systems.
此外,当系统检测到预设操作时,应用加载器可以控制第一执行域进入节能状态。以下以示例1~示例4为例进行说明。In addition, when the system detects a preset operation, the application loader can control the first execution domain to enter the energy-saving state. The following takes Example 1 to Example 4 as examples for description.
示例1:当系统检测到用户关闭屏幕,当前应用的执行域为高功耗执行域,则应用控制器可以控制高功耗执行域进入待机状态。Example 1: When the system detects that the user turns off the screen and the execution domain of the current application is a high-power execution domain, the application controller can control the high-power execution domain to enter the standby state.
示例2:当系统检测到用户超过一段时间(可配置,默认5s)不操作,当前应用的执行域为高功耗执行域,则应用加载器可以控制高功耗执行域进入待机状态。Example 2: When the system detects that the user has not operated for a period of time (configurable, 5s by default), and the execution domain of the current application is a high-power execution domain, the application loader can control the high-power execution domain to enter the standby state.
示例3:当系统检测到当前应用被用户切换到后台,同时启动了另一个应用,当前应用的执行域为高功耗执行域,新启动的应用的类别为长续航类应用,则新启动的应用被加载到低功耗执行域,而此时高功耗执行域又没有其它前台应用,则应用加载器可以控制高功耗执行域进入待机状态。Example 3: When the system detects that the current application is switched to the background by the user, and another application is started at the same time, the execution domain of the current application is a high-power execution domain, and the category of the newly started application is a long battery life application, then the newly started application The application is loaded into the low-power execution domain, and at this time the high-power execution domain has no other foreground applications, the application loader can control the high-power execution domain to enter the standby state.
示例4:当系统检测到当前应用正在运行一个低功耗特性,当前应用的执行域为高功 耗执行域,则应用加载器可以控制高功耗执行域进入待机状态。例如,应用Home包含了表盘、天气、海拔、电池电量、蓝牙状态等特性。进一步的,表盘特性可分为视频表盘、3D表盘、相册表盘、待机表盘等子特性,其中,视频表盘、3D表盘、相册表盘属于高体验的特性,这些特性提供了复杂的屏幕效果。相册表盘还需要从系统相册中读取图像文件。而待机表盘则只提供了简单的时间显示功能,无需复杂的屏幕效果,也不需要获取其它系统数据,它属于低功耗的特性。因此,当表盘特性为待机表盘时,应用加载器可以控制高功耗执行域进入待机状态。Example 4: When the system detects that the current application is running with a low power consumption feature, and the execution domain of the current application is a high power consumption execution domain, the application loader can control the high power consumption execution domain to enter the standby state. For example, the Home application includes features such as dial, weather, altitude, battery level, and Bluetooth status. Further, the dial features can be divided into sub-features such as video dials, 3D dials, album dials, and standby dials. Among them, video dials, 3D dials, and album dials are high-experience features, and these features provide complex screen effects. The album dial also needs to read image files from the system album. The standby dial only provides a simple time display function, without complicated screen effects, and no need to obtain other system data. It is a feature of low power consumption. Therefore, when the dial feature is a standby dial, the application loader can control the high power consumption execution domain to enter the standby state.
进一步地,针对上述示例1~示例4,在高功耗执行域处于待机状态超过一段时间仍未退出时,则高功耗执行域进入睡眠状态。一般地,深度睡眠状态需要用户进行显式切换,从深度睡眠状态恢复需要重新boot。Further, for the foregoing examples 1 to 4, when the high power consumption execution domain has been in the standby state for more than a period of time and has not exited, the high power consumption execution domain enters the sleep state. Generally, the deep sleep state requires the user to perform an explicit switch, and recovery from the deep sleep state requires a reboot.
应理解的是,当系统检测到示例1~示例4的反向操作时,应用加载器控制高功耗执行域从待机状态退出。It should be understood that when the system detects the reverse operation of Example 1 to Example 4, the application loader controls the high power consumption execution domain to exit from the standby state.
此外,应用加载器确定应用需要访问的共享外设被第一执行域独占,为共享外设设置全局性独占标识,在共享外设被访问完成后,清除为共享外设设置的全局性独占标识。因此,通过该标识,其它执行域将无法获得该外设的控制权,保证当前执行域对该外设的独占访问,避免数据或状态错误。应理解的是,对于CPU或Hub而言,外设一般是系统上的子节点,只支持单一的父节点,因此无论是否设置全局性独占标识,外设一般都是被独占的。同时,外设可被分时复用或分地址复用。一次复用期间只能被一个CPU访问。In addition, the application loader determines that the shared peripheral that the application needs to access is exclusively occupied by the first execution domain, and sets a global exclusive flag for the shared peripheral. After the shared peripheral is accessed, it clears the global exclusive flag set for the shared peripheral . Therefore, through this identification, other execution domains will not be able to obtain the control right of the peripheral, ensuring the exclusive access of the current execution domain to the peripheral, and avoiding data or status errors. It should be understood that for a CPU or Hub, peripherals are generally child nodes on the system and only support a single parent node. Therefore, regardless of whether a global exclusive flag is set, peripherals are generally exclusive. At the same time, peripherals can be time-division multiplexed or address multiplexed. Only one CPU can access during a multiplexing period.
进一步地,当系统检测到预设事件时,查询该预设事件对应的模式,即确定第二模式,第二模式为预设事件对应的第一特性的模式,控制应用中的第一特性的模式从第一模式切换至第二模式,第一模式为第一特性的初始模式。应用包括多个特性,第一特性为多个特性中的一个特性。模式可以是指特性的某种状态,可以表现在外观、行为等方面,其中,一个特性可拥有多个模式。Further, when the system detects a preset event, it queries the mode corresponding to the preset event, that is, determines the second mode, which is the mode of the first characteristic corresponding to the preset event, and controls the mode of the first characteristic in the application The mode is switched from the first mode to the second mode, and the first mode is the initial mode of the first characteristic. The application includes multiple characteristics, and the first characteristic is one of the multiple characteristics. Mode can refer to a certain state of a feature, which can be expressed in terms of appearance, behavior, etc., in which a feature can have multiple modes.
示例性地,以智能手表为例,预设事件可以包括但不限于以下事件:“智能手表从手腕摘下”,“用户抬起手腕”,“进入夜间时间段”。Illustratively, taking a smart watch as an example, the preset events may include but are not limited to the following events: "smart watch is removed from the wrist", "user raises the wrist", and "entering the night time period".
示例性地,第一特性的模式包括高体验模式、低功耗模式和关闭模式中的至少两种。此外,第一特性的模式还可以采用其他设计,本申请实施例对此不作限定。特性的模式与执行域具有对应关系。例如,第一特性的模式包括高体验模式、低功耗模式,则高体验模式对应高功耗执行域,低功耗模式对应低功耗执行域。Exemplarily, the mode of the first characteristic includes at least two of a high experience mode, a low power consumption mode, and an off mode. In addition, the mode of the first characteristic may also adopt other designs, which are not limited in the embodiment of the present application. The mode of the characteristic has a corresponding relationship with the execution domain. For example, the modes of the first characteristic include a high experience mode and a low power consumption mode, the high experience mode corresponds to the high power consumption execution domain, and the low power consumption mode corresponds to the low power consumption execution domain.
又例如,第一特性的模式包括高体验模式、低功耗模式和关闭模式,则高体验模式对应高功耗执行域,低功耗模式对应低功耗执行域,关闭模式不对应任何执行域。For another example, the modes of the first characteristic include high experience mode, low power consumption mode, and shutdown mode. The high experience mode corresponds to the high power execution domain, the low power mode corresponds to the low power execution domain, and the shutdown mode does not correspond to any execution domain. .
因此,可以理解的是,特性所具备的模式的数量与执行域的数量可以相同也可以不同。Therefore, it can be understood that the number of modes and the number of execution domains of the characteristic may be the same or different.
进一步地,控制应用中的第一特性的模式从第一模式切换至第二模式可以是指控制第一特性从第一执行域切换至第二执行域执行,其中,第一模式对应第一执行域,第二模式对应第二执行域。示例性地,当第一特性的模式从高体验模式切换至低功耗模式时,控制第一特性的执行域从高功耗执行域切换至低功耗执行域。又或者,控制应用中的第一特性的模式从第一模式切换至第二模式可以是指控制第一特性停止在第一执行域执行,即关闭第一特性。示例性地,当第一特性的模式从高体验模式切换至关闭模式时,控制第一特性关闭。Further, switching the mode of controlling the first characteristic in the application from the first mode to the second mode may refer to controlling the first characteristic to be executed from the first execution domain to the second execution domain, where the first mode corresponds to the first execution Domain, the second mode corresponds to the second execution domain. Exemplarily, when the mode of the first characteristic is switched from the high experience mode to the low power consumption mode, the execution domain of the first characteristic is controlled to switch from the high power consumption execution domain to the low power consumption execution domain. Or, switching the mode of controlling the first characteristic in the application from the first mode to the second mode may refer to controlling the first characteristic to stop executing in the first execution domain, that is, turning off the first characteristic. Exemplarily, when the mode of the first characteristic is switched from the high experience mode to the closed mode, the first characteristic is controlled to be turned off.
以下以酷炫表盘中的表盘特性为例说明表盘特性的模式切换。假设系统包括2个执行 域,分别为低功耗执行域和高功耗执行域。表盘特性的模式包括高体验模式、低功耗模式和关闭模式。表盘特性初始的执行域为低功耗执行域,表盘特性初始的模式为低功耗模式。The following takes the dial characteristics in the cool dial as an example to illustrate the mode switching of the dial characteristics. Suppose the system includes two execution domains, namely a low-power execution domain and a high-power execution domain. The modes of the dial feature include high experience mode, low power consumption mode and off mode. The initial execution domain of the dial feature is the low-power execution domain, and the initial mode of the dial feature is the low-power mode.
场景1:用户抬起手腕。在系统检测到用户抬起手腕时,将表盘特性从低功耗模式切换到高体验模式,相应的,表盘特性从低功耗执行域切换到高功耗执行域执行。示例性地,此时高功耗执行域中的AP及AP侧的GPU负责表盘上的3D模型、光照、交互的计算和绘制。用户获得一个全功能全特效的酷炫表盘体验,如弹珠游戏或光影劳力士。Scenario 1: The user raises his wrist. When the system detects that the user raises the wrist, the dial feature is switched from the low-power consumption mode to the high-experience mode, and accordingly, the dial feature is switched from the low-power execution domain to the high-power execution domain. Exemplarily, at this time, the AP in the high-power execution domain and the GPU on the AP side are responsible for the calculation and drawing of the 3D model, lighting, and interaction on the dial. Users get a cool dial experience with full functions and special effects, such as a pinball game or a rolex of light and shadow.
场景2:用户放下手腕。在系统检测到用户放下手腕3s(具体时间间隔可设置)后,系统确定用户放下手腕超过指定时间间隔,则表盘特性从高体验模式切换到低功耗模式,相应的,表盘特性从高功耗执行域切换到低功耗执行域执行。由于低功耗执行域的硬件能力限制,3D模型、光照皆不可用,用户得到一个能查看时间的基本表盘。Scenario 2: The user puts down his wrist. After the system detects that the user puts down the wrist for 3 seconds (the specific time interval can be set), the system determines that the user puts down the wrist for more than the specified time interval, the dial feature switches from the high experience mode to the low power consumption mode, and accordingly, the dial feature changes from high power consumption The execution domain switches to low-power execution domain execution. Due to the hardware capabilities of the low-power execution domain, the 3D model and lighting are not available, and the user gets a basic watch face that can check the time.
场景3:用户将智能手表从手腕摘下。场景3与场景2类似,表盘特性从高体验模式切换到低功耗模式,相应的,表盘特性从高功耗执行域切换到低功耗执行域执行。Scenario 3: The user takes the smart watch off the wrist. Scenario 3 is similar to scenario 2. The dial feature switches from a high experience mode to a low power consumption mode. Correspondingly, the dial feature switches from a high-power execution domain to a low-power execution domain.
场景4:进入夜间时间段。由于大多数情况下,在夜间时段用户已入睡,表盘特性在低功耗执行域执行也显得没有必要。因此,表盘特性切换到关闭模式,表盘特性不再任何执行域执行。示例性地,此时可直接关闭表盘乃至整个屏幕。Scenario 4: Enter the night time period. Since in most cases, the user has fallen asleep during the night time, it is unnecessary for the dial feature to execute in the low-power execution domain. Therefore, the dial feature is switched to the off mode, and the dial feature is no longer executed in any execution domain. Exemplarily, the dial and even the entire screen can be directly closed at this time.
以下以图4和图5为例对本申请实施例进行详细说明。Hereinafter, the embodiments of the present application will be described in detail by taking FIGS. 4 and 5 as examples.
步骤501:获取应用的类别,确定第一执行域。Step 501: Obtain the category of the application, and determine the first execution domain.
示例性地,应用加载器启动应用时,获取该应用的类别,根据该应用的类别,查询该应用的类别对应的执行域,确定第一执行域。Exemplarily, when the application loader starts the application, the category of the application is obtained, and the execution domain corresponding to the category of the application is queried according to the category of the application, and the first execution domain is determined.
步骤502:唤醒第一执行域。Step 502: Wake up the first execution domain.
示例性地,为保证用户体验,建议唤醒第一执行域的时间不超过300ms。Exemplarily, in order to ensure user experience, it is recommended that the time for waking up the first execution domain should not exceed 300 ms.
步骤503:判断其他执行域是否空闲,即除第一执行域之外的执行域是否空闲,若是,则执行步骤504,否则执行步骤505。Step 503: Determine whether other execution domains are idle, that is, whether execution domains other than the first execution domain are idle, if yes, go to step 504, otherwise go to step 505.
应理解的是,第一执行域之外的执行域可能不止1个。It should be understood that there may be more than one execution domain outside the first execution domain.
步骤504:控制空闲执行域进入节能状态。Step 504: Control the idle execution domain to enter the energy-saving state.
应理解的是,节能状态数目也可能不止1个。示例性地,针对除第一执行域之外的每个执行域执行判断该执行域是否空闲,若空闲,则控制该执行域进入节能状态。例如待机状态。It should be understood that the number of energy-saving states may also be more than one. Exemplarily, for each execution domain except the first execution domain, it is judged whether the execution domain is idle, and if it is idle, the execution domain is controlled to enter the energy-saving state. For example, the standby state.
步骤505:在第一执行域执行该应用。Step 505: Execute the application in the first execution domain.
示例性地,由于第一执行域已唤醒,第一执行域包括的硬件单元可以正常工作,因此在第一执行域中建立该应用的上下文,装入该应用的代码,并立即执行该应用。其中,上下文包括各个寄存器的初始化,运行时内存的分配域初始化等。Exemplarily, since the first execution domain has been awakened, the hardware units included in the first execution domain can work normally. Therefore, the context of the application is established in the first execution domain, the code of the application is loaded, and the application is executed immediately. Among them, the context includes the initialization of each register, the initialization of the allocation domain of the runtime memory, and so on.
步骤506:判断该应用是否需要访问外设。Step 506: Determine whether the application needs to access peripherals.
若需要访问外设,则执行步骤507,若不需要访问外设,则流程结束。If the peripheral needs to be accessed, step 507 is executed, and if the peripheral is not needed to be accessed, the process ends.
步骤507:若该应用需要访问外设,则进一步判断该外设是否为共享外设,即判断该共享外设是否为被第一执行域独占的,若是,则执行步骤508,否则执行步骤509。Step 507: If the application needs to access the peripheral, it is further judged whether the peripheral is a shared peripheral, that is, whether the shared peripheral is exclusively occupied by the first execution domain, if so, go to step 508, otherwise go to step 509 .
步骤508:设置全局性独占标识。Step 508: Set a global exclusive identifier.
可以理解的是,通过该标识,其它执行域将无法获得该外设的控制权,保证当前执行域对该外设的独占访问,避免数据或状态错误。It is understandable that through this identification, other execution domains will not be able to obtain the control right of the peripheral, ensuring exclusive access to the peripheral by the current execution domain, and avoiding data or status errors.
步骤509:执行正常的外设读写和控制。Step 509: Perform normal peripheral reading and writing and control.
具体的,若该应用需要访问共享外设,则执行正常的共享外设读写和控制,直至共享外设访问完成。若该应用需要访问独占外设,则执行正常的独占外设读写和控制,直至独占外设访问完成。若该应用需要访问共享外设和独占外设,则执行正常的共享外设读写和控制,直至共享外设访问完成,以及执行正常的共享外设读写和控制,直至独占外设访问完成。Specifically, if the application needs to access the shared peripheral, it executes normal read, write and control of the shared peripheral until the access to the shared peripheral is completed. If the application needs to access the exclusive peripheral, the normal exclusive peripheral read and write and control are performed until the exclusive peripheral access is completed. If the application needs to access shared peripherals and exclusive peripherals, perform normal shared peripheral read, write and control until the shared peripheral access is completed, and perform normal shared peripheral read, write and control until the exclusive peripheral access is completed .
步骤510:在共享外设访问完成后清除全局性独占标识。Step 510: Clear the global exclusive flag after the access to the shared peripheral is completed.
在清除全局性独占标识后,该共享外设的状态恢复为可用就绪。After the global exclusive flag is cleared, the state of the shared peripheral is restored to available and ready.
可以理解的是,当应用不访问共享外设,只访问为独占外设时,此时该步骤可以不执行。It is understandable that when the application does not access the shared peripherals, but only accesses the exclusive peripherals, this step may not be executed at this time.
采用上述方法,通过将硬件划分为不同执行域,并将不同类别的应用分配到对应的执行域上,可以提升系统功耗控制的灵活性,可以降低系统的总体功耗水平。相较于全部应用在高功耗执行域中执行的场景,一些应用被分配到低功耗执行域中执行。由于低功耗执行域的功耗水平显著低于高功耗执行域的功耗水平,因此可以实现降低总体功耗水平。一些应用被分配到高功耗执行域中执行,可以确保用户体验,因此,能够解决续航时间和用户体验以及功能之间的矛盾。Using the above method, by dividing the hardware into different execution domains and assigning different types of applications to the corresponding execution domains, the flexibility of system power consumption control can be improved, and the overall power consumption level of the system can be reduced. Compared with the scenario where all applications are executed in the high-power execution domain, some applications are allocated to execute in the low-power execution domain. Since the power consumption level of the low-power execution domain is significantly lower than that of the high-power execution domain, the overall power consumption level can be reduced. Some applications are allocated to execute in the high-power execution domain, which can ensure user experience. Therefore, the contradiction between battery life and user experience and functions can be resolved.
以下以图6为例对本申请实施例进行详细说明。Hereinafter, the embodiment of the present application will be described in detail by taking FIG. 6 as an example.
步骤601:获取应用的类别,将应用分配到第一执行域执行。Step 601: Obtain the category of the application, and allocate the application to the first execution domain for execution.
示例性地,应用加载器启动应用时,获取该应用的类别,根据该应用的类别,查询该应用的类别对应的执行域,确定第一执行域。Exemplarily, when the application loader starts the application, the category of the application is obtained, and the execution domain corresponding to the category of the application is queried according to the category of the application, and the first execution domain is determined.
其中,应用包括多个特性,第一特性为多个特性中的一个特性,第一模式为第一特性的初始模式,与第一执行域相关联。The application includes multiple characteristics, the first characteristic is one of the multiple characteristics, and the first mode is an initial mode of the first characteristic, which is associated with the first execution domain.
步骤602:检测预设事件。若检测到预设事件,执行步骤603,否则流程结束。Step 602: Detect a preset event. If a preset event is detected, step 603 is executed, otherwise the process ends.
若未检测到预设事件,则可参考如图5所示的实施例中的相关内容,重复之处不再赘述。If the preset event is not detected, you can refer to the related content in the embodiment shown in FIG. 5, and the repetition will not be repeated.
步骤603:查询预设事件对应的第一特性的模式,确定第二模式,将第一特性的模式从第一模式切换至第二模式。Step 603: Query the mode of the first characteristic corresponding to the preset event, determine the second mode, and switch the mode of the first characteristic from the first mode to the second mode.
步骤604:根据第二模式对应的执行域,将第一特性从第一执行域切换至第二模式对应的执行域。Step 604: Switch the first characteristic from the first execution domain to the execution domain corresponding to the second mode according to the execution domain corresponding to the second mode.
步骤605:在第二模式对应的执行域恢复执行第一特性。Step 605: resume the execution of the first feature in the execution domain corresponding to the second mode.
步骤606:判断应用是否结束,若完成执行则结束流程,否则持续检测预设事件,返回步骤602。Step 606: Determine whether the application is finished, if the execution is finished, the process is finished, otherwise, the preset event is continuously detected, and step 602 is returned.
采用上述方法避免了固定的执行域的分配方式,根据检测到的预设事件,应用中的特性可以动态切换到对应的执行域,进而可以提升系统功耗控制的灵活性,可以降低系统的总体功耗水平。The above method avoids the fixed execution domain allocation method. According to the detected preset event, the characteristics in the application can be dynamically switched to the corresponding execution domain, which can improve the flexibility of system power consumption control and reduce the overall system Power consumption level.
本申请实施例提供一种执行应用的方法,用以解决续航时间和用户体验以及功能之间的矛盾。该方法的执行主体可以为终端设备或者可以为系统中的应用加载器。以下以应用加载器为例进行说明,如图7所示,该方法包括:The embodiment of the present application provides a method for executing an application to resolve the contradiction between battery life and user experience and functions. The execution subject of this method may be a terminal device or may be an application loader in the system. The following takes the application loader as an example for description. As shown in Figure 7, the method includes:
S701:应用加载器获取第一特性的类别,第一特性为应用包括的多个特性中的一个特性。S701: The application loader obtains the category of the first characteristic, where the first characteristic is one of the multiple characteristics included in the application.
在本实施例中,应用包括多个特性,不同特性之间可以通过进程间通信(inter-process communication,IPC)设备或管道进行通信。示例性地,特性被划分为第一类别特性和第二类别特性,特性的划分依据可以包括续航、功耗和体验等因素。可以理解的是,应用的分类数量也可以大于2,上述举例不作为本申请实施例的限定。示例性地,可以将特性划分为高体验特性和低功耗特性,如图4所示。In this embodiment, the application includes multiple features, and different features can communicate through inter-process communication (IPC) devices or pipes. Exemplarily, the characteristics are divided into a first category of characteristics and a second category of characteristics, and the basis for the classification of the characteristics may include factors such as battery life, power consumption, and experience. It is understandable that the number of application categories can also be greater than 2, and the above examples are not limited to the embodiments of the present application. Exemplarily, the characteristics can be divided into high experience characteristics and low power consumption characteristics, as shown in FIG. 4.
一般地,可以将应用中属于后台计算类的特性、或用户交互体验要求不高的特性,例如,心率监测、手腕姿势检测(例如,抬腕亮屏)、压力监测等特性等,作为第一类别特性,又成为低功耗类特性,可以将应用中属于用户体验要求较高的特性,作为第二类别特性,又可称为高体验特性。例如,UI界面切换过渡,各种微动效、过渡动画等。其中,微动效是指内置在UI元素内的小范围内的动画效果。Generally, features that belong to the background computing category in the application, or features that do not require high user interaction experience, such as heart rate monitoring, wrist posture detection (for example, raising the wrist to brighten the screen), pressure monitoring, etc., can be used as the first Category features have become low-power features. Features that require higher user experience in applications can be used as second category features, which can also be referred to as high-experience features. For example, UI interface switching transition, various micro-motion effects, transition animation, etc. Among them, micro-motion effects refer to animation effects built into a small range of UI elements.
此外,一些特性还可以包括子特性,应用加载器还可以获取这些子特性的类别,例如,表盘特性还可分为视频表盘、3D表盘、相册表盘、待机表盘等子特性,其中视频表盘、3D表盘、相册表盘属于高体验的特性,这些特性提供了复杂的屏幕效果。而待机表盘则只提供了简单的时间显示功能,无需复杂的屏幕效果,也不需要获取其它系统数据,它属于低功耗的特性。In addition, some features can also include sub-features, and the application loader can also obtain the categories of these sub-features. For example, dial features can also be divided into video dials, 3D dials, album dials, standby dials and other sub-characteristics. Among them, video dials, 3D dials, etc. Dials, photo album dials are high-experience features, and these features provide complex screen effects. The standby dial only provides a simple time display function, without complicated screen effects, and no need to obtain other system data. It is a feature of low power consumption.
可以理解的是,执行域的数量和特性的分类的数量可以相同,也可以不同。示例性地,特性的分类的数量可以大于执行域的数量,或者执行域的数量可以大于特性的分类的数量。It can be understood that the number of execution domains and the number of feature classifications can be the same or different. Exemplarily, the number of classifications of characteristics may be greater than the number of execution domains, or the number of execution domains may be greater than the number of classifications of characteristics.
S702:应用加载器根据第一特性的类别从多个执行域中确定第一执行域,在第一执行域中执行第一特性。S702: The application loader determines a first execution domain from multiple execution domains according to the category of the first characteristic, and executes the first characteristic in the first execution domain.
示例性地,当应用加载器拉起应用时,根据获取到第一特性的类别,查询第一特性的类别对应的执行域,即确定第一执行域,其中,特性的类别与执行域的对应关系可以提前配置。在确定第一执行域后,应用加载器将第一特性分配到第一执行域执行。Exemplarily, when the application loader pulls up the application, it queries the execution domain corresponding to the first characteristic category according to the acquired first characteristic category, that is, determines the first execution domain, where the characteristic category corresponds to the execution domain The relationship can be configured in advance. After determining the first execution domain, the application loader assigns the first characteristic to the first execution domain for execution.
同时,应用加载器还可以获取第二特性的类别,根据第二特性的类别从多个执行域中确定第二执行域,在第二执行域中执行第二特性。其中,第二执行域与第一执行域不同,且第一特性与第二特性通过IPC设备或管道进行通信。第二特性为应用包括的多个特性中的一个特性,第二特性与第一特性不同。示例性地,应用加载器将低功耗类特性分配至MCU域执行,将高体验类特性分配至AP域执行。At the same time, the application loader may also obtain the category of the second characteristic, determine the second execution domain from a plurality of execution domains according to the category of the second characteristic, and execute the second characteristic in the second execution domain. Wherein, the second execution domain is different from the first execution domain, and the first characteristic and the second characteristic are communicated through an IPC device or a pipe. The second characteristic is one of a plurality of characteristics included in the application, and the second characteristic is different from the first characteristic. Exemplarily, the application loader allocates low power consumption features to the MCU domain for execution, and high experience features to the AP domain for execution.
进一步地,应用加载器可以控制除第一执行域和第二执行域外的空闲执行域进入节能状态。其中,节能状态包括待机状态、睡眠状态、深度睡眠状态中的至少一种。关于节能状态的相关描述可以参考如图3所示实施例中的S302部分的相关内容,重复之处不再赘述。Further, the application loader can control the idle execution domains except the first execution domain and the second execution domain to enter the energy-saving state. Wherein, the energy-saving state includes at least one of a standby state, a sleep state, and a deep sleep state. For the related description of the energy-saving state, please refer to the related content of part S302 in the embodiment shown in FIG. 3, and the repetition will not be repeated.
应用加载器确定第一特性需要访问的共享外设被第一执行域独占,为共享外设设置全局性独占标识,在共享外设被访问完成后,清除为共享外设设置的全局性独占标识。应理解的是,对于CPU或Hub而言,外设一般是系统上的子节点,只支持单一的父节点,因此无论是否设置全局性独占标识,外设一般都是被独占的。同时,外设可被分时复用或分地址复用。一次复用期间只能被一个CPU访问。The application loader determines that the shared peripheral that needs to be accessed by the first feature is exclusively owned by the first execution domain, and sets a global exclusive flag for the shared peripheral. After the shared peripheral is accessed, it clears the global exclusive flag set for the shared peripheral . It should be understood that for a CPU or Hub, peripherals are generally child nodes on the system and only support a single parent node. Therefore, regardless of whether a global exclusive flag is set, peripherals are generally exclusive. At the same time, peripherals can be time-division multiplexed or address multiplexed. Only one CPU can access during a multiplexing period.
进一步地,当系统检测到预设事件时,查询该预设事件对应的模式,即确定第二模式,第二模式为预设事件对应的第一特性的模式,控制第一特性的模式从第一模式切换至第二 模式,第一模式为第一特性的初始模式。Further, when the system detects a preset event, it queries the mode corresponding to the preset event, that is, determines the second mode. The second mode is the mode of the first characteristic corresponding to the preset event, and the mode of controlling the first characteristic is from the first One mode is switched to the second mode, and the first mode is the initial mode of the first characteristic.
示例性地,以智能手表为例,预设事件可以包括但不限于以下事件:“智能手表从手腕摘下”,“用户抬起手腕”,“进入夜间时间段”。Illustratively, taking a smart watch as an example, the preset events may include but are not limited to the following events: "smart watch is removed from the wrist", "user raises the wrist", and "entering the night time period".
示例性地,第一特性的模式包括高体验模式、低功耗模式和关闭模式中的至少两种。此外,第一特性的模式还可以采用其他设计,本申请实施例对此不作限定。特性的模式与执行域具有对应关系。例如,第一特性的模式包括高体验模式、低功耗模式,则高体验模式对应高功耗执行域,低功耗模式对应低功耗执行域。Exemplarily, the mode of the first characteristic includes at least two of a high experience mode, a low power consumption mode, and an off mode. In addition, the mode of the first characteristic may also adopt other designs, which are not limited in the embodiment of the present application. The mode of the characteristic has a corresponding relationship with the execution domain. For example, the modes of the first characteristic include a high experience mode and a low power consumption mode, the high experience mode corresponds to the high power consumption execution domain, and the low power consumption mode corresponds to the low power consumption execution domain.
又例如,第一特性的模式包括高体验模式、低功耗模式和关闭模式,则高体验模式对应高功耗执行域,低功耗模式对应低功耗执行域,关闭模式不对应任何执行域。For another example, the modes of the first characteristic include high experience mode, low power consumption mode, and shutdown mode. The high experience mode corresponds to the high power execution domain, the low power mode corresponds to the low power execution domain, and the shutdown mode does not correspond to any execution domain. .
因此,可以理解的是,特性所具备的模式的数量与执行域的数量可以相同也可以不同。Therefore, it can be understood that the number of modes and the number of execution domains of the characteristic may be the same or different.
进一步地,控制第一特性的模式从第一模式切换至第二模式可以是指控制第一特性从第一执行域切换至第三执行域执行,其中,第一模式对应第一执行域,第二模式对应第三执行域。这里的第三执行域可以为第二执行域或其他执行域,本申请实施例对此不作限定。示例性地,当第一特性的模式从高体验模式切换至低功耗模式时,控制第一特性的执行域从高功耗执行域切换至低功耗执行域。又或者,控制应用中的第一特性的模式从第一模式切换至第二模式可以是指控制第一特性停止在第一执行域执行,即关闭第一特性。示例性地,当第一特性的模式从高体验模式切换至关闭模式时,控制第一特性关闭。具体举例可以参考以酷炫表盘中的表盘特性为例说明表盘特性的模式切换的过程,重复之处不再赘述。Further, switching the mode of controlling the first characteristic from the first mode to the second mode may refer to controlling the first characteristic to be executed from the first execution domain to the third execution domain, wherein the first mode corresponds to the first execution domain, and the first mode corresponds to the first execution domain. The second mode corresponds to the third execution domain. The third execution domain here may be the second execution domain or other execution domains, which is not limited in the embodiment of the present application. Exemplarily, when the mode of the first characteristic is switched from the high experience mode to the low power consumption mode, the execution domain of the first characteristic is controlled to switch from the high power consumption execution domain to the low power consumption execution domain. Or, switching the mode of controlling the first characteristic in the application from the first mode to the second mode may refer to controlling the first characteristic to stop executing in the first execution domain, that is, turning off the first characteristic. Exemplarily, when the mode of the first characteristic is switched from the high experience mode to the closed mode, the first characteristic is controlled to be turned off. For specific examples, you can refer to the dial characteristics in the cool dial as an example to illustrate the process of mode switching of the dial characteristics, and the repetition will not be repeated.
以下以图8和图9为例对本申请实施例进行详细说明。Hereinafter, the embodiments of the present application will be described in detail by taking FIGS. 8 and 9 as examples.
步骤901:获取第一特性的类别,确定第一执行域。Step 901: Acquire the category of the first characteristic, and determine the first execution domain.
示例性地,应用加载器启动应用时,获取第一特性的类别。例如,第一特性可以为心率检测,或者某种微动效。当第一特性为心率检测时,第一特性的类别为低功耗特性,当第一特性为某种微动效时,第一特性的类别为高体验特性。Exemplarily, when the application loader starts the application, the category of the first characteristic is acquired. For example, the first characteristic may be heart rate detection, or some kind of micro-motion effect. When the first characteristic is heart rate detection, the category of the first characteristic is a low power consumption characteristic, and when the first characteristic is a certain micro-motion effect, the category of the first characteristic is a high experience characteristic.
示例性地,应用加载器根据第一特性的类别,查询第一特性的类别对应的执行域,确定第一执行域。例如,第一特性为心率检测,第一特性的类别为低功耗特性,应用加载器根据低功耗特性确定MCU域(即低功耗执行域)。例如,第一特性为某种微动效时,第一特性的类别为高体验特性,应用加载器根据高体验特性确定AP域(即低功耗执行域)。Exemplarily, the application loader queries the execution domain corresponding to the category of the first characteristic according to the category of the first characteristic, and determines the first execution domain. For example, the first characteristic is heart rate detection, the category of the first characteristic is low power consumption, and the application loader determines the MCU domain (that is, the low power execution domain) according to the low power consumption characteristic. For example, when the first characteristic is a certain micro-motion effect, the category of the first characteristic is a high-experience characteristic, and the application loader determines an AP domain (that is, a low-power execution domain) according to the high-experience characteristic.
步骤902:唤醒第一执行域。Step 902: Wake up the first execution domain.
步骤903:判断其他执行域是否空闲,即除第一执行域之外的执行域是否空闲,若是,则执行步骤904,否则执行步骤905。Step 903: Determine whether other execution domains are idle, that is, whether execution domains other than the first execution domain are idle, if yes, go to step 904, otherwise go to step 905.
应理解的是,第一执行域之外的执行域可能不止1个。It should be understood that there may be more than one execution domain outside the first execution domain.
步骤904:控制空闲执行域进入节能状态。Step 904: Control the idle execution domain to enter the energy-saving state.
应理解的是,节能状态数目也可能不止1个。示例性地,针对除第一执行域之外的每个执行域执行判断该执行域是否空闲,若空闲,则控制该执行域进入节能状态。例如待机状态。It should be understood that the number of energy-saving states may also be more than one. Exemplarily, for each execution domain except the first execution domain, it is judged whether the execution domain is idle, and if it is idle, the execution domain is controlled to enter the energy-saving state. For example, the standby state.
步骤905:在第一执行域执行第一特性。Step 905: Execute the first characteristic in the first execution domain.
步骤906:判断第一特性是否需要访问外设。Step 906: Determine whether the first feature needs to access peripherals.
若需要访问外设,则执行步骤907,若不需要访问外设,则流程结束。If the peripheral needs to be accessed, step 907 is executed. If the peripheral is not needed to be accessed, the process ends.
步骤907:若第一特性需要访问外设,则进一步判断该外设是否为共享外设,即判断 该共享外设是否为被第一执行域独占的,若是,则执行步骤908,否则执行步骤909。Step 907: If the first feature requires access to the peripheral, it is further judged whether the peripheral is a shared peripheral, that is, whether the shared peripheral is exclusively occupied by the first execution domain, if so, go to step 908, otherwise go to step 909.
步骤908:设置全局性独占标识。Step 908: Set a global exclusive identifier.
可以理解的是,通过该标识,其它执行域将无法获得该外设的控制权,保证当前执行域对该外设的独占访问,避免数据或状态错误。It is understandable that through this identification, other execution domains will not be able to obtain the control right of the peripheral, ensuring exclusive access to the peripheral by the current execution domain, and avoiding data or status errors.
步骤909:执行正常的外设读写和控制。Step 909: Perform normal peripheral reading and writing and control.
具体的,若该应用需要访问共享外设,则执行正常的共享外设读写和控制,直至共享外设访问完成。若该应用需要访问独占外设,则执行正常的独占外设读写和控制,直至独占外设访问完成。若该应用需要访问共享外设和独占外设,则执行正常的共享外设读写和控制,直至共享外设访问完成,以及执行正常的共享外设读写和控制,直至独占外设访问完成。Specifically, if the application needs to access the shared peripheral, it executes normal read, write and control of the shared peripheral until the access to the shared peripheral is completed. If the application needs to access the exclusive peripheral, the normal exclusive peripheral read and write and control are performed until the exclusive peripheral access is completed. If the application needs to access shared peripherals and exclusive peripherals, perform normal shared peripheral read, write and control until the shared peripheral access is completed, and perform normal shared peripheral read, write and control until the exclusive peripheral access is completed .
步骤910:在共享外设访问完成后清除全局性独占标识。Step 910: Clear the global exclusive identifier after the access to the shared peripheral is completed.
在清除全局性独占标识后,该共享外设的状态恢复为可用就绪。After the global exclusive flag is cleared, the state of the shared peripheral is restored to available and ready.
可以理解的是,当应用不访问共享外设,只访问为独占外设时,此时该步骤可以不执行。It is understandable that when the application does not access the shared peripherals, but only accesses the exclusive peripherals, this step may not be executed at this time.
步骤911:判断是否与其他特性进行通信。若是第一特性需要与其他特性进行通信执行步骤912,否则结束流程。Step 911: Determine whether to communicate with other features. If the first feature needs to communicate with other features, perform step 912; otherwise, the process ends.
步骤912:打开IPC设备。第一特性通过IPC设备与其他特性进行通信。Step 912: Turn on the IPC device. The first feature communicates with other features through the IPC device.
步骤913:读写IPC设备。Step 913: Read and write the IPC device.
采用上述方法,通过将硬件划分为不同执行域,并将不同类别的特性分配到对应的执行域上,可以提升系统功耗控制的灵活性,且能够实现较细力度的功耗控制,可以降低系统的总体功耗水平。Using the above method, by dividing the hardware into different execution domains and assigning different types of characteristics to the corresponding execution domains, the flexibility of system power consumption control can be improved, and more detailed power consumption control can be achieved, which can reduce The overall power consumption level of the system.
以下以图10为例对本申请实施例进行详细说明。The following uses FIG. 10 as an example to describe the embodiments of the present application in detail.
步骤1001:获取第一特性的类别,将第一特性分配到第一执行域执行。Step 1001: Acquire the category of the first characteristic, and assign the first characteristic to the first execution domain for execution.
示例性地,应用加载器启动应用时,获取该应用中第一特性的类别,根据第一特性的类别,查询第一特性的类别对应的执行域,确定第一执行域。Exemplarily, when the application loader starts the application, it obtains the category of the first characteristic in the application, and according to the category of the first characteristic, queries the execution domain corresponding to the category of the first characteristic to determine the first execution domain.
其中,应用包括第一特性,第一模式为第一特性的初始模式,与第一执行域相关联。Wherein, the application includes a first characteristic, and the first mode is an initial mode of the first characteristic, and is associated with the first execution domain.
步骤1002~步骤1006可以参考图6所示实施例的相关内容,重复之处不再赘述。For step 1002 to step 1006, reference may be made to the related content of the embodiment shown in FIG. 6, and the repetition will not be repeated.
采用上述方法避免了固定的执行域分配方式,根据检测到的预设事件,应用中的特性可以动态切换到对应的执行域,进而可以提升系统功耗控制的灵活性,可以降低系统的总体功耗水平。The above method avoids the fixed execution domain allocation method. According to the detected preset event, the characteristics in the application can be dynamically switched to the corresponding execution domain, which can improve the flexibility of system power consumption control and reduce the overall power of the system. Consumption level.
可以理解的是,为了实现上述实施例中功能,终端设备包括了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本申请中所公开的实施例描述的各示例的单元及方法步骤,本申请能够以硬件或硬件和计算机软件相结合的形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用场景和设计约束条件。It can be understood that, in order to implement the functions in the foregoing embodiments, the terminal device includes hardware structures and/or software modules corresponding to each function. Those skilled in the art should easily realize that, in combination with the units and method steps of the examples described in the embodiments disclosed in the present application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application scenarios and design constraints of the technical solution.
图11和图12为本申请的实施例提供的可能的通信装置的结构示意图。这些通信装置可以用于实现上述方法实施例中终端设备的功能,因此也能实现上述方法实施例所具备的有益效果。在本申请的实施例中,该通信装置可以是如图1所示的终端设备,可以是可穿 戴设备,还可以是应用于终端设备的模块(如芯片)。11 and FIG. 12 are schematic structural diagrams of possible communication devices provided by embodiments of this application. These communication devices can be used to implement the functions of the terminal equipment in the foregoing method embodiments, and therefore can also achieve the beneficial effects of the foregoing method embodiments. In the embodiment of the present application, the communication device may be a terminal device as shown in Fig. 1, a wearable device, or a module (such as a chip) applied to a terminal device.
如图11所示,通信装置1100包括处理单元1110和收发单元1120。通信装置1100用于实现上述图3、图4、图5、图6、图7、图8、图9和图10中所示的方法实施例中终端设备的功能。As shown in FIG. 11, the communication device 1100 includes a processing unit 1110 and a transceiving unit 1120. The communication device 1100 is used to implement the functions of the terminal device in the method embodiments shown in FIG. 3, FIG. 4, FIG. 5, FIG. 6, FIG. 7, FIG. 8, FIG. 9 and FIG. 10.
当通信装置1100用于实现图3所示的方法实施例中终端设备的功能时:收发单元1120用于获取应用的类别;处理单元1110用于根据应用的类别从多个执行域中确定第一执行域,在第一执行域中执行应用。When the communication device 1100 is used to implement the function of the terminal device in the method embodiment shown in FIG. 3: the transceiving unit 1120 is used to obtain the category of the application; the processing unit 1110 is used to determine the first from multiple execution domains according to the category of the application. Execution domain, the application is executed in the first execution domain.
当通信装置1100用于实现图7所示的方法实施例中终端设备的功能时:收发单元1120用于获取第一特性的类别,第一特性为应用包括的多个特性中的一个特性,每个特性对应应用的一个功能片段;处理单元1110用于根据第一特性的类别从多个执行域中确定第一执行域,在第一执行域中执行第一特性。When the communication device 1100 is used to implement the function of the terminal device in the method embodiment shown in FIG. 7: the transceiver unit 1120 is used to obtain the category of the first characteristic, and the first characteristic is one of the multiple characteristics included in the application. Each characteristic corresponds to a functional segment of the application; the processing unit 1110 is configured to determine a first execution domain from a plurality of execution domains according to the category of the first characteristic, and execute the first characteristic in the first execution domain.
有关上述处理单元1110和收发单元1120更详细的描述可以直接参考图3和图7所示的方法实施例中相关描述直接得到,这里不加赘述。More detailed descriptions about the processing unit 1110 and the transceiver unit 1120 can be obtained directly with reference to the relevant descriptions in the method embodiments shown in FIG. 3 and FIG. 7, and will not be repeated here.
如图12所示,通信装置1200包括处理器1210和接口电路1220。处理器1210和接口电路1220之间相互耦合。可以理解的是,接口电路1220可以为收发器或输入输出接口。可选的,通信装置1200还可以包括存储器1230,用于存储处理器1210执行的指令或存储处理器1210运行指令所需要的输入数据或存储处理器1210运行指令后产生的数据。此外,通信装置的具体结构还可为图2所示。As shown in FIG. 12, the communication device 1200 includes a processor 1210 and an interface circuit 1220. The processor 1210 and the interface circuit 1220 are coupled with each other. It can be understood that the interface circuit 1220 may be a transceiver or an input/output interface. Optionally, the communication device 1200 may further include a memory 1230 for storing instructions executed by the processor 1210 or storing input data required by the processor 1210 to run the instructions or storing data generated after the processor 1210 runs the instructions. In addition, the specific structure of the communication device may also be as shown in FIG. 2.
当通信装置1200用于实现图12所示的方法时,处理器1210用于实现上述处理单元1110的功能,接口电路1220用于实现上述收发单元1120的功能。When the communication device 1200 is used to implement the method shown in FIG. 12, the processor 1210 is used to implement the function of the above-mentioned processing unit 1110, and the interface circuit 1220 is used to implement the function of the above-mentioned transceiving unit 1120.
当上述通信装置为应用于终端设备的芯片时,该终端设备芯片实现上述方法实施例中终端设备的功能。When the foregoing communication device is a chip applied to a terminal device, the terminal device chip implements the function of the terminal device in the foregoing method embodiment.
在本申请的各个实施例中,如果没有特殊说明以及逻辑冲突,不同的实施例之间的术语和/或描述具有一致性、且可以相互引用,不同的实施例中的技术特征根据其内在的逻辑关系可以组合形成新的实施例。In the various embodiments of this application, if there are no special instructions and logical conflicts, the terms and/or descriptions between different embodiments are consistent and can be mutually cited. The technical features in different embodiments are based on their inherent Logical relationships can be combined to form new embodiments.
本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。在本申请的文字描述中,字符“/”,一般表示前后关联对象是一种“或”的关系;在本申请的公式中,字符“/”,表示前后关联对象是一种“相除”的关系。In this application, "at least one" refers to one or more, and "multiple" refers to two or more. "And/or" describes the association relationship of the associated object, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone, where A, B can be singular or plural. In the text description of this application, the character "/" generally indicates that the associated objects before and after are an "or" relationship; in the formula of this application, the character "/" indicates that the associated objects before and after are a kind of "division" Relationship.
可以理解的是,在本申请的实施例中涉及的各种数字编号仅为描述方便进行的区分,并不用来限制本申请的实施例的范围。上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定。It is understandable that the various numerical numbers involved in the embodiments of the present application are only for easy distinction for description, and are not used to limit the scope of the embodiments of the present application. The size of the sequence number of the above processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic.

Claims (25)

  1. 一种执行应用的方法,其特征在于,该方法包括:A method for executing an application, characterized in that the method includes:
    获取应用的类别;Get the category of the application;
    根据所述应用的类别从多个执行域中确定第一执行域,在所述第一执行域中执行所述应用;所述多个执行域为对硬件划分得到的不同执行域,所述多个执行域包括高功耗执行域和低功耗执行域。According to the category of the application, a first execution domain is determined from a plurality of execution domains, and the application is executed in the first execution domain; the plurality of execution domains are different execution domains obtained by dividing the hardware. One execution domain includes a high-power execution domain and a low-power execution domain.
  2. 如权利要求1所述的方法,其特征在于,还包括:The method of claim 1, further comprising:
    控制所述多个执行域中除所述第一执行域外的空闲执行域进入节能状态。Control the idle execution domains of the plurality of execution domains except the first execution domain to enter an energy-saving state.
  3. 如权利要求1或2所述的方法,其特征在于,还包括:The method of claim 1 or 2, further comprising:
    确定所述应用需要访问的共享外设被所述第一执行域独占,为所述共享外设设置全局性独占标识;Determining that the shared peripheral that the application needs to access is exclusively occupied by the first execution domain, and setting a global exclusive identifier for the shared peripheral;
    在所述共享外设被访问完成后,清除为所述共享外设设置的所述全局性独占标识。After the shared peripheral is accessed, the global exclusive identifier set for the shared peripheral is cleared.
  4. 如权利要求1-3任一项所述的方法,其特征在于,所述应用包括多个特性,每个特性对应所述应用的一个功能片段;The method according to any one of claims 1 to 3, wherein the application includes a plurality of characteristics, and each characteristic corresponds to a functional segment of the application;
    所述方法还包括:The method also includes:
    检测到预设事件,所述预设事件用于触发第二模式,所述第二模式为所述应用包括的所述多个特性中的第一特性的模式;A preset event is detected, the preset event is used to trigger a second mode, and the second mode is a mode of the first characteristic among the plurality of characteristics included in the application;
    控制所述第一特性的模式从第一模式切换至第二模式,所述第一模式为所述第一特性的初始模式。The mode for controlling the first characteristic is switched from the first mode to the second mode, and the first mode is the initial mode of the first characteristic.
  5. 如权利要求4所述的方法,其特征在于,控制所述应用中的第一特性的模式从所述第一模式切换至第二模式,包括:The method of claim 4, wherein switching the mode of controlling the first characteristic in the application from the first mode to the second mode comprises:
    控制所述第一特性从所述第一执行域切换至第二执行域执行,其中,所述第一模式对应所述第一执行域,所述第二模式对应所述第二执行域。Controlling the execution of the first characteristic from the first execution domain to the second execution domain, wherein the first mode corresponds to the first execution domain, and the second mode corresponds to the second execution domain.
  6. 一种执行应用的方法,其特征在于,该方法包括:A method for executing an application, characterized in that the method includes:
    获取第一特性的类别,所述第一特性为一个应用包括的多个特性中的一个特性,每个特性对应所述应用的一个功能片段;Acquiring a category of a first characteristic, where the first characteristic is one of a plurality of characteristics included in an application, and each characteristic corresponds to a functional segment of the application;
    根据所述第一特性的类别从多个执行域中确定第一执行域,在所述第一执行域中执行所述第一特性;所述多个执行域为对硬件划分得到的不同执行域,所述多个执行域包括高功耗执行域和低功耗执行域。According to the category of the first characteristic, a first execution domain is determined from a plurality of execution domains, and the first characteristic is executed in the first execution domain; the plurality of execution domains are different execution domains obtained by dividing the hardware , The multiple execution domains include a high power consumption execution domain and a low power consumption execution domain.
  7. 如权利要求6所述的方法,其特征在于,还包括:The method of claim 6, further comprising:
    获取第二特性的类别,所述第二特性为所述应用包括的多个特性中的一个特性,所述第二特性与所述第一特性不同;Acquiring a category of a second characteristic, where the second characteristic is one of a plurality of characteristics included in the application, and the second characteristic is different from the first characteristic;
    根据所述第二特性的类别从多个执行域中确定第二执行域,在所述第二执行域中执行所述第二特性,所述第二执行域与所述第一执行域不同,且所述第一特性与所述第二特性通过进程间通信IPC设备或管道进行通信。Determine a second execution domain from a plurality of execution domains according to the category of the second characteristic, execute the second characteristic in the second execution domain, and the second execution domain is different from the first execution domain, And the first characteristic and the second characteristic communicate through an inter-process communication IPC device or pipe.
  8. 如权利要求7所述的方法,其特征在于,还包括:The method of claim 7, further comprising:
    控制所述多个执行域中除所述第一执行域和所述第二执行域外的空闲执行域进入节能状态。Control the idle execution domains of the plurality of execution domains except the first execution domain and the second execution domain to enter an energy-saving state.
  9. 如权利要求6-8任一项所述的方法,其特征在于,还包括:The method according to any one of claims 6-8, further comprising:
    确定所述第一特性需要访问的共享外设被所述第一执行域独占,为所述共享外设设置全局性独占标识;It is determined that the shared peripheral that needs to be accessed by the first characteristic is exclusively occupied by the first execution domain, and a global exclusive identifier is set for the shared peripheral;
    在所述共享外设被访问完成后,清除为所述共享外设设置的所述全局性独占标识。After the shared peripheral is accessed, the global exclusive identifier set for the shared peripheral is cleared.
  10. 如权利要求6-9任一项所述的方法,其特征在于,还包括:The method according to any one of claims 6-9, further comprising:
    检测到预设事件,所述预设事件用于触发第二模式,所述第二模式为所述第一特性的模式;A preset event is detected, the preset event is used to trigger a second mode, and the second mode is a mode of the first characteristic;
    控制所述第一特性的模式从第一模式切换至所述第二模式,所述第一模式为所述第一特性的初始模式。The mode for controlling the first characteristic is switched from the first mode to the second mode, and the first mode is the initial mode of the first characteristic.
  11. 如权利要求10所述的方法,其特征在于,控制所述第一特性的模式从所述第一模式切换至第二模式,包括:The method of claim 10, wherein the switching of the mode of controlling the first characteristic from the first mode to the second mode comprises:
    控制所述第一特性从所述第一执行域切换至第三执行域执行,其中,所述第一模式对应所述第一执行域,所述第二模式对应所述第三执行域。Controlling the execution of the first characteristic from the first execution domain to the third execution domain, wherein the first mode corresponds to the first execution domain, and the second mode corresponds to the third execution domain.
  12. 一种执行应用的装置,其特征在于,该装置包括:A device for executing applications, characterized in that the device includes:
    获取单元,用于获取应用的类别;The obtaining unit is used to obtain the category of the application;
    处理单元,用于根据所述应用的类别从多个执行域中确定第一执行域,在所述第一执行域中执行所述应用;所述多个执行域为对硬件划分得到的不同执行域,所述多个执行域包括高功耗执行域和低功耗执行域。The processing unit is configured to determine a first execution domain from a plurality of execution domains according to the category of the application, and execute the application in the first execution domain; the plurality of execution domains are different executions obtained by dividing the hardware Domains, the multiple execution domains include a high power consumption execution domain and a low power consumption execution domain.
  13. 如权利要求12所述的装置,其特征在于,所述处理单元,还用于:The device according to claim 12, wherein the processing unit is further configured to:
    控制所述多个执行域中除所述第一执行域外的空闲执行域进入节能状态。Control the idle execution domains of the plurality of execution domains except the first execution domain to enter an energy-saving state.
  14. 如权利要求12或13所述的装置,其特征在于,所述处理单元,还用于:The device according to claim 12 or 13, wherein the processing unit is further configured to:
    确定所述应用需要访问的共享外设被所述第一执行域独占,为所述共享外设设置全局性独占标识;Determining that the shared peripheral that the application needs to access is exclusively occupied by the first execution domain, and setting a global exclusive identifier for the shared peripheral;
    在所述共享外设被访问完成后,清除为所述共享外设设置的所述全局性独占标识。After the shared peripheral is accessed, the global exclusive identifier set for the shared peripheral is cleared.
  15. 如权利要求12-14任一项所述的装置,其特征在于,所述处理单元,还用于:The device according to any one of claims 12-14, wherein the processing unit is further configured to:
    检测到预设事件,所述预设事件用于触发第二模式,所述第二模式为所述应用包括多个特性中的第一特性的模式,所述应用包括多个特性,每个特性对应所述应用的一个功能片段;A preset event is detected, the preset event is used to trigger a second mode, and the second mode is a mode in which the application includes a first characteristic of a plurality of characteristics, and the application includes a plurality of characteristics, each characteristic A functional segment corresponding to the application;
    控制所述第一特性的模式从第一模式切换至第二模式,所述第一模式为所述第一特性的初始模式。The mode for controlling the first characteristic is switched from the first mode to the second mode, and the first mode is the initial mode of the first characteristic.
  16. 如权利要求15所述的装置,其特征在于,所述处理单元,用于:控制所述第一特性从所述第一执行域切换至第二执行域执行,其中,所述第一模式对应所述第一执行域,所述第二模式对应所述第二执行域。The device according to claim 15, wherein the processing unit is configured to: control the first characteristic to switch from the first execution domain to the second execution domain to execute, wherein the first mode corresponds to In the first execution domain, the second mode corresponds to the second execution domain.
  17. 一种执行应用的装置,其特征在于,该装置包括:A device for executing applications, characterized in that the device includes:
    获取单元,用于获取第一特性的类别,所述第一特性为一个应用包括的多个特性中的一个特性,每个特性对应所述应用的一个功能片段;An acquiring unit, configured to acquire a category of a first characteristic, where the first characteristic is one of a plurality of characteristics included in an application, and each characteristic corresponds to a functional segment of the application;
    处理单元,用于根据所述第一特性的类别从多个执行域中确定第一执行域,在所述第一执行域中执行所述第一特性;所述多个执行域为对硬件划分得到的不同执行域,所述多个执行域包括高功耗执行域和低功耗执行域。The processing unit is configured to determine a first execution domain from a plurality of execution domains according to the category of the first characteristic, and execute the first characteristic in the first execution domain; the plurality of execution domains are hardware divisions Different execution domains obtained, the multiple execution domains include a high-power execution domain and a low-power execution domain.
  18. 如权利要求17所述的装置,其特征在于,所述获取单元,还用于:获取第二特性的类别,所述第二特性为所述应用包括的多个特性中的一个特性,所述第二特性与所述第 一特性不同;17. The apparatus according to claim 17, wherein the acquiring unit is further configured to: acquire a category of a second characteristic, the second characteristic being one of a plurality of characteristics included in the application, and The second characteristic is different from the first characteristic;
    所述处理单元,还用于根据所述第二特性的类别从多个执行域中确定第二执行域,在所述第二执行域中执行所述第二特性,所述第二执行域与所述第一执行域不同,且所述第一特性与所述第二特性通过进程间通信IPC设备或管道进行通信。The processing unit is further configured to determine a second execution domain from a plurality of execution domains according to the category of the second characteristic, execute the second characteristic in the second execution domain, and the second execution domain and The first execution domain is different, and the first characteristic and the second characteristic communicate through an inter-process communication IPC device or pipe.
  19. 如权利要求18所述的装置,其特征在于,所述处理单元,还用于控制所述多个执行域中除所述第一执行域和所述第二执行域外的空闲执行域进入节能状态。The device according to claim 18, wherein the processing unit is further configured to control idle execution domains other than the first execution domain and the second execution domain among the plurality of execution domains to enter an energy-saving state .
  20. 如权利要求17-19任一项所述的装置,其特征在于,所述处理单元,还用于The device according to any one of claims 17-19, wherein the processing unit is also used for
    确定所述第一特性需要访问的共享外设被所述第一执行域独占,为所述共享外设设置全局性独占标识;It is determined that the shared peripheral that needs to be accessed by the first characteristic is exclusively occupied by the first execution domain, and a global exclusive identifier is set for the shared peripheral;
    在所述共享外设被访问完成后,清除为所述共享外设设置的所述全局性独占标识。After the shared peripheral is accessed, the global exclusive identifier set for the shared peripheral is cleared.
  21. 如权利要求17-20任一项所述的装置,其特征在于,所述处理单元,还用于检测到预设事件,所述预设事件用于触发第二模式,所述第二模式为所述第一特性的模式;The device according to any one of claims 17-20, wherein the processing unit is further configured to detect a preset event, the preset event is used to trigger a second mode, and the second mode is The mode of the first characteristic;
    控制所述第一特性的模式从第一模式切换至所述第二模式,所述第一模式为所述第一特性的初始模式。The mode for controlling the first characteristic is switched from the first mode to the second mode, and the first mode is the initial mode of the first characteristic.
  22. 如权利要求21所述的装置,其特征在于,所述处理单元,还用于控制所述第一特性从所述第一执行域切换至第三执行域执行,其中,所述第一模式对应所述第一执行域,所述第二模式对应所述第三执行域。The device of claim 21, wherein the processing unit is further configured to control the first characteristic to switch from the first execution domain to a third execution domain to execute, wherein the first mode corresponds to In the first execution domain, the second mode corresponds to the third execution domain.
  23. 一种计算机存储介质,其特征在于,所述存储介质中存储有计算机程序或指令,当所述计算机程序或指令被通信装置执行时,实现如权利要求1至11中任一项所述的方法。A computer storage medium, characterized in that a computer program or instruction is stored in the storage medium, and when the computer program or instruction is executed by a communication device, the method according to any one of claims 1 to 11 is implemented .
  24. 一种可穿戴设备,其特征在于,包括处理器和存储器,所述存储器用于存储程序,所述处理器调用所述存储器执行如权利要求1至11任一项所述的方法。A wearable device, characterized by comprising a processor and a memory, the memory is used to store a program, and the processor calls the memory to execute the method according to any one of claims 1 to 11.
  25. 一种通信装置,其特征在于,包括处理器和接口电路,所述接口电路用于接收来自所述通信装置之外的其它通信装置的信号并传输至所述处理器或将来自所述处理器的信号发送给所述通信装置之外的其它通信装置,所述处理器通过逻辑电路或执行代码指令用于实现如权利要求1至11中任一项所述的方法。A communication device, characterized by comprising a processor and an interface circuit, the interface circuit is used to receive signals from other communication devices other than the communication device and transmit them to the processor or transfer signals from the processor The signal of is sent to another communication device other than the communication device, and the processor is used to implement the method according to any one of claims 1 to 11 through a logic circuit or an execution code instruction.
PCT/CN2021/083899 2020-05-29 2021-03-30 Application execution method and apparatus WO2021238387A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010479855.2A CN111651254A (en) 2020-05-29 2020-05-29 Method and device for executing application
CN202010479855.2 2020-05-29

Publications (1)

Publication Number Publication Date
WO2021238387A1 true WO2021238387A1 (en) 2021-12-02

Family

ID=72342487

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/083899 WO2021238387A1 (en) 2020-05-29 2021-03-30 Application execution method and apparatus

Country Status (2)

Country Link
CN (1) CN111651254A (en)
WO (1) WO2021238387A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651254A (en) * 2020-05-29 2020-09-11 华为技术有限公司 Method and device for executing application
CN112331146A (en) * 2020-11-18 2021-02-05 云谷(固安)科技有限公司 Display panel driving chip, control method and display panel
CN114995094B (en) * 2022-06-08 2023-07-11 深圳市万如夏科技有限公司 Intelligent watch capable of improving hand to lighten screen and method for improving hand to lighten screen

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103207659A (en) * 2012-01-16 2013-07-17 联想(北京)有限公司 Switching method and electronic equipment
CN103246559A (en) * 2012-02-10 2013-08-14 联想(北京)有限公司 Application processing method and electronic equipment
CN103645954A (en) * 2013-11-21 2014-03-19 华为技术有限公司 CPU scheduling method, device and system based on heterogeneous multi-core system
CN103646006A (en) * 2013-11-26 2014-03-19 乐视致新电子科技(天津)有限公司 Scheduling method, device and system for processor
CN105204931A (en) * 2014-06-11 2015-12-30 联发科技(新加坡)私人有限公司 Low-power wearable equipment and multi-operation system switching, communication and management method thereof
US20160173123A1 (en) * 2014-12-16 2016-06-16 Intel Corporation Partitioned data compression using accelerator
US9442758B1 (en) * 2008-01-21 2016-09-13 Marvell International Ltd. Dynamic processor core switching
CN111651254A (en) * 2020-05-29 2020-09-11 华为技术有限公司 Method and device for executing application

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9442758B1 (en) * 2008-01-21 2016-09-13 Marvell International Ltd. Dynamic processor core switching
CN103207659A (en) * 2012-01-16 2013-07-17 联想(北京)有限公司 Switching method and electronic equipment
CN103246559A (en) * 2012-02-10 2013-08-14 联想(北京)有限公司 Application processing method and electronic equipment
CN103645954A (en) * 2013-11-21 2014-03-19 华为技术有限公司 CPU scheduling method, device and system based on heterogeneous multi-core system
CN103646006A (en) * 2013-11-26 2014-03-19 乐视致新电子科技(天津)有限公司 Scheduling method, device and system for processor
CN105204931A (en) * 2014-06-11 2015-12-30 联发科技(新加坡)私人有限公司 Low-power wearable equipment and multi-operation system switching, communication and management method thereof
US20160173123A1 (en) * 2014-12-16 2016-06-16 Intel Corporation Partitioned data compression using accelerator
CN111651254A (en) * 2020-05-29 2020-09-11 华为技术有限公司 Method and device for executing application

Also Published As

Publication number Publication date
CN111651254A (en) 2020-09-11

Similar Documents

Publication Publication Date Title
WO2021052263A1 (en) Voice assistant display method and device
WO2021169337A1 (en) In-screen fingerprint display method and electronic device
WO2021238387A1 (en) Application execution method and apparatus
WO2021052410A1 (en) Application management method and apparatus
WO2020093988A1 (en) Image processing method and electronic device
WO2021063311A1 (en) Display control method for electronic device having foldable screen, and electronic device
WO2020073288A1 (en) Method for triggering electronic device to execute function and electronic device
WO2021147396A1 (en) Icon management method and smart terminal
WO2021043046A1 (en) Resource management and control method and device
WO2021036830A1 (en) Method for displaying application on folding screen, and electronic device
WO2021223539A1 (en) Radio frequency resource allocation method and apparatus
CN113691271B (en) Data transmission method and wearable device
WO2022100685A1 (en) Drawing command processing method and related device therefor
WO2021017935A1 (en) Wakelock management method and electronic device
WO2022017474A1 (en) Task processing method and related apparatus
WO2020056778A1 (en) Method for shielding touch event, and electronic device
WO2022052897A1 (en) Method and device for adjusting memory configuration parameter
WO2021254438A1 (en) Drive control method and related device
CN111522425A (en) Power consumption control method of electronic equipment and electronic equipment
WO2022078105A1 (en) Memory management method, electronic device, and computer-readable storage medium
WO2021052170A1 (en) Motor vibration control method and electronic device
WO2021073183A1 (en) Always on display method and mobile device
WO2022095744A1 (en) Vr display control method, electronic device, and computer readable storage medium
CN113610943B (en) Icon rounded angle processing method and device
WO2023246783A1 (en) Method for adjusting device power consumption 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: 21814194

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21814194

Country of ref document: EP

Kind code of ref document: A1