WO2020024732A1 - 进程处理方法、电子设备、计算机可读存储介质 - Google Patents

进程处理方法、电子设备、计算机可读存储介质 Download PDF

Info

Publication number
WO2020024732A1
WO2020024732A1 PCT/CN2019/092879 CN2019092879W WO2020024732A1 WO 2020024732 A1 WO2020024732 A1 WO 2020024732A1 CN 2019092879 W CN2019092879 W CN 2019092879W WO 2020024732 A1 WO2020024732 A1 WO 2020024732A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
target process
electronic device
threshold
asynchronous service
Prior art date
Application number
PCT/CN2019/092879
Other languages
English (en)
French (fr)
Inventor
陈岩
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2020024732A1 publication Critical patent/WO2020024732A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/329Power saving characterised by the action undertaken by task scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake

Definitions

  • the present application relates to the field of computer technology, and in particular, to a process processing method, an electronic device, and a computer-readable storage medium.
  • the process can be frozen, the frozen process cannot run, and it will not occupy the processor resources of the electronic device. However, since the process is not closed and still exists in the electronic device, the frozen process will still occupy the memory, hardware and other resources of the electronic device. The frozen process can also be awakened, and the process after waking can continue to perform different application operations.
  • a process processing method an electronic device, and a computer-readable storage medium are provided.
  • a process processing method includes:
  • obtaining a target process identifier included in the communication message wherein the target process identifier is used to identify a service process that receives the communication message;
  • the communication method of the target process is asynchronous communication, comparing the target process ID with the process ID in the process list;
  • the target process is woken up.
  • An electronic device includes a memory and a processor.
  • the memory stores a computer program.
  • the processor causes the processor to perform the following operations:
  • obtaining a target process identifier included in the communication message wherein the target process identifier is used to identify a service process that receives the communication message;
  • the communication method of the target process is asynchronous communication, comparing the target process ID with the process ID in the process list;
  • the target process is woken up.
  • a computer-readable storage medium stores a computer program thereon.
  • the computer program is executed by a processor, the following operations are implemented:
  • obtaining a target process identifier included in the communication message wherein the target process identifier is used to identify a service process that receives the communication message;
  • the communication method of the target process is asynchronous communication, comparing the target process ID with the process ID in the process list;
  • the target process is woken up.
  • a corresponding target process is found according to a target process identifier in the communication message.
  • the target process ID is compared with the process ID in the process list.
  • the target process is woken up only when there is no process ID corresponding to the target process ID in the process list. In this way, processes can be filtered through communication methods and process lists to prevent processes from being frequently awakened, thereby reducing power consumption of electronic devices.
  • FIG. 1 is a schematic diagram of an internal structure of an electronic device in an embodiment.
  • FIG. 2 is a flowchart of a process processing method in an embodiment.
  • FIG. 3 is a flowchart of a process processing method in another embodiment.
  • FIG. 4 is a schematic diagram of communication between a client process and a service process in an embodiment.
  • FIG. 5 is a flowchart of a process processing method in another embodiment.
  • FIG. 6 is a flowchart of a process processing method in another embodiment.
  • FIG. 7 is a schematic diagram of a process processing flow in an embodiment.
  • FIG. 8 is a structural block diagram of a process processing apparatus according to an embodiment.
  • FIG. 9 is a structural block diagram of a process processing apparatus according to another embodiment.
  • FIG. 10 is a block diagram of a partial structure of a mobile phone related to an electronic device according to an embodiment of the present application.
  • first, second, and the like used in this application can be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from another element.
  • first client may be referred to as the second client, and similarly, the second client may be referred to as the first client. Both the first client and the second client are clients, but they are not the same client.
  • the electronic device includes a processor, a memory, and a display screen connected through a system bus.
  • the processor is used to provide computing and control capabilities to support the operation of the entire electronic device.
  • the memory is used to store data, programs, and / or instruction codes, and the memory stores at least one computer program that can be executed by a processor to implement a process processing method applicable to an electronic device provided in the embodiments of the present application.
  • the memory may include a non-volatile storage medium such as a magnetic disk, an optical disc, a read-only memory (ROM), or a random-access memory (RAM).
  • the memory includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system and a computer program.
  • the computer program can be executed by a processor to implement a process processing method provided by various embodiments of the present application.
  • the internal memory provides a cached operating environment for the operating system and computer programs in a non-volatile storage medium.
  • the display screen can be a touch screen, such as a capacitive screen or an electronic screen, which is used to display the interface information of the application corresponding to the foreground process. Application switching instructions, etc.
  • the structure shown in FIG. 1 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied.
  • the specific electronic device may be Include more or fewer parts than shown in the figure, or combine certain parts, or have a different arrangement of parts.
  • the electronic device further includes a network interface connected through a system bus.
  • the network interface may be an Ethernet card or a wireless network card, and is used to communicate with external electronic devices, for example, to communicate with a server.
  • FIG. 2 is a flowchart of a process processing method in an embodiment. As shown in FIG. 2, the process processing method includes operations 202 to 206. among them:
  • a target process identifier included in the communication message is obtained; the target process identifier is used to identify a service process that receives the communication message.
  • An application is software written for a certain application purpose in an electronic device, and the electronic device can implement the service required by the user through the application. For example, users can play games through game applications, watch videos through video applications, and play music through music applications.
  • a process is a running activity of a program in a computer about a certain data collection, and is a basic unit for system resource allocation and scheduling.
  • a process can correspond to one or more threads.
  • a thread is a single sequential control flow in a program and a relatively independent and schedulable execution unit within a process.
  • the process may include a foreground process and a background process.
  • the foreground process is a process running in the foreground of the electronic device
  • the background process is a process running in the background of the electronic device.
  • a process may be frozen, and a process in a frozen state is not closed, but is temporarily not running.
  • the frozen process does not occupy processor resources for running, but still consumes resources such as memory and hardware of the electronic device.
  • the resource priority and restriction management module in the local framework layer of the electronic device can mark the status of the process, and by reading the status flag of the process, it can be known whether the process is in a frozen state. When the process is awakened, the resource priority and restriction management module will change the status flag of the process accordingly, so as to achieve the management and control of the frozen state of the process through the corresponding status flag.
  • Processes can send communication messages to each other, and the communication messages carry the target process identifiers that receive the communication messages. For example, process A sends a communication message to process B. When process A generates a communication message, it writes the process ID of process B into the communication message. When the electronic device detects the communication message, it can find and receive it based on the process ID. Process B of this communication message.
  • the target process ID is compared with the process ID in the process list.
  • the electronic device can send the communication message to the system kernel, and the driver in the system kernel reads the target process identifier in the communication message, and then finds the corresponding target process according to the target process identifier.
  • the electronic device needs to wake up the target process before receiving the communication message.
  • the electronic device determines whether the communication mode of the target process is asynchronous communication.
  • the electronic device allows the target process to be woken up and receive communication messages.
  • the electronic device may obtain a communication attribute tag of the target process, and determine whether the target process is asynchronous communication or synchronous communication by using the communication attribute tag.
  • the communication attribute tag may include an asynchronous tag and a synchronous tag.
  • the electronic device may consider the communication method of the target process to be asynchronous communication; when the communication attribute tag is a synchronous tag, the electronic device considers the target process to communicate
  • the method is to freeze communication synchronously.
  • synchronous communication is to process messages in order between different processes, and after one process is complete, the next process continues to process.
  • different processes are independent of each other, and processes can process other messages while waiting to process a message.
  • the electronic device stores this process list for filtering target processes, and the process list stores one or more process identifiers.
  • the communication method of the target process is asynchronous communication
  • the electronic device needs to further compare the target process ID with the process ID in the process list, and wake up the target process when there is no process ID corresponding to the target process ID in the process list.
  • the target process can continue to run, during the running process, it can receive communication messages and process the communication messages accordingly.
  • the target process may be frozen again.
  • the electronic device may set a freeze time after waking up the target process, and when the freeze time is reached, freeze the target process again.
  • a corresponding target process is found according to a target process identifier in the communication message.
  • the target process ID is compared with the process ID in the process list.
  • the target process is woken up only when there is no process ID corresponding to the target process ID in the process list. In this way, processes can be filtered through communication methods and process lists to prevent processes from being frequently awakened, thereby reducing power consumption of electronic devices.
  • FIG. 3 is a flowchart of a process processing method in another embodiment. As shown in FIG. 3, the process processing method includes operations 302 to 314. among them:
  • Operation 302 Count the historical running times of the asynchronous service process running historically in a preset period.
  • the running status of the process is recorded, and the historical running times of the asynchronous service process can be counted according to the recorded running situation, where the asynchronous service process refers to the service process of asynchronous communication.
  • the electronic device may record information such as the time when the process starts running, the time when the process ends, the process identification, and the communication attribute tag during the process running.
  • the electronic device can calculate the historical running times of the asynchronous service process through each time when the asynchronous service process starts to run within a preset period of time. For example, the electronic device can count the number of times that the asynchronous service process runs within 12 hours as the historical running times.
  • Operation 304 Obtain the target asynchronous service process from the historically running asynchronous service process according to the historical running times.
  • the electronic device may determine the target asynchronous service process from the historically running asynchronous service processes according to the historical running times, and then write a process identifier corresponding to the target asynchronous service process into the process list.
  • the operation of the electronic device to obtain the target asynchronous service process may include: sorting the historically running asynchronous service process according to the historical running times, and using the sorted asynchronous service process with the specified number of bits as the target asynchronous service process. For example, the electronic device may arrange the asynchronous service processes in order of historical running times from high to low, and then obtain the top 10 asynchronous service processes as the target asynchronous service process.
  • the operation of acquiring the target asynchronous service process may further include: acquiring the asynchronous service process whose historical running times are greater than the frequency threshold as the target asynchronous service process.
  • the historical running times may be counted running times in one day, and then an asynchronous service process that runs more than 1000 times in one day may be used as the target asynchronous service process.
  • Asynchronous service processes with high historical running times are considered to be more important asynchronous service processes. For these more important asynchronous service processes, the number of times they are awakened can be controlled. Further, the electronic device can also judge the importance of the asynchronous service process according to the function called by the asynchronous service process during operation. The electronic device can obtain the target asynchronous service process from the historically running asynchronous service process according to the historical running times. When the target asynchronous service process calls a preset function at runtime, the process identifier of the target asynchronous service process is written into the process list. .
  • the process identifier of the target asynchronous service process may be written into the process list.
  • the process identifier of the target asynchronous service process is not written in the process list.
  • Operation 306 Write the process identifier of the target asynchronous service process to the process list.
  • the application program is initialized.
  • the historical running frequency of the asynchronous service process running historically is counted, and the target asynchronous service process is determined according to the historical running frequency, and then the process identifier of the target asynchronous service process is written into the process list.
  • Operation 308 When a communication message is detected, obtain a target process identifier included in the communication message; the target process identifier is used to identify a service process that receives the communication message.
  • processes running in the system can communicate through a binder communication mechanism.
  • binder communication mechanism four roles are defined: Server (service process), Client (client process), ServiceManager (service manager), and Binder driver.
  • the service process writes the process ID and the corresponding memory address into the service manager.
  • the client process first asks the service manager to obtain the corresponding memory through the process ID of the service process address. After the client process receives the process ID and memory address of the service process, it can communicate with the service process.
  • the client process When the client process communicates with the service process, it will first send the communication message to the Binder driver in the kernel space.
  • the communication message carries the process ID of the service process that received the communication message.
  • the Binder driver searches for the corresponding service process based on the process ID, and then sends the communication message to the corresponding service process.
  • the target process ID is compared with the process ID in the process list.
  • Operation 312 When the process identifier corresponding to the target process identifier does not exist in the process list, obtain the freeze duration of the target process.
  • the electronic device can record the freeze status of the process, and each time the target process freezes, it records the freeze moment that freezes the process. Each time a process is awakened, the wake-up time of the process is recorded. When the process ID corresponding to the target process ID does not exist in the process list, it indicates that the target process is allowed to wake up, and then the freeze duration of the target process can be further obtained, and whether the target process is awakened according to the freeze duration.
  • the electronic device can obtain the target time when the communication message is detected, and then obtain the freeze time closest to the target time, and calculate the time interval from the freeze time to the target time to obtain the freeze time.
  • the freezing time recorded by the electronic device is: ..., "12:12:11 on January 2", “12:13:04 on January 2,” and "12:15:25 on January 2.”
  • the electronic device detects that the target time of the communication message is "January 2 12:16:02”
  • the counted freeze time is "January 2 12:15:25” to "January 2 12:16 : 02 "for 37 seconds.
  • Operation 314 When the freeze duration exceeds the first duration threshold, wake up the target process.
  • the electronic device may determine whether the freeze duration exceeds the first duration threshold after obtaining the freeze duration of the target process. When the freeze duration exceeds the first duration threshold, the electronic device wakes up the target process; when the freeze duration is less than the first duration threshold, the target process is prohibited from waking up.
  • FIG. 4 is a schematic diagram of communication between a client process and a service process in an embodiment.
  • the client process 402 sends a communication message to the service process 408, it first sends the communication message to the Linux kernel 404.
  • the Linux kernel 404 obtains the target process identifier contained in the communication message. Then find the service process 408 according to the target process ID. If the Linux kernel 404 detects that the service process 408 is in a frozen state and the communication method of the service process 408 is asynchronous communication, it will upload the target process identifier to the Native layer 406.
  • a process list is stored in the Native layer 406, and the target process ID is compared with the process ID in the process list. If there is no process ID corresponding to the target process ID in the process list, the service process 408 is woken up.
  • the target process can receive and process communication messages. As shown in FIG. 5, after the target process is awakened, the above method may further include:
  • Operation 502 Obtain a total resource occupation rate of the electronic device.
  • Resources refer to the software or hardware resources that electronic devices must use when processing application events, such as the CPU (Central Processing Unit), memory, hardware, network resources, and IO (Input-Output , Input and output) and so on.
  • the resource occupancy rate refers to the proportion of resources occupied by an electronic device, and generally refers to the proportion of occupied resources to all resources, which can be expressed as a percentage. For example, if the total memory of the device is 128GB and the occupied memory is 56GB, the resource usage of the device can be expressed as the memory usage, and the obtained memory usage is 43.75%.
  • Operation 504 When the total resource occupancy rate exceeds the first occupancy threshold value, control the awakened target process to enter the resource limit state; wherein, the resource occupancy rate of the process in the resource limit state of the electronic device is smaller than the second occupancy rate Threshold, the first occupancy threshold is greater than the second occupancy threshold.
  • the resource limitation state refers to a state in which resources of an electronic device used by a process are restricted.
  • the total resource occupancy rate exceeds the first occupancy threshold, it is considered that the remaining resources of the electronic device are relatively small, and the target process will affect the normal operation of the electronic device. Then, the awakened target process can be controlled to enter the resource limit state.
  • the target process is in a resource-restricted state, the resource occupancy rate during the running process cannot exceed the second occupancy threshold. This can control the use of electronic device resources by the target process, thereby saving the resources of the electronic device. For example, limit the CPU usage of the target process to 10% or less.
  • the electronic device can also control the occupation of resources according to the priority of the target process, establish the correspondence between the priority of the target process and the resource limit level, and then control the entry of the resource limit state according to the priority of the target process.
  • Resource limit level refers to the importance of the target process and can be set in advance.
  • the resource limit level refers to the degree to which resources used by a process are restricted.
  • the electronic device can obtain the priority corresponding to the target process, and obtain the corresponding resource limit level according to the priority; and control the awakened target process to enter the resource limit state corresponding to the resource limit level.
  • the electronic device may also establish a correspondence between the total resource occupancy rate and the resource limit level.
  • a resource limit level is obtained according to the total resource occupancy, and then the target process that is awakened is controlled to enter the resource limit state corresponding to the resource limit level.
  • the first occupancy threshold is 50%
  • the total occupancy of the resource is divided into three occupants such as 50% to 60%, 60% to 80%, and 80% to 100%.
  • Level, and then corresponding to three levels of light resource limit level, ordinary resource limit level and deep resource limit level, respectively the electronic device can obtain the corresponding resource limit level according to the total resource occupancy rate. It can be understood that the electronic device may also obtain the resource limit level by combining the total resource occupancy rate and the priority of the target process, which is not limited here.
  • the method may further include:
  • the timing starts from the moment when the target process is awakened.
  • the electronic device When the target process is awakened, the electronic device starts a timer, and then starts counting through the timer.
  • the electronic device can define a corresponding timer for each target process, and then each target process can be timed by the corresponding timer.
  • the electronic device may establish a correspondence between the process identifier of the target process and the timer identifier of the timer, so that after the target process is awakened, the timer identifier corresponding to the process identifier may be used to find and start the timer to start timing.
  • the system can define a timer in advance.
  • the electronic device can find the timer corresponding to the process identifier according to the pre-established correspondence and use timer.setBase (SystemClock.elapsedRealtime ( ) Clear the timer to zero, then start the timer through the timer.start () function to start timing.
  • timer.setBase SystemClock.elapsedRealtime ( ) Clear the timer to zero, then start the timer through the timer.start () function to start timing.
  • the Android operating system is used as an example to describe the process processing method in this application, but the process processing method of this application It is not limited to being implemented in the Android system, but can also be applied to operating systems such as IOS (IPhone Operating System), Symbian, Windows, and MAC (OS Operating System).
  • Operation 604 When the timing duration exceeds the second duration threshold, freeze the target process.
  • the time when the target process is awakened starts to count, and the time duration indicates the time from the time when the target process is awakened to the current time.
  • the electronic device may define a second duration threshold in advance, and freeze the target process again when the timing duration exceeds the second duration threshold.
  • the second duration threshold is generally set to a relatively small threshold, so as to avoid that the target process is always running and occupying the resources of the electronic device. It can be understood that different target processes may use the same second duration threshold, or may use different second duration thresholds, which is not limited herein.
  • the electronic device may set the second duration threshold according to the frequency of the target process receiving the communication message. Specifically, the electronic device acquires a receiving frequency of the wake-up target process to receive the communication message, and acquires a corresponding second duration threshold according to the receiving frequency. For example, when the receiving frequency is low, setting the second duration threshold to a smaller value can automatically freeze the target process when the target process is relatively idle, thereby avoiding the resource consumption of the electronic device.
  • FIG. 7 is a schematic diagram of a process processing flow in an embodiment.
  • the electronic device detects a communication message sent to a target process in a frozen state, it determines whether the target process is asynchronous communication. When it is, the target process is awakened, and the awakened process is controlled to enter the resource limit state. When the wake-up duration exceeds the second duration threshold, the electronic device freezes the target process. When the target process is frozen, the target process does not run, and the resource occupation rate corresponding to the target process does not change. When in the awake state and in the resource-restricted state, the target process can run, but only part of the device's resources can be occupied during the running process.
  • a corresponding target process is found according to a target process identifier in the communication message.
  • the target process ID is compared with the process ID in the process list.
  • the target process is awakened only when the freeze duration of the target process exceeds the first duration threshold. In this way, the process can be filtered by the communication method and the process list, and the freezing time of the process can be controlled to prevent the process from being frequently awakened, thereby reducing the power consumption of the electronic device.
  • FIGS. 2, 3, 5, and 6 are sequentially displayed in accordance with the directions of the arrows, these operations are not necessarily performed in the order indicated by the arrows. Unless explicitly stated in this article, the execution of these operations is not strictly limited, and these operations can be performed in other orders. Moreover, at least a part of the operations in FIGS. 2, 3, 5, and 6 may include multiple sub-operations or multiple phases. These sub-operations or phases are not necessarily performed at the same time, but may be performed at different times. The execution order of the sub-operations or stages is not necessarily sequential, but may be performed in turn or alternately with at least a part of the sub-operations or stages of other operations or other operations.
  • FIG. 8 is a structural block diagram of a process processing apparatus according to an embodiment. As shown in FIG. 8, the process processing apparatus 800 includes a message detection module 802, an identity comparison module 804, and a process wake-up module 806. among them:
  • the message detection module 802 is configured to obtain a target process identifier included in the communication message when a communication message is detected; the target process identifier is used to identify a service process that receives the communication message.
  • the identifier comparison module 804 is configured to compare the target process identifier with a process identifier in a process list when the target process corresponding to the target process identifier is in a frozen state and the communication method of the target process is asynchronous communication.
  • a process wake-up module 806 is configured to wake up the target process when a process identifier corresponding to the target process identifier does not exist in the process list.
  • the process processing apparatus finds a corresponding target process according to a target process identifier in the communication message when a communication message is detected.
  • the target process ID is compared with the process ID in the process list.
  • the target process is woken up only when there is no process ID corresponding to the target process ID in the process list. In this way, processes can be filtered through communication methods and process lists to prevent processes from being frequently awakened, thereby reducing power consumption of electronic devices.
  • FIG. 9 is a structural block diagram of a process processing apparatus according to another embodiment.
  • the process processing device 900 includes a list generation module 902, a message detection module 904, an identity comparison module 906, a process wake-up module 908, a resource restriction module 910, and a process freezing module 912. among them:
  • the list generating module 902 is configured to count the historical running times of the historically running asynchronous service process in a preset period; obtain the target asynchronous service process from the historically running asynchronous service process according to the historical running times; The process ID of the asynchronous service process is written in the process list.
  • the message detection module 904 is configured to obtain a target process identifier included in the communication message when a communication message is detected; the target process identifier is used to identify a service process that receives the communication message.
  • the identifier comparison module 906 is configured to compare the target process identifier with a process identifier in a process list when the target process corresponding to the target process identifier is in a frozen state and the communication method of the target process is asynchronous communication.
  • a process wake-up module 908 is configured to wake up the target process when a process identifier corresponding to the target process identifier does not exist in the process list.
  • the resource limitation module 910 is configured to obtain a total resource occupancy rate of the electronic device; when the total resource occupancy rate exceeds a first occupancy threshold value, control the target process awakened to enter a resource limitation state;
  • the resource occupancy rate of the electronic device when the process in the restricted state is running is less than a second occupancy rate threshold, and the first occupancy rate threshold is greater than the second occupancy rate threshold.
  • the process freezing module 912 is configured to start timing from the moment when the target process is awakened; when the timing duration exceeds a second duration threshold, freeze the target process.
  • the process processing apparatus finds a corresponding target process according to a target process identifier in the communication message when a communication message is detected.
  • the target process ID is compared with the process ID in the process list.
  • the target process is woken up only when there is no process ID corresponding to the target process ID in the process list. In this way, processes can be filtered through communication methods and process lists to prevent processes from being frequently awakened, thereby reducing power consumption of electronic devices.
  • the list generating module 902 is further configured to sort the historically running asynchronous service processes according to the historical running times, and use the sorted asynchronous service process with a specified number of bits as a target asynchronous service process; or obtain The asynchronous service process whose historical running times is greater than the threshold is regarded as the target asynchronous service process.
  • the process wake-up module 908 is further configured to obtain a freeze duration of the target process; when the freeze duration exceeds a first duration threshold, wake up the target process.
  • the process freezing module 912 is further configured to obtain a receiving frequency of a wake-up target process receiving a communication message, and obtain a corresponding second duration threshold according to the receiving frequency.
  • each module in the above-mentioned process processing device is only for illustration. In other embodiments, the process processing device may be divided into different modules according to requirements to complete all or part of the functions of the above-mentioned process processing device.
  • Each module in the above-mentioned process processing device may be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above-mentioned modules may be embedded in the hardware form or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor calls and performs the operations corresponding to the above modules.
  • each module in the process processing apparatus provided in the embodiments of the present application may be in the form of a computer program.
  • the computer program can be run on a terminal or a server.
  • the program module constituted by the computer program can be stored in the memory of the terminal or server.
  • the computer program is executed by a processor, the operations of the method described in the embodiments of the present application are implemented.
  • An embodiment of the present application further provides an electronic device.
  • the electronic device may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, and a wearable device.
  • the electronic device is a mobile phone as an example. :
  • FIG. 10 is a block diagram of a partial structure of a mobile phone related to an electronic device according to an embodiment of the present application.
  • the mobile phone includes: a radio frequency (RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, and a processor 1080 , And power supply 1090 and other components.
  • RF radio frequency
  • the RF circuit 1010 may be used for receiving and sending signals during the sending and receiving of information or during a call, and may receive the downlink information of the base station and process it to the processor 1080; it may also send the uplink data to the base station.
  • the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
  • the RF circuit 1010 can also communicate with a network and other devices through wireless communication.
  • the above wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division Multiple Access) Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail, Short Messaging Service (SMS), etc.
  • GSM Global System of Mobile
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • SMS Short Messaging Service
  • the memory 1020 may be used to store software programs and modules.
  • the processor 1080 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1020.
  • the memory 1020 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system, applications required for at least one function (such as an application for a sound playback function, an application for an image playback function, etc.), etc .;
  • the data storage area can store data (such as audio data, contacts, etc.) created according to the use of the mobile phone.
  • the memory 1020 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the input unit 1030 may be used to receive inputted numeric or character information, and generate key signal inputs related to user settings and function control of the mobile phone 1000.
  • the input unit 1030 may include a touch panel 1031 and other input devices 1032.
  • Touch panel 1031 also known as touch screen, can collect user's touch operations on or near it (for example, the user uses a finger, a stylus or any suitable object or accessory on touch panel 1031 or near touch panel 1031 Operation), and drive the corresponding connection device according to a preset program.
  • the touch panel 1031 may include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the user's touch position, and detects the signal caused by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into contact coordinates, and sends it To the processor 1080, and can receive the commands sent by the processor 1080 and execute them.
  • various types such as resistive, capacitive, infrared, and surface acoustic wave can be used to implement the touch panel 1031.
  • the input unit 1030 may include other input devices 1032.
  • the other input devices 1032 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.) and the like.
  • the display unit 1040 may be used to display information input by the user or information provided to the user and various menus of the mobile phone.
  • the display unit 1040 may include a display panel 1041.
  • the display panel 1041 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light emitting diode (Organic Light-Emitting Diode, OLED), and the like.
  • the touch panel 1031 may cover the display panel 1041. After the touch panel 1031 detects a touch operation on or near the touch panel 1031, the touch panel 1031 transmits the touch operation to the processor 1080 to determine the type of the touch event. The type of touch event provides corresponding visual output on the display panel 1041.
  • the touch panel 1031 and the display panel 1041 are implemented as two independent components to implement the input and input functions of the mobile phone, in some embodiments, the touch panel 1031 and the display panel 1041 can be integrated and Realize the input and output functions of the mobile phone.
  • the mobile phone 1000 may further include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of the ambient light, and the proximity sensor may close the display panel 1041 and / Or backlight.
  • Motion sensors can include acceleration sensors, which can detect the magnitude of acceleration in various directions, the magnitude and direction of gravity can be detected when stationary, and can be used for applications that recognize mobile phone posture (such as horizontal and vertical screen switching), vibration recognition related functions (such as Pedometer, tap), etc.
  • the mobile phone can be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor and so on.
  • the audio circuit 1060, the speaker 1061, and the microphone 1062 may provide an audio interface between the user and the mobile phone.
  • the audio circuit 1060 can transmit the received electrical data converted electrical signal to the speaker 1061, and the speaker 1061 converts the sound signal to an audio signal output.
  • the microphone 1062 converts the collected sound signal into an electrical signal, and the audio circuit 1060 After receiving, it is converted into audio data, and then the audio data is output to the processor 1080 for processing, and then can be sent to another mobile phone via the RF circuit 1010, or the audio data is output to the memory 1020 for subsequent processing.
  • WiFi is a short-range wireless transmission technology.
  • the mobile phone can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 1070. It provides users with wireless broadband Internet access.
  • FIG. 10 shows the WiFi module 1070, it can be understood that it does not belong to the necessary configuration of the mobile phone 1000, and can be omitted as needed.
  • the processor 1080 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone.
  • the processor 1080 runs or executes software programs and / or modules stored in the memory 1020, and calls data stored in the memory 1020 to execute.
  • Various functions and processing data of the mobile phone so as to monitor the mobile phone as a whole.
  • the processor 1080 may include one or more processing units.
  • the processor 1080 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and an application program, and the like; the modem processor mainly processes wireless communications. It can be understood that the foregoing modem processor may not be integrated into the processor 1080.
  • the mobile phone 1000 further includes a power source 1090 (such as a battery) for supplying power to various components.
  • a power source 1090 such as a battery
  • the power source can be logically connected to the processor 1080 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system.
  • the mobile phone 1000 may further include a camera, a Bluetooth module, and the like.
  • An embodiment of the present application further provides a computer-readable storage medium.
  • a computer program product containing instructions that, when run on a computer, causes the computer to perform a process processing method.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM), which is used as external cache memory.
  • RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM dual data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous Link (Synchlink) DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Abstract

