WO2022127632A1 - Procédé de gestion et de commande de ressources, et dispositif - Google Patents
Procédé de gestion et de commande de ressources, et dispositif Download PDFInfo
- Publication number
- WO2022127632A1 WO2022127632A1 PCT/CN2021/135662 CN2021135662W WO2022127632A1 WO 2022127632 A1 WO2022127632 A1 WO 2022127632A1 CN 2021135662 W CN2021135662 W CN 2021135662W WO 2022127632 A1 WO2022127632 A1 WO 2022127632A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- application
- electronic device
- foreground
- resource management
- resources
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 514
- 230000008569 process Effects 0.000 claims abstract description 454
- 239000011230 binding agent Substances 0.000 claims description 20
- 238000012545 processing Methods 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 11
- 230000000737 periodic effect Effects 0.000 claims description 9
- 238000012549 training Methods 0.000 claims description 5
- 230000005540 biological transmission Effects 0.000 claims description 4
- 230000003111 delayed effect Effects 0.000 claims description 3
- 238000007726 management method Methods 0.000 description 75
- 230000000694 effects Effects 0.000 description 45
- 238000004891 communication Methods 0.000 description 25
- 230000006870 function Effects 0.000 description 24
- 238000005516 engineering process Methods 0.000 description 15
- 230000000875 corresponding effect Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 12
- 238000010295 mobile communication Methods 0.000 description 12
- 230000005236 sound signal Effects 0.000 description 11
- 238000013528 artificial neural network Methods 0.000 description 5
- 238000012546 transfer Methods 0.000 description 5
- 230000000007 visual effect Effects 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 4
- 229920001621 AMOLED Polymers 0.000 description 3
- 230000003416 augmentation Effects 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000003190 augmentative effect Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 210000004027 cell Anatomy 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 230000010354 integration Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 239000002096 quantum dot Substances 0.000 description 2
- 230000005855 radiation Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000026676 system process Effects 0.000 description 2
- 101000941170 Homo sapiens U6 snRNA phosphodiesterase 1 Proteins 0.000 description 1
- 102100031314 U6 snRNA phosphodiesterase 1 Human genes 0.000 description 1
- 230000001133 acceleration Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000013529 biological neural network Methods 0.000 description 1
- 210000000988 bone and bone Anatomy 0.000 description 1
- 210000004556 brain Anatomy 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000019771 cognition Effects 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 230000001276 controlling effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 238000007429 general method Methods 0.000 description 1
- 230000003862 health status Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000004807 localization Effects 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 238000013468 resource allocation Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000003238 somatosensory effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/542—Event management; Broadcasting; Multicasting; Notifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/544—Buffers; Shared memory; Pipes
Definitions
- the embodiments of the present application relate to the field of electronic technologies, and in particular, to a resource management and control method and device.
- the mobile operating system provides a method for resource limitation on the process of the application.
- the process of an application running in the background is usually reduced its priority to limit the use of its resources, so as to provide more resources for the process of the application running in the foreground, and improve the operation efficiency of the foreground application.
- the process of the foreground application is usually not controlled.
- the embodiments of the present application provide a resource management and control method and device, which can perform fine-grained management and control of resource usage according to process types in foreground applications, and can reduce unnecessary system overhead and reduce the cost of electronic devices while ensuring services. Power consumption, while ensuring the experience of foreground process resource usage.
- an embodiment of the present application provides a resource management and control method, which is applied to an electronic device and includes: determining a first application program in a foreground running state. A first process of the first application is determined, wherein the first process is a non-critical process. Get the first number of times the first process was called by other processes. When the first number of times is less than or less than or equal to the first threshold, perform resource management and control on the first process.
- the electronic device can perform fine-grained control on the resource usage of the process according to the process type in the foreground application, thereby reducing unnecessary system overhead while ensuring services, and ensuring the experience of using resources of the foreground process.
- the first number of times the first process is called by other processes may be the first number of times the first process is called by other processes within the first time after the first application switches to the foreground running state and starts counting the first times. ; or the first process counts the first number of times it is called by other processes within the first time since its creation. Wherein, the first time is greater than or equal to the first time threshold.
- acquiring the first number of times that the first process is called by other processes includes: the electronic device identifies the first number of times that the first process is called by other processes in the kernel Binder driver.
- the electronic device can identify and record the number of times the first process is called by other processes in the kernel Binder driver, so that the process can be managed and controlled subsequently according to the number of times of being called.
- the first process is a non-critical process, including: the first process is a non-foreground business process of the first application, or the first process is an imperceptible process of the first application, or the first process It is an imperceptible process in the non-foreground business process of the first application.
- the non-foreground business process is a process that does not run UI components and will not be called by the foreground UI thread
- an imperceptible process is a process that does not include target features.
- the target features are preset, or the features obtained by electronic equipment training.
- the management and control of the imperceptible process in the non-foreground service process can reduce the resource consumption of the first application and the power consumption of the electronic device without affecting the user experience.
- Resource management and control for non-foreground business processes and imperceptible processes can further reduce resource consumption and power consumption, and at the same time, try to make the functions and services of the first application run normally, and try not to affect the user experience.
- the target features include periodic Alarm heartbeats, integration of third-party push service SDKs, network permissions, long TCP connections, and periodic sending and receiving of data packets. , one or more of notification bar, sound, and vibration; or, when the imperceptible process is an alarm clock process, the target features include setting a periodic Alarm clock timer, sound, vibration, daily One or more items that are started at least once and automatically start to the foreground; or, when the imperceptible process is an upload and download process, the target features include network permissions, TCP long connections, data packet sending and receiving, and resident notification bar , one or more of input and output operations; or, when the imperceptible process is an audio playback process, the target features include continuous sound playback, network, resident notification bar, and input and output operations.
- the target characteristics include one or more of GPS request, intermittent sound, network, resident notification bar, integrated map SDK; or , when the imperceptible process is a recording process, the target feature includes one or more of audio input, resident notification bar, and input and output operations.
- determining the first application program in the foreground running state includes: the touch focus of the application UI layer presented by the display screen of the electronic device changes, and the application of the layer where the current focus is located is obtained as the visible application. program, if the interface component of the application is in the running state, determine that the application is the first application in the foreground running state; or when the electronic device is unlocked, obtain the currently visible application, if the interface component of the application is running state, it is determined that the application is the first application in the foreground running state.
- performing resource management and control on the first process includes: restricting the use of resources by the first process, thereby reducing resource consumption of the first application and power consumption of the electronic device.
- the resources include: location positioning resources, network resources, Bluetooth resources, transmission control protocol TCP connection resources, audio resources, modem resources, timed alarm clock resources, wake-up lock resources, broadcast resources, and delay processing resource, or one or more of the service resources.
- the method further includes: stopping resource management and control on the first process to avoid affecting the user experience.
- stopping the resource management and control of the first process includes: when the first application is a non-instant messaging application, when it is detected that the first process receives a broadcast, receives a broadcast ANR, and a service ANR occurs, When one or more of the input ANR and the Binder call occur, stop the resource management and control of the first process; or, when the first application is an instant messaging application, when it is detected that the first process receives a message from the network side When the data packet is received, stop the resource management and control of the first process.
- embodiments of the present application provide an electronic device, including: a screen for displaying an interface; one or more processors; and a memory, where codes are stored in the memory.
- the electronic device When the code is executed by the electronic device, the electronic device is caused to perform the following steps: determining the first application program in the foreground running state. A first process of the first application is determined, wherein the first process is a non-critical process. Get the first number of times the first process was called by other processes. When the first number of times is less than or less than or equal to the first threshold, perform resource management and control on the first process.
- the first number of times the first process is called by other processes may be the first number of times the first process is called by other processes within the first time after the first application switches to the foreground running state and starts counting the first times. ; or the first process counts the first number of times it is called by other processes within the first time since its creation. Wherein, the first time is greater than or equal to the first time threshold.
- acquiring the first number of times that the first process is called by other processes includes: the electronic device identifies the first number of times that the first process is called by other processes in the kernel Binder driver.
- the first process is a non-critical process, including: the first process is a non-foreground business process of the first application, or the first process is an imperceptible process of the first application, or the first process It is an imperceptible process in the non-foreground business process of the first application.
- the non-foreground business process is a process that does not run UI components and will not be called by the foreground UI thread
- an imperceptible process is a process that does not include target features.
- the target feature is preset, or the feature obtained by the training of the electronic device.
- the target features include periodic Alarm heartbeats, integration of third-party push service SDKs, network permissions, long TCP connections, and periodic sending and receiving of data packets. , one or more of notification bar, sound, and vibration; or, when the imperceptible process is an alarm clock process, the target features include setting a periodic Alarm clock timer, sound, vibration, daily One or more items that are started at least once and automatically start to the foreground; or, when the imperceptible process is an upload and download process, the target features include network permissions, TCP long connections, data packet sending and receiving, and resident notification bar , one or more of input and output operations; or, when the imperceptible process is an audio playback process, the target features include continuous sound playback, network, resident notification bar, and input and output operations.
- the target characteristics include one or more of GPS request, intermittent sound, network, resident notification bar, integrated map SDK; or , when the imperceptible process is a recording process, the target feature includes one or more of audio input, resident notification bar, and input and output operations.
- determining the first application program in the foreground running state includes: the application UI layer presented by the display screen of the electronic device changes the touch focus, and obtaining the application of the layer where the current focus is located as the visible application program, if the interface component of the application is in the running state, determine that the application is the first application in the foreground running state; or when the electronic device is unlocked, obtain the currently visible application, if the interface component of the application is running state, it is determined that the application is the first application in the foreground running state.
- performing resource management and control on the first process includes: restricting the use of resources by the first process, thereby reducing resource consumption of the first application and power consumption of the electronic device.
- the resources include: location positioning resources, network resources, Bluetooth resources, transmission control protocol TCP connection resources, audio resources, modem resources, timed alarm clock resources, wake-up lock resources, broadcast resources, and delay processing resource, or one or more of the service resources.
- the method further includes: stopping resource management and control on the first process to avoid affecting the user experience.
- stopping the resource management and control of the first process includes: when the first application is a non-instant messaging application, when it is detected that the first process receives a broadcast, receives a broadcast ANR, and a service ANR occurs, When one or more of the input ANR and the Binder call occur, stop the resource management and control of the first process; or, when the first application is an instant messaging application, when it is detected that the first process receives a message from the network side When the data packet is received, stop the resource management and control of the first process.
- an embodiment of the present application provides a resource management and control apparatus, and the apparatus is included in an electronic device.
- the apparatus has the function of implementing the behavior of the electronic device in any of the above aspects and possible designs. This function can be implemented by hardware or by executing corresponding software by hardware.
- the hardware or software includes at least one module or unit corresponding to the above-mentioned functions. For example, detecting modules/units, determining modules/units, and managing and controlling modules/units, etc.
- an embodiment of the present application provides a computer storage medium, including computer instructions, which, when the computer instructions are executed on an electronic device, enable the electronic device to execute the resource management and control method in any possible design of the foregoing aspects.
- embodiments of the present application provide a computer program product, which, when the computer program product runs on a computer, enables the computer to execute the resource management and control method in any of the possible designs of the foregoing aspects.
- FIG. 1 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application.
- FIG. 2 is a schematic diagram of a software structure of an electronic device provided by an embodiment of the present application.
- FIG. 3 is a flowchart of a resource management and control method provided by an embodiment of the present application.
- FIG. 4 is a schematic diagram of a group of interfaces provided by an embodiment of the present application.
- FIG. 5 is a schematic diagram of determining a perceptible process and an imperceptible process according to process characteristics according to an embodiment of the present application
- Fig. 6 is the principle schematic diagram of inter-process communication of Android operating system
- Fig. 7 is a schematic diagram of an inter-process calling relationship of an application
- FIG. 8 is a schematic diagram of the mutual calling relationship between the processes of two application programs.
- first and second are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implying the number of indicated technical features.
- a feature defined as “first”, “second” may expressly or implicitly include one or more of that feature.
- plural means two or more.
- Electronic device a device that can install various application programs and can display objects provided in the installed application programs.
- the electronic device may include a device capable of implementing data processing functions (such as a processor or an image processor or other processors), and a device capable of displaying a user interface (such as a display screen).
- the electronic device can be mobile or fixed.
- electronic devices may include cell phones, foldable electronic devices, tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, cell phones, Personal digital assistant (PDA), augmented reality (AR) device, virtual reality (VR) device, artificial intelligence (AI) device, wearable device, in-vehicle device, intelligent At least one of home equipment and smart city equipment.
- the embodiments of the present application do not specifically limit the specific type of the electronic device.
- OS Operating system
- OS It is the most basic system software running on electronic devices, such as system, android system, system. Taking a smartphone as an example, the operating system may be an Android system or an IOS system. The embodiments of the present application mainly take the Android system as an example for introduction. Those skilled in the art can understand that in other operating systems, similar algorithms can also be used for implementation.
- Application can be referred to as an application, which is a computer program that can perform one or more specific functions. It may have a visual display interface and can interact with users, such as settings, electronic maps, browsers, etc.; or, it may not have a visual display interface and cannot interact with users.
- applications can be divided into third-party applications and system applications, where a third-party application can be understood as an application installed by a user, such as even me etc.; system applications can be understood as applications preset by the operating system, such as settings, dialing, and information.
- a process is a running activity of a program in a computer on a certain data set, and is the basic unit of resource allocation and scheduling in the system.
- An application can create multiple processes during running, and each process can apply for resources according to its own business needs.
- An application can create multiple processes during running, and each process can apply for resources according to its own business needs.
- the resources requested by the process of the application program may include hardware resources and software resources.
- the hardware resources may include location positioning resources, network resources, Bluetooth (bluetooth, BT) resources, transmission control protocol TCP connection resources, audio resources or modem resources, and the like.
- the location positioning resources may include global positioning system (GPS) resources, global navigation satellite system (GLONASS) resources, Beidou navigation satellite system (BDS) resources, quasi-sky Quasi-zenith satellite system (QZSS) resources and/or satellite-based augmentation systems (satellite based augmentation systems, SBAS) resources, etc.
- GPS global positioning system
- GLONASS global navigation satellite system
- BDS Beidou navigation satellite system
- QZSS quasi-sky Quasi-zenith satellite system
- SBAS satellite-based augmentation systems
- Network resources refer to resources that can be used for Internet access, such as operator mobile data service (2G/3G/4G/5G) resources or wireless fidelity (wireless fidelity, Wi-Fi) resources.
- a TCP connection can exchange information through a socket link.
- Audio resources are used to implement audio playback, such as speaker resources or audio codec resources.
- the software resources may include a timed alarm (Alarm) resource, a wakelock (Wakelock) resource, a broadcast resource, a delayed processing (Job) resource or a service (Service) resource, and the like.
- the Alarm resource can be used for system-level prompting according to the set time or period.
- the Wakelock resource can be used to prevent the processor from sleeping.
- Broadcast resources can be used for information transfer between different applications or different components.
- a Job resource is a resource in a library that can perform delayed processing in the background.
- a Service resource is an application component that can perform long-running operations in the background without a user interface.
- the embodiment of the present application provides a resource management and control method, which can be applied to any electronic device installed with an application program.
- the electronic device can precisely control the resource usage of the process according to the process type in the foreground application. For some processes in the foreground application, control the use of their resources, reduce unnecessary system overhead and ensure the resource usage experience of other processes in the foreground while ensuring the business.
- FIG. 1 is a schematic structural diagram of an electronic device 100 .
- the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) connector 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone connector 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 and so on.
- 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 structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100 .
- the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
- the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
- the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
- application processor application processor, AP
- modem processor graphics processor
- ISP image signal processor
- controller video codec
- digital signal processor digital signal processor
- baseband processor baseband processor
- neural-network processing unit neural-network processing unit
- the processor 110 may generate an operation control signal according to the instruction operation code and the timing signal, and complete the control of fetching and executing the instruction.
- a memory may also be provided in the processor 110 for storing instructions and data.
- the memory in the processor 110 may be a cache memory.
- the memory may store instructions or data that are used by the processor 110 or are frequently used. If the processor 110 needs to use the instructions or data, it can be called directly from this memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
- the processor 110 may include one or more interfaces.
- the interface may 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, a universal asynchronous transceiver (universal asynchronous transmitter) 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 (universal serial bus, USB) interface, etc.
- the processor 110 may be connected to modules such as a touch sensor, an audio module, a wireless communication module, a display, a camera, and the like through at least one of the above interfaces.
- the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
- the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
- the USB connector 130 is a connector that conforms to the USB standard specification, and can be used to connect the electronic device 100 and peripheral devices, specifically a Mini USB connector, a Micro USB connector, a USB Type C connector, and the like.
- the USB connector 130 can be used to connect to a charger, so that the charger can charge the electronic device 100, and can also be used to connect to other electronic devices, so as to transmit data between the electronic device 100 and other electronic devices. It can also be used to connect headphones to output audio stored in electronic devices through the headphones.
- This connector can also be used to connect other electronic devices, such as VR devices, etc.
- the standard specification of USB may be USB1.x, USB2.0, USB3.x, or USB4.
- the charging management module 140 is used for receiving charging input from the charger.
- the charger may be a wireless charger or a wired charger.
- the charging management module 140 may receive charging input from the wired charger through the USB connector 130 .
- the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 charges the battery 142 , the electronic device 100 can also be powered by the power management module 141 .
- the power management module 141 is used for connecting 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 display screen 194, the camera 193, and the like.
- the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, 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 electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
- Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
- Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
- the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
- the mobile communication module 150 may provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 100 .
- the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
- the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
- the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through 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 may be provided in the same device as at least part of the modules of the processor 110 .
- 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. Then the demodulator 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 passed to the application processor.
- the application processor outputs sound signals through audio devices (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 194 .
- the modem processor may be a stand-alone device.
- the modem processor may be independent of the processor 110, and may 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 electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), bluetooth low power power consumption (bluetooth low energy, BLE), ultra wide band (UWB), global navigation satellite 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 can also receive the signal to be sent from the processor 110, perform frequency modulation on it, amplify it, and convert it into an electromagnetic wave for radiation through the antenna 2.
- the antenna 1 of the electronic 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 electronic device 100 can communicate with the network and other electronic 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), wideband code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technology, etc.
- the GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a 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 electronic device 100 may implement a display function through a GPU, a display screen 194, an application processor, and the like.
- the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
- the GPU is used to perform mathematical and geometric calculations and graphics rendering.
- Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
- Display screen 194 is used to display images, videos, and the like.
- Display screen 194 includes a display panel.
- the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
- LED diode AMOLED
- flexible light-emitting diode flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
- electronic device 100 may include one or more display screens 194 .
- the electronic device 100 may implement a camera function through a camera module 193, an ISP, a video codec, a GPU, a display screen 194, an application processor AP, a neural network processor NPU, and the like.
- the camera module 193 can be used to collect color image data and depth data of the photographed object.
- the ISP can be used to process the color image data collected by the camera module 193 .
- the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye.
- ISP can also perform algorithm optimization on image noise, brightness, and skin tone. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
- the ISP may be provided in the camera module 193 .
- the camera module 193 may be composed of a color camera module and a 3D sensing module.
- the photosensitive element of the camera of the color camera module may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
- CCD charge coupled device
- CMOS complementary metal-oxide-semiconductor
- the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
- the ISP outputs the digital image signal to the DSP for processing.
- DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
- the 3D sensing module may be a time of flight (TOF) 3D sensing module or a structured light (structured light) 3D sensing module.
- the structured light 3D sensing is an active depth sensing technology, and the basic components of the structured light 3D sensing module may include an infrared (Infrared) emitter, an IR camera module, and the like.
- the working principle of the structured light 3D sensing module is to first emit a light spot of a specific pattern on the object to be photographed, and then receive the light coding of the light spot pattern on the surface of the object, and then compare the similarities and differences with the original projected light spot. And use the principle of trigonometry to calculate the three-dimensional coordinates of the object.
- the three-dimensional coordinates include the distance between the electronic device 100 and the object to be photographed.
- the TOF 3D sensing can be an active depth sensing technology, and the basic components of the TOF 3D sensing module can include an infrared (Infrared) transmitter, an IR camera module, and the like.
- the working principle of the TOF 3D sensing module is to calculate the distance (ie depth) between the TOF 3D sensing module and the object to be photographed through the time of infrared reentry, so as to obtain a 3D depth-of-field map.
- Structured light 3D sensing modules can also be used in face recognition, somatosensory game consoles, industrial machine vision detection and other fields.
- TOF 3D sensing modules can also be applied to game consoles, augmented reality (AR)/virtual reality (VR) and other fields.
- AR augmented reality
- VR virtual reality
- the camera module 193 may also be composed of two or more cameras.
- the two or more cameras may include color cameras, and the color cameras may be used to collect color image data of the photographed object.
- the two or more cameras may use stereo vision technology to collect depth data of the photographed object.
- Stereoscopic vision technology is based on the principle of human eye parallax. Under natural light sources, two or more cameras shoot images of the same object from different angles, and then perform triangulation and other operations to obtain the electronic device 100 and the photographed object. distance information between objects, that is, depth information.
- the electronic device 100 may include one or more camera modules 193 .
- the electronic device 100 may include a front camera module 193 and a rear camera module 193 .
- the front camera module 193 can usually be used to collect the color image data and depth data of the photographer facing the display screen 194, and the rear camera module can be used to collect the shooting objects (such as people, landscapes, etc.) that the photographer faces. etc.) color image data and depth data.
- a digital signal processor can be used to process digital signals as well as other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy and so on.
- Video codecs are used to compress or decompress digital video.
- the electronic device 100 may support one or more video codecs.
- the electronic device 100 can play or record videos of various encoding formats, such as: Moving Picture Experts Group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
- MPEG Moving Picture Experts Group
- MPEG2 moving picture experts group
- MPEG3 MPEG4
- MPEG4 Moving Picture Experts Group
- the NPU is a neural-network (NN) computing processor.
- NN neural-network
- Applications such as intelligent cognition of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
- the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 .
- the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example to save files like music, video etc in external memory card. Or transfer music, video and other files from electronic devices to external memory cards.
- Internal memory 121 may be used to store computer executable program code, which includes instructions.
- the internal memory 121 may include a storage program area and a storage data area.
- the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
- the storage data area may store data (such as audio data, phone book, etc.) created during the use of the electronic device 100 and the like.
- the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
- the processor 110 executes various functional methods or data processing of the electronic device 100 by executing the instructions stored in the internal memory 121 and/or the instructions stored in the memory provided in the processor.
- the electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone connector 170D, an application processor, and the like. Such as music playback, recording, etc.
- the audio module 170 is used for converting digital audio information into analog audio signal output, and also for converting analog audio input into digital audio signal. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .
- Speaker 170A also referred to as a "speaker" is used to convert audio electrical signals into sound signals.
- the electronic device 100 may listen to music through the speaker 170A, or output an audio signal for a hands-free call.
- the receiver 170B also referred to as "earpiece" is used to convert audio electrical signals into sound signals.
- the voice can be answered by placing the receiver 170B close to the human ear.
- the microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals.
- the user can make a sound by approaching the microphone 170C through a human mouth, and input the sound signal into the microphone 170C.
- the electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which can implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions.
- the earphone connector 170D is used to connect wired earphones.
- the earphone connector 170D may be a USB connector 130, or a 3.5mm connector that conforms to the Open Mobile Terminal Platform (OMTP) standard, and conforms to the cellular telecommunications industry association of the USA (CTIA) Standard connector.
- OMTP Open Mobile Terminal Platform
- CTIA cellular telecommunications industry association of the USA
- the keys 190 may include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key.
- the electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .
- Motor 191 can generate vibrating cues.
- the motor 191 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback.
- touch operations acting on different applications can correspond to different vibration feedback effects.
- the motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 194 .
- Different application scenarios for example: time reminder, receiving information, alarm clock, games, etc.
- the touch vibration feedback effect can also support customization.
- the indicator 192 can be an indicator light, which can be used to indicate the charging state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like.
- the SIM card interface 195 may be a hardware module for connecting a SIM card.
- the SIM card can be contacted and separated from the electronic device 100 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195 .
- the electronic device 100 may support one or more SIM card interfaces.
- the SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card and so on. Multiple cards can be inserted into the same SIM card interface 195 at the same time. Multiple cards can be of the same type or different.
- the SIM card interface 195 can also be compatible with different types of SIM cards.
- the SIM card interface 195 is also compatible with external memory cards.
- the electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
- the electronic device 100 employs an eSIM, ie: an embedded SIM card.
- the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
- the processor 110 may execute the instructions stored in the internal memory 121 to perform fine-grained control over resource usage according to the process type in the foreground application.
- the resource management and control method provided by the embodiment of the present application can reduce unnecessary system overhead and ensure the use of resources in the foreground process under the condition of ensuring services. experience.
- the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
- the embodiments of the present application take an Android system with a layered architecture as an example to exemplarily describe the software structure of the electronic device 100 .
- FIG. 2 is a block diagram of a software structure of an electronic device 100 according to an embodiment of the present invention.
- the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces.
- the Android system is divided into five layers, from top to bottom, the application layer, the application framework layer, the Android runtime (ART) and native C/C++ libraries, the hardware abstraction layer and the kernel Floor.
- the application layer can include a series of application packages.
- the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, weather, browser, etc.
- the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
- the application framework layer includes some predefined functions.
- the application framework layer can include window managers, content providers, view systems, resource managers, notification managers, activity managers, input managers, and so on.
- the window manager provides window management services (window manager service, WMS), WMS can be used for window management, window animation management, surface management and as a transfer station for the input system.
- WMS window manager service
- Content providers are used to store and retrieve data and make these data accessible to applications. This data can include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc. Content providers provide support for data access between applications.
- the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications.
- a display interface can consist of one or more views.
- the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
- the resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
- the notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
- the notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
- the activity manager can provide activity management services (activity manager service, AMS).
- AMS activity management services
- the activity manager is used to manage activities, and is responsible for the startup, switching, scheduling of various components in the system, and the management and scheduling of applications.
- the input manager can provide an input manager service (IMS), and the IMS can be used to manage the input of the system, such as touch screen input, key input, sensor input, and the like.
- IMS fetches events from input device nodes, and distributes events to appropriate windows through interaction with WMS.
- the Android runtime includes the core library and the Android runtime.
- the Android runtime is responsible for converting source code to bytecode, converting bytecode to machine code, and running the machine code.
- the Android runtime supports ahead or time (AOT) compilation technology and just in time (JIT) compilation technology, in which AOT converts bytecode into machine code during application installation and stores it in On-memory; the JIT converts a portion of the bytecode to machine code in real-time while the application is running.
- AOT ahead or time
- JIT just in time
- the core library is mainly used to provide the functions of basic Java class libraries, such as basic data structures, mathematics, IO, tools, databases, networks and other libraries.
- the core library provides an API for users to develop Android applications.
- a native C/C++ library can include multiple functional modules. For example: surface manager, media framework, libc, OpenGL ES, SQLite, Webkit, etc. Among them, the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
- the media framework supports playback and recording of many common audio and video formats, as well as still image files.
- the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
- libc provides a library of standard C functions.
- OpenGL ES provides the drawing and manipulation of 2D graphics and 3D graphics in applications.
- SQLite provides a lightweight relational database for applications.
- Webkit provides browser kernel support.
- the modules in the application framework layer are written in the Java language, and the modules in the native C/C++ library are written in the C/C++ language, and the communication between the two can be realized through the Java native interface (JNI).
- JNI Java native interface
- the hardware abstraction layer runs in user space, encapsulates the kernel layer driver, and provides a calling interface to the upper layer, which can include a display module, a camera module, an audio module, and a Bluetooth module.
- the kernel layer is the layer between hardware and software.
- the kernel layer contains at least display driver, camera driver, audio driver, sensor driver, Binder driver, etc.
- the kernel layer also supports functions such as memory management, system process management, file system management, and power management.
- the user performs an input operation on the electronic device 100 (such as an operation that triggers the electronic device to display an application), and the kernel layer can generate a corresponding input event (such as a folding screen unfolding event) according to the input operation, and report the event to the application framework layer. event.
- the window properties of the application are set by the activity management server AMS of the application framework layer.
- the window management server WMS of the application framework layer draws the window according to the settings of the AMS, and then sends the window data to the display driver of the kernel layer, and the display driver displays the corresponding application interface on the folding screen.
- the properties of the window may include the position and size of the Activity window, and the visible properties of the Activity window (ie, the state of the Activity window).
- the position of the Activity window is the position of the Activity window on the display screen, and the size of the Activity window may be information such as width and height in the application startup config.
- the visible property of the Activity window can be true or false. When the visible property of the Activity window is true, it means that the Activity window is in an active state, and the Activity window is visible to the user, that is, the display driver will display the content of the Activity window. When the visible attribute of the Activity of the Activity window is false, it means that the Activity window is in the pause state, and the Activity window is invisible to the user, that is, the display driver will not display the content of the Activity window.
- the application can call the start Activity interface to start the corresponding Activity.
- the activity manager AMS may request the window manager WMS to draw a window corresponding to the Activity, and invoke the display driver to display the interface.
- the resource manager in the application framework layer can perform fine-grained control over resource usage for the processes in the foreground application. Therefore, compared with allowing each process in the foreground application to normally use each resource, the resource management and control method provided by the embodiment of the present application can reduce unnecessary system overhead and reduce the power consumption of the electronic device.
- the method may include:
- S301 Detect a first application program in a foreground running state.
- the running state of the application in the operating system can be divided into a foreground running state and a background running state.
- an application running in the foreground is also called a foreground application
- an application running in the background is also called a background application.
- the foreground running state can be that the application program runs directly on the display window or interface of the display screen, showing the current interface of the program running, or the user of the electronic device (that is, the user) interacts with the application through the interface displayed by the application program.
- the foreground running state can also be that an application applies for a new Activity (startActivity) through the activity manager AMS, or the Activity in the Paused state re-enters the active state.
- the display screen In the background running state, the display screen does not present the running interface of the application, but the application continues to provide services in the background.
- the application can switch from the background running state to the foreground running state at any time, or from the foreground running state to the background running state; for applications without a visual display interface, its Can be in the background running state, but cannot switch to the foreground running state.
- the electronic device 100 after the electronic device 100 detects the first operation instructing the user to open the first application, the electronic device 100 runs the first application in the foreground.
- the first application program may be a system application program or a third-party application program, which is not limited in this embodiment of the present application.
- the user may instruct the electronic device 100 to open the first application by clicking on the icon of the first application, a voice command, or a gesture in various manners.
- the electronic device 100 detects the first operation of the user clicking the browser icon 401, and in response to the first operation, the electronic device 100 100 Starts the browser application in the foreground.
- the interface of the browser is displayed on the screen, and the application browser is in the foreground running state at this time.
- one or more applications may run simultaneously on the electronic device 100, including applications running in the foreground and applications running in the background, and there may be various implementations for determining whether a system application is running in the foreground.
- the Android operating system will call methods such as onResume to make the Activity of the first application program in a running state.
- Acticity is a component used to control the display interface, which can provide users with an interface for interacting with the system, and each application has one or more Acticities.
- the Activity includes: running the Resumed state, pausing the Paused state and stopping the Stopped state; and then, if the Activity of the first application program is in the Resumed state, It means that the first application is in the foreground running state, and if the Activity of the first application is in the Paused state, it means that the first application is running in the background.
- the Activity includes: a Resumed state and a Stopped state; further, if the Activity of the first application program is in the Resumed state, it means that the first The application is running in the background. In this way, it can be determined whether the application is in the foreground running state according to the state of the Activity of the system application.
- the application of the currently focused layer can be acquired with a delay of 100ms as the currently visible first application. If the first application If the interface component of the program is in the running state, it means that the first application is in the foreground running state, and the first application is set to the foreground flag; otherwise, the first application is set to the background flag.
- the currently visible first application can be obtained immediately. If the interface component of the first application is in the running state, it means that the first application is in the foreground running state, and the first application is in the foreground running state. The application sets the foreground flag, otherwise, the first application sets the background flag.
- the Android operating system if the currently visible Activity of the first application is in the Resumed state, it means that the first application is in the foreground running state.
- step S302 For the first application program determined in step S301, identify the non-critical process of the first application program.
- the electronic device 100 may identify the non-critical process in the first application program according to the type of business performed by the process.
- the electronic device 100 usually creates multiple business processes for it, so as to execute different services to realize corresponding functions.
- the electronic device 100 may create one or more of the browser main process, the web browsing process, and the download service process; for another example, when the foreground application is a navigation application, The electronic device 100 may create one or more of a navigation application main process, a map navigation process, and a message push process.
- each business process in the foreground application can apply for resources, and the resources may include software resources and/or hardware resources, so as to support the normal operation of various functional services of the foreground application.
- the business types can be divided into foreground business and non-foreground business, where the foreground business can be the business that the user directly interacts with, and the non-foreground business can be the one that the user does not directly interact with.
- Interactive business Exemplarily, taking the browser as the first application running in the foreground as an example, see (b) in FIG. 4 , when the user uses the browser to browse the webpage, the webpage browsing process belongs to the foreground business process.
- the process is a non-foreground business process of the first application.
- the Android operating system if a certain process does not run the UI component, it may be that the process does not run the Activity.
- each application running in the foreground corresponds to a user interface (UI), and the UI thread is created when the application is started, and is mainly used to control the display, update and control interaction of the UI interface.
- UI user interface
- the electronic device 100 may learn and identify whether the process is a non-critical process according to the characteristics of the process.
- the cloud server may learn and identify whether the process is a non-critical process according to the characteristics of the process, and the electronic device 100 may obtain the identification result of the process from the cloud server.
- the electronic device 100 can obtain the types of various business processes.
- the business process may include a perceptible process and an imperceptible process, and the like.
- a perceptible process can be a running business process that the user can hear, see, or touch, such as a message receiving/sending process, an alarm clock process, an upload/download process, an audio playback process, or a navigation process. Not limited to this. Although the perceptible process has entered the background, it can still be perceived by the user that the business is running.
- the imperceptible process may be a running business process that cannot be perceived by the user.
- the electronic device 100 may learn and identify whether a process is a perceptible process or an imperceptible process according to the characteristics of the process.
- the cloud server may learn and identify whether the process is a perceptible process or an imperceptible process according to the characteristics of the process, and the electronic device 100 may obtain the identification result of the process from the cloud server.
- the electronic device 100 may determine that these processes are user-perceivable processes.
- the electronic device 100 may collect heartbeats, network data packets by process, record notifications, vibrations, or collect other related information of the process.
- the electronic device 100 identifies whether the process characteristics shown in Table 1 are met according to the relevant information; if so, the electronic device 100 determines that the process is a perceptible process; if not, the electronic device 100 determines that the process is an imperceptible process.
- having network authority means that the process has the authority to use network resources and can use network resources normally.
- the electronic device 100 can collect heartbeats, network data packets, record notifications, vibrations, or other related information of the process according to the process, and upload it to the cloud server.
- the cloud server identifies whether the process characteristics shown in Table 1 are met according to the relevant information of the process; if so, the cloud server determines that the process is a perceptible process; if not, the cloud server determines that the process is an imperceptible process.
- the cloud server returns the identification result of the process to the electronic device 100 .
- whether the electronic device 100 or the cloud service determines whether the process is a perceptible process or an imperceptible process according to the process characteristics can be performed after the first application enters the foreground running state; Save the training result of process identification and save it in the list of perceptible and non-perceptible processes. Perceived and imperceptible processes can also be preset.
- the non-critical process of the first application may be a non-foreground business process of the first application, or may be an imperceptible process of the first application.
- the non-critical process of the first application may be an imperceptible process in the non-foreground business process of the first application.
- the electronic device 100 retains the perceptible process in it, and performs resource management and control on the non-perceived process in it, which can not affect the foreground service and user experience on the basis of , reduce the power consumption of electronic equipment.
- step S303 After determining the non-critical process of the first application, the electronic device 100 performs step S303 on the non-critical process determined in step S302.
- a one-way process can be a process that is not called by any other process.
- step S302 starting from the switching of the first application to the foreground running state, statistics on all processes on the electronic device 100 being invoked and/or invocation relationships are performed, and the invocation of the non-critical process determined in step S302 is obtained after a period of time after the statistics are started. As a result, a one-way process within it is identified.
- the non-critical processes determined in step S302 may be created from the time of creation, and the calling and/or calling relationships of all processes on the electronic device 100 may be counted, and the imperceptible processes determined in step S303 may be obtained after starting statistics for a period of time The result of the call to identify the one-way process.
- the calling relationship between all processes running on the electronic device 100 can be identified in the kernel Binder driver.
- other methods may also be used to identify the logical relationship of calls between processes, which is not limited in this application.
- FIG. 6 is a schematic diagram of the principle of inter-process communication of the Android operating system.
- Each Android operating system process can only run in the virtual address space owned by its own process.
- the virtual address space includes user space and kernel space independent of each other. For user space, different processes cannot share with each other, but the kernel space between different processes can be shared.
- Each communication between the two different processes is implemented through the Binder driver located in the kernel space.
- the Binder mechanism adopts the client-server (Client-Server) communication mode, the application process acts as the client, the designated program acts as the server, and the two communicate through the Binder driver.
- the client needs to transfer a piece of memory data to the server.
- the general method is that the client copies this piece of data from the client's process space to the kernel space, and then the kernel copies this piece of data from the kernel space to the kernel space.
- the process space on the server side so the server side can access this piece of data, but this method performs two memory copy operations.
- the Binder mechanism only needs to copy the data of the client process space to the kernel space once, and then the server side shares this data with the kernel. The whole process only needs to perform a memory copy operation, which improves the operation efficiency.
- the client process and the server process can be any two processes, either an application or a service.
- it can be a communication between an application and an application, or between an application and a service. Communication.
- the processes running in the system can communicate through the Binder mechanism. Inter-process calls are done through Binder shared memory.
- the calling relationship between all processes can be identified in the kernel Binder driver, and the logical relationship between the calls can be recorded. / or the specific case of the call.
- FIG. 7 shows a schematic diagram of an inter-process calling relationship of an application.
- the main process A of the first application program derives three service sub-processes A1 , A2 and A3 .
- the child process A1 For the child process A1, it is called by the main process A and the child process A3, and calls the main process A at the same time, so the child process A1 has a two-way calling dependency.
- the child process A2 For the child process A2, it calls the main process A and the child process A3, but is not called by any other process, so the child process A2 is a one-way process.
- the child process A3 it is called by the child process A2, and calls the main process A and the child process A1 at the same time, so the child process A3 has a two-way calling dependency.
- FIG. 8 shows a schematic diagram of the mutual calling relationship between the processes of two application programs.
- the main process A of the first application program derives three service sub-processes A1 , A2 and A3
- the main process B of the second application program derives three service sub-processes B1 , B2 and B3 .
- the child process A1 it is called by the main process A, the child process A3, and the child process B3, and calls the main process A at the same time, so the child process A1 has a two-way calling dependency.
- the child process A2 calls the main process A and the child process A3, but is not called by any process, so the child process A2 is a one-way process.
- the child process A3 For the child process A3, it is called by the child process A2 and the child process B2, and calls the main process A and the child process A1 at the same time, so the child process A3 has a two-way calling dependency.
- the child process B1 For the child process B1, it is called by the main process B, the child process B2, and the child process B3, and calls the main process B at the same time, so the child process B1 has a two-way calling dependency.
- the child process B2 it calls the child process B1, the child process B3 and the child process A3, but is not called by any other process, so the child process B2 is a one-way process.
- the child process B3 For the child process B3, it is called by the child process B2, and calls the child process A1 and the child process B1 at the same time, so the child process B3 has a two-way calling dependency.
- S304 For the application in the foreground running state, perform resource management and control on the one-way process determined in S304.
- the electronic device 100 can perform resource management and control on the one-way process A2 and the one-way process B2.
- the manner in which the electronic device 100 performs resource management and control on the process may specifically include: suspending the Alarm heartbeat by process; disconnecting the TCP connection by process; restricting network permissions by process; caching or discarding broadcasts by process; pausing GNSS by process Use of resources such as /Wakelock/Job/broadcast, etc.
- suspending the Alarm heartbeat by process refers to stopping the current process based on the Alarm's heartbeat packet.
- the TCP connection exchanges information through the Socket link.
- the TCP connection is disconnected by process, that is, the Socket link corresponding to the TCP connection of the current process is disconnected.
- Restricting network permissions by process means restricting the current process from using network resources.
- Pausing resources such as GNSS/Wakelock/Job/broadcast by process means that the current process is prohibited from using resources such as GNSS/Wakelock/Job/broadcast.
- suspending the broadcast resources by process includes caching or discarding the broadcast content of the current non-critical process.
- performing resource management on a process can restrict the process from using one or more resources.
- the electronic device 100 may restrict the process to use the socket link and network resources, but allow the process to use the Alarm resource normally.
- the manner in which the electronic device 100 performs resource management and control on the process may also be other manners, which are not limited in this application.
- performing resource management and control on the one-way process determined in step S304 can reduce the system overhead and ensure the resource usage experience of the foreground business process under the condition that the foreground business process is not affected.
- step S304 for the application in the foreground running state, among the non-critical processes determined in step S302, the process that has been called a few times, or the process that has not been called for a long time, or satisfies
- the process of the preset calling scene is used for resource management and control, which can further reduce the system overhead, and at the same time ensure that the foreground business process is not affected as much as possible.
- the method may further include:
- step S305 Stop performing resource management and control on the one-way process determined in step S304.
- the resource management and control of the process is stopped immediately.
- step S304 when it is detected that the one-way process determined in step S304 receives a data packet from the network side, the resource management and control of the process is stopped.
- the manner in which the electronic device 100 stops performing resource management and control on the one-way process may also be other manners, which are not limited in this application.
- the process can use various resources normally, so as to ensure that the application currently in the foreground running state normally provides services.
- the resource method provided by the present application can precisely manage and control the resource usage of its non-foreground business process from the perspective of the process.
- the resource management and control method provided by the embodiment of the present application can reduce unnecessary system overhead under the condition of ensuring services, thereby ensuring the foreground application.
- an embodiment of the present application also provides an electronic device, including a detection unit, a determination unit, and a management and control unit, each of which can cooperate with each other to enable the electronic device to execute the steps in the foregoing embodiments to implement the foregoing resource management and control method.
- Embodiments of the present application also provide an electronic device, including one or more processors; a memory; and one or more computer programs.
- One or more computer programs are stored in the memory, the one or more computer programs including instructions.
- the electronic device is caused to execute the relevant steps in the foregoing embodiments, so as to implement the foregoing resource management and control method.
- the present application provides a computer program product containing instructions, when the computer program product runs on an electronic device (eg, the electronic device 100 described above), the electronic device executes the above-mentioned relevant steps, so as to realize the resource management and control method in the above-mentioned embodiment. .
- the present application provides a computer-readable storage medium, where computer instructions are stored in the computer storage medium, and when the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned relevant steps, so as to realize the resource management and control method in the above-mentioned embodiment. .
- the electronic devices, computer program products, or computer-readable storage media provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, for the beneficial effects that can be achieved, reference may be made to the corresponding methods provided above. The beneficial effects of the method are not repeated here.
- the embodiments of the present application may be implemented in hardware, or in a manner of hardware and software.
- the above-described functions can be stored in a computer-readable medium.
- the medium includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application.
- the aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Telephone Function (AREA)
Abstract
Procédé de gestion et de commande de ressources et dispositif, qui se rapportent au domaine technique de l'électronique. Une gestion et une commande fines sont effectuées sur l'utilisation de ressources d'un processus selon un type de processus dans une application d'avant-plan, de telle sorte qu'une surcharge de système inutile peut être réduite tout en assurant un service, et l'expérience d'utilisation de ressources d'un processus de service d'avant-plan est assurée. La solution spécifique consiste : à déterminer un premier programme d'application devant être dans un état d'exécution d'avant-plan ; à déterminer un premier processus du premier programme d'application, le premier processus étant un processus non critique ; à acquérir un premier nombre de fois où le premier processus a été appelé par d'autres processus ; et quand le premier nombre de fois est inférieur ou égal à une première valeur seuil, à réaliser une gestion et une commande de ressources sur le premier processus. Le procédé permet une gestion et une commande de ressources.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011464555.3A CN114625525A (zh) | 2020-12-14 | 2020-12-14 | 一种资源管控方法及设备 |
CN202011464555.3 | 2020-12-14 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022127632A1 true WO2022127632A1 (fr) | 2022-06-23 |
Family
ID=81896680
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/135662 WO2022127632A1 (fr) | 2020-12-14 | 2021-12-06 | Procédé de gestion et de commande de ressources, et dispositif |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114625525A (fr) |
WO (1) | WO2022127632A1 (fr) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117349006A (zh) * | 2023-09-14 | 2024-01-05 | 荣耀终端有限公司 | Cpu资源管理方法及相关装置 |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116055546A (zh) * | 2022-07-21 | 2023-05-02 | 荣耀终端有限公司 | 进程管理方法、电子设备、存储介质及程序产品 |
CN116700815B (zh) * | 2022-10-21 | 2024-04-26 | 荣耀终端有限公司 | 硬件资源控制方法、电子设备及可读存储介质 |
CN117149362B (zh) * | 2023-04-06 | 2024-07-16 | 荣耀终端有限公司 | 进程管控方法及相关装置 |
CN117707718A (zh) * | 2023-06-29 | 2024-03-15 | 荣耀终端有限公司 | 进程管理的方法、电子设备及可读存储介质 |
CN117707719A (zh) * | 2023-06-29 | 2024-03-15 | 荣耀终端有限公司 | 进程管理的方法、电子设备及可读存储介质 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102736953A (zh) * | 2011-04-08 | 2012-10-17 | 腾讯科技(深圳)有限公司 | 一种系统资源配置方法和设备 |
US20130031424A1 (en) * | 2011-07-27 | 2013-01-31 | Oracle International Corporation | Proactive and adaptive cloud monitoring |
CN109862184A (zh) * | 2019-01-28 | 2019-06-07 | 努比亚技术有限公司 | 终端及其资源管控方法、计算机可读存储介质 |
CN109992397A (zh) * | 2017-12-29 | 2019-07-09 | 广东欧珀移动通信有限公司 | 进程处理方法和装置、电子设备、计算机可读存储介质 |
CN110032429A (zh) * | 2018-01-10 | 2019-07-19 | 广东欧珀移动通信有限公司 | 信息处理方法、装置、移动终端及计算机可读存储介质 |
CN110806926A (zh) * | 2019-09-05 | 2020-02-18 | 华为技术有限公司 | 一种资源管控方法及设备 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103176842B (zh) * | 2013-03-15 | 2016-04-27 | 广东欧珀移动通信有限公司 | 后台进程管理方法及其移动终端 |
US10552179B2 (en) * | 2014-05-30 | 2020-02-04 | Apple Inc. | Resource management with dynamic resource policies |
CN107402791B (zh) * | 2017-07-31 | 2020-05-12 | Oppo广东移动通信有限公司 | 应用程序处理方法、装置、存储介质及终端 |
CN109992438A (zh) * | 2017-12-29 | 2019-07-09 | 广东欧珀移动通信有限公司 | 信息处理方法、装置、计算机设备和计算机可读存储介质 |
CN110245021A (zh) * | 2019-06-21 | 2019-09-17 | 上海创功通讯技术有限公司 | 移动终端的内存管理方法、系统、电子设备及存储介质 |
-
2020
- 2020-12-14 CN CN202011464555.3A patent/CN114625525A/zh active Pending
-
2021
- 2021-12-06 WO PCT/CN2021/135662 patent/WO2022127632A1/fr active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102736953A (zh) * | 2011-04-08 | 2012-10-17 | 腾讯科技(深圳)有限公司 | 一种系统资源配置方法和设备 |
US20130031424A1 (en) * | 2011-07-27 | 2013-01-31 | Oracle International Corporation | Proactive and adaptive cloud monitoring |
CN109992397A (zh) * | 2017-12-29 | 2019-07-09 | 广东欧珀移动通信有限公司 | 进程处理方法和装置、电子设备、计算机可读存储介质 |
CN110032429A (zh) * | 2018-01-10 | 2019-07-19 | 广东欧珀移动通信有限公司 | 信息处理方法、装置、移动终端及计算机可读存储介质 |
CN109862184A (zh) * | 2019-01-28 | 2019-06-07 | 努比亚技术有限公司 | 终端及其资源管控方法、计算机可读存储介质 |
CN110806926A (zh) * | 2019-09-05 | 2020-02-18 | 华为技术有限公司 | 一种资源管控方法及设备 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117349006A (zh) * | 2023-09-14 | 2024-01-05 | 荣耀终端有限公司 | Cpu资源管理方法及相关装置 |
Also Published As
Publication number | Publication date |
---|---|
CN114625525A (zh) | 2022-06-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020259452A1 (fr) | Procédé d'affichage plein écran pour terminal mobile et appareil | |
WO2021135730A1 (fr) | Procédé d'adaptation d'interface d'affichage, procédé de conception d'adaptation d'interface d'affichage et dispositif électronique | |
WO2022127632A1 (fr) | Procédé de gestion et de commande de ressources, et dispositif | |
WO2021000807A1 (fr) | Procédé et appareil de traitement pour un scénario d'attente dans une application | |
WO2021213164A1 (fr) | Procédé d'interaction entre des interfaces d'application, dispositif électronique et support de stockage lisible par ordinateur | |
WO2020108356A1 (fr) | Procédé d'affichage d'application et dispositif électronique | |
WO2020000448A1 (fr) | Procédé et terminal d'affichage d'écran flexible | |
EP4084486B1 (fr) | Procédé de projection de contenu inter-dispositif et dispositif électronique | |
WO2020093988A1 (fr) | Procédé de traitement d'image et dispositif électronique | |
WO2021036770A1 (fr) | Procédé de traitement d'écran partagé et dispositif terminal | |
WO2021258809A1 (fr) | Procédé de synchronisation de données, dispositif électronique et support de stockage lisible par ordinateur | |
WO2022199509A1 (fr) | Procédé d'application d'opération de dessin et dispositif électronique | |
WO2021052415A1 (fr) | Procédé de planification de ressources et dispositif électronique | |
CN116360725B (zh) | 显示交互系统、显示方法及设备 | |
WO2022095744A1 (fr) | Procédé de commande d'affichage vr, dispositif électronique et support de stockage lisible par ordinateur | |
WO2022042637A1 (fr) | Procédé de transmission de données à base de bluetooth et appareil associé | |
WO2023005282A9 (fr) | Procédé et appareil de poussée de message | |
WO2021073337A1 (fr) | Procédé et appareil pour installer un module d'extension, et support de stockage | |
WO2022143180A1 (fr) | Procédé d'affichage collaboratif, dispositif terminal et support de stockage lisible par ordinateur | |
WO2022268009A1 (fr) | Procédé de partage d'écran et dispositif associé | |
CN115016697A (zh) | 投屏方法、计算机设备、可读存储介质和程序产品 | |
WO2022135195A1 (fr) | Procédé et appareil permettant d'afficher une interface de réalité virtuelle, dispositif, et support de stockage lisible | |
WO2022152174A1 (fr) | Procédé de projection d'écran et dispositif électronique | |
WO2021129453A1 (fr) | Procédé de capture d'écran et dispositif associé | |
WO2024083031A1 (fr) | Procédé d'affichage, dispositif électronique et système |
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: 21905561 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: 21905561 Country of ref document: EP Kind code of ref document: A1 |