WO2024099017A1 - Process management method, and electronic device and storage medium - Google Patents

Process management method, and electronic device and storage medium Download PDF

Info

Publication number
WO2024099017A1
WO2024099017A1 PCT/CN2023/123873 CN2023123873W WO2024099017A1 WO 2024099017 A1 WO2024099017 A1 WO 2024099017A1 CN 2023123873 W CN2023123873 W CN 2023123873W WO 2024099017 A1 WO2024099017 A1 WO 2024099017A1
Authority
WO
WIPO (PCT)
Prior art keywords
dormant
awakened
wake
request
management method
Prior art date
Application number
PCT/CN2023/123873
Other languages
French (fr)
Chinese (zh)
Inventor
吴汝煜
Original Assignee
蔚来移动科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 蔚来移动科技有限公司 filed Critical 蔚来移动科技有限公司
Publication of WO2024099017A1 publication Critical patent/WO2024099017A1/en

Links

Definitions

  • the present invention relates to the field of computer technology, and in particular to a process management method, electronic equipment and storage medium.
  • Android system performance and power consumption optimization are the key points to improve user experience, and process hibernation technology is a means of background process control.
  • Putting background processes into hibernation solves the problem of background processes occupying central processing unit (CPU) resources, thereby improving mobile phone performance and reducing power consumption.
  • CPU central processing unit
  • Binder communication is one of the main means of inter-process communication. Sometimes it is necessary to wake up the dormant process through Binder communication, but frequent wake-ups between background processes will affect the overall hibernation effect.
  • the present invention is proposed to provide a process management method, electronic device and storage medium to solve or at least partially solve the technical problem that the system background process is frequently awakened after hibernation and affects the hibernation effect.
  • a process management method which is applied to a system framework layer, and the method comprises:
  • the importance level of the process that initiates the wake-up request belongs to the first importance level, waking up the dormant process corresponding to the wake-up request for the first time;
  • the dormant process When the dormant process is awakened and remains in the awakened state for a first preset time period, it is determined whether the awakened dormant process can be perceived by the user, and a corresponding operation is performed based on the determination result.
  • determining whether the awakened dormant process can be perceived by the user, and performing corresponding operations based on the determination result include:
  • the awakened dormant process If the awakened dormant process can be perceived by the user, the awakened dormant process remains in the awakened state;
  • the awakened dormant process is controlled to enter the dormant state again.
  • the step of determining the importance level of the process that initiates the wake-up request includes:
  • the process that initiates the wake-up request is at least one of a system process, a foreground visible process, a foreground visible associated process, and a system-aware process
  • the importance level belongs to the first importance level.
  • the determining whether the awakened dormant process can be perceived by the user comprises:
  • the awakened dormant process is at least one of the foreground visible process, the background using process, the foreground process dependent process, and the process communicating with other processes in the background, it is determined that the awakened dormant process can be perceived by the user.
  • the method further includes:
  • the dormant process remains in the dormant state for a second preset time period
  • the dormant process When the dormant process is awakened and remains in the awakened state for a third preset time, it is determined whether the awakened dormant process can be perceived by the user, and corresponding operations are performed based on the determination result. Should be operated.
  • determining whether the awakened dormant process can be perceived by the user, and performing corresponding operations based on the determination result include:
  • the awakened dormant process If the awakened dormant process can be perceived by the user, the awakened dormant process remains in the awakened state;
  • the awakened dormant process is controlled to enter the dormant state again.
  • the method further includes:
  • the wake-up request sent by the process initiating the wake-up request and receiving feedback from the operating system Kernel includes:
  • the operating system Kernel When the operating system Kernel receives the wake-up request sent by the process that initiates the wake-up request, the operating system Kernel receives the wake-up request fed back by the operating system Kernel via the local framework layer and the local call layer.
  • an electronic device which includes a processor and a storage device, wherein the storage device is suitable for storing multiple program codes, and the program codes are suitable for being loaded and run by the processor to execute the process management method described in any one of the technical solutions of the above-mentioned process management method.
  • a computer-readable storage medium which stores a plurality of program codes, wherein the program codes are suitable for being loaded and run by a processor to execute the process management method described in any one of the technical solutions of the above-mentioned process management method.
  • the system framework layer responds to the received The wake-up request of the dormant process determines the importance level of the process that initiates the wake-up request. If the process that initiates the wake-up request belongs to the first importance level, the dormant process corresponding to the wake-up request is awakened for the first time. After the dormant process is awakened and remains awake for the first preset time, it is determined whether the awakened dormant process can be perceived by the user, and the corresponding operation is performed based on the judgment result.
  • the dormancy effect of the system background process is further guaranteed, memory is released, and then system performance is improved, power consumption is reduced, and the user experience is improved.
  • FIG1 is a schematic flow chart of a process management method according to an embodiment of the present invention.
  • FIG2 is a schematic flow chart of the main steps of a process management method according to an embodiment of the present invention.
  • FIG. 3 is a schematic flow chart of a process management method according to another embodiment of the present invention.
  • FIG. 4 is a schematic flow chart of the main steps of a process management method according to another embodiment of the present invention.
  • FIG. 5 is a schematic flow chart of the main steps of a process management method according to another embodiment of the present invention.
  • FIG. 6 is a schematic block diagram of an electronic device according to an embodiment of the present invention.
  • module or “processor” may include hardware, software or a combination of both.
  • a module may include hardware circuits, various suitable sensors, Communication port, memory, may also include software parts, such as program code, or may be a combination of software and hardware.
  • the processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor or any other suitable processor.
  • the processor has data and/or signal processing functions.
  • the processor may be implemented in software, hardware or a combination of the two.
  • Non-temporary computer-readable storage media include any suitable medium that can store program code, such as a disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, etc.
  • a and/or B means all possible combinations of A and B, such as just A, just B or A and B.
  • the term “at least one A or B” or “at least one of A and B” has a similar meaning to “A and/or B” and may include just A, just B or A and B.
  • the singular terms “one” and “the” may also include plural forms.
  • Binder communication is one of the main means of inter-process communication.
  • the dormant process needs to be awakened through Binder communication, but the frequent awakening between background processes will affect the overall dormancy effect.
  • the present invention further ensures the dormancy effect of the system background process by judging the importance level of the process that initiates the wake-up request and whether the awakened dormant process can be perceived by the user, and performing corresponding operations based on the judgment result.
  • FIG1 is a flow chart of a process management method according to an embodiment of the present invention.
  • the process initiating the wake-up request first sends a wake-up request to the operating system Kernel, and after the operating system Kernel receives the wake-up request, it sends a wake-up request to the system framework layer, and the system framework layer performs corresponding operations after receiving the wake-up request to the dormant process.
  • FIG 2 is a schematic flow chart of the main steps of a process management method according to an embodiment of the present invention.
  • the process management method in the embodiment of the present invention is applied to the system framework layer, and after the system framework layer receives a wake-up request for a dormant process, it executes the following steps S201 to S203.
  • Step S201 In response to a received wake-up request for a dormant process, determining the importance level of the process that initiates the wake-up request.
  • Step S202 If the importance level of the process that initiates the wake-up request belongs to the first importance level, the dormant process corresponding to the wake-up request is woken up for the first time.
  • Step S203 After the dormant process is awakened and remains in the awakened state for a first preset time period, it is determined whether the awakened dormant process can be perceived by the user, and corresponding operations are performed based on the determination result.
  • the corresponding operation is performed by judging the importance level of the process that initiates the wake-up request and judging whether the awakened dormant process can be perceived by the user, thereby further ensuring the dormant effect of the system background process, improving system performance and reducing power consumption.
  • the Android system includes a system framework layer, a native call layer, a native framework layer and an operating system Kernel.
  • the system framework layer is a framework layer used to support the running of programs in the system.
  • the local call layer JNI Java native interface
  • the local call layer is a bridge connecting the system framework layer and the local framework layer, that is to say, the local call layer is an "interface" for the system framework layer to call the local framework layer.
  • the local framework layer Native provides some local services and some link libraries, etc., and is generally developed in C++.
  • Operating system Kernel refers to the core part of most operating systems, namely the kernel, which consists of those parts of the operating system used to manage memory, files, peripherals, and system resources.
  • the operating system kernel usually runs processes and provides communication between processes.
  • step S201 when a process in the system initiates a wake-up request to a dormant process, it can be executed through the flowchart shown in FIG3 .
  • the system framework layer starts to initiate a registration and monitoring instruction of the operating system Kernel to the local call layer;
  • the local call layer notifies the local framework layer of the registration instruction
  • the local framework layer registers to listen to communication events through the asynchronous Socket communication interface provided by the Linux system, and the system framework layer begins to receive communication events sent by the operating system Kernel.
  • the process that initiates the wake-up first sends a wake-up request to the operating system kernel;
  • the operating system Kernel receives the wake-up request, determines that the process receiving the request is already in a dormant state, and then sends a wake-up request to the local framework layer;
  • the local framework layer sends the wake-up request to the local call layer
  • the local call layer After receiving the wake-up request, the local call layer feeds back to the system framework layer;
  • the system framework layer receives the wake-up request fed back by the operating system Kernel.
  • the above is the process of the system framework layer sending the wake-up request by the process initiating the wake-up request feedback from the operating system Kernel.
  • the system framework layer receives the wake-up request fed back by the operating system Kernel through the following steps S401 to S402 .
  • Step S401 Initiate a registration and monitoring instruction of the operating system Kernel layer to the local call layer, so that the local call layer notifies the local framework layer of the registration instruction, and the local framework layer monitors the communication events of the operating system Kernel layer through the asynchronous Socket communication interface.
  • Step 402 When the operating system Kernel receives the wake-up request sent by the process that initiates the wake-up request, the operating system Kernel receives the wake-up request fed back by the local framework layer and the local call layer.
  • step S201 The above is a further description of step S201.
  • step S202 The following is a further description of step S202.
  • the system process, the foreground visible process, the foreground visible associated process and the system aware process may be classified into a first importance level.
  • the system process refers to a process with a UID less than 10000, where UID is a user ID.
  • UID is a user ID.
  • Each process in the Android system has a UID, and a process with a UID less than 10000 is a system process.
  • the foreground visible process refers to the process that is currently displayed on the screen, that is, the process that the user is interacting with.
  • a foreground-visible associated process refers to a process whose partial program interface can be seen by the user but does not interact with the user in the foreground.
  • the system-aware processes include processes that are dependent on the foreground process and processes that are being used in the background.
  • the processes that are being used in the background include processes that are playing audio in the background, processes that are recording in the background, processes that are using GPS positioning in the background, and processes that are downloading in the background, etc.
  • the system framework layer wakes up the dormant process corresponding to the wake-up request for the first time.
  • step S202 is a further description of step S202.
  • step S203 is described. For further explanation.
  • step S203 it may be determined whether the awakened dormant process can be perceived by the user ten seconds after the dormant process is awakened.
  • the above value of the first preset time length i.e., ten seconds, is only a schematic illustration. As long as it does not violate the technical concept of the solution of the present invention, technical personnel in this field can select a suitable first preset time length according to actual needs during actual application, and no limitation is made here.
  • the accuracy of the judgment can be increased, thereby avoiding the problem of misjudgment when judging the importance level of the process that initiates the wake-up request, or the awakened dormant process is only awakened and used for a short time but remains awakened all the time, thereby wasting system resources.
  • the awakened dormant process is at least one of a foreground visible process, a background using process, a foreground process dependent process, and a process communicating with other processes in the background
  • the awakened dormant process is determined to be a process that can be perceived by the user.
  • the foreground visible process refers to the process currently displayed on the screen, that is, the process that the user is interacting with.
  • Processes currently in use in the background include processes playing audio in the background, processes recording in the background, processes using GPS positioning in the background, and processes downloading in the background.
  • the foreground process dependent process is a process that is being used by the foreground process.
  • a process that communicates with other processes in the background is a process that cannot be seen by the user but is communicating with other processes.
  • the awakened dormant process if the awakened dormant process can be perceived by the user, the awakened dormant process remains in the awakened state.
  • the awakened dormant process can be perceived by the user as indicating that the process is being used. At this time, the awakened state continues to be maintained to ensure the normal operation of the system process.
  • the awakened dormant process if the awakened dormant process cannot be perceived by the user, the awakened dormant process is controlled to enter the dormant state again.
  • the awakened dormant process cannot be perceived by the user, indicating that an error is made in determining the importance level of the process that initiates the wake-up request, or that the awakened dormant process is only awakened and used within the first preset time period. At this time, the awakened dormant process is controlled to enter the dormant state again to ensure the dormancy effect of the system background process.
  • step S203 is a further description of step S203.
  • step S202 of the present invention refers to FIG5, which is a schematic flow chart of the main steps of performing corresponding operations when the importance level of the process initiating the wake-up request in step S202 of the present invention does not belong to the first importance level. As shown in FIG5, the following steps S2021 to S2025 are included.
  • Step S2021 If the importance level of the process that initiates the wake-up request does not belong to the first importance level, the sleeping process remains in the sleeping state for a second preset time period.
  • Step S2022 After the sleeping process remains in the sleeping state for the second preset time period, the sleeping process is awakened.
  • the dormant process may be awakened after remaining in the dormant state for fifteen seconds. Waking up the dormant process at this time is to avoid misjudgment when determining the importance level of the process that initiates the wake-up request, thereby causing some processes to fail to operate normally.
  • the above value of the second preset time length i.e. fifteen seconds, is only a schematic illustration. As long as it does not violate the technical concept of the solution of the present invention, technical personnel in this field can select a suitable second preset time length according to actual needs during actual application, and no limitation is made here.
  • Step S2023 After the dormant process is awakened and remains in the awakened state for a third preset time period, it is determined whether the awakened dormant process can be perceived by the user.
  • the third preset duration can be the same as the first preset duration, or it can be different from the first preset duration. Without violating the technical concept of the scheme of the present invention, technical personnel in this field can select a suitable third preset duration according to actual needs during actual application, and no limitation is made here.
  • the dormant process After the dormant process is awakened, it can be determined whether it can be perceived by the user, and subsequent operations can be performed based on the determination result.
  • step S1024 is executed; if the awakened dormant process cannot be perceived by the user, step S1025 is executed.
  • Step S2024 The awakened sleeping process remains awakened.
  • the awakened dormant process if the awakened dormant process can be perceived by the user, it means that the process is being used. At this time, the awakened dormant process remains in the awakened state to ensure the normal operation of the system process.
  • Step S2025 Control the awakened sleeping process to enter the sleeping state again.
  • the awakened dormant process if the awakened dormant process cannot be perceived by the user, it means that the process is not in use. At this time, the awakened dormant process is controlled to enter the dormant state again to ensure the dormant effect of the system background process.
  • the present invention implements all or part of the processes in the method of the above embodiment, and can also be completed by instructing the relevant hardware through a computer program
  • the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of each of the above method embodiments when executed by the processor.
  • the computer program includes computer program code
  • the computer program code can be in source code form, object code form, executable file or some intermediate form.
  • the computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium, etc. that can carry the computer program code.
  • the present invention also provides an electronic device.
  • Figure 6, is an electronic device according to the present invention.
  • the electronic device includes a processor 601 and a memory 602.
  • the memory 602 can be configured to store a program for executing the process management method of the above method embodiment.
  • the processor can be configured to execute the program in the storage device, which includes but is not limited to the program for executing the process management method of the above method embodiment.
  • the computer device can be a control device device formed by various electronic devices.
  • the present invention also provides a computer-readable storage medium.
  • the computer-readable storage medium may be configured to store a program for executing the process management method of the above method embodiment, and the program may be loaded and run by a processor to implement the above process management method.
  • the computer-readable storage medium may include various electronic devices formed Storage device equipment, optionally, the computer-readable storage medium in the embodiment of the present invention is a non-temporary computer-readable storage medium.