一种进程处理方法,包括:当检测到通信消息时,获取通信消息中包含的目标进程标识;其中,目标进程标识用于标示接收通信消息的服务进程;当目标进程标识对应的目标进程处于冻结状态,且目标进程的通信方式为异步通信时,将目标进程标识与进程列表中的进程标识进行比较;当进程列表中不存在与目标进程标识对应的进程标识时,将目标进程唤醒。

Description

进程处理方法、电子设备、计算机可读存储介质
相关申请的交叉引用
本申请要求于2018年08月01日提交中国专利局、申请号为2018108670936、发明名称为“进程处理方法和装置、电子设备、计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别是涉及一种进程处理方法、电子设备、计算机可读存储介质。
背景技术
电子设备在运行应用程序的时候,会建立不同的进程来实现不同的应用操作。进程可以被冻结,被冻结的进程不能运行,就不会占用电子设备的处理器资源。但由于进程没有被关闭,还是存在于电子设备中的,所以被冻结的进程还是会占用电子设备的内存、硬件等资源。被冻结的进程还可以被唤醒,唤醒之后的进程可以继续执行不同的应用操作。
发明内容
根据本申请的各种实施例,提供一种进程处理方法、电子设备、计算机可读存储介质。
一种进程处理方法,包括:
当检测到通信消息时,获取所述通信消息中包含的目标进程标识;其中,所述目标进程标识用于标示接收所述通信消息的服务进程;
当所述目标进程标识对应的目标进程处于冻结状态,且所述目标进程的通信方式为异步通信时,将所述目标进程标识与进程列表中的进程标识进行比较;及
当所述进程列表中不存在与所述目标进程标识对应的进程标识时,将所述目标进程唤醒。
一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
当检测到通信消息时,获取所述通信消息中包含的目标进程标识;其中,所述目标进程标识用于标示接收所述通信消息的服务进程;
当所述目标进程标识对应的目标进程处于冻结状态,且所述目标进程的通信方式为异步通信时,将所述目标进程标识与进程列表中的进程标识进行比较;及
当所述进程列表中不存在与所述目标进程标识对应的进程标识时,将所述目标进程唤醒。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如下操作:
当检测到通信消息时,获取所述通信消息中包含的目标进程标识;其中,所述目标进程标识用于标示接收所述通信消息的服务进程;
当所述目标进程标识对应的目标进程处于冻结状态,且所述目标进程的通信方式为异步通信时,将所述目标进程标识与进程列表中的进程标识进行比较;及
当所述进程列表中不存在与所述目标进程标识对应的进程标识时,将所述目标进程唤醒。
上述进程处理方法、电子设备、计算机可读存储介质,在检测到通信消息时,根据通信消息中的目标进程标识查找对应的目标进程。当该目标进程处于冻结状态,且目标进程 的通信方式为异步通信时,会将目标进程标识与进程列表中的进程标识进行比较。在进程列表中不存在与目标进程标识对应的进程标识时,才会将目标进程唤醒。这样可以通过通信方式和进程列表来过滤进程,防止进程被频繁地唤醒,从而降低电子设备的功耗。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为一个实施例中电子设备的内部结构示意图。
图2为一个实施例中进程处理方法的流程图。
图3为另一个实施例中进程处理方法的流程图。
图4为一个实施例中客户端进程与服务进程进行通信的示意图。
图5为又一个实施例中进程处理方法的流程图。
图6为又一个实施例中进程处理方法的流程图。
图7为一个实施例中进程处理流程的示意图。
图8为一个实施例的进程处理装置的结构框图。
图9为另一个实施例的进程处理装置的结构框图。
图10为与本申请实施例提供的电子设备相关的手机的部分结构的框图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本申请的范围的情况下,可以将第一客户端称为第二客户端,且类似地,可将第二客户端称为第一客户端。第一客户端和第二客户端两者都是客户端,但其不是同一客户端。
如图1所示,提供了一种电子设备的内部结构示意图。该电子设备包括通过系统总线连接的处理器、存储器和显示屏。其中,该处理器用于提供计算和控制能力,支撑整个电子设备的运行。存储器用于存储数据、程序、和/或指令代码等,存储器上存储至少一个计算机程序,该计算机程序可被处理器执行,以实现本申请实施例中提供的适用于电子设备的进程处理方法。存储器可包括磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random-Access-Memory,RAM)等。例如,在一个实施例中,存储器包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统和计算机程序。该计算机程序可被处理器所执行,以用于实现本申请各个实施例所提供的一种进程处理方法。内存储器为非易失性存储介质中的操作系统和计算机程序提供高速缓存的运行环境。显示屏可以是触摸屏,比如为电容屏或电子屏,用于显示前台进程对应的应用的界面信息,还可以被用于检测作用于该显示屏的触摸操作,生成相应的指令,比如进行前后台应用的切换指令等。
本领域技术人员可以理解,图1中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的电子设备的限定,具体的电子设备可以包 括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。如该电子设备还包括通过系统总线连接的网络接口,网络接口可以是以太网卡或无线网卡等,用于与外部的电子设备进行通信,比如可用于同服务器进行通信。
图2为一个实施例中进程处理方法的流程图。如图2所示,该进程处理方法包括操作202至操作206。其中:
操作202,当检测到通信消息时,获取通信消息中包含的目标进程标识;目标进程标识用于标示接收通信消息的服务进程。
应用程序(Application,APP)是电子设备中针对某种应用目的所撰写的软体,电子设备可以通过应用程序实现对用户的需求服务。例如,用户可以通过游戏类应用程序玩游戏,也可以通过视频类应用程序看视频,还可以通过音乐类应用程序播放音乐等。
一般地,应用程序的应用操作是由一个或多个进程(process)来共同完成,进程是计算机中的程序关于某数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位。同时,一个进程可以对应一个或多个线程,线程是程序中一个单一的顺序控制流程,是进程内一个相对独立的、可调度的执行单元。进程可包括前台进程和后台进程,前台进程即为在电子设备前台运行的进程,后台进程即为在电子设备后台运行的进程。
具体地,进程可以被冻结,处于冻结状态的进程并没有被关闭,只是暂时不运行。处于冻结状态的进程不占用处理器资源进行运行,但是仍然占用电子设备的内存和硬件等资源。电子设备的本地框架层中的资源优先级和限制管理模块可以对进程的状态进行标记,通过读取进程的状态标记就可以知道进程是否处于冻结状态。当进程被唤醒后,资源优先级和限制管理模块会相应地更改进程的状态标记,从而通过对应的状态标记来实现对进程冻结状态的管控。
进程之间可以相互发送通信消息,通信消息中会携带接收该通信消息的目标进程标识。例如,进程A向进程B发送通信消息,进程A在生成通信消息的时候,会将进程B的进程标识写入通信消息中,电子设备在检测到通信消息的时候,就可以根据进程标识查找接收该通信消息的进程B。
操作204,当目标进程标识对应的目标进程处于冻结状态,且目标进程的通信方式为异步通信时,将目标进程标识与进程列表中的进程标识进行比较。
具体的,进程间发送通信消息的时候,电子设备可以将通信消息发送到系统内核中,系统内核中驱动会读取通信消息中的目标进程标识,然后根据目标进程标识查找对应的目标进程。当检测到目标进程处于冻结状态时,电子设备需要将目标进程唤醒之后才能接收该通信消息。
在本申请实施例中,当接收通信消息的目标进程处于冻结状态时,电子设备会判断目标进程的通信方式是否为异步通信。当目标进程的通信方式为异步通信时,则电子设备允许该目标进程被唤醒并接收通信消息。具体的,电子设备可以获取目标进程的通信属性标签,通过通信属性标签判断目标进程为异步通信还是同步通信。
通信属性标签可以包括异步标签和同步标签,当通信属性标签为异步标签时,则电子设备可以认为目标进程的通信方式为异步通信;当通信属性标签为同步标签时,则电子设备认为目标进程通信方式为同步冻结通信。其中,同步通信就是不同进程间要按照顺序处理消息,一个进程处理完成之后下一个进程再继续处理。异步通信中不同进程间是彼此独立的,进程在等待处理某消息的过程中可以处理其他消息。
操作206,当进程列表中不存在与目标进程标识对应的进程标识时,将目标进程唤醒。
电子设备中存储这一张用于过滤目标进程的进程列表,进程列表中存储着一个或多个进程标识。当目标进程的通信方式为异步通信时,电子设备需要进一步将目标进程标识与进程列表中的进程标识进行比较,当进程列表中不存在与目标进程标识对应的进程标识时,将目标进程唤醒。
当目标进程被唤醒之后,目标进程可以继续运行,在运行过程中可以接收通信消息,并对通信消息进行相应地处理。被唤醒之后的目标进程,还可以能会被再次冻结。例如,电子设备可以在将目标进程唤醒之后,设置一个冻结时间,当到达冻结时间时,将该目标进程再次进行冻结。
上述实施例提供的进程处理方法,在检测到通信消息时,根据通信消息中的目标进程标识查找对应的目标进程。当该目标进程处于冻结状态,且目标进程的通信方式为异步通信时,会将目标进程标识与进程列表中的进程标识进行比较。在进程列表中不存在与目标进程标识对应的进程标识时,才会将目标进程唤醒。这样可以通过通信方式和进程列表来过滤进程,防止进程被频繁地唤醒,从而降低电子设备的功耗。
图3为另一个实施例中进程处理方法的流程图。如图3所示,该进程处理方法包括操作302至操作314。其中:
操作302,统计历史运行的异步服务进程在预设时段内的历史运行次数。
在一个实施例中,电子设备在运行过程中,会将进程的运行情况进行记录,根据记录的运行情况可以统计异步服务进程的历史运行次数,其中异步服务进程是指异步通信的服务进程。例如,电子设备可以在进程运行的过程中,记录进程开始运行的时刻、结束运行的时刻、进程标识、通信属性标签等信息。通过预设时段内记录的异步服务进程每次开始运行的时刻,电子设备可以统计得到异步服务进程的历史运行次数。例如,电子设备可以统计异步服务进程在12小时之内运行的次数,作为历史运行次数。
操作304,根据历史运行次数从历史运行的异步服务进程中获取目标异步服务进程。
历史运行次数越大,说明电子设备运行该异步服务进程的频率越高。电子设备可以根据历史运行次数从历史运行的异步服务进程中确定目标异步服务进程,然后将目标异步服务进程对应的进程标识写入进程列表中。
具体的,电子设备获取目标异步服务进程的操作可以包括:根据历史运行次数将历史运行的异步服务进程进行排序,将排序后的指定位数的异步服务进程作为目标异步服务进程。例如,电子设备可以将异步服务进程按照历史运行次数从高到低的顺序进行排列,然后获取排序前10位的异步服务进程作为目标异步服务进程。
在一个实施例中,获取目标异步服务进程的操作还可以包括:获取历史运行次数大于频率阈值的异步服务进程作为目标异步服务进程。例如,历史运行次数可以是统计的一天之内的运行次数,那么可以将一天之内运行次数大于1000次的异步服务进程作为目标异步服务进程。
历史运行次数较高的异步服务进程被认为是比较重要的异步服务进程,对于这些比较重要的异步服务进程,可以控制被唤醒的次数。进一步地,电子设备还可以根据异步服务进程在运行过程中所调用的函数来判断异步服务进程的重要性。则电子设备可以根据历史运行次数从历史运行的异步服务进程中获取目标异步服务进程,当目标异步服务进程在运行时调用预设函数时,则将目标异步服务进程的进程标识写入进程列表中。
例如,在Android(安卓)系统中,当目标异步服务进程在运行过程中调用的是Activity类函数、Service类函数时,则可以将该目标异步服务进程的进程标识写入进程列表中。当目标异步服务进程在运行过程中调用的是location类函数时,该目标异步服务进程的进程标识就不写入进程列表中。
操作306,将目标异步服务进程的进程标识写入进程列表中。
可以理解的是,电子设备在每次开机的时候,会对应用程序进行初始化。可以在应用程序进行初始化的时候,统计历史运行的异步服务进程的历史运行频率,并根据历史运行频率确定目标异步服务进程,然后将目标异步服务进程的进程标识写入进程列表中。
操作308,当检测到通信消息时,获取通信消息中包含的目标进程标识;目标进程标识 用于标示接收通信消息的服务进程。
在本申请提供的实施例中,系统中运行的进程可以通过binder通信机制进行通信。在binder通信机制中,定义了Server(服务进程)、Client(客户端进程),ServiceManager(服务管理器)以及Binder驱动等四个角色。服务进程会将进程标识以及对应的内存地址写入服务管理器中,当客户端进程需要与服务进程通信时,客户端进程首先会询问服务管理器,通过服务进程的进程标识获取到对应的内存地址。客户端进程收到服务进程的进程标识和内存地址之后,就可以与服务进程进行通信了。
客户端进程在与服务进程通信的时候,会首先将通信消息发送给内核空间的Binder驱动。通信消息中会携带接收该通信消息的服务进程的进程标识,Binder驱动会根据该进程标识查找对应的服务进程,然后将通信消息发送给对应的服务进程。
操作310,当目标进程标识对应的目标进程处于冻结状态,且目标进程的通信方式为异步通信时,将目标进程标识与进程列表中的进程标识进行比较。
操作312,当进程列表中不存在与目标进程标识对应的进程标识时,获取目标进程的冻结时长。
电子设备可以记录进程的冻结情况,每次目标进程的时候,记录冻结该进程的冻结时刻。每次唤醒进程的时候,记录该进程的唤醒时刻。当进程列表中不存在与目标进程标识对应的进程标识时,说明该目标进程被允许唤醒,则可以进一步地获取目标进程的冻结时长,根据冻结时长判断是否将目标进程唤醒。
电子设备可以获取检测到通信消息的目标时刻,然后获取距离目标时刻最近的冻结时刻,计算冻结时刻到目标时刻的时间间隔得到冻结时长。例如,电子设备记录的冻结时刻为:……、“1月2日12:12:11”、“1月2日12:13:04”、“1月2日12:15:25”。当电子设备检测到通信消息的目标时刻为“1月2日12:16:02”,则统计的冻结时长就为“1月2日12:15:25”到“1月2日12:16:02”的时长,即37秒。
操作314,当冻结时长超过第一时长阈值时,将目标进程唤醒。
为了防止目标进程被频繁地唤醒,本申请实施例中根据进程冻结的时长来判断是否将进程唤醒。电子设备可以在获取到目标进程的冻结时长之后,判断冻结时长是否超过第一时长阈值。当冻结时长超过第一时长阈值时,则电子设备将目标进程唤醒;当冻结时长小于第一时长阈值时,则该目标进程被禁止唤醒。
图4为一个实施例中客户端进程与服务进程进行通信的示意图。如图4所示,客户端进程402向服务进程408发送通信消息时,会首先将通信消息发送到Linux内核404中,Linux内核404接收到通信消息后,获取通信消息中包含的目标进程标识,然后根据目标进程标识查找服务进程408。若Linux内核404检测到服务进程408处于冻结状态,且服务进程408的通信方式为异步通信,则会将目标进程标识上传到Native层406。Native层406中存储着进程列表,会将目标进程标识与进程列表中的进程标识进行比较,若进程列表中不存在目标进程标识对应的进程标识,就会唤醒服务进程408。
在一个实施例中,将目标进程唤醒之后,目标进程就可以接收并处理通信消息。如图5所示,目标进程被唤醒之后,上述方法还可以包括:
操作502,获取电子设备的资源总占用率。
资源是指电子设备在处理应用事件时所必须用到的软件或硬件资源,比如电子设备的CPU(Central Processing Unit,中央处理器)、内存(Memory)、硬件、网络资源、IO(Input-Output,输入输出)等。资源占用率是指电子设备的资源被占用的比例,一般是指被占用的资源与全部资源的比例,可以通过百分比的形式进行表示。例如,设备的总内存有128GB,已经被占用的内存有56GB,那么该设备的资源占用率就可以表示为内存占用率,得到的内存占用率即为43.75%。
操作504,当资源总占用率超过第一占用率阈值时,控制被唤醒的目标进程进入资源 限制状态;其中,处于资源限制状态的进程在运行时对电子设备的资源占用率小于第二占用率阈值,第一占用率阈值大于第二占用率阈值。
可以理解的是,资源限制状态是指对进程在运行时使用的电子设备的资源进行限制的状态。当资源总占用率超过第一占用率阈值时,则认为电子设备的剩余资源比较少,目标进程会影响电子设备的正常运行,那么就可以控制被唤醒的目标进程进入资源限制状态。目标进程处于资源限制状态时,运行过程中的资源占用率不能超过第二占用率阈值,这样可以控制目标进程对电子设备资源的使用,从而节省电子设备的资源。例如,限制目标进程在运行时的CPU占用率不能超过10%。
具体地,电子设备还可以根据目标进程的优先级来控制对资源的占用情况,预先建立目标进程的优先级与资源限制级别的对应关系,然后根据目标进程的优先级来控制进入资源限制状态的资源限制级别。目标进程的优先级是指目标进程的重要程度,可以预先进行设置。资源限制级别是指对进程使用的资源进行限制的程度。电子设备可以获取目标进程对应的优先级,根据优先级获取对应的资源限制级别;控制被唤醒的目标进程进入资源限制级别对应的资源限制状态。
在本申请提供的其他实施例中,电子设备还可以建立资源总占用率和资源限制级别的对应关系。当资源总占用率超过第一占用率阈值时,根据资源总占用率获取资源限制级别,然后控制被唤醒的目标进程进入资源限制级别对应的资源限制状态。例如,第一占用率阈值为50%,则当资源总占用率超过50%时,将资源总占用率划分为50%~60%、60%~80%、80%~100%等三个占用级别,然后分别对应轻度资源限制级别、普通资源限制级别和深度资源限制级别等三个等级,电子设备根据资源总占用率可以获取对应的资源限制级别。可以理解的是,电子设备还可以结合资源总占用率和目标进程的优先级,来获取资源限制级别,在此不做限定。
在一个实施例中,如图6所示,将目标进程唤醒之后,还可以包括:
操作602,从目标进程被唤醒的时刻开始计时。
当目标进程被唤醒时,电子设备启动计时器,然后通过计时器开始计时。当同时存在多条目标进程被唤醒的情况时,电子设备可以对每条目标进程可以定义一个对应的计时器,则每条目标进程都可以通过对应的计时器来进行计时。具体的,电子设备可以建立目标进程的进程标识和计时器的计时标识之间的对应关系,这样在目标进程被唤醒后,可以通过进程标识对应的计时标识查找并启动计时器开始计时。
以Android系统为例,系统可以预先定义一个计时器,当检测到目标进程被唤醒时,电子设备可以根据预先建立的对应关系查找进程标识对应的计时器,并通过timer.setBase(SystemClock.elapsedRealtime()将计时器清零,然后通过timer.start()函数启动计时器,开始计时。可以理解的是,本申请中以Android操作系统为例对进程处理方法进行说明,但是本申请的进程处理方法并不仅限于在Android系统中实现,还可以应用在IOS(IPhone Operating System)、塞班、Windows、MAC OS(Macintosh Operating System)等操作系统中。
操作604,当计时时长超过第二时长阈值时,冻结目标进程。
目标进程被唤醒的时刻开始计时,计时时长表示从目标进程被唤醒的时刻到当前时刻的时长。电子设备可以预先定义第二时长阈值,当计时时长超过第二时长阈值时,将该目标进程重新进行冻结。第二时长阈值一般会设置为一个比较小的阈值,这样避免目标进程一直处于运行状态,而占用电子设备的资源。可以理解的是,不同的目标进程可以使用相同的第二时长阈值,也可以使用不同的第二时长阈值,在此不做限定。
在一个实施例中,电子设备可以根据目标进程接收通信消息的频率,来设置第二时长阈值。具体的,电子设备获取被唤醒的目标进程接收通信消息的接收频率,并根据接收频率获取对应的第二时长阈值。例如,在接收频率较低的时候,将第二时长阈值设置为一 个较小的值,就可以在目标进程比较空闲的时候,自动将目标进程进行冻结,避免电子设备的资源消耗。
图7为一个实施例中进程处理流程的示意图。如图7所示,当电子设备检测到发送至处于冻结状态的目标进程的通信消息时,判断该目标进程是否为异步通信。当是时,则将该目标进程唤醒,并控制唤醒的进程进入资源限制状态。在唤醒时长超过第二时长阈值时,电子设备冻结该目标进程。目标进程处于冻结状态时,目标进程不运行,目标进程对应的资源占用率不会产生变化。处于唤醒状态且在资源限制状态中时,目标进程可以运行,但是运行过程中只能占用设备的部分资源。
上述实施例提供的进程处理方法,在检测到通信消息时,根据通信消息中的目标进程标识查找对应的目标进程。当该目标进程处于冻结状态,且目标进程的通信方式为异步通信时,会将目标进程标识与进程列表中的进程标识进行比较。在进程列表中不存在与目标进程标识对应的进程标识时,判断目标进程的冻结时长是否超过第一时长阈值。在目标进程的冻结时长超过第一时长阈值时,才会将目标进程唤醒。这样可以通过通信方式和进程列表来过滤进程,同时控制进程的冻结时长,防止进程被频繁地唤醒,从而降低电子设备的功耗。
应该理解的是,虽然图2、3、5、6的流程图中的各个操作按照箭头的指示依次显示,但是这些操作并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些操作的执行并没有严格的顺序限制,这些操作可以以其它的顺序执行。而且,图2、3、5、6中的至少一部分操作可以包括多个子操作或者多个阶段,这些子操作或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子操作或者阶段的执行顺序也不必然是依次进行,而是可以与其它操作或者其它操作的子操作或者阶段的至少一部分轮流或者交替地执行。
图8为一个实施例的进程处理装置的结构框图。如图8所示,该进程处理装置800包括消息检测模块802、标识比较模块804和进程唤醒模块806。其中:
消息检测模块802,用于当检测到通信消息时,获取所述通信消息中包含的目标进程标识;所述目标进程标识用于标示接收所述通信消息的服务进程。
标识比较模块804,用于当所述目标进程标识对应的目标进程处于冻结状态,且所述目标进程的通信方式为异步通信时,将所述目标进程标识与进程列表中的进程标识进行比较。
进程唤醒模块806,用于当所述进程列表中不存在与所述目标进程标识对应的进程标识时,将所述目标进程唤醒。
上述实施例提供的进程处理装置,在检测到通信消息时,根据通信消息中的目标进程标识查找对应的目标进程。当该目标进程处于冻结状态,且目标进程的通信方式为异步通信时,会将目标进程标识与进程列表中的进程标识进行比较。在进程列表中不存在与目标进程标识对应的进程标识时,才会将目标进程唤醒。这样可以通过通信方式和进程列表来过滤进程,防止进程被频繁地唤醒,从而降低电子设备的功耗。
图9为另一个实施例的进程处理装置的结构框图。如图9所示,该进程处理装置900包括列表生成模块902、消息检测模块904、标识比较模块906、进程唤醒模块908、资源限制模块910和进程冻结模块912。其中:
列表生成模块902,用于统计历史运行的异步服务进程在预设时段内的历史运行次数;根据所述历史运行次数从所述历史运行的异步服务进程中获取目标异步服务进程;将所述目标异步服务进程的进程标识写入进程列表中。
消息检测模块904,用于当检测到通信消息时,获取所述通信消息中包含的目标进程 标识;所述目标进程标识用于标示接收所述通信消息的服务进程。
标识比较模块906,用于当所述目标进程标识对应的目标进程处于冻结状态,且所述目标进程的通信方式为异步通信时,将所述目标进程标识与进程列表中的进程标识进行比较。
进程唤醒模块908,用于当所述进程列表中不存在与所述目标进程标识对应的进程标识时,将所述目标进程唤醒。
资源限制模块910,用于获取电子设备的资源总占用率;当所述资源总占用率超过第一占用率阈值时,控制被唤醒的所述目标进程进入资源限制状态;其中,处于所述资源限制状态的进程在运行时对电子设备的资源占用率小于第二占用率阈值,所述第一占用率阈值大于第二占用率阈值。
进程冻结模块912,用于从所述目标进程被唤醒的时刻开始计时;当计时时长超过第二时长阈值时,冻结所述目标进程。
上述实施例提供的进程处理装置,在检测到通信消息时,根据通信消息中的目标进程标识查找对应的目标进程。当该目标进程处于冻结状态,且目标进程的通信方式为异步通信时,会将目标进程标识与进程列表中的进程标识进行比较。在进程列表中不存在与目标进程标识对应的进程标识时,才会将目标进程唤醒。这样可以通过通信方式和进程列表来过滤进程,防止进程被频繁地唤醒,从而降低电子设备的功耗。
在一个实施例中,列表生成模块902还用于根据所述历史运行次数将所述历史运行的异步服务进程进行排序,将排序后的指定位数的异步服务进程作为目标异步服务进程;或获取所述历史运行次数大于次数阈值的异步服务进程作为目标异步服务进程。
在一个实施例中,进程唤醒模块908还用于获取所述目标进程的冻结时长;当所述冻结时长超过第一时长阈值时,将所述目标进程唤醒。
在一个实施例中,进程冻结模块912还用于获取被唤醒的目标进程接收通信消息的接收频率,并根据所述接收频率获取对应的第二时长阈值。
上述进程处理装置中各个模块的划分仅用于举例说明,在其他实施例中,可将进程处理装置按照需要划分为不同的模块,以完成上述进程处理装置的全部或部分功能。
关于进程处理装置的具体限定可以参见上文中对于进程处理方法的限定,在此不再赘述。上述进程处理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
本申请实施例中提供的进程处理装置中的各个模块的实现可为计算机程序的形式。该计算机程序可在终端或服务器上运行。该计算机程序构成的程序模块可存储在终端或服务器的存储器上。该计算机程序被处理器执行时,实现本申请实施例中所描述方法的操作。
本申请实施例还提供了一种电子设备。如图10所示,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请实施例方法部分。该电子设备可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑、穿戴式设备等任意终端设备,以电子设备为手机为例:
图10为与本申请实施例提供的电子设备相关的手机的部分结构的框图。参考图10,手机包括:射频(Radio Frequency,RF)电路1010、存储器1020、输入单元1030、显示单元1040、传感器1050、音频电路1060、无线保真(wireless fidelity,WiFi)模块1070、处理器1080、以及电源1090等部件。本领域技术人员可以理解,图10所示的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
其中,RF电路1010可用于收发信息或通话过程中,信号的接收和发送,可将基站的下行信息接收后,给处理器1080处理;也可以将上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路1010还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等。
存储器1020可用于存储软件程序以及模块,处理器1080通过运行存储在存储器1020的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器1020可主要包括程序存储区和数据存储区,其中,程序存储区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能的应用程序、图像播放功能的应用程序等)等;数据存储区可存储根据手机的使用所创建的数据(比如音频数据、通讯录等)等。此外,存储器1020可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
输入单元1030可用于接收输入的数字或字符信息,以及产生与手机1000的用户设置以及功能控制有关的键信号输入。具体地,输入单元1030可包括触控面板1031以及其他输入设备1032。触控面板1031,也可称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板1031上或在触控面板1031附近的操作),并根据预先设定的程式驱动相应的连接装置。在一个实施例中,触控面板1031可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器1080,并能接收处理器1080发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板1031。除了触控面板1031,输入单元1030还可以包括其他输入设备1032。具体地,其他输入设备1032可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)等中的一种或多种。
显示单元1040可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元1040可包括显示面板1041。在一个实施例中,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板1041。在一个实施例中,触控面板1031可覆盖显示面板1041,当触控面板1031检测到在其上或附近的触摸操作后,传送给处理器1080以确定触摸事件的类型,随后处理器1080根据触摸事件的类型在显示面板1041上提供相应的视觉输出。虽然在图10中,触控面板1031与显示面板1041是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板1031与显示面板1041集成而实现手机的输入和输出功能。
手机1000还可包括至少一种传感器1050,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板1041的亮度,接近传感器可在手机移动到耳边时,关闭显示面板1041和/或背光。运动传感器可包括加速度传感器,通过加速度传感器可检测各个方向上加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换)、振动识别相关功能(比如计步器、敲击)等;此外,手机还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器等。
音频电路1060、扬声器1061和传声器1062可提供用户与手机之间的音频接口。音 频电路1060可将接收到的音频数据转换后的电信号,传输到扬声器1061,由扬声器1061转换为声音信号输出;另一方面,传声器1062将收集的声音信号转换为电信号,由音频电路1060接收后转换为音频数据,再将音频数据输出处理器1080处理后,经RF电路1010可以发送给另一手机,或者将音频数据输出至存储器1020以便后续处理。
WiFi属于短距离无线传输技术,手机通过WiFi模块1070可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图10示出了WiFi模块1070,但是可以理解的是,其并不属于手机1000的必须构成,可以根据需要而省略。
处理器1080是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器1020内的软件程序和/或模块,以及调用存储在存储器1020内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。在一个实施例中,处理器1080可包括一个或多个处理单元。在一个实施例中,处理器1080可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等;调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1080中。
手机1000还包括给各个部件供电的电源1090(比如电池),优选的,电源可以通过电源管理系统与处理器1080逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
在一个实施例中,手机1000还可以包括摄像头、蓝牙模块等。
在本申请实施例中,该电子设备所包括的处理器1080执行存储在存储器上的计算机程序时实现进程处理方法的操作。
本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当所述计算机可执行指令被一个或多个处理器执行时,使得所述处理器执行进程处理方法的操作。
一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行进程处理方法。
本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种进程处理方法,包括:
    当检测到通信消息时,获取所述通信消息中包含的目标进程标识;其中,所述目标进程标识用于标示接收所述通信消息的服务进程;
    当所述目标进程标识对应的目标进程处于冻结状态,且所述目标进程的通信方式为异步通信时,将所述目标进程标识与进程列表中的进程标识进行比较;及
    当所述进程列表中不存在与所述目标进程标识对应的进程标识时,将所述目标进程唤醒。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    统计历史运行的异步服务进程在预设时段内的历史运行次数;
    根据所述历史运行次数从所述历史运行的异步服务进程中获取目标异步服务进程;及将所述目标异步服务进程的进程标识写入进程列表中。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述历史运行次数从所述历史运行的异步服务进程中获取目标异步服务进程,包括:
    根据所述历史运行次数将所述历史运行的异步服务进程进行排序,将排序后的指定位数的异步服务进程作为目标异步服务进程。
  4. 根据权利要求2所述的方法,其特征在于,所述根据所述历史运行次数从所述历史运行的异步服务进程中获取目标异步服务进程,包括:
    获取所述历史运行次数大于次数阈值的异步服务进程作为目标异步服务进程。
  5. 根据权利要求2所述的方法,其特征在于,所述将所述目标异步服务进程的进程标识写入进程列表中,还包括:
    判断所述目标异步服务进程在运行时是否调用预设函数;及
    当所述目标异步服务进行在运行时调用所述预设函数时,则执行所述将所述目标异步服务进程的进程标识写入进程列表中的操作。
  6. 根据权利要求1所述的方法,其特征在于,所述将所述目标进程唤醒,包括:
    获取所述目标进程的冻结时长;及
    当所述冻结时长超过第一时长阈值时,将所述目标进程唤醒。
  7. 根据权利要求1所述的方法,其特征在于,所述将所述目标进程唤醒之后,还包括:
    获取电子设备的资源总占用率;及
    当所述资源总占用率超过第一占用率阈值时,控制被唤醒的所述目标进程进入资源限制状态;
    其中,处于所述资源限制状态的进程在运行时对电子设备的资源占用率小于第二占用率阈值,所述第一占用率阈值大于第二占用率阈值。
  8. 根据权利要求7所述的方法,其特征在,所述当所述资源总占用率超过第一占用率阈值时,控制被唤醒的所述目标进程进入资源限制状态,包括:
    当所述资源总占用率超过第一占用率阈值时,获取所述目标进程的优先级;
    根据所述目标进程的优先级获取对应的资源限制级别;及
    控制被唤醒的所述目标进行进程所述资源限制级别对应的资源限制状态。
  9. 根据权利要求7所述的方法,其特征在于,所述当所述资源总占用率超过第一占用率阈值时,控制被唤醒的所述目标进程进入资源限制状态,包括:
    当所述资源总占用率超过第一占用率阈值时,根据所述资源占用率获取对应的资源限制级别;及
    控制被唤醒的所述目标进程进入所述资源限制级别对应的资源限制状态。
  10. 根据权利要求1至98中任一项所述的方法,其特征在于,所述将所述目标进程 唤醒之后,还包括:
    从所述目标进程被唤醒的时刻开始计时;及
    当计时时长超过第二时长阈值时,冻结所述目标进程。
  11. 根据权利要求10所述的方法,其特征在于,所述当计时时长超过第二时长阈值时,冻结所述目标进程之前,还包括:
    获取被唤醒的目标进程接收通信消息的接收频率,并根据所述接收频率获取对应的第二时长阈值。
  12. 一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
    当检测到通信消息时,获取所述通信消息中包含的目标进程标识;其中,所述目标进程标识用于标示接收所述通信消息的服务进程;
    当所述目标进程标识对应的目标进程处于冻结状态,且所述目标进程的通信方式为异步通信时,将所述目标进程标识与进程列表中的进程标识进行比较;及
    当所述进程列表中不存在与所述目标进程标识对应的进程标识时,将所述目标进程唤醒。
  13. 根据权利要求12所述的电子设备,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器还执行如下操作:
    统计历史运行的异步服务进程在预设时段内的历史运行次数;
    根据所述历史运行次数从所述历史运行的异步服务进程中获取目标异步服务进程;及
    将所述目标异步服务进程的进程标识写入进程列表中。
  14. 根据权利要求13所述的电子设备,其特征在于,所述处理器执行所述根据所述历史运行次数从所述历史运行的异步服务进程中获取目标异步服务进程时,还执行如下操作:
    根据所述历史运行次数将所述历史运行的异步服务进程进行排序,将排序后的指定位数的异步服务进程作为目标异步服务进程;或
    获取所述历史运行次数大于次数阈值的异步服务进程作为目标异步服务进程。
  15. 根据权利要求11所述的电子设备,其特征在于,所述处理器执行所述将所述目标进程唤醒时,还执行如下操作:
    获取所述目标进程的冻结时长;及
    当所述冻结时长超过第一时长阈值时,将所述目标进程唤醒。
  16. 根据权利要求11所述的电子设备,其特征在于,所述处理器执行所述将所述目标进程唤醒之后,还执行如下操作:
    获取电子设备的资源总占用率;及
    当所述资源总占用率超过第一占用率阈值时,控制被唤醒的所述目标进程进入资源限制状态;
    其中,处于所述资源限制状态的进程在运行时对电子设备的资源占用率小于第二占用率阈值,所述第一占用率阈值大于第二占用率阈值。
  17. 根据权利要求16所述的电子设备,其特征在于,所述处理器执行所述当所述资源总占用率超过第一占用率阈值时,控制被唤醒的所述目标进程进入资源限制状态时,还执行如下操作:
    当所述资源总占用率超过第一占用率阈值时,获取所述目标进程的优先级;
    根据所述目标进程的优先级获取对应的资源限制级别;及
    控制被唤醒的所述目标进行进程所述资源限制级别对应的资源限制状态。
  18. 根据权利要1至17中任一项所述的电子设备,其特征在于,所述处理器执行所述将所述目标进程唤醒之后,还执行如下操作:
    从所述目标进程被唤醒的时刻开始计时;及
    当计时时长超过第二时长阈值时,冻结所述目标进程。
  19. 根据权利要求18所述的电子设备,其特征在于,所述处理器执行所述当计时时长超过第二时长阈值时,冻结所述目标进程之前,还执行如下操作:
    获取被唤醒的目标进程接收通信消息的接收频率,并根据所述接收频率获取对应的第二时长阈值。
  20. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至11中任一项所述的方法的操作。
