WO2017206877A1 - 一种唤醒锁的释放方法、装置、存储介质及电子设备 - Google Patents
一种唤醒锁的释放方法、装置、存储介质及电子设备 Download PDFInfo
- Publication number
- WO2017206877A1 WO2017206877A1 PCT/CN2017/086474 CN2017086474W WO2017206877A1 WO 2017206877 A1 WO2017206877 A1 WO 2017206877A1 CN 2017086474 W CN2017086474 W CN 2017086474W WO 2017206877 A1 WO2017206877 A1 WO 2017206877A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- application process
- wake
- lock
- determining
- associated application
- Prior art date
- Legal status (The legal status 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 status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/26—Power supply means, e.g. regulation thereof
- G06F1/32—Means for saving power
- G06F1/3203—Power management, i.e. event-based initiation of a power-saving mode
- G06F1/3234—Power saving characterised by the action undertaken
- G06F1/329—Power saving characterised by the action undertaken by task scheduling
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/26—Power supply means, e.g. regulation thereof
- G06F1/32—Means for saving power
Definitions
- the present invention relates to the field of terminal technologies, and in particular, to a method, an apparatus, a storage medium, and an electronic device for releasing a wake-up lock.
- the embodiment of the invention provides a method, a device, a storage medium and an electronic device for releasing a wake-up lock, which can release the wake-up lock held by the background application associated with the application while the application is closed, thereby saving the power of the terminal.
- an embodiment of the present invention provides a method for releasing a wake-up lock, including:
- the embodiment of the present invention further provides a release device for a wake-up lock, including: a first release module, a determination module, a first determination module, and a second release module;
- the first release module is configured to release a wakelock held by the application process when the application process is closed;
- the determining module is configured to determine an associated application process associated with the application process
- the first determining module is configured to determine whether the associated application process holds a wakelock
- the second release module is configured to release the wakelock held by the associated application process when the first determining module determines to be YES.
- an embodiment of the present invention further provides a storage medium having a computer program stored thereon, the computer program being invoked by a processor to perform a release method of a wake lock according to any embodiment of the present invention.
- an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor calls the computer stored in the memory A program for performing a release method of a wake lock according to any of the embodiments of the present invention.
- the embodiment of the invention provides a method, a device, a storage medium and an electronic device for releasing a wake-up lock, which can release the wake-up lock held by the background application associated with the application while the application is closed, thereby saving the power of the terminal.
- FIG. 1 is a schematic flowchart diagram of a method for releasing a wake-up lock according to an embodiment of the present invention.
- FIG. 2 is another schematic flowchart of a method for releasing a wake-up lock according to an embodiment of the present invention.
- FIG. 3 is a schematic flowchart of releasing a cpu lock in a smart phone according to an embodiment of the present invention.
- FIG. 4 is a schematic structural diagram of a release device for a wake-up lock according to an embodiment of the present invention.
- FIG. 5 is another schematic structural diagram of a release device for a wake-up lock according to an embodiment of the present invention.
- FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
- FIG. 7 is another schematic structural diagram of an electronic device according to an embodiment of the present invention.
- Embodiments of the present invention provide a method, an apparatus, a storage medium, and an electronic device for releasing a wake-up lock. The details will be described separately below.
- the embodiment of the present invention will be described from the perspective of a release device for a wake-up lock.
- the device may be integrated into an electronic device, which may be a mobile Internet device (such as a smart phone or a tablet) or a smart wear device (such as a smart watch). ) and other types of terminals.
- a mobile Internet device such as a smart phone or a tablet
- a smart wear device such as a smart watch
- An embodiment of the present invention provides a method for releasing a wake-up lock, including:
- determining whether the associated application process holds a wakelock further includes:
- determining whether the associated application process holds a wakelock further includes:
- the determining whether the associated application process is a preset application process includes:
- the determining an associated application process associated with the application process comprises:
- the determining whether the associated application process holds a wakelock includes:
- the determining an associated application process associated with the application process comprises:
- the associated application process is determined according to the process identification information.
- the releasing the wakelock held by the associated application process further includes:
- the wake lock held by the associated application process is released according to the received confirmation message sent by the user.
- the method further includes:
- the determining whether the application process holds a wakelock includes:
- the working wakelock is a wakelock corresponding to the application process, it is determined that the application process holds a wakelock.
- FIG. 1 is a schematic flowchart diagram of a method for releasing a wake-up lock according to an embodiment of the present invention. The method includes:
- step S101 when the application process is closed, the wake lock held by the application process is released.
- some applications are often associated with launching other applications and running in the background.
- applications such as Taobao and Tmall
- the application process is After exiting to the background, the wake-up lock held by the background application is released.
- the wake-up lock held by the background application associated with the application process is not immediately released, and the system wake-up lock needs to be held for a period of time to ensure its normal operation.
- the wake-up lock cannot be released for a long time, the mobile phone will not be able to sleep deeply. It seems that the mobile phone is no longer working. In fact, when the mobile phone is in standby, the background CPU and other devices are always in working state, which increases unnecessary. The consumption of standby battery power. If the user's mobile phone is installed with more such application processes running in the background, there will be more associated application processes running in the background and holding the wake lock, resulting in waste of the terminal power.
- the user may receive a shutdown instruction, where the instruction includes the identification information of the application process, and according to the closing instruction, close the application process and simultaneously release the wakelock held by the application process.
- the method may further include: determining whether the application process holds the wake-up lock, and if yes, releasing the wake-up held by the application process. lock.
- the method for determining whether the application process holds the wake-up lock may be various, for example, detecting whether there is a wake-up lock in the working state, and if yes, further determining whether the application process is present in the working wake-up lock.
- the name of the wake-up lock in the working state and the name of the application process corresponding to the wake-up lock in the working state can be obtained through the framework layer of the system.
- the wake-up lock in the working state may have one or may have If there are multiple wake-up locks that are in the working state, the application process names corresponding to the multiple wake-up locks are respectively obtained, and it is determined whether there is a wake-up lock corresponding to the application process. That is, the step of determining whether the application process holds the wakelock may specifically include:
- Step S102 determining an associated application process associated with the closed application process.
- the system When a state changes, the system will automatically run Google Maps in the background.
- the event can be associated with the application process such as Tmall APP and Taobao APP.
- Many self-starting items generated after the software is installed will start their own processes according to different trigger conditions.
- some application processes have mutual dependencies. For example, when application process A and application process B run simultaneously, if application process A is forcibly closed, application process B cannot run. Then, it can be considered that the application process A and the application process B belong to the associated process.
- the identifier information of the closed application process may be obtained, where the identifier information may be feature information in the application process, such as the uid of the application process.
- Identifier, user identification) information, uid is an identifier that describes the process of the service association point. Different processes of the same service generally use the same uid to find the application process using the uid in the application process running in the background of the system. Apply the process to the above association. That is, the step of determining the associated application process associated with the process according to the closed application process may specifically include:
- the application process associated with the closed application process may also be searched in the preset associated application process list, where the associated application process list may be a preset list downloaded from the server in advance.
- the associated application process list may include information about the application process and the application process associated with the application process.
- the identification information of the application process that is closed by the user may be first determined, and the identifier information is sent to the server, so that the server searches for the application in the preset associated application process list.
- the process identifier corresponding to the process identifier is sent, and the corresponding application process identifier is sent to the user terminal, so as to determine the associated application process.
- Step S103 determining whether the associated application process holds a wake lock. If yes, go to step S104, if no, go to step S105.
- the identifier information of the associated application process may be obtained, and the wakeup lock corresponding to the identifier information and in the working state is searched in the system according to the identifier information, and if yes, it is determined that the associated application process holds the wakelock.
- Step S104 releasing the wake lock held by the associated application process.
- the wakelock is released, so that the terminal's cpu can enter a deep sleep state, thereby reducing unnecessary battery power consumption during standby and increasing standby time.
- the prompt window may be included to remind the user whether to release the wake-up lock of the application process. If the user clicks the "confirm” button, the wake-up lock held by the associated application process is released; if the user clicks the "cancel” button, The above wakelock is not further processed.
- step S105 it is determined that the associated application process does not hold the wake lock.
- the embodiment of the present invention may add a control switch for controlling the opening and closing of the release mode of the wake-up lock.
- the release mode of the wake-up lock provided by the embodiment of the present invention can reduce the power consumption of the terminal, thereby increasing the standby time. Therefore, the processing method can also set a remaining power threshold in the terminal in advance, when the terminal power is lower than When the preset threshold is used, the function is automatically turned on. For example, when the mobile phone is lower than 20%, the mobile phone enters the power saving mode to automatically turn on the function, and the preset threshold of the remaining power can be set according to the user's demand.
- FIG. 2 is another schematic flowchart of a method for releasing a wake-up lock according to an embodiment of the present invention.
- the method includes:
- step S201 when the application process is closed, the wake lock held by the application process is released.
- Step S202 Acquire user identification information in a closed application process.
- the uid of the application process can be obtained, for example, based on the terminal of the android system, in order to realize data sharing, android allocates almost different uids for each application, and different processes of the same service generally use the same uid, specifically
- the attribute information of the application process may be obtained, where the attribute information includes the uid of the application process.
- Step S203 searching for a process with the same user identification information in the system
- Step S204 determining that the process is an associated application process
- steps S202-S204 are processes for determining the associated application process.
- some application processes are bound to each other.
- the bound application process is determined to be an associated application process, and the step may be specific.
- the associated application process is determined according to the process identification information.
- step S205 it is determined whether the associated application process is running in the foreground of the terminal. If yes, step S208 is performed, and if no, step S206 is performed.
- the application process associated with the application process may be opened in the foreground, and the wakeup lock held by the associated application process does not need to be released. Therefore, it is determined whether the associated application process is in the terminal.
- the steps in the foreground are added to increase convenience.
- step S206 it is determined whether the associated application process is a preset application process. If yes, step S208 is performed, and if no, step S207 is performed.
- a preset application process set may be established in advance, and the preset application process may be some commonly used application processes, or may allow an application process in the background that the wakeup lock is not released, thereby determining the associated application.
- the steps of whether the process is a preset application process may specifically include:
- step S207 it is determined whether the associated application process holds the wakelock lock. If yes, step S209 is performed, and if no, step S209 is performed.
- the method for determining whether the associated application process holds the wake-up lock may be various.
- the terminal may detect whether the wake-up lock is in a working state, and if yes, determine whether the wake-up lock is associated with the foregoing.
- the wakeup lock corresponding to the application process.
- Step S208 the associated application process is allowed to hold the wake lock.
- the associated application process when the associated application process is running in the foreground of the terminal, or when the associated application process is determined to be a preset application process, it is allowed to hold the wake lock.
- Step S209 releasing the wake lock held by the associated application process.
- a prompt message can be generated to inform the user that those wake locks are released.
- Step S210 determining that the associated application process does not hold the wake lock.
- the terminal may be, but not limited to, a smart terminal such as a smart phone, a tablet computer, or a notebook computer.
- the operating system of the terminal may be an Android operating system, an IOS operating system, or a black.
- the Berry operating system and the like are not limited in the present invention.
- FIG. 3 is a schematic flowchart of releasing a cpu lock in a smart phone according to an embodiment of the present invention.
- the embodiment of the present invention takes a smart phone as an example, and the above-mentioned wake-up lock is a cpu lock, and describes specific implementation steps of the solution in practical applications, including the following steps:
- Step S301 When the smart phone closes the application process, the cpu lock held by the application process is released.
- Step S302 the smartphone acquires the uid in the closed application process
- Step S303 the smartphone searches for a process with the same uid in the system
- Step S304 the smartphone determines that the process is an associated application process.
- the application process A uses the same uid as the process of the application process B, after the application A is closed, the uid in the application A process is obtained, and then the other process that also has the above uid, that is, the application process, is further searched for in the process of the system.
- step S305 the smart phone determines whether the associated application process is running in the foreground of the mobile phone. If yes, step S308 is performed, and if no, step S306 is performed.
- step S306 the smartphone determines whether the associated application process is in the white list. If yes, step S308 is performed, and if no, step S307 is performed.
- the whitelist may be established in advance according to the user instruction, and the application process included in the whitelist may be some commonly used application processes, or an application process that may allow the background to hold the lock not released;
- the associated application process matches the application process in the whitelist. If the application process matches the application process in the whitelist successfully, that is, the application process is in the whitelist, the application process is allowed to hold the cpu lock; if the application process The matching with the application process in the whitelist fails, that is, the application process is not in the whitelist, so the application process is not allowed to hold the cpu lock.
- step S307 the smartphone determines whether the associated application process holds the cpu lock. If yes, step S309 is performed, and if no, step S310 is performed.
- Step S308 the smartphone allows the associated application process to hold a cpu lock.
- the application process B is allowed to hold the cpu lock.
- Step S309 the smart phone releases the cpu lock held by the associated application process.
- a prompt message may be generated to prompt the user that the cpu lock is released.
- step S310 the smart phone determines that the associated application process does not hold the cpu lock and does not perform further processing.
- the cpu lock held by the application process is released, and the associated application process associated with the application process is determined, and whether the associated application process holds the cpu lock is determined. , releasing the cpu lock held by the associated application process; the solution can release the cpu lock of the application process and further release the cpu lock held by the application process associated with the application process when the mobile phone closes the application process. Therefore, the power consumption in the terminal is reduced, the power of the terminal is saved, and the endurance capability of the terminal can be improved, thereby improving the user experience.
- the embodiment of the present invention further provides a release device for a wake-up lock, including: a first release module, a determination module, a first determination module, and a second release module;
- the first release module is configured to release a wakelock held by the application process when the application process is closed;
- the determining module is configured to determine an associated application process associated with the application process
- the first determining module is configured to determine whether the associated application process holds a wakelock
- the second release module is configured to release the wakelock held by the associated application process when the first determining module determines to be YES.
- the apparatus further includes: a second determining module
- the second determining module is configured to: after the determining module determines an associated application process associated with the application process, the first determining module determines whether the associated application process holds a wakelock, and determines the Whether the associated application process is running in the foreground of the terminal;
- the first determining module is specifically configured to: when the second determining module determines to be no, determine whether the associated application process holds a wakelock.
- the apparatus further includes: a third determining module
- the third determining module is configured to: after the determining module determines an associated application process associated with the application process, the first determining module determines whether the associated application process holds a wakelock, and determines the Whether the associated application process is a preset application process;
- the first determining module is specifically configured to: when the third determining module determines to be no, determine whether the associated application process holds a wakelock.
- the third determining module is further configured to determine, according to the obtained identifier information of the associated application process, whether a preset application process corresponding to the identifier information exists in the preset application process set. .
- the determining module specifically includes: a first obtaining submodule, a searching submodule, and a first determining submodule;
- the first obtaining submodule is configured to obtain user identification information in the closed application process
- the searching submodule is configured to search for a process having the same user identification information in the terminal system
- the first determining submodule is configured to determine that the process is the associated application process.
- the first determining module is further configured to determine, according to the acquired identification information of the associated application process, whether there is a wakelock corresponding to the identifier information and in a working state in the system.
- the determining module specifically includes: a second obtaining submodule and a second determining submodule;
- the second obtaining submodule is configured to acquire process identification information of the application process
- the second determining submodule is configured to determine an associated application process according to the process identification information.
- the second release module is further configured to release the wake lock held by the associated application process according to the received confirmation information sent by the user.
- FIG. 4 is a schematic structural diagram of a release device for a wake-up lock according to an embodiment of the present invention.
- the device can be integrated in an electronic device, which can be various types of smart terminals such as mobile Internet devices (such as smart phones, tablets) and smart wearable devices (such as smart watches).
- smart terminals such as mobile Internet devices (such as smart phones, tablets) and smart wearable devices (such as smart watches).
- the release device of the wake-up lock includes: a first release module 401, a determination module 402, a first determination module 403, and a second release module 404;
- the first release module 401 is configured to release the wake lock held by the application process when the application process is closed;
- the determining module 402 is configured to determine an associated application process associated with the closed application process
- the first determining module 403 is configured to determine whether the associated application process holds a wakelock
- the second release module 404 is configured to release the wake lock held by the associated application process when the first determining module 403 determines YES.
- FIG. 5 is another schematic structural diagram of a release device for a wake-up lock according to an embodiment of the present invention.
- the device for releasing the wake-up lock provided by the embodiment of the present invention may further include: a second determining module 405 and a third determining module 406;
- the second determining module 405 is configured to: after the determining module 402 determines the associated application process associated with the closed application process, the first determining module 403 determines whether the associated application process is holding the wakelock, and determines whether the associated application process is in the terminal. Running at the front desk;
- the first determining module 403 is specifically configured to: when the second determining module 405 determines to be no, determine whether the associated application process holds a wakelock;
- the third determining module 406 is configured to determine, after the determining module 402 determines the associated application process associated with the closed application process, whether the associated application process is pre-determined before determining whether the associated application process holds the wake-up lock. Set the application process;
- the first determining module 403 is specifically configured to determine, when the third determining module 406 determines to be no, whether the associated application process holds the wakelock.
- the determining module 402 in the foregoing apparatus may specifically include: a first acquiring submodule, a searching submodule, and a first determining submodule;
- the first obtaining submodule is configured to obtain user identification information in a closed application process
- the searching submodule is configured to search for a process with the same user identification information in the terminal system
- the first determining submodule is configured to determine that the process is an associated application process.
- the determining module 402 may further include: a second obtaining submodule and a second determining submodule;
- the second obtaining submodule is configured to acquire process identification information of an application process.
- the second determining submodule is configured to determine an associated application process according to the process identification information. .
- the first release module 401 releases the wakeup lock held by the application process
- the determining module 402 determines the associated application process associated with the application process
- the first determining module 403 determines Whether the associated application process holds the wake-up lock
- the second release module 404 releases the wake-up lock held by the associated application process; the solution may further release the wake-up lock of the application process while the application process is closed.
- the wake-up lock held by the application process associated with the application process is released, thereby reducing the consumption of power in the terminal, saving the power of the terminal, and thereby improving the endurance of the terminal.
- the foregoing modules may be implemented as a separate entity, or may be implemented in any combination, and may be implemented as the same or a plurality of entities.
- the foregoing modules refer to the foregoing method embodiments, and details are not described herein again.
- An embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor calling the computer program stored in the memory, executing the program A method of releasing a wake lock according to any of the embodiments of the invention.
- the electronic device can be a device such as a smartphone or a tablet.
- electronic device 300 includes a processor 301 having one or more processing cores, a memory 302 having one or more computer readable storage media, and a computer program stored on the memory and executable on the processor.
- the processor 301 is electrically connected to the memory 302.
- the processor 301 is a control center of the electronic device 300, and connects various parts of the entire electronic device using various interfaces and lines, executes the electronic by running or loading an application stored in the memory 302, and calling data stored in the memory 302.
- the various functions and processing data of the device enable overall monitoring of the electronic device.
- the processor 301 in the electronic device 300 loads the instructions corresponding to the process of one or more applications into the memory 302 according to the following steps, and is stored in the memory by the processor 301.
- the application in 302 to implement various functions:
- the processor 301 is further configured to perform the following steps:
- the processor 301 is further configured to perform the following steps:
- the processor 301 is further configured to perform the following steps:
- the processor 301 is further configured to perform the following steps:
- the processor 301 is further configured to perform the following steps:
- the processor 301 is further configured to perform the following steps:
- the associated application process is determined according to the process identification information.
- the processor 301 is further configured to perform the following steps:
- the wake lock held by the associated application process is released according to the received confirmation message sent by the user.
- the processor 301 before releasing the wake-up lock held by the application process after the application process is closed, the processor 301 is further configured to perform the following steps:
- the processor 301 is further configured to perform the following steps:
- the working wakelock is a wakelock corresponding to the application process, it is determined that the application process holds a wakelock.
- the electronic device 300 further includes: a display screen 303, wireless fidelity (WiFi, Wireless) Fidelity module 304, RF circuit 305, input unit 306, audio circuit 307, sensor 308, and power source 309.
- the processor 301 is electrically connected to the display screen 303, the wireless fidelity (WiFi) module 304, the radio frequency circuit 305, the input unit 306, the audio circuit 307, the sensor 308, and the power source 309, respectively.
- the electronic device structure illustrated in FIG. 7 does not constitute a limitation on the electronic device, and may include more or less components than those illustrated, or a combination of certain components, or different component arrangements.
- the display screen 303 can be used to display information entered by the user or information provided to the user as well as various graphical user interfaces of the electronic device, which can be composed of graphics, text, icons, video, and any combination thereof.
- the input function can also be implemented as part of the input unit.
- the Wireless Fidelity (WiFi) module 304 can be used for short-range wireless transmission, and can help users to send and receive emails, browse websites, and access streaming media. It provides users with wireless broadband Internet access.
- the radio frequency circuit 305 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other electronic devices through wireless communication, and to transmit and receive signals with network devices or other electronic devices.
- the input unit 306 can be configured to receive input digits, character information, or user characteristic information (eg, fingerprints), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function controls.
- the input unit 306 can include a fingerprint identification module.
- the audio circuit 307 can provide an audio interface between the user and the electronic device through a speaker and a microphone.
- Sensor 308 is used to collect external environmental information.
- Sensor 308 can include one or more of ambient brightness sensors, acceleration sensors, gyroscopes, and the like.
- Power source 309 is used to power various components of electronic device 300.
- the power source 309 can be logically coupled to the processor 301 through a power management system to enable functions such as managing charging, discharging, and power management through the power management system.
- the electronic device 300 may further include a camera, a Bluetooth module, and the like, and details are not described herein.
- the electronic device releases the wake-up lock held by the application process when the electronic device closes the application process, determines an associated application process associated with the application process, and determines whether the associated application process is held.
- Wake-up lock if yes, release the wake-up lock held by the associated application process; this solution can release the wake-up lock of the application process while releasing the application process, and further release the application process associated with the application process.
- the wake-up lock reduces the consumption of power in the electronic device, saves the power of the electronic device, and thus improves the battery life of the electronic device.
- the embodiment of the invention further provides a storage medium on which a computer program is stored, the computer program being called by the processor to execute the release method of the wake lock according to any embodiment of the present invention.
- ROM read only memory
- RAM Random Access Memory
- the functional modules may be integrated into one processing chip, or each module may exist separately or physically. Two or more modules are integrated in one module.
- the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Telephone Function (AREA)
- Stored Programmes (AREA)
Abstract
一种唤醒锁的释放方法、释放装置、存储介质及电子设备,所述方法包括:在关闭应用进程时,释放应用进程持有的唤醒锁(S101),确定与该应用进程相关联的关联应用进程(S102),判断上述关联应用进程是否持有唤醒锁(S103),若是,则释放该关联应用进程持有的唤醒锁(S104)。
Description
本发明涉及终端技术领域,具体涉及一种唤醒锁的释放方法、装置、存储介质及电子设备。
随着电子通讯领域的发展,移动终端例如智能手机的功能越来越强大,用户不仅通过智能手机打电话、发短信,用户还可以根据需求在移动终端中安装各种功能的应用程序,以满足自己在不同方面的需求(例如游戏、阅读、音乐、视频播放、购物等等)。
如果用户手机安装了比较多的应用进程并在后台运行,就会出现比较多的关联应用进程在后台运行并持有唤醒锁,从而造成终端电量的浪费。故,需进一步改进。
本发明实施例提供一种唤醒锁的释放方法、装置、存储介质及电子设备,可以在关闭应用的同时释放此应用相关联的后台应用持有的唤醒锁,从而节省了终端的电量。
第一方面,本发明实施例提供一种唤醒锁的释放方法,包括:
关闭应用进程时,释放所述应用进程持有的唤醒锁;
确定与所述应用进程相关联的关联应用进程;
判断所述关联应用进程是否持有唤醒锁;
若是,则释放所述关联应用进程持有的唤醒锁。
第二方面,本发明实施例还提供一种唤醒锁的释放装置,包括:第一释放模块、确定模块、第一判断模块以及第二释放模块;
所述第一释放模块,用于关闭应用进程时,释放所述应用进程持有的唤醒锁;
所述确定模块,用于确定与所述应用进程相关联的关联应用进程;
所述第一判断模块,用于判断所述关联应用进程是否持有唤醒锁;
所述第二释放模块,用于当所述第一判断模块判断为是时,释放所述关联应用进程持有的唤醒锁。
第三方面,本发明实施例还提供一种存储介质,其上存储有计算机程序,所述计算机程序被处理器调用以执行本发明任一实施例所述的唤醒锁的释放方法。
第四方面,本发明实施例还提供一种电子设备,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器调用所述存储器中存储的所述计算机程序,执行本发明任一实施例所述的唤醒锁的释放方法。
本发明实施例提供一种唤醒锁的释放方法、装置、存储介质及电子设备,可以在关闭应用的同时释放此应用相关联的后台应用持有的唤醒锁,从而节省了终端的电量。
图1为本发明实施例提供的一种唤醒锁的释放方法的流程示意图。
图2为本发明实施例提供的一种唤醒锁的释放方法的另一流程示意图。
图3为本发明实施例提供的一种智能手机中释放cpu锁的流程示意图。
图4为本发明实施例提供的一种唤醒锁的释放装置的结构示意图。
图5为本发明实施例提供的一种唤醒锁的释放装置的另一结构示意图。
图6为本发明实施例提供的电子设备的结构示意图。
图7为本发明实施例提供的电子设备的另一结构示意图。
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例提供一种唤醒锁的释放方法、装置、存储介质及电子设备。以下将分别进行详细说明。
本发明实施例将从唤醒锁的释放装置的角度进行描述,该装置具体可以集成在电子设备中,该电子设备可以为移动互联网设备(如智能手机、平板电脑)、智能穿戴设备(如智能手表)等各类终端。
本发明实施例提供一种唤醒锁的释放方法,包括:
关闭应用进程时,释放所述应用进程持有的唤醒锁;
确定与所述应用进程相关联的关联应用进程;
判断所述关联应用进程是否持有唤醒锁;
若是,则释放所述关联应用进程持有的唤醒锁。
在一些实施例中,在所述确定与所述应用进程相关联的关联应用进程之后,判断所述关联应用进程是否持有唤醒锁之前,还包括:
判断所述关联应用进程是否正在终端前台运行;
若否,则执行判断所述关联应用进程是否持有唤醒锁的步骤。
在一些实施例中,在所述确定与所述应用进程相关联的关联应用进程之后,判断所述关联应用进程是否持有唤醒锁之前,还包括:
判断所述关联应用进程是否为预设应用进程;
若否,则执行判断所述关联应用进程是否持有唤醒锁的步骤。
在一些实施例中,所述判断所述关联应用进程是否为预设应用进程,包括:
根据获取到的所述关联应用进程的标识信息,判断预设应用进程集合中是否存在与所述标识信息相对应的预设应用进程。
在一些实施例中,所述确定与所述应用进程相关联的关联应用进程,包括:
获取所述关闭的应用进程中的用户标识信息;
在终端系统中查找具有相同所述用户标识信息的进程;
确定所述进程为所述关联应用进程。
在一些实施例中,所述判断所述关联应用进程是否持有唤醒锁,包括:
根据获取到的所述关联应用进程的标识信息,判断系统中是否存在与所述标识信息相对应且处于工作状态的唤醒锁。
在一些实施例中,所述确定与所述应用进程相关联的关联应用进程,包括:
获取所述应用进程的进程标识信息;
根据所述进程标识信息确定相关联的应用进程。
在一些实施例中,所述释放所述关联应用进程持有的唤醒锁,还包括:
根据接收到的用户发出的确认信息,释放所述关联应用进程持有的唤醒锁。
在一些实施例中,在所述关闭应用进程之后,释放所述应用进程持有的唤醒锁之前,还包括:
判断所述应用进程是否持有唤醒锁,若是,则释放所述应用进程所持有的唤醒锁。
在一些实施例中,所述判断所述应用进程是否持有唤醒锁,包括:
检测终端中是否存在处于工作状态的唤醒锁;
若是,则判断所述处于工作状态的唤醒锁是否为与所述应用进程相对应的唤醒锁;
当所述处于工作状态的唤醒锁为与所述应用进程相对应的唤醒锁时,确定所述应用进程持有唤醒锁。
请参阅图1,图1为本发明实施例提供的一种唤醒锁的释放方法的流程示意图。所述方法包括:
步骤S101,关闭应用进程时,释放应用进程持有的唤醒锁。
可以理解的是,在使用智能手机的过程当中,有的应用程序往往会关联启动其他的应用程序并在后台运行比如打开支付宝后,其会关联启动淘宝、天猫等应用程序,而应用进程在退出到后台以后释放其持有的唤醒锁,与该应用进程相关联的后台应用所持有的唤醒锁并没有立即被释放掉,还需要持有系统的唤醒锁一段时间,以保证其正常运行,但是如果长时间不能释放掉此唤醒锁,会导致手机不能正常深度睡眠,看上去手机已经不再工作,实际上手机在待机的时候,后台的CPU等设备一直处于工作状态,增加了不必要的待机电池电量的消耗。如果用户手机安装了比较多的此类应用进程在后台运行,就会出现比较多的关联应用进程在后台运行并持有唤醒锁,从而造成终端电量的浪费。
具体的,可以接收用户的关闭指令,该指令包含应用进程的标识信息,根据上述关闭指令,关闭应用进程并同时释放该应用进程持有的唤醒锁。
在本发明实施例中,在关闭上述应用进程之后,释放应用进程的唤醒锁之前,上述方法还可以包括:判断该应用进程是否持有唤醒锁,若是,则释放该应用进程所持有的唤醒锁。其中,判断该应用进程是否持有唤醒锁的方法可以有多种,比如检测终端当中是否存在处于工作状态的唤醒锁,若是,则进一步判断上述处于工作状态的唤醒锁中是否存在该应用进程持有的唤醒锁,若存在,则确定该应用进程持有唤醒锁。其中,可以通过系统的框架层来获取处于工作状态的唤醒锁的名称以及处于工作状态的唤醒锁对应的应用进程名称,需要说明的是,上述处于工作状态的唤醒锁可能有一个,也可能有多个,当检测到处于工作状态的唤醒锁有多个时,则分别获取多个唤醒锁对应的应用进程名称,确定是否存在与上述应用进程相对应的唤醒锁。即判断上述应用进程是否持有唤醒锁的步骤可以具体包括:
检测终端中是否存在处于工作状态的唤醒锁;
若是,则判断上述处于工作状态的唤醒锁是否为与上述应用进程相对应的唤醒锁;
若是,则确定上述应用进程持有唤醒锁。
步骤S102,确定与关闭的应用进程相关联的关联应用进程。
在实际应用当中,以基于android系统的智能设备为例,一切都是软件进程事件触发自行后台启动造成的。因为安卓系统的进程管理机制是事件触发式,比如开机时、打开某应用进程时、网络连接更改时、电量不足时、时间更改、插上电源时、断开电源时等等这些状态的改变都可看作一个事件,而安卓系统允许程序关联这些事件,比如关联开机事件后,就相当于我们一般说的开机启动了。但是安卓系统是可以允许一个程序关联多个事件的,以谷歌地图举例,它关联的触发事件有“开机后、安装程序、卸载程序、更新程序、插上电源”等等,这些事件中的任何一个状态发生改变,系统就会自动后台运行谷歌地图,再比如说打开支付宝APP时,该事件作为一个触发事件,便可以关联启动天猫APP、淘宝APP等应用进程。很多软件安装完以后所产生的自启动项,会根据不同触发条件自行启动自身的进程。另外,在用户终端上安装的众多应用进程当中,有些应用进程之间存在相互依赖关系,比如应用进程A与应用进程B同时运行时,若强制关闭应用进程A,则应用进程B将无法运行,则可以认为该应用进程A与应用进程B属于关联进程。
在本发明实施例当中,可以获取上述关闭的应用进程的标识信息,该标识信息可以为该应用进程中的特征信息,比如该应用进程的uid(User
Identifier,用户身份证明)信息,uid是描述业务关联点进程的一个标识,相同业务不同进程一般会使用相同的uid,从而查找系统后台运行的应用进程当中使用该uid的应用进程,该应用进程即为上述关联应用进程。即上述根据关闭的应用进程确定与其进程相关联的关联应用进程的步骤可以具体包括:
获取关闭的应用进程中的标识信息;
在终端系统中查找具有相同标识信息的进程;
确定该进程为关联应用进程。
在本发明的其他实施例当中,还可以在预设的关联应用进程列表中查找与关闭的应用进程相关联的应用进程,其中,该关联应用进程列表可以为预先从服务器中下载的预设列表,该关联应用进程列表中可以包括应用进程和与该应用进程相关联的应用进程的信息。
在一些实施例中,还可以先确定用户关闭的应用进程的标识信息(比如应用进程的名称),将该标识信息发送至服务器,以使服务器在预设的关联应用进程列表当中查找与该应用进程标识对应的应用进程标识,并将该对应的应用进程标识发送至用户终端,从而确定关联应用进程。
步骤S103,判断关联应用进程是否持有唤醒锁。若是,则执行步骤S104,若否,则执行步骤S105。
比如,可以获取该关联应用进程的标识信息,根据该标识信息在系统中查找与该标识信息相对应且处于工作状态的唤醒锁,若存在,则确定该关联应用进程持有唤醒锁。
步骤S104,释放关联应用进程持有的唤醒锁。
比如,若判断上述关联应用进程持有唤醒锁,则释放掉该唤醒锁,以使终端的cpu能够进入深度睡眠状态,从而减少了不必要的待机时电池电量的消耗,增加待机时间。
在一些实施例中,在释放该关联应用进程持有的唤醒锁之前,接收用户发出的确认信息,然后根据该确认信息释放上述唤醒锁,比如,在手机屏幕中生成一个提示窗口,该提示窗口中可以包含关联应用进程信息,提醒用户是否释放这些应用进程的唤醒锁,若用户点击“确认”按钮,则对上述关联应用进程持有的唤醒锁进行释放;若用户点击“取消”按钮,则上述唤醒锁不做进一步处理。
步骤S105,确定其关联应用进程未持有唤醒锁。
在本发明实施例中,考虑到用户使用终端的灵活性,本发明实施例可以增加一个控制开关,用于控制该唤醒锁的释放方式的开启与关闭。
在一些实施例中,本发明实施例提供的唤醒锁的释放方式可以减少终端的功耗,进而增长待机时间,因此该处理方法还可以预先在终端中设置一个剩余电量阈值,当终端电量低于该预设阈值时,自动打开该功能,比如,当手机电量低于20%时,手机进入省电模式自动打开该功能,其中剩余电量的预设阈值可以根据用户需求来自行设定。
由上可知,本发明实施例采用在关闭应用进程时,释放应用进程持有的唤醒锁,确定与该应用进程相关联的关联应用进程,判断上述关联应用进程是否持有唤醒锁,若是,则释放该关联应用进程持有的唤醒锁;本方案可以在关闭应用进程时,释放掉该应用进程的唤醒锁的同时进一步释放与该应用进程相关联的应用进程所持有的唤醒锁,从而减少了终端中电量的消耗,节省了终端的电量,进而可以提高终端的续航能力。
请参阅图2,图2为本发明实施例提供的一种唤醒锁的释放方法的另一流程示意图。所述方法包括:
步骤S201,关闭应用进程时,释放应用进程持有的唤醒锁。
步骤S202,获取关闭的应用进程中的用户标识信息。
具体的,可以获取该应用进程的uid,以基于android系统的终端为例,为了实现数据共享,android为每个应用几乎都分配了不同的uid,相同业务不同进程一般会使用相同的uid,具体的,可以获取该应用进程的属性信息,其中,上述属性信息中包括该应用进程的uid。
步骤S203,在系统中查找具有相同用户标识信息的进程;
步骤S204,确定该进程为关联应用进程;
上述步骤S202-S204即为确定关联应用进程的过程,在实际应用进程中,考虑到有些应用进程之间会相互绑定,此时,确定绑定的应用进程为关联应用进程,该步骤可以具体为:获取所述应用进程的进程标识信息;
根据所述进程标识信息确定相关联的应用进程。
步骤S205,判断关联应用进程是否正在终端前台运行,若是,则执行步骤S208,若否,则执行步骤S206。
在本步骤中,考虑到用户在关闭一个应用进程后,可能在前台打开与其关联的应用进程,此时并不需要释放该关联应用进程持有的唤醒锁,故而增加判断关联应用进程是否正在终端前台运行的步骤,增加了便利性。
步骤S206,判断关联应用进程是否为预设应用进程,若是,则执行步骤S208,若否,则执行步骤S207。
在本发明实施例中,可预先建立预设应用进程集合,该预设应用进程可以为一些常用的应用进程,或是可以允许后台持有唤醒锁不被释放掉的应用进程,因此判断关联应用进程是否为预设应用进程的步骤可以具体包括:
获取该关联应用进程的标识信息;
在预设应用进程集合查找是否存在与该标识信息相对应的样本;
若不存在,则确定该关联应用进程不为预设应用进程。
步骤S207,判断关联应用进程是否持有唤醒锁,若是,则执行步骤S209,若否,则执行步骤S209。
在本发明实施例中,判断上述关联应用进程是否持有唤醒锁的方法可以有多种,比如可以对终端进行检测是否有唤醒锁处于工作状态,若是,则判断该唤醒锁是否为与上述关联应用进程所对应的唤醒锁。
步骤S208,允许关联应用进程持有唤醒锁。
比如,当该关联应用进程正在终端的前台运行时,或者判断该关联应用进程为预设应用进程时,允许其持有唤醒锁。
步骤S209,释放关联应用进程持有的唤醒锁。
在一些实施例中,在释放该关联应用进程持有的唤醒锁时,可以生成提示信息,以通知用户那些唤醒锁被释放掉。
步骤S210,确定关联应用进程未持有唤醒锁。
本发明实施例中,上述终端可以但不限于智能手机、平板电脑、笔记本电脑等智能终端,其中,该终端的操作系统可以为Android操作系统、IOS操作系统、Black
Berry操作系统等,本发明不做限定。
由上可知,本发明实施例采用在关闭应用进程时,释放应用进程持有的唤醒锁,确定与该应用进程相关联的关联应用进程,判断上述关联应用进程是否持有唤醒锁,若是,则释放该关联应用进程持有的唤醒锁;本方案可以在关闭应用进程时,释放掉该应用进程的唤醒锁的同时进一步释放与该应用进程相关联的应用进程所持有的唤醒锁,从而减少了终端中电量的消耗,节省了终端的电量,进而可以提高终端的续航能力,另外方案不需要增加任何器件以及物料成本,实施起来较为简单。
请参阅图3,图3为本发明实施例提供的一种智能手机中释放cpu锁的流程示意图。本发明实施例将以智能手机为例,上述唤醒锁为cpu锁,描述本方案在实际应用当中的具体实施步骤,包括以下步骤:
步骤S301,智能手机关闭应用进程时,释放该应用进程持有的cpu锁。
比如,关闭应用A时,系统会查找到后台处于工作状态的cpu锁当中与A相对应的,并将该cpu锁释放掉。
步骤S302,智能手机获取该关闭的应用进程中的uid;
步骤S303,智能手机在系统中查找具有相同uid的进程;
步骤S304,智能手机确定该进程为关联应用进程。
比如,应用进程A与应用进程B的进程中使用相同的uid,则在应用A关闭后,获取应用A进程当中的uid,然后进一步查找系统的进程当中同样具有上述uid的其他进程也即应用进程B,确定应用进程B为关联应用进程。
步骤S305,智能手机判断关联应用进程是否正在手机前台运行,若是,则执行步骤S308,若否,则执行步骤S306。
比如,在确定关联应用进程为B后,判断当前的手机前台是否正在运行该应用进程B。
步骤S306,智能手机判断关联应用进程是否在白名单当中,若是,则执行步骤S308,若否,则执行步骤S307。
具体的,可以预先根据用户指令建立白名单,该白名单中包含的应用进程可以为一些常用的应用进程,或是可以允许后台持有锁不被释放掉的应用进程;具体的,可以将该关联应用进程与白名单当中的应用进程进行匹配,若该应用进程与白名单当中的应用进程匹配成功,即该应用进程在白名单当中,所以允许该应用进程持有cpu锁;若该应用进程与白名单当中的应用进程匹配失败,即该应用进程不在白名单当中,所以不允许该应用进程持有cpu锁。
步骤S307,智能手机判断关联应用进程是否持有cpu锁,若是,则执行步骤S309,若否,则执行步骤S310。
以上述关联应用进程B为例,具体的,检测智能手机中是否存在处于工作状态的cpu锁,若存在,则进一步判断该处于工作状态的cpu锁是否为与应用进程B相对应的cpu锁,若是则执行步骤S309,若否,则执行步骤S310。
步骤S308,智能手机允许该关联应用进程持有cpu锁。
以上述关联应用进程B为例,若智能手机当前正在前台运行该应用进程B,或是确定该应用进程B在白名单当中,则允许该应用进程B持有cpu锁。
步骤S309,智能手机释放关联应用进程持有的cpu锁。
在一些实施例中,在释放该应用进程持有的cpu锁时,可以生成提示信息,以提示用户该cpu锁被释放掉。
步骤S310,智能手机确定关联应用进程未持有cpu锁,不做进一步处理。
由上可知,本发明实施例采用在智能手机关闭应用进程时,释放应用进程持有的cpu锁,确定与该应用进程相关联的关联应用进程,判断上述关联应用进程是否持有cpu锁,若是,则释放该关联应用进程持有的cpu锁;本方案可以在手机关闭应用进程时,释放掉该应用进程的cpu锁的同时进一步释放与该应用进程相关联的应用进程所持有的cpu锁,从而减少了终端中电量的消耗,节省了终端的电量,进而可以提高终端的续航能力,提升用户体验。
为了更好地实施上述方法实施例,本发明实施例还提供了一种唤醒锁的释放装置,包括:第一释放模块、确定模块、第一判断模块以及第二释放模块;
所述第一释放模块,用于关闭应用进程时,释放所述应用进程持有的唤醒锁;
所述确定模块,用于确定与所述应用进程相关联的关联应用进程;
所述第一判断模块,用于判断所述关联应用进程是否持有唤醒锁;
所述第二释放模块,用于当所述第一判断模块判断为是时,释放所述关联应用进程持有的唤醒锁。
在一些实施例中,所述装置还包括:第二判断模块;
所述第二判断模块,用于在所述确定模块确定与所述应用进程相关联的关联应用进程之后,所述第一判断模块判断所述关联应用进程是否持有唤醒锁之前,判断所述关联应用进程是否正在终端前台运行;
所述第一判断模块,具体用于当所述第二判断模块判断为否时,判断所述关联应用进程是否持有唤醒锁。
在一些实施例中,所述装置还包括:第三判断模块;
所述第三判断模块,用于在所述确定模块确定与所述应用进程相关联的关联应用进程之后,所述第一判断模块判断所述关联应用进程是否持有唤醒锁之前,判断所述关联应用进程是否为预设应用进程;
所述第一判断模块,具体用于当所述第三判断模块判断为否时,判断所述关联应用进程是否持有唤醒锁。
在一些实施例中,所述第三判断模块,还用于根据获取到的所述关联应用进程的标识信息,判断预设应用进程集合中是否存在与所述标识信息相对应的预设应用进程。
在一些实施例中,所述确定模块具体包括:第一获取子模块、查找子模块以及第一确定子模块;
所述第一获取子模块,用于获取所述关闭的应用进程中的用户标识信息;
所述查找子模块,用于在终端系统中查找具有相同所述用户标识信息的进程;
所述第一确定子模块,用于确定所述进程为所述关联应用进程。
在一些实施例中,所述第一判断模块,还用于根据获取到的所述关联应用进程的标识信息,判断系统中是否存在与所述标识信息相对应且处于工作状态的唤醒锁。
在一些实施例中,所述确定模块具体包括:第二获取子模块和第二确定子模块;
所述第二获取子模块,用于获取所述应用进程的进程标识信息;
所述第二确定子模块,用于根据所述进程标识信息确定相关联的应用进程。
在一些实施例中,所述第二释放模块,还用于根据接收到的用户发出的确认信息,释放所述关联应用进程持有的唤醒锁。
如图4所示,图4为本发明实施例提供的一种唤醒锁的释放装置的结构示意图。该装置可以集成在电子设备中,该电子设备可以为移动互联网设备(如智能手机、平板电脑)、智能穿戴设备(如智能手表)等各类智能终端。
如图4所示,该唤醒锁的释放装置具体包括:第一释放模块401、确定模块402、第一判断模块403以及第二释放模块404;
该第一释放模块401,用于关闭应用进程时,释放应用进程持有的唤醒锁;
该确定模块402,用于确定与关闭的应用进程相关联的关联应用进程;
该第一判断模块403,用于判断关联应用进程是否持有唤醒锁;
该第二释放模块404,用于当第一判断模块403判断为是时,释放关联应用进程持有的唤醒锁。
请一并参阅图5,图5为本发明实施例提供的一种唤醒锁的释放装置的另一结构示意图。本发明实施例提供的唤醒锁的释放装置还可以包括:第二判断模块405和第三判断模块406;
该第二判断模块405,用于在确定模块402确定与关闭的应用进程相关联的关联应用进程之后,第一判断模块403判断关联应用进程是否持有唤醒锁之前,判断关联应用进程是否正在终端前台运行;
第一判断模块403,具体用于当第二判断模块405判断为否时,判断关联应用进程是否持有唤醒锁;
该第三判断模块406,用于在确定模块402确定与关闭的应用进程相关联的关联应用进程之后,第一判断模块403判断关联应用进程是否持有唤醒锁之前,判断关联应用进程是否为预设应用进程;
第一判断模块403,具体用于当第三判断模块406判断为否时,判断关联应用进程是否持有唤醒锁。
在本发明实施例当中,上述装置中的确定模块402可以具体包括:第一获取子模块、查找子模块以及第一确定子模块;
该第一获取子模块,用于获取关闭的应用进程中的用户标识信息;
该查找子模块,用于在终端系统中查找具有相同用户标识信息的进程;
该第一确定子模块,用于确定该进程为关联应用进程。
在一些实施例中,确定模块402还可以具体包括:第二获取子模块和第二确定子模块;
该第二获取子模块,用于获取应用进程的进程标识信息;
该第二确定子模块,用于根据进程标识信息确定相关联的应用进程。。
由上可知,本发明实施例采用在关闭应用进程时,第一释放模块401释放应用进程持有的唤醒锁,确定模块402确定与该应用进程相关联的关联应用进程,第一判断模块403判断上述关联应用进程是否持有唤醒锁,若是,则由第二释放模块404释放该关联应用进程持有的唤醒锁;本方案可以在关闭应用进程时,释放掉该应用进程的唤醒锁的同时进一步释放与该应用进程相关联的应用进程所持有的唤醒锁,从而减少了终端中电量的消耗,节省了终端的电量,进而可以提高终端的续航能力。
具体实施时,以上各个模块可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个模块的具体实施可参见前面的方法实施例,在此不再赘述。
本发明实施例还提供一种电子设备,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器调用所述存储器中存储的所述计算机程序,执行本发明任一实施例所述的唤醒锁的释放方法。
该电子设备可以是智能手机、平板电脑等设备。如图6所示,电子设备300包括有一个或者一个以上处理核心的处理器301、有一个或一个以上计算机可读存储介质的存储器302及存储在存储器上并可在处理器上运行的计算机程序。其中,处理器301与存储器302电性连接。
处理器301是电子设备300的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器302内的应用程序,以及调用存储在存储器302内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。
在本发明实施例中,电子设备300中的处理器301会按照如下的步骤,将一个或一个以上的应用程序的进程对应的指令加载到存储器302中,并由处理器301来运行存储在存储器302中的应用程序,从而实现各种功能:
关闭应用进程时,释放所述应用进程持有的唤醒锁;
确定与所述应用进程相关联的关联应用进程;
判断所述关联应用进程是否持有唤醒锁;
若是,则释放所述关联应用进程持有的唤醒锁。
在一些实施例中,在所述确定与所述应用进程相关联的关联应用进程之后,判断所述关联应用进程是否持有唤醒锁之前,处理器301还用于执行以下步骤:
判断所述关联应用进程是否正在电子设备前台运行;
若否,则执行判断所述关联应用进程是否持有唤醒锁的步骤。
在一些实施例中,在所述确定与所述应用进程相关联的关联应用进程之后,判断所述关联应用进程是否持有唤醒锁之前,处理器301还用于执行以下步骤:
判断所述关联应用进程是否为预设应用进程;
若否,则执行判断所述关联应用进程是否持有唤醒锁的步骤。
在一些实施例中,所述判断所述关联应用进程是否为预设应用进程,处理器301还用于执行以下步骤:
根据获取到的所述关联应用进程的标识信息,判断预设应用进程集合中是否存在与所述标识信息相对应的预设应用进程。
在一些实施例中,所述确定与所述应用进程相关联的关联应用进程,处理器301还用于执行以下步骤:
获取所述关闭的应用进程中的用户标识信息;
在电子设备系统中查找具有相同所述用户标识信息的进程;
确定所述进程为所述关联应用进程。
在一些实施例中,所述判断所述关联应用进程是否持有唤醒锁,处理器301还用于执行以下步骤:
根据获取到的所述关联应用进程的标识信息,判断系统中是否存在与所述标识信息相对应且处于工作状态的唤醒锁。
在一些实施例中,所述确定与所述应用进程相关联的关联应用进程,处理器301还用于执行以下步骤:
获取所述应用进程的进程标识信息;
根据所述进程标识信息确定相关联的应用进程。
在一些实施例中,所述释放所述关联应用进程持有的唤醒锁,处理器301还用于执行以下步骤:
根据接收到的用户发出的确认信息,释放所述关联应用进程持有的唤醒锁。
在一些实施例中,在所述关闭应用进程之后,释放所述应用进程持有的唤醒锁之前,处理器301还用于执行以下步骤:
判断所述应用进程是否持有唤醒锁,若是,则释放所述应用进程所持有的唤醒锁。
在一些实施例中,所述判断所述应用进程是否持有唤醒锁,处理器301还用于执行以下步骤:
检测电子设备中是否存在处于工作状态的唤醒锁;
若是,则判断所述处于工作状态的唤醒锁是否为与所述应用进程相对应的唤醒锁;
当所述处于工作状态的唤醒锁为与所述应用进程相对应的唤醒锁时,确定所述应用进程持有唤醒锁。
在一些实施例中,如图7所示,电子设备300还包括:显示屏303、无线保真(WiFi,Wireless
Fidelity)模块304、射频电路305、输入单元306、音频电路307、传感器308以及电源309。其中,处理器301分别与显示屏303、无线保真(WiFi)模块304、射频电路305、输入单元306、音频电路307、传感器308以及电源309电性连接。本领域技术人员可以理解,图7中示出的电子设备结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
显示屏303可用于显示由用户输入的信息或提供给用户的信息以及电子设备的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示屏303为触控显示屏时,也可以作为输入单元的一部分实现输入功能。
无线保真(WiFi)模块304可用于短距离无线传输,可以帮助用户收发电子邮件、浏览网站和访问流式媒体等,它为用户提供了无线的宽带互联网访问。
射频电路305可用于收发射频信号,以通过无线通信与网络设备或其他电子设备建立无线通讯,与网络设备或其他电子设备之间收发信号。
输入单元306可用于接收输入的数字、字符信息或用户特征信息(例如指纹),以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。其中,输入单元306可以包括指纹识别模组。
音频电路307可通过扬声器、传声器提供用户与电子设备之间的音频接口。
传感器308用于采集外部环境信息。传感器308可以包括环境亮度传感器、加速度传感器、陀螺仪等传感器中的一种或多种。
电源309用于给电子设备300的各个部件供电。在一些实施例中,电源309可以通过电源管理系统与处理器301逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
尽管图7中未示出,电子设备300还可以包括摄像头、蓝牙模块等,在此不再赘述。
本发明实施例本发明实施例提供的电子设备,在电子设备关闭应用进程时,释放应用进程持有的唤醒锁,确定与该应用进程相关联的关联应用进程,判断上述关联应用进程是否持有唤醒锁,若是,则释放该关联应用进程持有的唤醒锁;本方案可以在关闭应用进程时,释放掉该应用进程的唤醒锁的同时进一步释放与该应用进程相关联的应用进程所持有的唤醒锁,从而减少了电子设备中电量的消耗,节省了电子设备的电量,进而可以提高电子设备的续航能力。
本发明实施例还提供一种存储介质,其上存储有计算机程序,所述计算机程序被处理器调用以执行本发明任一实施例所述的唤醒锁的释放方法。
需要说明的是,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于计算机可读存储介质中,如存储在终端的存储器中,并被该终端内的至少一个处理器执行,在执行过程中可包括如信息发布方法的实施例的流程。其中,存储介质可以包括:只读存储器(ROM,Read
Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。
以上对本发明实施例提供的一种唤醒锁的释放方法、装置、存储介质及电子设备进行了详细介绍,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。
Claims (20)
- 一种唤醒锁的释放方法,其包括:关闭应用进程时,释放所述应用进程持有的唤醒锁;确定与所述应用进程相关联的关联应用进程;判断所述关联应用进程是否持有唤醒锁;若是,则释放所述关联应用进程持有的唤醒锁。
- 如权利要求1所述的唤醒锁的释放方法,其中在所述确定与所述应用进程相关联的关联应用进程之后,判断所述关联应用进程是否持有唤醒锁之前,还包括:判断所述关联应用进程是否正在终端前台运行;若否,则执行判断所述关联应用进程是否持有唤醒锁的步骤。
- 如权利要求1所述的唤醒锁的释放方法,其中在所述确定与所述应用进程相关联的关联应用进程之后,判断所述关联应用进程是否持有唤醒锁之前,还包括:判断所述关联应用进程是否为预设应用进程;若否,则执行判断所述关联应用进程是否持有唤醒锁的步骤。
- 如权利要求3所述的唤醒锁的释放方法,其中所述判断所述关联应用进程是否为预设应用进程,包括:根据获取到的所述关联应用进程的标识信息,判断预设应用进程集合中是否存在与所述标识信息相对应的预设应用进程。
- 如权利要求1所述的唤醒锁的释放方法,其中所述确定与所述应用进程相关联的关联应用进程,包括:获取所述关闭的应用进程中的用户标识信息;在终端系统中查找具有相同所述用户标识信息的进程;确定所述进程为所述关联应用进程。
- 如权利要求5所述的唤醒锁的释放方法,其中所述判断所述关联应用进程是否持有唤醒锁,包括:根据获取到的所述关联应用进程的标识信息,判断系统中是否存在与所述标识信息相对应且处于工作状态的唤醒锁。
- 如权利要求1所述的唤醒锁的释放方法,其中所述确定与所述应用进程相关联的关联应用进程,包括:获取所述应用进程的进程标识信息;根据所述进程标识信息确定相关联的应用进程。
- 如权利要求1所述的唤醒锁的释放方法,其中所述释放所述关联应用进程持有的唤醒锁,还包括:根据接收到的用户发出的确认信息,释放所述关联应用进程持有的唤醒锁。
- 如权利要求1所述的唤醒锁的释放方法,其中在所述关闭应用进程之后,释放所述应用进程持有的唤醒锁之前,还包括:判断所述应用进程是否持有唤醒锁,若是,则释放所述应用进程所持有的唤醒锁。
- 如权利要求9所述的唤醒锁的释放方法,其中所述判断所述应用进程是否持有唤醒锁,包括:检测终端中是否存在处于工作状态的唤醒锁;若是,则判断所述处于工作状态的唤醒锁是否为与所述应用进程相对应的唤醒锁;当所述处于工作状态的唤醒锁为与所述应用进程相对应的唤醒锁时,确定所述应用进程持有唤醒锁。
- 一种唤醒锁的释放装置,其包括第一释放模块、确定模块、第一判断模块以及第二释放模块;所述第一释放模块,用于关闭应用进程时,释放所述应用进程持有的唤醒锁;所述确定模块,用于确定与所述应用进程相关联的关联应用进程;所述第一判断模块,用于判断所述关联应用进程是否持有唤醒锁;所述第二释放模块,用于当所述第一判断模块判断为是时,释放所述关联应用进程持有的唤醒锁。
- 如权利要求11所述的唤醒锁的释放装置,其中所述装置还包括:第二判断模块;所述第二判断模块,用于在所述确定模块确定与所述应用进程相关联的关联应用进程之后,所述第一判断模块判断所述关联应用进程是否持有唤醒锁之前,判断所述关联应用进程是否正在终端前台运行;所述第一判断模块,具体用于当所述第二判断模块判断为否时,判断所述关联应用进程是否持有唤醒锁。
- 如权利要求11所述的唤醒锁的释放装置,其中所述装置还包括:第三判断模块;所述第三判断模块,用于在所述确定模块确定与所述应用进程相关联的关联应用进程之后,所述第一判断模块判断所述关联应用进程是否持有唤醒锁之前,判断所述关联应用进程是否为预设应用进程;所述第一判断模块,具体用于当所述第三判断模块判断为否时,判断所述关联应用进程是否持有唤醒锁。
- 如权利要求13所述的唤醒锁的释放装置,所述第三判断模块,还用于根据获取到的所述关联应用进程的标识信息,判断预设应用进程集合中是否存在与所述标识信息相对应的预设应用进程。
- 如权利要求11所述的唤醒锁的释放装置,其中所述确定模块具体包括:第一获取子模块、查找子模块以及第一确定子模块;所述第一获取子模块,用于获取所述关闭的应用进程中的用户标识信息;所述查找子模块,用于在终端系统中查找具有相同所述用户标识信息的进程;所述第一确定子模块,用于确定所述进程为所述关联应用进程。
- 如权利要求15所述的唤醒锁的释放装置,其中所述第一判断模块,还用于根据获取到的所述关联应用进程的标识信息,判断系统中是否存在与所述标识信息相对应且处于工作状态的唤醒锁。
- 如权利要求11所述的唤醒锁的释放装置,其中所述确定模块具体包括:第二获取子模块和第二确定子模块;所述第二获取子模块,用于获取所述应用进程的进程标识信息;所述第二确定子模块,用于根据所述进程标识信息确定相关联的应用进程。
- 如权利要求11所述的唤醒锁的释放装置,其中所述第二释放模块,还用于根据接收到的用户发出的确认信息,释放所述关联应用进程持有的唤醒锁。
- 一种存储介质,其上存储有计算机程序,其中所述计算机程序被处理器调用以执行如权利要求1-10任一项所述的唤醒锁的释放方法。
- 一种电子设备,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,其中所述处理器调用所述存储器中存储的所述计算机程序,执行如权利要求1-10任一项所述的唤醒锁的释放方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610379891.5 | 2016-05-31 | ||
| CN201610379891.5A CN106020426B (zh) | 2016-05-31 | 2016-05-31 | 一种唤醒锁的释放方法和装置 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017206877A1 true WO2017206877A1 (zh) | 2017-12-07 |
Family
ID=57092094
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2017/086474 Ceased WO2017206877A1 (zh) | 2016-05-31 | 2017-05-29 | 一种唤醒锁的释放方法、装置、存储介质及电子设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106020426B (zh) |
| WO (1) | WO2017206877A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110018885A (zh) * | 2017-12-29 | 2019-07-16 | 广东欧珀移动通信有限公司 | 应用程序冻结方法、装置、存储介质和终端 |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106020426B (zh) * | 2016-05-31 | 2018-12-11 | 广东欧珀移动通信有限公司 | 一种唤醒锁的释放方法和装置 |
| CN109375959B (zh) * | 2018-09-28 | 2022-03-25 | 北京小米移动软件有限公司 | 定向拉起应用的方法及装置 |
| CN112860439A (zh) * | 2021-03-01 | 2021-05-28 | 北京字节跳动网络技术有限公司 | 应用启动方法、装置、终端及存储介质 |
| CN119277488A (zh) * | 2023-07-07 | 2025-01-07 | 华为技术有限公司 | 一种待机方法和电子设备 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104503841A (zh) * | 2014-12-15 | 2015-04-08 | 北京奇虎科技有限公司 | 进程清理方法及装置 |
| US20150233985A1 (en) * | 2013-05-17 | 2015-08-20 | Tencent Technology (Shenzhen) Company Limited | Method, device and computer storage medium for detecting power consumption of an application |
| CN105468426A (zh) * | 2016-01-05 | 2016-04-06 | 珠海市魅族科技有限公司 | 一种应用冻结的方法及终端 |
| CN106020426A (zh) * | 2016-05-31 | 2016-10-12 | 广东欧珀移动通信有限公司 | 一种唤醒锁的释放方法和装置 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102306118A (zh) * | 2011-08-31 | 2012-01-04 | 中兴通讯股份有限公司 | Android终端应用程序功耗监控的方法和装置 |
| CN104808767A (zh) * | 2015-03-31 | 2015-07-29 | 深圳市金立通信设备有限公司 | 一种终端控制方法 |
-
2016
- 2016-05-31 CN CN201610379891.5A patent/CN106020426B/zh active Active
-
2017
- 2017-05-29 WO PCT/CN2017/086474 patent/WO2017206877A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150233985A1 (en) * | 2013-05-17 | 2015-08-20 | Tencent Technology (Shenzhen) Company Limited | Method, device and computer storage medium for detecting power consumption of an application |
| CN104503841A (zh) * | 2014-12-15 | 2015-04-08 | 北京奇虎科技有限公司 | 进程清理方法及装置 |
| CN105468426A (zh) * | 2016-01-05 | 2016-04-06 | 珠海市魅族科技有限公司 | 一种应用冻结的方法及终端 |
| CN106020426A (zh) * | 2016-05-31 | 2016-10-12 | 广东欧珀移动通信有限公司 | 一种唤醒锁的释放方法和装置 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110018885A (zh) * | 2017-12-29 | 2019-07-16 | 广东欧珀移动通信有限公司 | 应用程序冻结方法、装置、存储介质和终端 |
| CN110018885B (zh) * | 2017-12-29 | 2021-06-01 | Oppo广东移动通信有限公司 | 应用程序冻结方法、装置、存储介质和终端 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106020426A (zh) | 2016-10-12 |
| CN106020426B (zh) | 2018-12-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2017206878A1 (zh) | 一种基于唤醒锁的处理方法、装置、存储介质及电子设备 | |
| WO2017206862A1 (zh) | 一种基于亮屏锁的处理方法、装置、存储介质及电子设备 | |
| WO2021066293A1 (en) | Electronic device for synchronizing modification among screens and operation method thereof | |
| WO2020246822A1 (en) | Electronic device and method for switching electronic device between dual standby mode and single standby mode | |
| WO2018090823A1 (zh) | 一种系统分区关键数据的保护方法及系统、终端 | |
| WO2018076866A1 (zh) | 数据处理方法、装置、存储介质、电子设备及服务器 | |
| WO2018076818A1 (zh) | 数据的备份方法、装置、电子设备、存储介质及系统 | |
| WO2018076819A1 (zh) | 数据的上传方法、装置、存储介质、电子设备及系统 | |
| WO2018076864A1 (zh) | 一种数据同步方法、装置、存储介质及电子设备 | |
| WO2018076812A1 (zh) | 数据请求的响应方法、装置、存储介质、服务器及系统 | |
| WO2017206877A1 (zh) | 一种唤醒锁的释放方法、装置、存储介质及电子设备 | |
| WO2017206883A1 (zh) | 一种应用处理方法、装置、存储介质及电子设备 | |
| WO2018166199A1 (zh) | 定位精度等级调整方法、装置、存储介质及电子设备 | |
| WO2017206879A1 (zh) | 一种移动终端应用程序的处理方法、装置、存储介质及电子设备 | |
| WO2017206890A1 (zh) | 一种基于唤醒锁的处理方法、装置、存储介质及电子设备 | |
| WO2020027562A1 (en) | Electronic apparatus for controlling display of virtual input interface in environment of a plurality of output screens and operating method thereof | |
| WO2018076829A1 (zh) | 终端数据的处理方法、装置、系统、存储介质及服务器 | |
| WO2016188285A1 (zh) | 一种终端应用的进程管理方法及装置 | |
| WO2017071326A1 (zh) | 一种终端的控制方法、装置和系统 | |
| WO2018076840A1 (zh) | 数据分享方法、装置、存储介质及服务器 | |
| WO2017206886A1 (zh) | 一种唤醒锁释放方法、装置、存储介质及电子设备 | |
| WO2017206870A1 (zh) | 一种传感器关闭方法、装置、存储介质及电子设备 | |
| WO2017206867A1 (zh) | 一种传感器的关闭方法、装置、存储介质及电子设备 | |
| WO2018076811A1 (zh) | 数据分享方法、装置、存储介质及电子设备 | |
| WO2017206880A1 (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: 17805822 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: 17805822 Country of ref document: EP Kind code of ref document: A1 |