Landscapes

  • Mobile Radio Communication Systems (AREA)
  • Power Sources (AREA)

Abstract

The present invention relates to the technical field of computers. Specifically provided are a process management method, and an electronic device and a storage medium, which aim to solve the problem of a sleep effect being influenced due to the fact that a background process of a system is frequently woken up after the system background process sleeps. For this purpose, the process management method in the present invention is applied to a system framework layer, and the method comprises: in response to a received wake-up request for a sleep process, determining an importance level of a process initiating a wake-up request; if the importance level of the process initiating the wake-up request belongs to a first importance level, waking up a corresponding sleep process, which initiates the wake-up request, for the first time; and after the sleep process is woken up and remains in a wake-up state for a first preset duration, determining whether the sleep process, which is woken up, can be sensed by a user, and executing a corresponding operation on the basis of a determination result. In this way, the sleep effect of a background process of a system is further ensured, memory is released, and thus the performance of the system is improved, and the power consumption is reduced.

Description

一种进程管理方法、电子设备及存储介质Process management method, electronic device and storage medium
本申请要求2022年11月07日提交的、发明名称为“一种进程管理方法、电子设备及存储介质”的中国专利申请202211390743.5的优先权,上述中国专利申请的全部内容通过引用并入本申请中。This application claims priority to Chinese patent application 202211390743.5, filed on November 7, 2022, with the invention name “A process management method, electronic device and storage medium”. The entire contents of the above Chinese patent application are incorporated into this application by reference.
技术领域Technical Field
本发明涉及计算机技术领域,具体涉及一种进程管理方法、电子设备及存储介质。The present invention relates to the field of computer technology, and in particular to a process management method, electronic equipment and storage medium.
背景技术Background technique
目前,Android系统性能和功耗优化是提升用户体验的重点,而进程休眠技术是进程后台管控的一种手段,把后台进程休眠掉,解决了后台进程占用中央处理器(Central Processing Unit,CPU)资源等问题,提升手机性能和降低功耗。At present, Android system performance and power consumption optimization are the key points to improve user experience, and process hibernation technology is a means of background process control. Putting background processes into hibernation solves the problem of background processes occupying central processing unit (CPU) resources, thereby improving mobile phone performance and reducing power consumption.
进程休眠后,为了不影响用户体验效果,在用户需要使用某个App的情况下,又必须把相关联的后台进程都唤醒,在系统里面,Binder通信是进程间通信的主要手段之一,有时需要通过Binder通信唤醒被休眠的进程,但是后台进程之间频繁的唤醒,会影响整个休眠效果。After a process goes into hibernation, in order not to affect the user experience, when the user needs to use an App, the associated background processes must be woken up. In the system, Binder communication is one of the main means of inter-process communication. Sometimes it is necessary to wake up the dormant process through Binder communication, but frequent wake-ups between background processes will affect the overall hibernation effect.
相应地,本领域需要一种新的技术方案来解决上述问题。Accordingly, the art needs a new technical solution to solve the above problems.
发明内容Summary of the invention
为了克服上述缺陷,提出了本发明,以提供解决或至少部分地解决系统后台进程在休眠后被频繁唤醒影响休眠效果的技术问题的一种进程管理方法、电子设备及存储介质。In order to overcome the above-mentioned defects, the present invention is proposed to provide a process management method, electronic device and storage medium to solve or at least partially solve the technical problem that the system background process is frequently awakened after hibernation and affects the hibernation effect.
在第一方面,提供一种进程管理方法,应用于系统框架层,所述方法包括:In a first aspect, a process management method is provided, which is applied to a system framework layer, and the method comprises:
响应于接收到的对休眠进程的唤醒请求,判断发起唤醒请求 的进程的重要性层级;In response to a received wake-up request for a dormant process, determining to initiate a wake-up request The importance level of the process;
若所述发起唤醒请求的进程的所述重要性层级属于第一重要性层级,则对所述发起唤醒请求对应的所述休眠进程进行第一次唤醒;If the importance level of the process that initiates the wake-up request belongs to the first importance level, waking up the dormant process corresponding to the wake-up request for the first time;
当所述休眠进程被唤醒且保持唤醒状态第一预设时长后,判断被唤醒的所述休眠进程是否能够被用户感知,并基于判断结果执行相应操作。When the dormant process is awakened and remains in the awakened state for a first preset time period, it is determined whether the awakened dormant process can be perceived by the user, and a corresponding operation is performed based on the determination result.
在上述进程管理方法的一个技术方案中,所述当所述休眠进程被唤醒第一预设时长后,判断被唤醒的所述休眠进程是否能够被用户感知,并基于判断结果执行相应操作包括:In a technical solution of the above process management method, when the dormant process is awakened for a first preset time, determining whether the awakened dormant process can be perceived by the user, and performing corresponding operations based on the determination result include:
若被唤醒的所述休眠进程能够被用户感知,则被唤醒的所述休眠进程保持唤醒状态;If the awakened dormant process can be perceived by the user, the awakened dormant process remains in the awakened state;
若被唤醒的所述休眠进程不能够被用户感知,则控制被唤醒的所述休眠进程再次进入休眠状态。If the awakened dormant process cannot be perceived by the user, the awakened dormant process is controlled to enter the dormant state again.
在上述进程管理方法的一个技术方案中,所述判断发起唤醒请求的进程的重要性层级包括:In a technical solution of the above process management method, the step of determining the importance level of the process that initiates the wake-up request includes:
当所述发起唤醒请求的进程为系统进程、前台可见进程、前台可见关联进程和系统感知进程中至少一种时,所述重要性层级属于所述第一重要性层级。When the process that initiates the wake-up request is at least one of a system process, a foreground visible process, a foreground visible associated process, and a system-aware process, the importance level belongs to the first importance level.
在上述进程管理方法的一个技术方案中,所述判断被唤醒的所述休眠进程是否能够被用户感知包括:In a technical solution of the above process management method, the determining whether the awakened dormant process can be perceived by the user comprises:
当被唤醒的所述休眠进程为所述前台可见进程、后台正在使用进程、前台进程依赖进程和在后台与其他进程通信中至少一种时,判定被唤醒的所述休眠进程能够被用户感知。When the awakened dormant process is at least one of the foreground visible process, the background using process, the foreground process dependent process, and the process communicating with other processes in the background, it is determined that the awakened dormant process can be perceived by the user.
在上述进程管理方法的一个技术方案中,所述方法还包括:In a technical solution of the above process management method, the method further includes:
若所述发起唤醒请求的进程的重要性层级不属于所述第一重要性层级,则所述休眠进程保持休眠状态至第二预设时长;If the importance level of the process that initiates the wake-up request does not belong to the first importance level, the dormant process remains in the dormant state for a second preset time period;
所述休眠进程保持休眠状态至所述第二预设时长后,唤醒所述休眠进程;After the dormant process remains in the dormant state for the second preset time period, waking up the dormant process;
当所述休眠进程被唤醒且保持唤醒状态第三预设时长后,判断被唤醒的所述休眠进程是否能够被用户感知,并基于判断结果执行相 应操作。When the dormant process is awakened and remains in the awakened state for a third preset time, it is determined whether the awakened dormant process can be perceived by the user, and corresponding operations are performed based on the determination result. Should be operated.
在上述进程管理方法的一个技术方案中,所述当所述休眠进程被唤醒且保持唤醒状态第三预设时长后,判断被唤醒的所述休眠进程是否能够被用户感知,并基于判断结果执行相应操作包括:In a technical solution of the above process management method, when the dormant process is awakened and remains awake for a third preset time, determining whether the awakened dormant process can be perceived by the user, and performing corresponding operations based on the determination result include:
若被唤醒的所述休眠进程能够被用户感知,则被唤醒的所述休眠进程保持唤醒状态;If the awakened dormant process can be perceived by the user, the awakened dormant process remains in the awakened state;
若被唤醒的所述休眠进程不能够被用户感知,则控制被唤醒的所述休眠进程再次进入休眠状态。If the awakened dormant process cannot be perceived by the user, the awakened dormant process is controlled to enter the dormant state again.
在上述进程管理方法的一个技术方案中,所述方法还包括:In a technical solution of the above process management method, the method further includes:
接收操作系统Kernel反馈的所述发起唤醒请求的进程发送的所述唤醒请求。Receive the wake-up request sent by the process that initiates the wake-up request and fed back by the operating system Kernel.
在上述进程管理方法的一个技术方案中,所述接收操作系统Kernel反馈的所述发起唤醒请求的进程发送的所述唤醒请求包括:In a technical solution of the above process management method, the wake-up request sent by the process initiating the wake-up request and receiving feedback from the operating system Kernel includes:
向本地调用层发起注册监听所述操作系统Kernel层的指令,以使得所述本地调用层向本地框架层通知注册指令、所述本地框架层通过异步Socket通信接口对所述操作系统Kernel层进行通信事件监听;Initiate a registration and monitoring instruction of the operating system Kernel layer to the local call layer, so that the local call layer notifies the local framework layer of the registration instruction, and the local framework layer monitors the communication events of the operating system Kernel layer through the asynchronous Socket communication interface;
当所述操作系统Kernel接收到所述发起唤醒请求的进程发送的所述唤醒请求时,接收所述操作系统Kernel经由所述本地框架层、所述本地调用层反馈的所述唤醒请求。When the operating system Kernel receives the wake-up request sent by the process that initiates the wake-up request, the operating system Kernel receives the wake-up request fed back by the operating system Kernel via the local framework layer and the local call layer.
在第二方面,提供一种电子设备,该电子设备包括处理器和存储装置,所述存储装置适于存储多条程序代码,所述程序代码适于由所述处理器加载并运行以执行上述进程管理方法的技术方案中任一项技术方案所述的进程管理方法。In a second aspect, an electronic device is provided, which includes a processor and a storage device, wherein the storage device is suitable for storing multiple program codes, and the program codes are suitable for being loaded and run by the processor to execute the process management method described in any one of the technical solutions of the above-mentioned process management method.
在第三方面,提供一种计算机可读存储介质,该计算机可读存储介质其中存储有多条程序代码,所述程序代码适于由处理器加载并运行以执行上述进程管理方法的技术方案中任一项技术方案所述的进程管理方法。In a third aspect, a computer-readable storage medium is provided, which stores a plurality of program codes, wherein the program codes are suitable for being loaded and run by a processor to execute the process management method described in any one of the technical solutions of the above-mentioned process management method.
本发明上述一个或多个技术方案,至少具有如下一种或多种有益效果:The above one or more technical solutions of the present invention have at least one or more of the following beneficial effects:
在实施本发明的技术方案中,系统框架层响应于接收到的对 休眠进程的唤醒请求,判断发起唤醒请求的进程的重要性层级,若发起唤醒请求的进程属于第一重要性层级,则对发起唤醒请求对应的休眠进程进行第一次唤醒,休眠进程被唤醒且保持唤醒状态第一预设时长后,判断被唤醒的休眠进程是否能够被用户感知,并基于判断结果执行相应操作。通过对发起唤醒请求的进程的重要性层级判断和被唤醒的休眠进程是否能够被用户感知进行判断,进一步保证了系统后台进程的休眠效果,释放了内存,进而提升系统性能降低功耗,提高了用户的使用体验。In the technical solution of the present invention, the system framework layer responds to the received The wake-up request of the dormant process determines the importance level of the process that initiates the wake-up request. If the process that initiates the wake-up request belongs to the first importance level, the dormant process corresponding to the wake-up request is awakened for the first time. After the dormant process is awakened and remains awake for the first preset time, it is determined whether the awakened dormant process can be perceived by the user, and the corresponding operation is performed based on the judgment result. By judging the importance level of the process that initiates the wake-up request and whether the awakened dormant process can be perceived by the user, the dormancy effect of the system background process is further guaranteed, memory is released, and then system performance is improved, power consumption is reduced, and the user experience is improved.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
参照附图,本发明的公开内容将变得更易理解。本领域技术人员容易理解的是:这些附图仅仅用于说明的目的,而并非意在对本发明的保护范围组成限制。其中:The disclosure of the present invention will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present invention. Among them:
图1是根据本发明的一个实施例的进程管理方法的流程示意图;FIG1 is a schematic flow chart of a process management method according to an embodiment of the present invention;
图2是根据本发明的一个实施例的进程管理方法的主要步骤流程示意图;FIG2 is a schematic flow chart of the main steps of a process management method according to an embodiment of the present invention;
图3是根据本发明的另一个实施例的进程管理方法的流程示意图;3 is a schematic flow chart of a process management method according to another embodiment of the present invention;
图4是根据本发明的另一个实施例的进程管理方法的主要步骤流程示意图;4 is a schematic flow chart of the main steps of a process management method according to another embodiment of the present invention;
图5是根据本发明的另一个实施例的进程管理方法的主要步骤流程示意图;5 is a schematic flow chart of the main steps of a process management method according to another embodiment of the present invention;
图6是根据本发明的一个实施例的电子设备的示意框图。FIG. 6 is a schematic block diagram of an electronic device according to an embodiment of the present invention.
具体实施方式Detailed ways
下面参照附图来描述本发明的一些实施方式。本领域技术人员应当理解的是,这些实施方式仅仅用于解释本发明的技术原理,并非旨在限制本发明的保护范围。Some embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
在本发明的描述中,“模块”、“处理器”可以包括硬件、软件或者两者的组合。一个模块可以包括硬件电路,各种合适的感应器, 通信端口,存储器,也可以包括软件部分,比如程序代码,也可以是软件和硬件的组合。处理器可以是中央处理器、微处理器、图像处理器、数字信号处理器或者其他任何合适的处理器。处理器具有数据和/或信号处理功能。处理器可以以软件方式实现、硬件方式实现或者二者结合方式实现。非暂时性的计算机可读存储介质包括任何合适的可存储程序代码的介质,比如磁碟、硬盘、光碟、闪存、只读存储器、随机存取存储器等等。术语“A和/或B”表示所有可能的A与B的组合,比如只是A、只是B或者A和B。术语“至少一个A或B”或者“A和B中的至少一个”含义与“A和/或B”类似,可以包括只是A、只是B或者A和B。单数形式的术语“一个”、“这个”也可以包含复数形式。In the description of the present invention, "module" or "processor" may include hardware, software or a combination of both. A module may include hardware circuits, various suitable sensors, Communication port, memory, may also include software parts, such as program code, or may be a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor or any other suitable processor. The processor has data and/or signal processing functions. The processor may be implemented in software, hardware or a combination of the two. Non-temporary computer-readable storage media include any suitable medium that can store program code, such as a disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, etc. The term "A and/or B" means all possible combinations of A and B, such as just A, just B or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and/or B" and may include just A, just B or A and B. The singular terms "one" and "the" may also include plural forms.
现有的Android系统进程休眠后,需要使用某个App时,须把相关联的后台进程都唤醒,Binder通信是进程间通信的主要手段之一,需要通过Binder通信唤醒被休眠的进程,但是后台进程之间频繁的唤醒,会影响整个休眠效果。本发明通过判断发起唤醒请求的进程的重要性层级,以及被唤醒的休眠进程是否能够被用户感知,并基于判断结果执行相应操作,进一步保证了系统后台进程的休眠效果。After the existing Android system process is dormant, when a certain App needs to be used, all the related background processes must be awakened. Binder communication is one of the main means of inter-process communication. The dormant process needs to be awakened through Binder communication, but the frequent awakening between background processes will affect the overall dormancy effect. The present invention further ensures the dormancy effect of the system background process by judging the importance level of the process that initiates the wake-up request and whether the awakened dormant process can be perceived by the user, and performing corresponding operations based on the judgment result.
在本发明的一些实施方式中,参阅附图1,图1是根据本发明的一个实施例的进程管理方法的流程示意图。当系统中的某个进程向一个休眠进程发起唤醒请求时,如图1所示,该发起唤醒请求的进程先向操作系统Kernel发送唤醒请求,操作系统Kernel接收到该唤醒请求后,再向系统框架层发送唤醒请求,系统框架层接收到的对休眠进程的唤醒请求后执行相应操作。In some embodiments of the present invention, refer to FIG1, which is a flow chart of a process management method according to an embodiment of the present invention. When a process in the system initiates a wake-up request to a dormant process, as shown in FIG1, the process initiating the wake-up request first sends a wake-up request to the operating system Kernel, and after the operating system Kernel receives the wake-up request, it sends a wake-up request to the system framework layer, and the system framework layer performs corresponding operations after receiving the wake-up request to the dormant process.
参阅附图2,图2是根据本发明的一个实施例的进程管理方法的主要步骤流程示意图。如图2所示,本发明实施例中的进程管理方法应用于系统框架层,系统框架层接收到的对休眠进程的唤醒请求后,执行下列步骤S201至步骤S203。Refer to Figure 2, which is a schematic flow chart of the main steps of a process management method according to an embodiment of the present invention. As shown in Figure 2, the process management method in the embodiment of the present invention is applied to the system framework layer, and after the system framework layer receives a wake-up request for a dormant process, it executes the following steps S201 to S203.
步骤S201:响应于接收到的对休眠进程的唤醒请求,判断发起唤醒请求的进程的重要性层级。Step S201: In response to a received wake-up request for a dormant process, determining the importance level of the process that initiates the wake-up request.
步骤S202:若发起唤醒请求的进程的重要性层级属于第一重要性层级,则对发起唤醒请求对应的休眠进程进行第一次唤醒。 Step S202: If the importance level of the process that initiates the wake-up request belongs to the first importance level, the dormant process corresponding to the wake-up request is woken up for the first time.
步骤S203:当休眠进程被唤醒且保持唤醒状态第一预设时长后,判断被唤醒的休眠进程是否能够被用户感知,并基于判断结果执行相应操作。Step S203: After the dormant process is awakened and remains in the awakened state for a first preset time period, it is determined whether the awakened dormant process can be perceived by the user, and corresponding operations are performed based on the determination result.
基于上述步骤S201至步骤S203所述的方法,通过判断发起唤醒请求的进程的重要性层级以及判断被唤醒的所述休眠进程是否能够被用户感知的结果执行相应操作,进一步保证了系统后台进程的休眠效果,提升系统性能降低功耗。Based on the method described in steps S201 to S203 above, the corresponding operation is performed by judging the importance level of the process that initiates the wake-up request and judging whether the awakened dormant process can be perceived by the user, thereby further ensuring the dormant effect of the system background process, improving system performance and reducing power consumption.
下面对上述步骤S201至步骤S203作进一步说明。The above steps S201 to S203 are further explained below.
在本发明的实施方式中,Android系统包括系统框架层、本地调用层、本地框架层和操作系统Kernel。In the implementation manner of the present invention, the Android system includes a system framework layer, a native call layer, a native framework layer and an operating system Kernel.
其中,系统框架层是用来支持系统中的程序运行的框架层。Among them, the system framework layer is a framework layer used to support the running of programs in the system.
本地调用层JNI(Java native interface)是连接系统框架层和本地框架层的一座桥梁,也就是说本地调用层是系统框架层调用本地框架层的一个“接口”。The local call layer JNI (Java native interface) is a bridge connecting the system framework layer and the local framework layer, that is to say, the local call layer is an "interface" for the system framework layer to call the local framework layer.
本地框架层Native提供一些本地服务和一些链接库等,一般用C++开发。The local framework layer Native provides some local services and some link libraries, etc., and is generally developed in C++.
操作系统Kernel是指大多数操作系统的核心部分,即内核,它由操作系统中用于管理存储器、文件、外设和系统资源的那些部分组成,操作系统内核通常运行进程,并提供进程间的通信。Operating system Kernel refers to the core part of most operating systems, namely the kernel, which consists of those parts of the operating system used to manage memory, files, peripherals, and system resources. The operating system kernel usually runs processes and provides communication between processes.
在上述步骤S201的一些实施方式中,当系统中的某个进程向一个休眠进程发起唤醒请求时,可以通过图3所示的流程示意图执行,如图3所示,设备开机后,系统框架层开始向本地调用层发起注册监听操作系统Kernel的指令;In some implementations of the above step S201, when a process in the system initiates a wake-up request to a dormant process, it can be executed through the flowchart shown in FIG3 . As shown in FIG3 , after the device is turned on, the system framework layer starts to initiate a registration and monitoring instruction of the operating system Kernel to the local call layer;
本地调用层向本地框架层通知注册指令;The local call layer notifies the local framework layer of the registration instruction;
本地框架层通过Linux系统提供的异步Socket通信接口,注册监听通信事件,系统框架层开始接收操作系统Kernel发送的通信事件。The local framework layer registers to listen to communication events through the asynchronous Socket communication interface provided by the Linux system, and the system framework layer begins to receive communication events sent by the operating system Kernel.
当系统中的某个进程向一个休眠进程发起唤醒请求时,发起唤醒的进程先向操作系统Kernel发送唤醒请求;When a process in the system initiates a wake-up request to a sleeping process, the process that initiates the wake-up first sends a wake-up request to the operating system kernel;
操作系统Kernel接收到该唤醒请求,判断接收请求的进程已经是休眠状态后,向本地框架层发送唤醒请求; The operating system Kernel receives the wake-up request, determines that the process receiving the request is already in a dormant state, and then sends a wake-up request to the local framework layer;
本地框架层将该唤醒请求发送至本地调用层;The local framework layer sends the wake-up request to the local call layer;
本地调用层收到该唤醒请求后反馈至系统框架层;After receiving the wake-up request, the local call layer feeds back to the system framework layer;
系统框架层接收到操作系统Kernel反馈的唤醒请求。The system framework layer receives the wake-up request fed back by the operating system Kernel.
以上是系统框架层通过接收操作系统Kernel反馈的发起唤醒请求的进程发送的唤醒请求的流程。The above is the process of the system framework layer sending the wake-up request by the process initiating the wake-up request feedback from the operating system Kernel.
具体的,参阅附图4,在一些实施方式中,系统框架层通过下列步骤S401至步骤S402接收操作系统Kernel反馈的唤醒请求。Specifically, referring to FIG. 4 , in some implementations, the system framework layer receives the wake-up request fed back by the operating system Kernel through the following steps S401 to S402 .
步骤S401:向本地调用层发起注册监听操作系统Kernel层的指令,以使得本地调用层向本地框架层通知注册指令、本地框架层通过异步Socket通信接口对操作系统Kernel层进行通信事件监听。Step S401: Initiate a registration and monitoring instruction of the operating system Kernel layer to the local call layer, so that the local call layer notifies the local framework layer of the registration instruction, and the local framework layer monitors the communication events of the operating system Kernel layer through the asynchronous Socket communication interface.
步骤402:当操作系统Kernel接收到发起唤醒请求的进程发送的唤醒请求时,接收操作系统Kernel经由本地框架层、本地调用层反馈的唤醒请求。Step 402: When the operating system Kernel receives the wake-up request sent by the process that initiates the wake-up request, the operating system Kernel receives the wake-up request fed back by the local framework layer and the local call layer.
以上是对步骤S201的进一步说明,下面继续对步骤S202作进一步说明。The above is a further description of step S201. The following is a further description of step S202.
在上述步骤S202的一些实施方式中,可以将系统进程、前台可见进程、前台可见关联进程和系统感知进程划分至第一重要性层级。In some implementations of the above step S202, the system process, the foreground visible process, the foreground visible associated process and the system aware process may be classified into a first importance level.
在本实施方式中,系统进程是指UID小于10000的进程,UID为用户ID,Android系统里的每一个进程都有一个UID,UID小于10000的进程即为系统进程。In this embodiment, the system process refers to a process with a UID less than 10000, where UID is a user ID. Each process in the Android system has a UID, and a process with a UID less than 10000 is a system process.
前台可见进程是指目前正在屏幕上显示的进程,也就是和用户正在交互的进程。The foreground visible process refers to the process that is currently displayed on the screen, that is, the process that the user is interacting with.
前台可见关联进程是指部分程序界面能够被用户看见,却不在前台与用户交互的进程。A foreground-visible associated process refers to a process whose partial program interface can be seen by the user but does not interact with the user in the foreground.
系统感知进程包括被前台进程依赖的进程和后台正在使用的进程,其中,后台正在使用的进程包括在后台播放音频的进程、在后台录音的进程、在后台使用GPS定位的进程以及在后台下载的进程等。The system-aware processes include processes that are dependent on the foreground process and processes that are being used in the background. The processes that are being used in the background include processes that are playing audio in the background, processes that are recording in the background, processes that are using GPS positioning in the background, and processes that are downloading in the background, etc.
当发起唤醒请求的进程的重要性层级属于上述第一重要性层级时,系统框架层对发起唤醒请求对应的休眠进程进行第一次唤醒。When the importance level of the process that initiates the wake-up request belongs to the first importance level, the system framework layer wakes up the dormant process corresponding to the wake-up request for the first time.
以上是对步骤S202的进一步说明,下面继续对步骤S203 作进一步说明。The above is a further description of step S202. Next, step S203 is described. For further explanation.
在上述步骤S203的一些实施方式中,可以在休眠进程被唤醒十秒后,判断被唤醒的休眠进程是否能够被用户感知。In some implementations of the above step S203, it may be determined whether the awakened dormant process can be perceived by the user ten seconds after the dormant process is awakened.
上关于第一预设时长的数值,即十秒只是示意性说明,只要在不违背本发明方案技术构思的基础上,本领域技术人员在实际应用过程中均可以根据实际需要选择合适的第一预设时长,此处不作限定。The above value of the first preset time length, i.e., ten seconds, is only a schematic illustration. As long as it does not violate the technical concept of the solution of the present invention, technical personnel in this field can select a suitable first preset time length according to actual needs during actual application, and no limitation is made here.
在本实施方式中,通过判断被唤醒的休眠进程是否能够被用户感知,可以增加判断的准确性,避免在判断发起唤醒请求的进程的重要性层级时判断失误,或者被唤醒的休眠进程仅仅在短时间内被唤醒使用,却一直保持唤醒状态,从而浪费系统资源的问题。In this embodiment, by judging whether the awakened dormant process can be perceived by the user, the accuracy of the judgment can be increased, thereby avoiding the problem of misjudgment when judging the importance level of the process that initiates the wake-up request, or the awakened dormant process is only awakened and used for a short time but remains awakened all the time, thereby wasting system resources.
其中,当被唤醒的休眠进程为前台可见进程、后台正在使用进程、前台进程依赖进程和在后台与其他进程通信中至少一种时,判定被唤醒的休眠进程能够被用户感知的进程。Among them, when the awakened dormant process is at least one of a foreground visible process, a background using process, a foreground process dependent process, and a process communicating with other processes in the background, the awakened dormant process is determined to be a process that can be perceived by the user.
具体地,前台可见进程是指目前屏幕上显示的进程,也就是和用户正在交互的进程。Specifically, the foreground visible process refers to the process currently displayed on the screen, that is, the process that the user is interacting with.
后台正在使用进程包括在后台播放音频的进程、在后台录音的进程、在后台使用GPS定位的进程以及在后台下载的进程。Processes currently in use in the background include processes playing audio in the background, processes recording in the background, processes using GPS positioning in the background, and processes downloading in the background.
前台进程依赖进程是正在被前台进程依赖使用的进程。The foreground process dependent process is a process that is being used by the foreground process.
在后台与其他进程通信的进程是指不能够被用户看见,却在与其他进程通信的进程。A process that communicates with other processes in the background is a process that cannot be seen by the user but is communicating with other processes.
进一步地,在一些实施方式中,若被唤醒的休眠进程能够被用户感知,则被唤醒的休眠进程保持唤醒状态。Furthermore, in some implementations, if the awakened dormant process can be perceived by the user, the awakened dormant process remains in the awakened state.
被唤醒的休眠进程能够被用户感知表示该进程正在被使用,此时,继续保持唤醒状态以保证系统进程的正常运行。The awakened dormant process can be perceived by the user as indicating that the process is being used. At this time, the awakened state continues to be maintained to ensure the normal operation of the system process.
在另一些实施方式中,若被唤醒的休眠进程不能够被用户感知,则控制被唤醒的休眠进程再次进入休眠状态。In other implementations, if the awakened dormant process cannot be perceived by the user, the awakened dormant process is controlled to enter the dormant state again.
被唤醒的休眠进程不能够被用户感知,表示判断发起唤醒请求的进程的重要性层级时判断失误,或者被唤醒的休眠进程仅在第一预设时长内被唤醒使用,此时,控制被唤醒的休眠进程再次进入休眠状态,以保证系统后台进程的休眠效果。 The awakened dormant process cannot be perceived by the user, indicating that an error is made in determining the importance level of the process that initiates the wake-up request, or that the awakened dormant process is only awakened and used within the first preset time period. At this time, the awakened dormant process is controlled to enter the dormant state again to ensure the dormancy effect of the system background process.
以上是对步骤S203的进一步说明。The above is a further description of step S203.
在本发明上述步骤S202的另一实施方式中,参阅附图5,图5是根据本发明的步骤S202中发起唤醒请求的进程的重要性层级不属于第一重要性层级时,执行相应操作的主要步骤流程示意图。如图5所示,包括下列步骤S2021至步骤S2025。In another embodiment of the above step S202 of the present invention, refer to FIG5, which is a schematic flow chart of the main steps of performing corresponding operations when the importance level of the process initiating the wake-up request in step S202 of the present invention does not belong to the first importance level. As shown in FIG5, the following steps S2021 to S2025 are included.
步骤S2021:若发起唤醒请求的进程的重要性层级不属于第一重要性层级,则休眠进程保持休眠状态至第二预设时长。Step S2021: If the importance level of the process that initiates the wake-up request does not belong to the first importance level, the sleeping process remains in the sleeping state for a second preset time period.
步骤S2022:休眠进程保持休眠状态至所述第二预设时长后,唤醒休眠进程。Step S2022: After the sleeping process remains in the sleeping state for the second preset time period, the sleeping process is awakened.
在一些实施方式中,可以在休眠进程保持休眠状态十五秒后,唤醒休眠进程,此时唤醒休眠进程是避免发生在判断发起唤醒请求的进程的重要性层级时判断失误,从而导致一些进程无法正常运行的情况。In some implementations, the dormant process may be awakened after remaining in the dormant state for fifteen seconds. Waking up the dormant process at this time is to avoid misjudgment when determining the importance level of the process that initiates the wake-up request, thereby causing some processes to fail to operate normally.
以上关于第二预设时长的数值,即十五秒只是示意性说明,只要在不违背本发明方案技术构思的基础上,本领域技术人员在实际应用过程中均可以根据实际需要选择合适的第二预设时长,此处不作限定。The above value of the second preset time length, i.e. fifteen seconds, is only a schematic illustration. As long as it does not violate the technical concept of the solution of the present invention, technical personnel in this field can select a suitable second preset time length according to actual needs during actual application, and no limitation is made here.
步骤S2023:当休眠进程被唤醒且保持唤醒状态第三预设时长后,判断被唤醒的休眠进程是否能够被用户感知。Step S2023: After the dormant process is awakened and remains in the awakened state for a third preset time period, it is determined whether the awakened dormant process can be perceived by the user.
其中,第三预设时长可以与第一预设时长相同,也可以与第一预设时长不同,在不违背本发明方案技术构思的基础上,本领域技术人员在实际应用过程中均可以根据实际需要选择合适的第三预设时长,此处不作限定。Among them, the third preset duration can be the same as the first preset duration, or it can be different from the first preset duration. Without violating the technical concept of the scheme of the present invention, technical personnel in this field can select a suitable third preset duration according to actual needs during actual application, and no limitation is made here.
休眠进程被唤醒后,可以判断其是否能够被用户感知,并根据判断结果执行后续操作。After the dormant process is awakened, it can be determined whether it can be perceived by the user, and subsequent operations can be performed based on the determination result.
具体地,若被唤醒的休眠进程能够被用户感知,则执行步骤S1024;若被唤醒的休眠进程不能被用户感知,则执行步骤S1025。Specifically, if the awakened dormant process can be perceived by the user, step S1024 is executed; if the awakened dormant process cannot be perceived by the user, step S1025 is executed.
步骤S2024:被唤醒的休眠进程保持唤醒状态。Step S2024: The awakened sleeping process remains awakened.
在本实施方式中,若被唤醒的休眠进程能够被用户感知,表示该进程正在被使用,此时,被唤醒的休眠进程保持唤醒状态以保证系统进程的正常运行。In this embodiment, if the awakened dormant process can be perceived by the user, it means that the process is being used. At this time, the awakened dormant process remains in the awakened state to ensure the normal operation of the system process.
步骤S2025:控制被唤醒的休眠进程再次进入休眠状态。 Step S2025: Control the awakened sleeping process to enter the sleeping state again.
在本实施方式中,若被唤醒的休眠进程不能被用户感知,表示该进程未被使用,此时,控制被唤醒的休眠进程再次进入休眠状态,以保证系统后台进程的休眠效果。In this embodiment, if the awakened dormant process cannot be perceived by the user, it means that the process is not in use. At this time, the awakened dormant process is controlled to enter the dormant state again to ensure the dormant effect of the system background process.
需要指出的是,尽管上述实施例中将各个步骤按照特定的先后顺序进行了描述,但是本领域技术人员可以理解,为了实现本发明的效果,不同的步骤之间并非必须按照这样的顺序执行,其可以同时(并行)执行或以其他顺序执行,这些变化都在本发明的保护范围之内。It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effects of the present invention, different steps do not have to be performed in such an order. They can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present invention.
本领域技术人员能够理解的是,本发明实现上述一实施例的方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读存储介质可以包括:能够携带所述计算机程序代码的任何实体或装置、介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器、随机存取存储器、电载波信号、电信信号以及软件分发介质等。It is understood by those skilled in the art that the present invention implements all or part of the processes in the method of the above embodiment, and can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of each of the above method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium, etc. that can carry the computer program code.
进一步,本发明还提供了一种电子设备。参阅附图6,图6是根据本发明的一种电子设备,如图6所示,电子设备包括处理器601和存储器602,存储器602可以被配置成存储执行上述方法实施例的进程管理方法的程序,处理器可以被配置成用于执行存储装置中的程序,该程序包括但不限于执行上述方法实施例的进程管理方法的程序。为了便于说明,仅示出了与本发明实施例相关的部分,具体技术细节未揭示的,请参照本发明实施例方法部分。该计算机设备可以是包括各种电子设备形成的控制装置设备。Furthermore, the present invention also provides an electronic device. Refer to Figure 6, which is an electronic device according to the present invention. As shown in Figure 6, the electronic device includes a processor 601 and a memory 602. The memory 602 can be configured to store a program for executing the process management method of the above method embodiment. The processor can be configured to execute the program in the storage device, which includes but is not limited to the program for executing the process management method of the above method embodiment. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The computer device can be a control device device formed by various electronic devices.
进一步,本发明还提供了一种计算机可读存储介质。在根据本发明的一个计算机可读存储介质实施例中,计算机可读存储介质可以被配置成存储执行上述方法实施例的进程管理方法的程序,该程序可以由处理器加载并运行以实现上述进程管理方法。为了便于说明,仅示出了与本发明实施例相关的部分,具体技术细节未揭示的,请参照本发明实施例方法部分。该计算机可读存储介质可以是包括各种电子设备形成 的存储装置设备,可选的,本发明实施例中计算机可读存储介质是非暂时性的计算机可读存储介质。Furthermore, the present invention also provides a computer-readable storage medium. In one embodiment of a computer-readable storage medium according to the present invention, the computer-readable storage medium may be configured to store a program for executing the process management method of the above method embodiment, and the program may be loaded and run by a processor to implement the above process management method. For ease of explanation, only the part related to the embodiment of the present invention is shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The computer-readable storage medium may include various electronic devices formed Storage device equipment, optionally, the computer-readable storage medium in the embodiment of the present invention is a non-temporary computer-readable storage medium.
至此,已经结合附图所示的一个实施方式描述了本发明的技术方案,但是,本领域技术人员容易理解的是,本发明的保护范围显然不局限于这些具体实施方式。在不偏离本发明的原理的前提下,本领域技术人员可以对相关技术特征作出等同的更改或替换,这些更改或替换之后的技术方案都将落入本发明的保护范围之内。 So far, the technical solution of the present invention has been described in conjunction with an embodiment shown in the accompanying drawings, but it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims (10)

  1. 一种进程管理方法,应用于系统框架层,其特征在于,所述方法包括:A process management method, applied to a system framework layer, is characterized in that the method comprises:
    响应于接收到的对休眠进程的唤醒请求,判断发起唤醒请求的进程的重要性层级;In response to a received wake-up request for a dormant process, determining an importance level of the process initiating the wake-up request;
    若所述发起唤醒请求的进程的所述重要性层级属于第一重要性层级,则对所述发起唤醒请求对应的所述休眠进程进行第一次唤醒;If the importance level of the process that initiates the wake-up request belongs to the first importance level, waking up the dormant process corresponding to the wake-up request for the first time;
    当所述休眠进程被唤醒且保持唤醒状态第一预设时长后,判断被唤醒的所述休眠进程是否能够被用户感知,并基于判断结果执行相应操作。When the dormant process is awakened and remains in the awakened state for a first preset time period, it is determined whether the awakened dormant process can be perceived by the user, and a corresponding operation is performed based on the determination result.
  2. 根据权利要求1所述的进程管理方法,其特征在于,所述当所述休眠进程被唤醒第一预设时长后,判断被唤醒的所述休眠进程是否能够被用户感知,并基于判断结果执行相应操作包括:The process management method according to claim 1 is characterized in that when the dormant process is awakened for a first preset time, determining whether the awakened dormant process can be perceived by the user, and performing corresponding operations based on the determination result comprises:
    若被唤醒的所述休眠进程能够被用户感知,则被唤醒的所述休眠进程保持唤醒状态;If the awakened dormant process can be perceived by the user, the awakened dormant process remains in the awakened state;
    若被唤醒的所述休眠进程不能够被用户感知,则控制被唤醒的所述休眠进程再次进入休眠状态。If the awakened dormant process cannot be perceived by the user, the awakened dormant process is controlled to enter the dormant state again.
  3. 根据权利要求1或2所述的进程管理方法,其特征在于,所述判断发起唤醒请求的进程的重要性层级包括:The process management method according to claim 1 or 2, characterized in that the importance level of the process of determining the process that initiates the wake-up request comprises:
    当所述发起唤醒请求的进程为系统进程、前台可见进程、前台可见关联进程和系统感知进程中至少一种时,所述重要性层级属于所述第一重要性层级。When the process that initiates the wake-up request is at least one of a system process, a foreground visible process, a foreground visible associated process, and a system-aware process, the importance level belongs to the first importance level.
  4. 根据权利要求1至3中任一项所述的进程管理方法,其特征在于,所述判断被唤醒的所述休眠进程是否能够被用户感知包括:The process management method according to any one of claims 1 to 3, characterized in that the step of determining whether the awakened dormant process can be perceived by a user comprises:
    当被唤醒的所述休眠进程为所述前台可见进程、后台正在使用进程、前台进程依赖进程和在后台与其他进程通信中至少一种时,判定被唤醒的所述休眠进程能够被用户感知。 When the awakened dormant process is at least one of the foreground visible process, the background using process, the foreground process dependent process, and the process communicating with other processes in the background, it is determined that the awakened dormant process can be perceived by the user.
  5. 根据权利要求1至4中任一项所述的进程管理方法,其特征在于,所述方法还包括:The process management method according to any one of claims 1 to 4, characterized in that the method further comprises:
    若所述发起唤醒请求的进程的所述重要性层级不属于所述第一重要性层级,则所述休眠进程保持休眠状态至第二预设时长;If the importance level of the process that initiates the wake-up request does not belong to the first importance level, the dormant process remains in a dormant state for a second preset time period;
    所述休眠进程保持休眠状态至所述第二预设时长后,唤醒所述休眠进程;After the dormant process remains in the dormant state for the second preset time period, waking up the dormant process;
    当所述休眠进程被唤醒且保持唤醒状态第三预设时长后,判断被唤醒的所述休眠进程是否能够被用户感知,并基于判断结果执行相应操作。When the dormant process is awakened and remains in the awakened state for a third preset time period, it is determined whether the awakened dormant process can be perceived by the user, and a corresponding operation is performed based on the determination result.
  6. 根据权利要求5所述的进程管理方法,其特征在于,所述当所述休眠进程被唤醒且保持唤醒状态第三预设时长后,判断被唤醒的所述休眠进程是否能够被用户感知,并基于判断结果执行相应操作包括:The process management method according to claim 5 is characterized in that when the dormant process is awakened and remains awake for a third preset time, determining whether the awakened dormant process can be perceived by the user, and performing corresponding operations based on the determination result comprises:
    若被唤醒的所述休眠进程能够被用户感知,则被唤醒的所述休眠进程保持唤醒状态;If the awakened dormant process can be perceived by the user, the awakened dormant process remains in the awakened state;
    若被唤醒的所述休眠进程不能够被用户感知,则控制被唤醒的所述休眠进程再次进入休眠状态。If the awakened dormant process cannot be perceived by the user, the awakened dormant process is controlled to enter the dormant state again.
  7. 根据权利要求1至6中任一项所述的进程管理方法,其特征在于,所述方法还包括:The process management method according to any one of claims 1 to 6, characterized in that the method further comprises:
    接收操作系统Kernel反馈的所述发起唤醒请求的进程发送的所述唤醒请求。Receive the wake-up request sent by the process that initiates the wake-up request and fed back by the operating system Kernel.
  8. 根据权利要求7所述的进程管理方法,其特征在于,所述接收操作系统Kernel反馈的所述发起唤醒请求的进程发送的所述唤醒请求包括:The process management method according to claim 7, wherein the receiving of the wake-up request sent by the process initiating the wake-up request fed back by the operating system Kernel comprises:
    向本地调用层发起注册监听所述操作系统Kernel层的指令,以使得所述本地调用层向本地框架层通知注册指令、所述本地框架层通过异步Socket通信接口对所述操作系统Kernel层进行通信事件监听;Initiate a registration and monitoring instruction of the operating system Kernel layer to the local call layer, so that the local call layer notifies the local framework layer of the registration instruction, and the local framework layer monitors the communication events of the operating system Kernel layer through the asynchronous Socket communication interface;
    当所述操作系统Kernel接收到所述发起唤醒请求的进程发送的所述唤醒请求时,接收所述操作系统Kernel经由所述本地框架层、所述本地 调用层反馈的所述唤醒请求。When the operating system Kernel receives the wake-up request sent by the process initiating the wake-up request, the operating system Kernel receives the wake-up request sent by the process initiating the wake-up request via the local framework layer, the local The wake-up request fed back by the calling layer.
  9. 一种电子设备,包括处理器和存储装置,所述存储装置适于存储多条程序代码,其特征在于,所述程序代码适于由所述处理器加载并运行以执行权利要求1至8中任一项所述的进程管理方法。An electronic device comprises a processor and a storage device, wherein the storage device is suitable for storing multiple program codes, and is characterized in that the program codes are suitable for being loaded and run by the processor to execute the process management method described in any one of claims 1 to 8.
  10. 一种计算机可读存储介质,其中存储有多条程序代码,其特征在于,所述程序代码适于由处理器加载并运行以执行权利要求1至8中任一项所述的进程管理方法。 A computer-readable storage medium storing a plurality of program codes, characterized in that the program codes are suitable for being loaded and run by a processor to execute the process management method according to any one of claims 1 to 8.