PCT/CN2019/092879 2018-08-01 2019-06-26 进程处理方法、电子设备、计算机可读存储介质 WO2020024732A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810867093.6 2018-08-01
CN201810867093.6A CN109144232B (zh) 2018-08-01 2018-08-01 进程处理方法和装置、电子设备、计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2020024732A1 true WO2020024732A1 (zh) 2020-02-06

Family

ID=64798811

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/092879 WO2020024732A1 (zh) 2018-08-01 2019-06-26 进程处理方法、电子设备、计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN109144232B (zh)
WO (1) WO2020024732A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416541A (zh) * 2020-08-13 2021-02-26 上海哔哩哔哩科技有限公司 任务调度的方法和系统

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144232B (zh) * 2018-08-01 2020-12-01 Oppo广东移动通信有限公司 进程处理方法和装置、电子设备、计算机可读存储介质
EP3907608A4 (en) * 2019-02-02 2022-03-02 Huawei Technologies Co., Ltd. APPLICATION MANAGEMENT METHOD, DEVICE AND INSTALLATION
CN111897586A (zh) * 2019-05-06 2020-11-06 中兴通讯股份有限公司 应用状态控制方法、装置、终端及计算机可读存储介质
CN110687998A (zh) * 2019-09-18 2020-01-14 华为技术有限公司 一种应用管理方法及装置
CN111651763B (zh) * 2020-05-26 2023-08-22 珠海豹趣科技有限公司 进程监控方法、装置、电子设备及存储介质
CN114579325A (zh) * 2020-11-30 2022-06-03 华为技术有限公司 进程间通信方法和装置
CN113568748A (zh) * 2021-07-27 2021-10-29 Oppo广东移动通信有限公司 一种应用进程处理方法、装置、存储介质及电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106681768A (zh) * 2016-12-29 2017-05-17 努比亚技术有限公司 一种进程控制方法及电子设备
CN106681722A (zh) * 2016-12-27 2017-05-17 努比亚技术有限公司 一种进程处理方法及电子设备
CN106844029A (zh) * 2017-01-19 2017-06-13 努比亚技术有限公司 一种自管理的Android进程冻结和解冻的装置及方法
CN107066320A (zh) * 2017-01-19 2017-08-18 努比亚技术有限公司 一种Android进程冻结和解冻的装置及方法
CN107846725A (zh) * 2017-10-27 2018-03-27 努比亚技术有限公司 一种通知消息的处理方法、终端及存储介质
CN109144232A (zh) * 2018-08-01 2019-01-04 Oppo广东移动通信有限公司 进程处理方法和装置、电子设备、计算机可读存储介质

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9423866B2 (en) * 2014-07-16 2016-08-23 Eta Compute, Inc. Asynchronous processor that adjusts a respective operating voltage for causing a task to consume substantially all of a respective allocated time interval for the task
US10102889B2 (en) * 2012-09-10 2018-10-16 Texas Instruments Incorporated Processing device with nonvolatile logic array backup
CN106020415B (zh) * 2016-05-09 2019-01-29 深圳市万普拉斯科技有限公司 智能设备待机状态下的应用控制方法及装置
CN106502773B (zh) * 2016-10-09 2019-12-03 武汉斗鱼网络科技有限公司 具有同步回调信息功能的数据异步处理方法及模块
CN106648704A (zh) * 2017-01-05 2017-05-10 广东欧珀移动通信有限公司 一种进程管理的方法、装置及移动终端
CN107203377B (zh) * 2017-04-24 2021-03-02 维沃移动通信有限公司 一种移动终端的唤醒方法和移动终端
CN107526640B (zh) * 2017-08-17 2020-03-27 Oppo广东移动通信有限公司 资源管理方法、装置、移动终端及计算机可读存储介质
CN108021220A (zh) * 2017-10-25 2018-05-11 努比亚技术有限公司 一种终端应用控制方法、终端及计算机可读存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106681722A (zh) * 2016-12-27 2017-05-17 努比亚技术有限公司 一种进程处理方法及电子设备
CN106681768A (zh) * 2016-12-29 2017-05-17 努比亚技术有限公司 一种进程控制方法及电子设备
CN106844029A (zh) * 2017-01-19 2017-06-13 努比亚技术有限公司 一种自管理的Android进程冻结和解冻的装置及方法
CN107066320A (zh) * 2017-01-19 2017-08-18 努比亚技术有限公司 一种Android进程冻结和解冻的装置及方法
CN107846725A (zh) * 2017-10-27 2018-03-27 努比亚技术有限公司 一种通知消息的处理方法、终端及存储介质
CN109144232A (zh) * 2018-08-01 2019-01-04 Oppo广东移动通信有限公司 进程处理方法和装置、电子设备、计算机可读存储介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416541A (zh) * 2020-08-13 2021-02-26 上海哔哩哔哩科技有限公司 任务调度的方法和系统