PCT/CN2023/123873 2022-11-07 2023-10-11 Process management method, and electronic device and storage medium WO2024099017A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211390743.5 2022-11-07
CN202211390743.5A CN118034789A (en) 2022-11-07 2022-11-07 Process management method, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2024099017A1 true WO2024099017A1 (en) 2024-05-16

Family

ID=90986496

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/123873 WO2024099017A1 (en) 2022-11-07 2023-10-11 Process management method, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN118034789A (en)
WO (1) WO2024099017A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101122870A (en) * 2007-09-30 2008-02-13 金蝶软件(中国)有限公司 Thread wakening control systems and method
CN106815065A (en) * 2015-11-27 2017-06-09 腾讯科技(深圳)有限公司 The awakening method and device of background application, electronic equipment
CN109254850A (en) * 2018-09-30 2019-01-22 深圳市万普拉斯科技有限公司 memory resource management method and system
CN109992360A (en) * 2017-12-29 2019-07-09 广东欧珀移动通信有限公司 Process handling method and device, electronic equipment, computer readable storage medium
CN111857919A (en) * 2020-07-16 2020-10-30 北京字节跳动网络技术有限公司 Video processing method, device, terminal equipment and medium
CN112988375A (en) * 2019-12-17 2021-06-18 华为技术有限公司 Process management method and device and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101122870A (en) * 2007-09-30 2008-02-13 金蝶软件(中国)有限公司 Thread wakening control systems and method
CN106815065A (en) * 2015-11-27 2017-06-09 腾讯科技(深圳)有限公司 The awakening method and device of background application, electronic equipment
CN109992360A (en) * 2017-12-29 2019-07-09 广东欧珀移动通信有限公司 Process handling method and device, electronic equipment, computer readable storage medium
CN109254850A (en) * 2018-09-30 2019-01-22 深圳市万普拉斯科技有限公司 memory resource management method and system
CN112988375A (en) * 2019-12-17 2021-06-18 华为技术有限公司 Process management method and device and electronic equipment
CN111857919A (en) * 2020-07-16 2020-10-30 北京字节跳动网络技术有限公司 Video processing method, device, terminal equipment and medium