Also Published As

Publication number Publication date
CN109144232A (zh) 2019-01-04
CN109144232B (zh) 2020-12-01

Similar Documents

Publication Publication Date Title
WO2020024732A1 (zh) 进程处理方法、电子设备、计算机可读存储介质
WO2019128546A1 (zh) 应用程序处理方法、电子设备、计算机可读存储介质
WO2020093208A1 (zh) 应用程序处理方法和装置、计算机设备、计算机可读存储介质
WO2019128540A1 (zh) 资源管理方法、移动终端及计算机可读存储介质
CN110018901B (zh) 内存回收方法、装置、计算机设备和计算机可读存储介质
CN106775685B (zh) 唤醒锁释放方法和装置、移动终端
CN108541013B (zh) 信息处理方法、装置、移动终端和计算机可读存储介质
CN110032266B (zh) 信息处理方法、装置、计算机设备和计算机可读存储介质
CN107577508B (zh) 应用程序处理方法、装置、可读存储介质和移动终端
CN107045383B (zh) 通过监视移动应用的活动来延长电池寿命的系统和方法
WO2019128537A1 (zh) 应用冻结方法、计算机设备和计算机可读存储介质
WO2019128573A1 (zh) 信息处理方法、装置、计算机设备和计算机可读存储介质
CN106990826B (zh) 用于通过监视设备活动来延长电池寿命的系统和方法
WO2019128574A1 (zh) 信息处理方法、装置、计算机设备和计算机可读存储介质
WO2019128586A1 (zh) 应用程序处理方法、电子设备、计算机可读存储介质
CN109992380B (zh) 应用程序处理方法和装置、电子设备、计算机可读存储介质
WO2019128569A1 (zh) 应用程序冻结方法、装置、存储介质和终端
CN110032397B (zh) 应用处理方法和装置、电子设备、计算机可读存储介质
CN109992323B (zh) 进程处理方法和装置、电子设备、计算机可读存储介质
WO2019128553A1 (zh) 应用程序处理方法、电子设备、计算机可读存储介质
CN109511139B (zh) Wifi控制方法、装置、移动设备、计算机可读存储介质
CN109992360B (zh) 进程处理方法和装置、电子设备、计算机可读存储介质
CN108646909B (zh) 信息处理方法、装置、移动终端和计算机可读存储介质
CN110046033B (zh) 应用程序处理方法和装置、电子设备、计算机可读存储介质
CN109992369B (zh) 应用程序处理方法和装置、电子设备、计算机可读存储介质

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: 19844699

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: 19844699

Country of ref document: EP

Kind code of ref document: A1