Also Published As

Publication number Publication date
CN118034789A (en) 2024-05-14

Similar Documents

Publication Publication Date Title
US11200101B2 (en) Managing applications for power conservation
CN102789305B (en) Postponing suspend
US9329671B2 (en) Power-efficient inter processor communication scheduling
KR101943134B1 (en) Managing processes within suspend states and execution states
CN102866903B (en) Background work and foreground work are separated to coupling
CN102880505B (en) For the event aggregation that background work performs
RU2435200C2 (en) Fast booting operating system from off state
EP3274788B1 (en) Technologies for improved hybrid sleep power management
US7114090B2 (en) Computing system with operational low power states
RU2595577C2 (en) Suspension and/or control of processes for connected standby state
US7249024B2 (en) Resource saving preemption
JP6491326B2 (en) Method and apparatus for executing an application program
US8402293B2 (en) Power management in electronic systems
JP6370498B2 (en) Method and system for operating state coordination among multiple SOCs in a computing device
KR101943133B1 (en) Managing processes within suspend states and execution states
CN106502687A (en) A kind of method and terminal for entering resting state
US20170212687A1 (en) Demand-based provisioning of volatile memory for use as non-volatile memory
KR20080071979A (en) Direct computing experience
CN110806925B (en) Audio playing method and equipment
Park et al. Reducing energy consumption of alarm-induced wake-ups on android smartphones
US9134784B2 (en) Predictive power state transitions for information handling devices
WO2024099017A1 (en) Process management method, and electronic device and storage medium
US9766672B2 (en) System for managing power provided to a processor or memory based on a measured memory consumption characteristic
CN111459261A (en) Disk wake-up method and device, electronic equipment and storage medium
US7272731B2 (en) Information handling system having reduced power consumption