WO2017206873A1 - 一种应用程序的关闭方法、装置、存储介质及电子设备 - Google Patents

一种应用程序的关闭方法、装置、存储介质及电子设备 Download PDF

Info

Publication number
WO2017206873A1
WO2017206873A1 PCT/CN2017/086470 CN2017086470W WO2017206873A1 WO 2017206873 A1 WO2017206873 A1 WO 2017206873A1 CN 2017086470 W CN2017086470 W CN 2017086470W WO 2017206873 A1 WO2017206873 A1 WO 2017206873A1
Authority
WO
WIPO (PCT)
Prior art keywords
function
function level
application
level
duration
Prior art date
Application number
PCT/CN2017/086470
Other languages
English (en)
French (fr)
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 WO2017206873A1 publication Critical patent/WO2017206873A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3287Power saving characterised by the action undertaken by switching off individual functional units in the computer system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality

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 closing an application.
  • the embodiment of the invention provides a method, a device, a storage medium and an electronic device for closing an application, which can improve the speed of restarting the application while reducing the power consumption of the terminal.
  • an embodiment of the present invention provides a method for shutting down an application, including:
  • the corresponding function in the application is closed according to the first target function level.
  • the embodiment of the present invention further provides an apparatus for shutting down an application, comprising: a setting module, a first duration acquisition module, a first level acquisition module, and a first shutdown module;
  • the setting module is configured to set a function level for a function in an application
  • the first duration acquiring module is configured to acquire a first duration that the current application does not receive an operation instruction, where the operation instruction is an operation instruction triggered by a user operation of the application;
  • the first level acquiring module is configured to acquire a corresponding first target function level according to the first duration
  • the first closing module is configured to close a corresponding function in the application according to the first target function level.
  • an embodiment of the present invention further provides a storage medium, where the storage medium stores a plurality of instructions, the instructions being adapted to be loaded by a processor to perform the step of closing the application as described above. .
  • an embodiment of the present invention further provides an electronic device, including a processor and a memory, where the memory is used to store instructions and data, and the processor is configured to perform the following steps:
  • the corresponding function in the application is closed according to the first target function level.
  • the embodiment of the invention provides a method, a device, a storage medium and an electronic device for closing an application, which can improve the speed of restarting the application while reducing the power consumption of the terminal.
  • FIG. 1 is a schematic flowchart diagram of a method for shutting down an application according to an embodiment of the present invention.
  • FIG. 2 is another schematic flowchart of a method for shutting down an application in an actual application according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of an apparatus for shutting down an application according to an embodiment of the present invention.
  • FIG. 4 is another schematic structural diagram of an apparatus for shutting down an application according to an embodiment of the present invention.
  • FIG. 5 is still another schematic structural diagram of an apparatus for shutting down an application 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.
  • a smart terminal In order to realize various functions to meet various needs of users, a smart terminal usually installs various kinds of applications (which may be simply referred to as applications). However, the application installed on the smart terminal consumes a large amount of power and reduces the endurance of the smart terminal.
  • the smart terminal closes the application, that is, closes all functions (including main functions, sub-functions, etc.) in the application; for example, the smart terminal can automatically close The application, or the application is closed according to the user's operation; specifically, the smart terminal can monitor the user's operation on the smart terminal, and then close the corresponding application based on the operation.
  • the current application shutdown scheme can reduce the terminal power consumption, since the scheme is to close all the functions in the application, if the smart terminal needs to restart the application after the application is closed, then at this time, the smart terminal Recalling all of the application's functions will cause the application to restart slowly.
  • the present invention can be overcome by the following implementations.
  • An application shutdown method includes the following steps:
  • the corresponding function in the application is closed according to the first target function level.
  • the step of obtaining the corresponding first target function level according to the first duration comprises:
  • the first preset function level corresponding to the first preset duration is obtained, and the first preset function level is used as the first target function level.
  • the step of setting a function level for a function in an application specifically includes:
  • the function level is set for the function in the application based on the call relationship.
  • the first target function level is lower than a highest function level; the step of closing a corresponding function in the application according to the first target function level specifically includes:
  • the function corresponding to the first objective function level in the application is closed, and the function level is lower than the function of the first target function level.
  • the shutdown method further includes:
  • the second duration is a time interval between a completion time and a current time of the shutdown function according to the first target function level
  • a corresponding remaining unclosed function in the application is closed according to the second target function level.
  • the step of obtaining the corresponding second objective function level according to the second duration comprises:
  • the second preset function level is taken as a second objective function level.
  • the step of closing the corresponding remaining unclosed function in the application according to the second target function level specifically includes:
  • the function corresponding to the second objective function level in the remaining unclosed functions is closed, and the function level is lower than the function of the second objective function level.
  • the method before the step of setting a function level to a function in the application, the method further includes:
  • Embodiments of the present invention provide a method and apparatus for closing an application. The details will be described separately below.
  • the embodiment will be described from the perspective of a shutdown device of an application, and the shutdown device of the application may be specifically integrated in the terminal, and the terminal may be a mobile Internet device (such as a smart phone or a tablet) or a smart wearable device (such as a smart device). Watch) and other types of electronic equipment.
  • a mobile Internet device such as a smart phone or a tablet
  • a smart wearable device such as a smart device). Watch
  • FIG. 1 is a schematic flowchart of a method for shutting down an application according to an embodiment of the present invention.
  • step S101 a function level is set for a function in the application.
  • the computer When the computer compiles or runs, it uses a function to complete the relevant commands.
  • the function body In the application, the function body is executed by calling the function.
  • the implementation of each function in the application is performed by the function. Specifically, Combining a series of statements that perform a function is a function.
  • the function level may be set according to the calling relationship between the functions in the application, that is, the step of setting the function level to the function in the application may specifically include:
  • the main function means to establish an independent process, and the process becomes the entry point of the program, calling other functions and methods.
  • the running track of the whole program is like a stack, sometimes called the call stack.
  • the main function is both the entry point of the program and the exit of the program.
  • kind of Since the main function shoulders the burden of entry and exit, don't put too much detail in the main function, which is not conducive to maintenance and expansion.
  • the main function should be as simple as possible, and the specific implementation details should be encapsulated into the called subfunction.
  • the embodiment of the present invention sets a function level to a function in an application according to the calling relationship, and any third-party application stores a main function.
  • the main function can be set as a first-level function
  • the function that can be directly called by the main function is set as a secondary function
  • the direct call of the secondary function is set to a third-level function, and so on.
  • the function level can be expressed in a variety of ways, such as a function level that can be represented by a number, where a small number represents a higher function level or a larger number represents a higher function level, for example, a function is defined as a level 1 function, 2 Level function, level 3 function, etc., the level 1 function has the highest level
  • a function is defined as a level 1 function, 2 Level function, level 3 function, etc.
  • the level 1 function has the highest level
  • Step S102 Acquire a first duration that the current application does not receive the operation instruction.
  • the operation instruction is an operation instruction triggered by a user operation of the application, such as operating the application through a touch screen or a button of the terminal, or controlling the application by voice, and the like.
  • the first duration is a time interval between the last time the application receives the operation instruction and the current time, wherein the manner in which the current application does not receive the first duration of the operation instruction may be various.
  • a timer is set, and the terminal starts timing after receiving an operation instruction for the application, and the time counted by the timer is the first time when the current application does not receive the operation instruction.
  • the embodiment may further provide a mechanism for detecting a user operation instruction, configured to detect whether the terminal receives an operation instruction of the user for the application, and the timer may control the start timing and the stop timing according to the detection result.
  • Step S103 Acquire a corresponding first target function level according to the first duration.
  • the step of obtaining the corresponding first target function level according to the first duration may specifically include: determining whether the first duration is greater than the first preset duration;
  • the first preset function level corresponding to the first preset duration is obtained, and the first preset function level is used as the first target function level.
  • the function level set in step S101 corresponds to the preset duration, for example, setting the first preset duration to 5 min, and determining that the acquired current application does not receive the first duration of the operation instruction. Whether it is greater than 5 min, if it is greater than, the first preset function level corresponding to the first preset duration is obtained, and the first preset function level is the first target function level; if the timer is timed and the duration does not exceed 5 min When the terminal receives an operation instruction for the application, the timer stops counting and the time is cleared to restart the timing.
  • the first preset duration can be set according to user requirements, such as 5 min, 10 min, 20 min, and the like.
  • Step S104 the corresponding function in the application is closed according to the first target function level.
  • the function level of the function in the application has at least two levels, for example, the main function is At the function level, the function called by the main function is the second function level. Therefore, the first target function level cannot be the first function level, that is, the first target function level is lower than the highest function level.
  • the step of closing the corresponding function in the application according to the first target function level may specifically include:
  • the function is closed.
  • the function corresponding to the first target function level in the application that is, close all functions in the second function level; if three function levels are set for the function in the application, that is, the main function is the first function level, the main function call
  • the function is a second function level, and the function that can be called by the function in the second function level is the third function level, and the first target function level is, for example, the second function level, and the first target function level is not the lowest function level.
  • the function corresponding to the first target function level in the application and the function whose function level is lower than the first target function level are closed, that is, all functions in the second function level are closed, and all functions in the third function level are closed.
  • the shutdown method further includes:
  • the second duration is a time interval between the completion time and the current time of the function according to the first target function level.
  • a corresponding second objective function level is obtained according to the second duration, wherein the second objective function level is higher than the first target function level.
  • the corresponding remaining unclosed function in the application is closed according to the second objective function level.
  • the method for obtaining the second duration that the current application does not receive the operation instruction may be various, for example, setting the timer to start timing at the completion time of the function according to the first target function level, until the terminal receives the user for the application.
  • the time counted by the timer is the second time period described above.
  • the step of acquiring the corresponding second target function level according to the second duration includes:
  • the second preset function level corresponding to the second preset duration is obtained, and the second preset function level is higher than the first target function level.
  • the second preset function level is taken as the second target function level.
  • the second preset duration may be set to be the same as the first preset duration, or may be set to be different. In some embodiments, to reduce the consumption of the power of the terminal system, the second preset duration may be set to be smaller than the first preset. Set the duration, for example, set the first preset duration to 5 min, the second preset duration to 4 min, and determine whether the second duration is greater than 4 min. If yes, obtain a second preset function level corresponding to the second preset duration. If the terminal receives an operation instruction for the application during the timer period and the duration does not exceed 4 minutes, the timer stops counting and clears the time, waiting for the next time the first target function level close function is completed to restart the timing. .
  • the step of closing the corresponding remaining unclosed function in the application according to the second target function level includes:
  • the second objective function level is the main function, that is, The highest function level, then close all remaining unclosed functions in the application;
  • the function level is set to three function levels, that is, the main function is the first function level, the function called by the main function is the second function level, The function that can be called by the function in the second function level is the third function level, and the second objective function level is, for example, the second function level.
  • the second target function level is not the highest function level, then the second unclosed function is closed.
  • the function corresponding to the target function level, and the function whose function level is lower than the second objective function level that is, close all functions in the second function level, and all functions in the third function level.
  • the embodiment of the present invention further You can set up a preset application collection, for which the application in the application collection does not have to be closed with the shutdown method provided by this solution. That is, before setting the function level to the function in the application, it is first determined whether the application is a preset application, and if not, the step of setting the function level to the function in the application is performed.
  • the embodiment of the present invention sets a function level for a function in an application, and then acquires a first duration that the current application does not receive an operation instruction, where the operation instruction is an operation instruction triggered by a user operation of the application.
  • the solution may close the corresponding function in the application based on the duration of the user not operating the application, and may reduce The power consumption of the terminal, and because the solution does not directly close the application, but closes the corresponding function in the application, therefore, when the application needs to be restarted, it is necessary to re-call and execute the closed function, this implementation For example, while reducing the power consumption of the terminal, the application restart speed can be improved, and the user experience is better.
  • FIG. 2 is a schematic flowchart of a method for shutting down an application in an actual application according to another embodiment of the present invention.
  • the method for shutting down an application in this embodiment includes:
  • step S201 three function levels are set for the functions in the application.
  • the main function in the application is set to the first function level
  • the function called by the main function is set to the second function level
  • the function that can be called by the function in the second function level is set to the third function level.
  • Step S202 Acquire a first duration that the application does not receive the operation instruction, and acquire a third function level corresponding to the first duration.
  • the first preset duration may be set to be 5 min, and it is determined whether the first duration of the operation command is not greater than 5 min, and if the application does not receive the user's operation within 5 minutes, Get the third function level.
  • Step S203 the corresponding function in the application is closed according to the third function level.
  • the third function level is the lowest function level, so the function among the third function levels in the application is closed. It should be noted that if there is still a fourth function level, that is, the function that can be called by the function in the third function level is the fourth function level, that is, the third function level is not the lowest function level, then the third function level is closed. The function, as well as closing the function in the fourth function level.
  • Step S204 Acquire a second duration that the application does not receive the operation instruction, and acquire a second function level corresponding to the second duration.
  • the second duration is a time interval between the completion time and the current time of the function in the third function level.
  • the second preset duration may be set to 4 min, and the second duration is determined to be greater than 4 min. That is, the application does not receive the user's operation within 4 minutes after the function in the third function level is closed, and the second function level is acquired.
  • Step S205 the corresponding function in the application is closed according to the second function level.
  • Step S206 Acquire a third duration that the application does not receive the operation instruction, and acquire a first function level corresponding to the third duration.
  • the third duration is a time interval between the completion time and the current time of the function in the second function level.
  • the third preset duration for example, 3 minutes, may be set to determine whether the third duration is greater than 3 minutes, and if so, That is, the application still does not receive the user's operation within 3 minutes after the function in the second function level is closed, and then acquires the first function level, that is, the function level of the main function.
  • Step S207 the corresponding function in the application is closed according to the first function level.
  • the main function of the application is closed. Specifically, if the first function level is determined to be the highest function level, all remaining unclosed functions in the application are closed.
  • the embodiment of the present invention adopts three function levels for the application, obtains the first duration of the operation instruction that the application does not receive, and the corresponding third function level, and closes the function in the third function level, and then obtains The application does not receive the second duration of the operation instruction and the corresponding second function level, and closes the function in the second function level, and finally obtains the third duration that the application does not receive the operation instruction and the corresponding first function level.
  • the program can close the corresponding function in the application based on the length of time the user has not operated the application, which can reduce the power consumption of the terminal, and since the solution does not directly close the application, Is to close the corresponding function in the application, therefore, when you need to restart the application, you need to recall and execute the closed function, this embodiment can improve the speed of the application restart while reducing the power consumption of the terminal. , has a good user experience.
  • An application closing device includes a setting module, a first duration acquisition module, a first level acquisition module, and a first shutdown module;
  • the setting module is configured to set a function level for a function in an application
  • the first duration acquiring module is configured to acquire a first duration that the current application does not receive an operation instruction, where the operation instruction is an operation instruction triggered by a user operation of the application;
  • the first level acquiring module is configured to acquire a corresponding first target function level according to the first duration
  • the first closing module is configured to close a corresponding function in the application according to the first target function level.
  • the first level obtaining module specifically includes: a determining submodule and a level acquiring submodule;
  • the determining submodule is configured to determine whether the first duration is greater than a first preset duration
  • the level obtaining sub-module is configured to acquire a first preset function level corresponding to the first preset duration when the determining sub-module is determined to be YES, and use the first preset function level as the first The target function level.
  • the setting module specifically includes: a relationship acquisition submodule and a setting submodule;
  • the relationship obtaining submodule is configured to acquire a calling relationship between functions in an application
  • the setting submodule is configured to set a function level to a function in the application according to the calling relationship.
  • the first target function level is lower than a highest function level
  • the first shutdown module specifically includes: a determining submodule and a closing submodule
  • the determining submodule is configured to determine whether the first target function level is the lowest function level
  • the closing sub-module is configured to: when the determining sub-module determines to be YES, close a function corresponding to the first target function level in the application; when the determining sub-module determines to be no, close the A function corresponding to the first objective function level in the application, and a function whose function level is lower than the first target function level.
  • the apparatus further includes: a second duration acquisition module, a second level acquisition module, and a second shutdown module;
  • the second duration acquisition module is configured to acquire, after the first shutdown module closes the corresponding function in the application according to the first target function level, that the current application does not receive the operation instruction a second duration, wherein the second duration is a time interval between a completion time and a current time of the closure function according to the first objective function level;
  • the second level obtaining module is configured to obtain a corresponding second target function level according to the second duration, wherein the second target function level is higher than the first target function level;
  • the second shutdown module is configured to close a corresponding remaining unclosed function in the application according to the second target function level.
  • the embodiment of the present invention further provides an application closing device, where the closing device of the application can be integrated in a terminal, and the terminal can be a mobile internet device (such as a smart phone or a tablet).
  • a mobile internet device such as a smart phone or a tablet.
  • Various types of electronic devices such as smart wearable devices (such as smart watches).
  • the shutdown device of the application may include: a setting module 301, a first duration acquisition module 302, a first level acquisition module 303, and a first shutdown module 304;
  • the setting module 301 is configured to set a function level for a function in an application.
  • the first duration acquisition module 302 is configured to acquire a first duration that the current application does not receive the operation instruction, where the operation instruction is an operation instruction triggered by a user operation of the application.
  • the first level obtaining module 303 is configured to obtain a corresponding first target function level according to the first duration.
  • the first closing module 304 is configured to close the corresponding function in the application according to the first target function level.
  • the first level obtaining module 303 specifically includes: a determining submodule 3031 and a level obtaining submodule 3032.
  • the determining sub-module 3031 is configured to determine whether the first duration is greater than the first preset duration.
  • the level obtaining sub-module 3032 is configured to obtain a first preset function level corresponding to the first preset duration when the determining sub-module 3031 is determined to be YES, and use the first preset function level as the first target function level.
  • the foregoing setting module 301 specifically includes: a relationship obtaining submodule 3011 and a setting submodule 3012.
  • the relationship acquisition sub-module 3011 is configured to acquire a calling relationship between functions in an application.
  • the setting sub-module 3012 is configured to set a function level to a function in the application according to the calling relationship.
  • the first target function level is lower than the highest function level
  • the first closing module 304 specifically includes: a determining submodule 3041 and a closing submodule 3042.
  • the determining sub-module 3041 is configured to determine whether the first target function level is the lowest function level.
  • the closing sub-module 3042 is configured to: when the determining sub-module 3041 determines that it is YES, close the function corresponding to the first target function level in the application; when the determining sub-module 3041 determines to be no, the first target function level in the application is closed. Corresponding functions, and functions whose function level is lower than the first objective function level.
  • the apparatus provided by the embodiment of the present invention may further include: a second duration acquisition module 305, a second level acquisition module 306, and a second shutdown module 307.
  • the second duration acquisition module 305 is configured to: after the first shutdown module 304 closes the corresponding function in the application according to the first target function level, acquire a second duration that the current application does not receive the operation instruction, and the second duration The time interval between the completion time of the function and the current time according to the first objective function level;
  • the second level obtaining module 306 is configured to obtain a corresponding second target function level according to the second duration, wherein the second target function level is higher than the first target function level.
  • the second closing module 307 is configured to close the corresponding remaining unclosed function in the application according to the second target function level.
  • the setting module 301 is used to set a function level for a function in the application, and then the first duration acquiring module 302 obtains a first duration of the current application that does not receive the operation instruction, and the operation instruction is for the application.
  • the user of the program operates the triggered operation instruction, the first level obtaining module 303 acquires the corresponding first target function level according to the first duration, and the first closing module 304 closes the corresponding function in the application according to the first target function level;
  • the solution can close the corresponding function in the application based on the length of time the user does not operate the application, which can reduce the power consumption of the terminal, and since the solution does not directly close the application, but closes the corresponding function in the application, therefore, when needed When the application is restarted, it is necessary to re-call and execute the closed function.
  • This embodiment can improve the restart speed of the application while reducing the power consumption of the terminal, and has a better user experience.
  • 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 electronic device which may be a device such as a smartphone, a tablet, or the like.
  • the electronic device 500 includes a processor 501, a memory 502, a display screen 503, and a control circuit 504.
  • the processor 501 is electrically connected to the memory 502, the display screen 503, and the control circuit 504, respectively.
  • the processor 501 is a control center of the electronic device 500, 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 502, and calling data stored in the memory 502.
  • the various functions and processing data of the device enable overall monitoring of the electronic device.
  • the processor 501 in the electronic device 500 loads the instructions corresponding to the process of one or more applications into the memory 502 according to the following steps, and is stored and stored in the memory 502 by the processor 501.
  • the application thus implementing various functions:
  • the corresponding function in the application is closed according to the first target function level.
  • the processor when the acquiring the corresponding first target function level according to the first duration, the processor is further configured to perform the following steps:
  • the first preset function level corresponding to the first preset duration is obtained, and the first preset function level is used as the first target function level.
  • the processor when the function level is set for a function in an application, the processor is further configured to perform the following steps:
  • the function level is set for the function in the application based on the call relationship.
  • the first target function level is lower than a highest function level; when the corresponding function in the application is closed according to the first target function level, the processor is further configured to perform the following steps :
  • the function corresponding to the first objective function level in the application is closed, and the function level is lower than the function of the first target function level.
  • the processor is further configured to perform the following steps:
  • the second duration is a time interval between a completion time and a current time of the shutdown function according to the first target function level
  • a corresponding remaining unclosed function in the application is closed according to the second target function level.
  • the processor when the acquiring the second target function level according to the second duration, the processor is further configured to perform the following steps:
  • the second preset function level is taken as a second objective function level.
  • Memory 502 can be used to store applications and data.
  • the application stored in the memory 502 contains instructions executable in the processor.
  • Applications can form various functional modules.
  • the processor 501 executes various functional applications and data processing by running an application stored in the memory 502.
  • the display screen 503 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 images, text, icons, video, and any combination thereof.
  • the control circuit 504 is electrically connected to the display screen 503 for controlling the display screen 503 to display information.
  • the electronic device 500 further includes a radio frequency circuit 505, an input unit 506, an audio circuit 507, a sensor 508, and a power source 509.
  • the processor 501 is electrically connected to the radio frequency circuit 505, the input unit 506, the audio circuit 507, the sensor 508, and the power source 509, respectively.
  • the radio frequency circuit 505 is used for transmitting and receiving 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 506 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 506 can include a fingerprint identification module.
  • the audio circuit 507 can provide an audio interface between the user and the electronic device through a speaker and a microphone.
  • Electronic device 500 may also include at least one type of sensor 508, such as a light sensor, motion sensor, velocity sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor may close the display panel when the electronic device moves to the ear, and/or Backlighting.
  • the gravity acceleration sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity.
  • Power source 509 is used to power various components of electronic device 500.
  • the power supply 509 can be logically coupled to the processor 501 through a power management system to enable functions such as managing charging, discharging, and power management through the power management system.
  • the electronic device 500 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
  • the embodiment of the present invention further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor to execute the shutdown method of the application described in any of the above embodiments.
  • ROM read only memory
  • RAM Random Access Memory
  • Each function module may be integrated into one processing chip, or each module may exist physically separately, or may be two or more.
  • the 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.
  • the principles and embodiments of the present invention are described herein with reference to specific examples. The description of the above embodiments is only for the purpose of understanding the method of the present invention and the core idea thereof. Also, those skilled in the art according to the present invention The present invention is not limited by the scope of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Stored Programmes (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

一种应用程序的关闭方法、装置、存储介质及电子设备,通过对应用程序中的函数设置函数级别(S101),获取应用程序未接收到操作指令的第一时长(S102),根据第一时长获取相应的第一目标函数级别(S103),根据第一目标函数级别关闭应用程序中相应的函数(S104)。可以在降低终端电量消耗的同时,提升应用程序重新启动的速度。

Description

一种应用程序的关闭方法、装置、存储介质及电子设备 技术领域
本发明涉及终端技术领域,具体涉及一种应用程序的关闭方法、装置、存储介质及电子设备。
背景技术
随着智能终端的发展,智能终端能够兼容的功能越来越多,不仅丰富用户生活,还给用户带来便利。随着移动终端设备已日益融入人们生活、应用功能日趋完善,给用户带来了极大便利以及提高用户体验。
技术问题
本发明实施例提供一种应用程序的关闭方法、装置、存储介质及电子设备,可以在降低终端电量消耗的同时,提升应用程序重新启动的速度。
技术解决方案
第一方面,本发明实施例提供了一种应用程序的关闭方法,包括:
对应用程序中的函数设置函数级别;
获取当前所述应用程序未接收到操作指令的第一时长,所述操作指令为针对所述应用程序的用户操作所触发的操作指令;
根据所述第一时长获取相应的第一目标函数级别;
根据所述第一目标函数级别关闭所述应用程序中相应的函数。
第二方面,本发明实施例还提供了一种应用程序的关闭装置,包括:设置模块、第一时长获取模块、第一级别获取模块以及第一关闭模块;
所述设置模块,用于对应用程序中的函数设置函数级别;
所述第一时长获取模块,用于获取当前所述应用程序未接收到操作指令的第一时长,所述操作指令为针对所述应用程序的用户操作所触发的操作指令;
所述第一级别获取模块,用于根据所述第一时长获取相应的第一目标函数级别;
所述第一关闭模块,用于根据所述第一目标函数级别关闭所述应用程序中相应的函数。
第三方面,本发明实施例还提供了一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行如上面所述的应用程序的关闭方法的步骤。
第四方面,本发明实施例还提供了一种电子设备,包括处理器和存储器,所述存储器用于存储指令和数据,所述处理器用于执行以下步骤:
对应用程序中的函数设置函数级别;
获取当前所述应用程序未接收到操作指令的第一时长,所述操作指令为针对所述应用程序的用户操作所触发的操作指令;
根据所述第一时长获取相应的第一目标函数级别;
根据所述第一目标函数级别关闭所述应用程序中相应的函数。
有益效果
本发明实施例提供一种应用程序的关闭方法、装置、存储介质及电子设备,可以在降低终端电量消耗的同时,提升应用程序重新启动的速度。
附图说明
图1为本发明实施例提供的应用程序的关闭方法的流程示意图。
图2为本发明实施例提供的在实际应用当中应用程序的关闭方法的另一流程示意图。
图3为本发明实施例提供的应用程序的关闭装置的结构示意图。
图4为本发明实施例提供的应用程序的关闭装置的另一结构示意图。
图5为本发明实施例提供的应用程序的关闭装置的又一结构示意图。
图6为本发明实施例提供的电子设备的结构示意图。
图7为本发明实施例提供的电子设备的另一结构示意图。
本发明的最佳实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
目前,为了实现各种功能以满足用户的各种需求,通常智能终端会安装各种各样的应用程序(可以简称为应用)。但是,智能终端上安装的应用程序会消耗大量的电量,降低智能终端的续航能力。
目前,为了减低智能终端电量的消耗,进而提升智能终端的续航能力,智能终端会关闭应用程序,即关闭应用程序中所有的函数(包括主函数、子函数等等);比如智能终端可以自动关闭应用程序,或者根据用户的操作来关闭应用程序;具体地,智能终端可以监测用户对智能终端的操作,然后,基于该操作关闭相应的应用程序。
然而,目前应用程序的关闭方案虽然可以降低终端电量消耗,但是由于该方案是关闭应用程序中所有的函数,如果在关闭应用程序之后,智能终端需要重新启动该应用程序,那么此时,智能终端需要重新调用该应用程序的所有函数,会导致应用程序重新启动的速度比较慢。本发明可以采用如下的实现方式来克服。
一种应用程序的关闭方法,包括以下步骤:
对应用程序中的函数设置函数级别;
获取当前所述应用程序未接收到操作指令的第一时长,所述操作指令为针对所述应用程序的用户操作所触发的操作指令;
根据所述第一时长获取相应的第一目标函数级别;
根据所述第一目标函数级别关闭所述应用程序中相应的函数。
在一些实施例中,所述根据所述第一时长获取相应的第一目标函数级别的步骤具体包括:
确定所述第一时长是否大于第一预设时长;
若是,则获取所述第一预设时长对应的第一预设函数级别,并将所述第一预设函数级别作为第一目标函数级别。
在一些实施例中,所述对应用程序中的函数设置函数级别的步骤具体包括:
获取应用程序中函数之间的调用关系;
根据所述调用关系对应用程序中的函数设置函数级别。
在一些实施例中,所述第一目标函数级别低于最高函数级别;所述根据所述第一目标函数级别关闭所述应用程序中相应的函数的步骤具体包括:
判断所述第一目标函数级别是否为最低函数级别;
若是,则关闭所述应用程序中所述第一目标函数级别对应的函数;
若否,则关闭所述应用程序中所述第一目标函数级别对应的函数,以及函数级别低于所述第一目标函数级别的函数。
在一些实施例中,在根据所述第一目标函数级别关闭所述应用程序中相应的函数之后,所述关闭方法还包括:
获取当前所述应用程序未接收到所述操作指令的第二时长,所述第二时长为根据第一目标函数级别关闭函数的完成时刻与当前时刻之间的时间间隔;
根据所述第二时长获取相应的第二目标函数级别,其中,所述第二目标函数级别高于所述第一目标函数级别;
根据所述第二目标函数级别关闭所述应用程序中相应的剩余未关闭函数。
在一些实施例中,所述根据所述第二时长获取相应的第二目标函数级别的步骤具体包括:
确定所述第二时长是否大于第二预设时长;
若是,则获取所述第二预设时长对应的第二预设函数级别,所述第二预设函数级别高于所述第一目标函数级别;
将所述第二预设函数级别作为第二目标函数级别。
在一些实施例中,所述根据所述第二目标函数级别关闭所述应用程序中相应的剩余未关闭函数的步骤具体包括:
判断所述第二目标函数级别是否为最高函数级别;
若是,则关闭所述应用程序中所有的剩余未关闭函数;
若否,则关闭所述剩余未关闭函数中所述第二目标函数级别对应的函数,以及函数级别低于所述第二目标函数级别的函数。
在一些实施例中,在所述对应用程序中的函数设置函数级别的步骤之前,还包括:
判断所述应用程序是否为预设应用程序;
若否,则执行所述对应用程序中的函数设置函数级别的步骤。
本发明实施例提供一种应用程序的关闭方法和装置。以下将分别进行详细说明。
本实施例将从应用程序的关闭装置的角度进行描述,该应用程序的关闭装置具体可以集成在终端中,该终端可以为移动互联网设备(如智能手机、平板电脑)、智能穿戴设备(如智能手表)等各类电子设备。
请参阅图1,图1为本发明一实施例提供的应用程序的关闭方法的流程示意图,本实施例的应用程序的关闭方法包括:
步骤S101,对应用程序中的函数设置函数级别。
在计算机编译或运行时,使用某个函数来完成相关命令,在应用程序中通过对函数的调用来执行函数体,应用程序中每个功能的实现都是由函数来进行的,具体来说,把一系列执行某个功能的语句组合在一起就是函数。
在本发明实施例中,便可以根据应用程序中函数之间的调用关系来设置函数级别,即上述对应用程序中的函数设置函数级别的步骤可以具体包括:
获取应用程序中函数之间的调用关系。
根据该调用关系对应用程序中的函数设置函数级别。
在实际应用中,编写一个能运行在操作系统上的应用程序,都需要一个主函数,主函数意味着建立一个独立进程,且该进程成为了程序的入口,对其它各函数、方法进行调用,这样整个程序的运行轨迹就像一种栈,有时称之为调用栈,主函数既是程序的入口,又是程序的出口,通常还可以指定一个返回值再退出,以表明程序最后的结果是什么样的。由于主函数肩负着入口和出口的重任,所以不要把太多的细节方面的逻辑直接放在主函数内,这样不利于维护和扩展。主函数应该尽量简洁,具体的实现细节应该封装到被调用的子函数里。
本发明实施例将根据该调用关系对应用程序中的函数设置函数级别,任何一个第三方应用都存一个主函数,比如,在一个应用程序中,可以将该主函数设置为一级函数,将主函数可以直接调用的函数设置为二级函数,将二级函数直接调用的设置为为三级函数,以此类推。
其中,函数级别可以用多种方式来表示,比如可以用数字表示的函数级别,其中,数字小代表函数级别越高或数字越大代表函数级别越高,例如,函数定义为1级函数、2级函数、3级函数等,该1级函数的级别最高 ;此外,还可以利用字母表示的函数级别,字母的顺序越靠前,代表函数级别越高,比如,函数可以设置为A级函数、B级函数、C级函数等等,其中,该A级函数的级别最高。
步骤S102,获取当前应用程序未接收到操作指令的第一时长。
其中,上述操作指令为针对应用程序的用户操作所触发的操作指令,比如通过终端的触摸屏或按键操作应用程序,或通过语音来控制应用程序等等。
在本发明实施例中,上述第一时长为该应用程序最后一次接收操作指令到当前时间之间的时间间隔,其中,获取当前应用程序未接收到操作指令的第一时长的方式可以有多种,比如,设置一个计时器,在终端接收到针对该应用程序的操作指令后开始计时,计时器所统计的时间即为当前应用程序未接收到操作指令的第一时长。
可选的,本实施例还可以提供一个检测用户操作指令的机制,用于检测终端是否接收到用户针对应用程序的操作指令,计时器便可以根据该检测结果来控制开始计时与停止计时。
步骤S103,根据第一时长获取相应的第一目标函数级别。
具体的,上述根据第一时长获取相应的第一目标函数级别的步骤可以具体包括:确定第一时长是否大于第一预设时长;
若是,则获取第一预设时长对应的第一预设函数级别,并将该第一预设函数级别作为第一目标函数级别。
在本发明实施例中,步骤S101中设置的函数级别分别与预设时长相对应,比如设置第一预设时长为5min,判断获取到的当前所述应用程序未接收到操作指令的第一时长是否大于5min,若大于,则获取该第一预设时长对应的第一预设函数级别,该第一预设函数级别即为第一目标函数级别;若在计时器计时期间且时长未超过5min时,终端接收到针对该应用程序的操作指令,则计时器停止计时并将时间清零后重新开始计时。其中,该第一预设时长可以根据用户需求自行设定,比如5min、10min、20min等。
步骤S104,根据第一目标函数级别关闭应用程序中相应的函数。
在本发明实施例中,考虑到应用程序通常都有有主函数和主函数能够调用的函数,所以步骤S102中对应用程序中的函数设置函数级别至少要有两级,比如,主函数为第一函数级别,主函数调用的函数为第二函数级别。故而上述第一目标函数级别不能为第一函数级别,也即该第一目标函数级别低于最高函数级别。
具体的,上述根据第一目标函数级别关闭应用程序中相应的函数的步骤可以具体包括:
判断第一目标函数级别是否为最低函数级别。
若是,则关闭应用程序中所述第一目标函数级别对应的函数。
若否,则关闭应用程序中第一目标函数级别对应的函数,以及函数级别低于第一目标函数级别的函数。
比如,若是对应用程序中的函数设置两个函数级别,即主函数为第一函数级别,主函数调用的函数为第二函数级别,此时第一目标函数级别即为最低函数级别,则关闭应用程序中该第一目标函数级别对应的函数,也就是关闭第二函数级别当中的所有函数;若是对应用程序中的函数设置三个函数级别,即主函数为第一函数级别,主函数调用的函数为第二函数级别,第二函数级别当中函数能够调用的函数为第三函数级别,第一目标函数级别譬如为第二函数级别,此时该第一目标函数级别不为最低函数级别,则关闭应用程序中该第一目标函数级别对应的函数,以及函数级别低于第一目标函数级别的函数,也就是关闭第二函数级别当中的所有函数,以及第三函数级别当中所有的函数。
进一步的,在根据第一目标函数级别关闭应用程序中相应的函数之后,该关闭方法还包括:
获取当前应用程序未接收到操作指令的第二时长,第二时长为根据第一目标函数级别关闭函数的完成时刻与当前时刻之间的时间间隔。
根据第二时长获取相应的第二目标函数级别,其中,第二目标函数级别高于所述第一目标函数级别。
根据第二目标函数级别关闭应用程序中相应的剩余未关闭函数。
其中,获取上述当前应用程序未接收到操作指令的第二时长的方法可以有多种,比如设置计时器在根据第一目标函数级别关闭函数的完成时刻开始计时,直到终端接收到用户针对该应用程序的操作时停止计时,计时器所统计的时间即为上述第二时长。
具体的,上述根据所述第二时长获取相应的第二目标函数级别的步骤具体包括:
确定第二时长是否大于第二预设时长。
若是,则获取第二预设时长对应的第二预设函数级别,第二预设函数级别高于所述第一目标函数级别。
将该第二预设函数级别作为第二目标函数级别。
其中,该第二预设时长与第一预设时长可以设置相同也可以设置为不同,在一些实施例中,为减少终端系统电量的消耗,可以将第二预设时长设置为小于第一预设时长,比如设置第一预设时长为5min,第二预设时长则可以设置为4min,判断第二时长是否大于4min,若是,则获取第二预设时长对应的第二预设函数级别,若在计时器计时期间且时长未超过4min时,终端接收到针对该应用程序的操作指令,则计时器停止计时并将时间清零,等待下一次第一目标函数级别关闭函数完成时重新开始计时。
进一步的,上述根据第二目标函数级别关闭应用程序中相应的剩余未关闭函数的步骤具体包括:
判断第二目标函数级别是否为最高函数级别。
若是,则关闭应用程序中所有的剩余未关闭函数。
若否,则关闭剩余未关闭函数中第二目标函数级别对应的函数,以及函数级别低于第二目标函数级别的函数。
比如,若是对应用程序中的函数设置两个函数级别,即主函数为第一函数级别,主函数调用的函数为第二函数级别,此时该第二目标函数级别即为主函数,也就是最高函数级别,则关闭应用程序中所有的剩余未关闭函数;若是对应用程序中的函数设置三个函数级别,即主函数为第一函数级别,主函数调用的函数为第二函数级别,第二函数级别中函数能够调用的函数为第三函数级别,第二目标函数级别譬如为第二函数级别,此时该第二目标函数级别不为最高函数级别,则关闭剩余未关闭函数中第二目标函数级别对应的函数,以及函数级别低于第二目标函数级别的函数,也就是关闭第二函数级别当中的所有函数,以及第三函数级别当中所有的函数。
在一些实施例中,考虑到某些应用程序在运行时可能长时间不需要用户的操作指令,比如用于视频播放的应用程序,或是用于下载的应用程序等,因此本发明实施例还可以设置一个预设应用程序集合,针对该应用程序集合当中的应用程序不必用本方案提供的关闭方法来进行关闭。也即在对应用程序中的函数设置函数级别之前,先判断该应用程序是否为预设应用程序,若否,则执行对应用程序中的函数设置函数级别的步骤。
由上可知,本发明实施例采用对应用程序中的函数设置函数级别,然后,获取当前应用程序未接收到操作指令的第一时长,该操作指令为针对应用程序的用户操作所触发的操作指令,根据上述第一时长获取相应的第一目标函数级别,根据第一目标函数级别关闭应用程序中相应的函数;该方案可以基于用户未操作应用程序的时长关闭应用程序中相应的函数,可以降低终端的电量消耗,且由于该方案并没有直接关闭应用程序,而是关闭应用程序中相应的函数,因此,在需要重新启动该应用程序时,需要重新调用并且执行关闭的函数即可,本实施例可以在降低终端电量消耗的同时,提升应用程序重新启动的速度,有较好的用户体验。
本实施例将提供一种在实际应用当中的应用程序的关闭方法,在本实施例中,将以对应用程序中的函数设置为三个函数级别为例,进行详细说明。请参阅图2,图2为本发明另一实施例提供的在实际应用当中应用程序的关闭方法的流程示意图,本实施例的应用程序的关闭方法包括:
步骤S201,对应用程序中的函数设置三个函数级别。
具体的,将应用程序中的主函数设置为第一函数级别,主函数调用的函数设置为第二函数级别,第二函数级别当中函数能够调用的函数设置为第三函数级别。
步骤S202,获取应用程序未接收到操作指令的第一时长,并获取与第一时长对应的第三函数级别。
具体的,可以设置第一预设时长譬如为5min,判断该应用程序未接收到操作指令的第一时长是否大于5min,若是,也即在5min之内该应用程序未接收到用户的操作,则获取第三函数级别。
步骤S203,根据第三函数级别关闭应用程序当中对应的函数。
在本发明实施例中,第三函数级别即为最低函数级别,故而关闭应用程序当中第三函数级别当中的函数。需要说明的是,若还存在第四函数级别,也即第三函数级别当中的函数能够调用的函数为第四函数级别,即第三函数级别不为最低函数级别,则关闭第三函数级别当中的函数,以及关闭该第四函数级别当中的函数。
步骤S204,获取应用程序未接收到操作指令的第二时长,并获取与第二时长对应的第二函数级别。
其中,第二时长为关闭第三函数级别当中函数的完成时刻与当前时刻之间的时间间隔,具体的,可以设置第二预设时长譬如为4min,判断该第二时长是否大于4min,若是,也即在关闭第三函数级别当中的函数之后的4min之内该应用程序未接收到用户的操作,则获取第二函数级别。
步骤S205,根据第二函数级别关闭应用程序当中对应的函数。
具体的,在获取到上述第二函数级别之后,判断该函数级别不为最高函数级别,则关闭第二函数级别当中的所有函数,需要知道的是,若此时还有低于第二函数级别的函数级别,则同时关闭该函数级别当中的函数。
步骤S206,获取应用程序未接收到操作指令的第三时长,并获取与第三时长对应的第一函数级别。
其中,第三时长为关闭第二函数级别当中函数的完成时刻与当前时刻之间的时间间隔,具体的,可以设置第三预设时长譬如为3min,判断该第三时长是否大于3min,若是,也即在关闭第二函数级别当中的函数之后的3min之内该应用程序仍然未接收到用户的操作,则获取第一函数级别,也即主函数的函数级别。
步骤S207,根据第一函数级别关闭应用程序当中对应的函数。
也即关闭该应用程序的主函数,具体的,判断该第一函数级别为最高函数级别,则关闭所述应用程序中所有的剩余未关闭函数。
由上可知,本发明实施例采用对应用程序设置三个函数级别,获取应用程序未接收到操作指令的第一时长以及对应的第三函数级别,并关闭第三函数级别中的函数,然后获取应用程序未接收到操作指令的第二时长以及对应的第二函数级别,并关闭第二函数级别中的函数,最后获取应用程序未接收到操作指令的第三时长以及对应的第一函数级别,并关闭应用程序中所有的剩余未关闭函数;该方案可以基于用户未操作应用程序的时长关闭应用程序中相应的函数,可以降低终端的电量消耗,且由于该方案并没有直接关闭应用程序,而是关闭应用程序中相应的函数,因此,在需要重新启动该应用程序时,需要重新调用并且执行关闭的函数即可,本实施例可以在降低终端电量消耗的同时,提升应用程序重新启动的速度,有着较好的用户体验。
一种应用程序的关闭装置,包括设置模块、第一时长获取模块、第一级别获取模块以及第一关闭模块;
所述设置模块,用于对应用程序中的函数设置函数级别;
所述第一时长获取模块,用于获取当前所述应用程序未接收到操作指令的第一时长,所述操作指令为针对所述应用程序的用户操作所触发的操作指令;
所述第一级别获取模块,用于根据所述第一时长获取相应的第一目标函数级别;
所述第一关闭模块,用于根据所述第一目标函数级别关闭所述应用程序中相应的函数。
在一些实施例中,所述第一级别获取模块具体包括:确定子模块和级别获取子模块;
所述确定子模块,用于确定所述第一时长是否大于第一预设时长;
所述级别获取子模块,用于当所述确定子模块确定为是时,获取所述第一预设时长对应的第一预设函数级别,并将所述第一预设函数级别作为第一目标函数级别。
在一些实施例中,所述设置模块具体包括:关系获取子模块和设置子模块;
所述关系获取子模块,用于获取应用程序中函数之间的调用关系;
所述设置子模块,用于根据所述调用关系对应用程序中的函数设置函数级别。
在一些实施例中,所述第一目标函数级别低于最高函数级别,所述第一关闭模块具体包括:判断子模块和关闭子模块;
所述判断子模块,用于判断所述第一目标函数级别是否为最低函数级别;
所述关闭子模块,用于当所述判断子模块判断为是时,关闭所述应用程序中所述第一目标函数级别对应的函数;当所述判断子模块判断为否时,关闭所述应用程序中所述第一目标函数级别对应的函数,以及函数级别低于所述第一目标函数级别的函数。
在一些实施例中,所述装置还包括:第二时长获取模块、第二级别获取模块以及第二关闭模块;
所述第二时长获取模块,用于在所述第一关闭模块根据所述第一目标函数级别关闭所述应用程序中相应的函数之后,获取当前所述应用程序未接收到所述操作指令的第二时长,所述第二时长为根据第一目标函数级别关闭函数的完成时刻与当前时刻之间的时间间隔;
所述第二级别获取模块,用于根据所述第二时长获取相应的第二目标函数级别,其中,所述第二目标函数级别高于所述第一目标函数级别;
所述第二关闭模块,用于根据所述第二目标函数级别关闭所述应用程序中相应的剩余未关闭函数。
为了更好地实施以上方法,本发明实施例还提供一种应用程序的关闭装置,该应用程序的关闭装置可以集成在终端中,该终端可以为移动互联网设备(如智能手机、平板电脑)、智能穿戴设备(如智能手表)等各类电子设备。如图3所示,该应用程序的关闭装置可以包括:设置模块301、第一时长获取模块302、第一级别获取模块303以及第一关闭模块304;
该设置模块301,用于对应用程序中的函数设置函数级别。
该第一时长获取模块302,用于获取当前应用程序未接收到操作指令的第一时长,上述操作指令为针对应用程序的用户操作所触发的操作指令。
该第一级别获取模块303,用于根据第一时长获取相应的第一目标函数级别。
该第一关闭模块304,用于根据第一目标函数级别关闭应用程序中相应的函数。
在一些实施例中,如图4所示,在本发明实施例提供的装置当中,第一级别获取模块303具体包括:确定子模块3031和级别获取子模块3032。
该确定子模块3031,用于确定第一时长是否大于第一预设时长。
该级别获取子模块3032,用于当确定子模块3031确定为是时,获取第一预设时长对应的第一预设函数级别,并将该第一预设函数级别作为第一目标函数级别。
上述设置模块301具体包括:关系获取子模块3011和设置子模块3012。
该关系获取子模块3011,用于获取应用程序中函数之间的调用关系。
该设置子模块3012,用于根据调用关系对应用程序中的函数设置函数级别。
其中,第一目标函数级别低于最高函数级别,上述第一关闭模块304具体包括:判断子模块3041和关闭子模块3042。
该判断子模块3041,用于判断第一目标函数级别是否为最低函数级别。
该关闭子模块3042,用于当判断子模块3041判断为是时,关闭应用程序中第一目标函数级别对应的函数;当判断子模块3041判断为否时,关闭应用程序中第一目标函数级别对应的函数,以及函数级别低于所述第一目标函数级别的函数。
在一些实施例中,如图5所示,本发明实施例提供的装置还可以包括:第二时长获取模块305、第二级别获取模块306以及第二关闭模块307。
该第二时长获取模块305,用于在第一关闭模块304根据第一目标函数级别关闭应用程序中相应的函数之后,获取当前应用程序未接收到所述操作指令的第二时长,第二时长为根据第一目标函数级别关闭函数的完成时刻与当前时刻之间的时间间隔;
该第二级别获取模块306,用于根据第二时长获取相应的第二目标函数级别,其中,第二目标函数级别高于第一目标函数级别。
该第二关闭模块307,用于根据第二目标函数级别关闭应用程序中相应的剩余未关闭函数。
由上可知,本发明实施例采用设置模块301对应用程序中的函数设置函数级别,然后,第一时长获取模块302获取当前应用程序未接收到操作指令的第一时长,该操作指令为针对应用程序的用户操作所触发的操作指令,第一级别获取模块303根据上述第一时长获取相应的第一目标函数级别,第一关闭模块304根据第一目标函数级别关闭应用程序中相应的函数;该方案可以基于用户未操作应用程序的时长关闭应用程序中相应的函数,可以降低终端的电量消耗,且由于该方案并没有直接关闭应用程序,而是关闭应用程序中相应的函数,因此,在需要重新启动该应用程序时,需要重新调用并且执行关闭的函数即可,本实施例可以在降低终端电量消耗的同时,提升应用程序重新启动的速度,有较好的用户体验。
具体实施时,以上各个模块可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个模块的具体实施可参见前面的方法实施例,在此不再赘述。
在一些实施例中,还提供一种电子设备,该电子设备可以是智能手机、平板电脑等设备。图6所示,电子设备500包括处理器501、存储器502、显示屏503以及控制电路504。其中,处理器501分别与存储器502、显示屏503、控制电路504电性连接。
处理器501是电子设备500的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器502内的应用程序,以及调用存储在存储器502内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。
在本实施例中,电子设备500中的处理器501会按照如下的步骤,将一个或一个以上的应用程序的进程对应的指令加载到存储器502中,并由处理器501来运行存储在存储器502中的应用程序,从而实现各种功能:
对应用程序中的函数设置函数级别;
获取当前所述应用程序未接收到操作指令的第一时长,所述操作指令为针对所述应用程序的用户操作所触发的操作指令;
根据所述第一时长获取相应的第一目标函数级别;
根据所述第一目标函数级别关闭所述应用程序中相应的函数。
在一些实施例中,所述根据所述第一时长获取相应的第一目标函数级别时,所述处理器还用于执行以下步骤:
确定所述第一时长是否大于第一预设时长;
若是,则获取所述第一预设时长对应的第一预设函数级别,并将所述第一预设函数级别作为第一目标函数级别。
在一些实施例中,所述对应用程序中的函数设置函数级别时,所述处理器还用于执行以下步骤:
获取应用程序中函数之间的调用关系;
根据所述调用关系对应用程序中的函数设置函数级别。
在一些实施例中,所述第一目标函数级别低于最高函数级别;所述根据所述第一目标函数级别关闭所述应用程序中相应的函数时,所述处理器还用于执行以下步骤:
判断所述第一目标函数级别是否为最低函数级别;
若是,则关闭所述应用程序中所述第一目标函数级别对应的函数;
若否,则关闭所述应用程序中所述第一目标函数级别对应的函数,以及函数级别低于所述第一目标函数级别的函数。
在一些实施例中,在根据所述第一目标函数级别关闭所述应用程序中相应的函数之后,所述处理器还用于执行以下步骤:
获取当前所述应用程序未接收到所述操作指令的第二时长,所述第二时长为根据第一目标函数级别关闭函数的完成时刻与当前时刻之间的时间间隔;
根据所述第二时长获取相应的第二目标函数级别,其中,所述第二目标函数级别高于所述第一目标函数级别;
根据所述第二目标函数级别关闭所述应用程序中相应的剩余未关闭函数。
在一些实施例中,所述根据所述第二时长获取相应的第二目标函数级别时,所述处理器还用于执行以下步骤:
确定所述第二时长是否大于第二预设时长;
若是,则获取所述第二预设时长对应的第二预设函数级别,所述第二预设函数级别高于所述第一目标函数级别;
将所述第二预设函数级别作为第二目标函数级别。
存储器502可用于存储应用程序和数据。存储器502存储的应用程序中包含有可在处理器中执行的指令。应用程序可以组成各种功能模块。处理器501通过运行存储在存储器502的应用程序,从而执行各种功能应用以及数据处理。
显示屏503可用于显示由用户输入的信息或提供给用户的信息以及电子设备的各种图形用户接口,这些图形用户接口可以由图像、文本、图标、视频和其任意组合来构成。
控制电路504与显示屏503电性连接,用于控制显示屏503显示信息。
在一些实施例中,如图7所示,电子设备500还包括:射频电路505、输入单元506、音频电路507、传感器508以及电源509。其中,处理器501分别与射频电路505、输入单元506、音频电路507、传感器508以及电源509电性连接。
射频电路505用于收发射频信号,以通过无线通信与网络设备或其他电子设备建立无线通讯,与网络设备或其他电子设备之间收发信号。
输入单元506可用于接收输入的数字、字符信息或用户特征信息(例如指纹),以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。其中,输入单元506可以包括指纹识别模组。
音频电路507可通过扬声器、传声器提供用户与电子设备之间的音频接口。
电子设备500还可以包括至少一种传感器508,比如光传感器、运动传感器、力度传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板的亮度,接近传感器可在电子设备移动到耳边时,关闭显示面板和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别电子设备姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等; 至于电子设备还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
电源509用于给电子设备500的各个部件供电。在一些实施例中,电源509可以通过电源管理系统与处理器501逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
尽管图7中未示出,电子设备500还可以包括摄像头、蓝牙模块等,在此不再赘述。
本发明实施例还提供一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行上述任一实施例所述的应用程序的关闭方法。
需要说明的是,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于计算机可读存储介质中,如存储在终端的存储器中,并被该终端内的至少一个处理器执行,在执行过程中可包括如应用程序的关闭方法的实施例的流程。其中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。
以上对本发明实施例提供的一种应用程序的关闭方法和装置进行了详细介绍,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。

Claims (20)

  1. 一种应用程序的关闭方法,其中,包括以下步骤:
    对应用程序中的函数设置函数级别;
    获取当前所述应用程序未接收到操作指令的第一时长,所述操作指令为针对所述应用程序的用户操作所触发的操作指令;
    根据所述第一时长获取相应的第一目标函数级别;
    根据所述第一目标函数级别关闭所述应用程序中相应的函数。
  2. 如权利要求1所述的关闭方法,其中,所述根据所述第一时长获取相应的第一目标函数级别的步骤具体包括:
    确定所述第一时长是否大于第一预设时长;
    若是,则获取所述第一预设时长对应的第一预设函数级别,并将所述第一预设函数级别作为第一目标函数级别。
  3. 如权利要求1所述的关闭方法,其中,所述对应用程序中的函数设置函数级别的步骤具体包括:
    获取应用程序中函数之间的调用关系;
    根据所述调用关系对应用程序中的函数设置函数级别。
  4. 如权利要求1所述的关闭方法,其中,所述第一目标函数级别低于最高函数级别;所述根据所述第一目标函数级别关闭所述应用程序中相应的函数的步骤具体包括:
    判断所述第一目标函数级别是否为最低函数级别;
    若是,则关闭所述应用程序中所述第一目标函数级别对应的函数;
    若否,则关闭所述应用程序中所述第一目标函数级别对应的函数,以及函数级别低于所述第一目标函数级别的函数。
  5. 如权利要求4所述的关闭方法,其中,在根据所述第一目标函数级别关闭所述应用程序中相应的函数之后,所述关闭方法还包括:
    获取当前所述应用程序未接收到所述操作指令的第二时长,所述第二时长为根据第一目标函数级别关闭函数的完成时刻与当前时刻之间的时间间隔;
    根据所述第二时长获取相应的第二目标函数级别,其中,所述第二目标函数级别高于所述第一目标函数级别;
    根据所述第二目标函数级别关闭所述应用程序中相应的剩余未关闭函数。
  6. 如权利要求5所述的关闭方法,其中,所述根据所述第二时长获取相应的第二目标函数级别的步骤具体包括:
    确定所述第二时长是否大于第二预设时长;
    若是,则获取所述第二预设时长对应的第二预设函数级别,所述第二预设函数级别高于所述第一目标函数级别;
    将所述第二预设函数级别作为第二目标函数级别。
  7. 如权利要求5所述的关闭方法,其中,所述根据所述第二目标函数级别关闭所述应用程序中相应的剩余未关闭函数的步骤具体包括:
    判断所述第二目标函数级别是否为最高函数级别;
    若是,则关闭所述应用程序中所有的剩余未关闭函数;
    若否,则关闭所述剩余未关闭函数中所述第二目标函数级别对应的函数,以及函数级别低于所述第二目标函数级别的函数。
  8. 如权利要求1所述的关闭方法,其中,在所述对应用程序中的函数设置函数级别的步骤之前,还包括:
    判断所述应用程序是否为预设应用程序;
    若否,则执行所述对应用程序中的函数设置函数级别的步骤。
  9. 一种应用程序的关闭装置,其中,包括设置模块、第一时长获取模块、第一级别获取模块以及第一关闭模块;
    所述设置模块,用于对应用程序中的函数设置函数级别;
    所述第一时长获取模块,用于获取当前所述应用程序未接收到操作指令的第一时长,所述操作指令为针对所述应用程序的用户操作所触发的操作指令;
    所述第一级别获取模块,用于根据所述第一时长获取相应的第一目标函数级别;
    所述第一关闭模块,用于根据所述第一目标函数级别关闭所述应用程序中相应的函数。
  10. 如权利要求9所述的关闭装置,其中,所述第一级别获取模块具体包括:确定子模块和级别获取子模块;
    所述确定子模块,用于确定所述第一时长是否大于第一预设时长;
    所述级别获取子模块,用于当所述确定子模块确定为是时,获取所述第一预设时长对应的第一预设函数级别,并将所述第一预设函数级别作为第一目标函数级别。
  11. 如权利要求9所述的关闭装置,其中,所述设置模块具体包括:关系获取子模块和设置子模块;
    所述关系获取子模块,用于获取应用程序中函数之间的调用关系;
    所述设置子模块,用于根据所述调用关系对应用程序中的函数设置函数级别。
  12. 如权利要求9所述的关闭装置,其中,所述第一目标函数级别低于最高函数级别,所述第一关闭模块具体包括:判断子模块和关闭子模块;
    所述判断子模块,用于判断所述第一目标函数级别是否为最低函数级别;
    所述关闭子模块,用于当所述判断子模块判断为是时,关闭所述应用程序中所述第一目标函数级别对应的函数;当所述判断子模块判断为否时,关闭所述应用程序中所述第一目标函数级别对应的函数,以及函数级别低于所述第一目标函数级别的函数。
  13. 如权利要求12所述的关闭装置,其中,所述装置还包括:第二时长获取模块、第二级别获取模块以及第二关闭模块;
    所述第二时长获取模块,用于在所述第一关闭模块根据所述第一目标函数级别关闭所述应用程序中相应的函数之后,获取当前所述应用程序未接收到所述操作指令的第二时长,所述第二时长为根据第一目标函数级别关闭函数的完成时刻与当前时刻之间的时间间隔;
    所述第二级别获取模块,用于根据所述第二时长获取相应的第二目标函数级别,其中,所述第二目标函数级别高于所述第一目标函数级别;
    所述第二关闭模块,用于根据所述第二目标函数级别关闭所述应用程序中相应的剩余未关闭函数。
  14. 一种存储介质,其中,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行如权利要求1至8任一项所述的应用程序的关闭方法的步骤。
  15. 一种电子设备,其中,包括处理器和存储器,所述存储器用于存储指令和数据,所述处理器用于执行以下步骤:
    对应用程序中的函数设置函数级别;
    获取当前所述应用程序未接收到操作指令的第一时长,所述操作指令为针对所述应用程序的用户操作所触发的操作指令;
    根据所述第一时长获取相应的第一目标函数级别;
    根据所述第一目标函数级别关闭所述应用程序中相应的函数。
  16. 如权利要求15所述的电子设备,其中,所述根据所述第一时长获取相应的第一目标函数级别时,所述处理器还用于执行以下步骤:
    确定所述第一时长是否大于第一预设时长;
    若是,则获取所述第一预设时长对应的第一预设函数级别,并将所述第一预设函数级别作为第一目标函数级别。
  17. 如权利要求15所述的电子设备,其中,所述对应用程序中的函数设置函数级别时,所述处理器还用于执行以下步骤:
    获取应用程序中函数之间的调用关系;
    根据所述调用关系对应用程序中的函数设置函数级别。
  18. 如权利要求15所述的电子设备,其中,所述第一目标函数级别低于最高函数级别;所述根据所述第一目标函数级别关闭所述应用程序中相应的函数时,所述处理器还用于执行以下步骤:
    判断所述第一目标函数级别是否为最低函数级别;
    若是,则关闭所述应用程序中所述第一目标函数级别对应的函数;
    若否,则关闭所述应用程序中所述第一目标函数级别对应的函数,以及函数级别低于所述第一目标函数级别的函数。
  19. 如权利要求18所述的电子设备,其中,在根据所述第一目标函数级别关闭所述应用程序中相应的函数之后,所述处理器还用于执行以下步骤:
    获取当前所述应用程序未接收到所述操作指令的第二时长,所述第二时长为根据第一目标函数级别关闭函数的完成时刻与当前时刻之间的时间间隔;
    根据所述第二时长获取相应的第二目标函数级别,其中,所述第二目标函数级别高于所述第一目标函数级别;
    根据所述第二目标函数级别关闭所述应用程序中相应的剩余未关闭函数。
  20. 如权利要求19所述的电子设备,其中,所述根据所述第二时长获取相应的第二目标函数级别时,所述处理器还用于执行以下步骤:
    确定所述第二时长是否大于第二预设时长;
    若是,则获取所述第二预设时长对应的第二预设函数级别,所述第二预设函数级别高于所述第一目标函数级别;
    将所述第二预设函数级别作为第二目标函数级别。
PCT/CN2017/086470 2016-05-31 2017-05-29 一种应用程序的关闭方法、装置、存储介质及电子设备 WO2017206873A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610383791.XA CN106095055B (zh) 2016-05-31 2016-05-31 一种应用程序的关闭方法和装置
CN201610383791.X 2016-05-31

Publications (1)

Publication Number Publication Date
WO2017206873A1 true WO2017206873A1 (zh) 2017-12-07

Family

ID=57447944

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/086470 WO2017206873A1 (zh) 2016-05-31 2017-05-29 一种应用程序的关闭方法、装置、存储介质及电子设备

Country Status (2)

Country Link
CN (1) CN106095055B (zh)
WO (1) WO2017206873A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113852975A (zh) * 2021-08-19 2021-12-28 浙江三维利普维网络有限公司 基站的协议栈程序的性能确定方法及装置

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095055B (zh) * 2016-05-31 2018-07-27 广东欧珀移动通信有限公司 一种应用程序的关闭方法和装置
CN107273157A (zh) * 2017-06-05 2017-10-20 广东欧珀移动通信有限公司 应用控制方法及相关产品
CN107885588B (zh) * 2017-11-21 2021-02-19 Oppo广东移动通信有限公司 应用服务的控制方法、装置及存储介质和移动终端

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030097651A1 (en) * 2001-09-28 2003-05-22 Peter Markstein Efficient compilation of family of related functions
CN101673216A (zh) * 2008-09-09 2010-03-17 联想(北京)有限公司 应用程序关闭方法和装置
CN104156226A (zh) * 2013-05-15 2014-11-19 索尼公司 混合内存设备的挂起或关机方法
CN104298549A (zh) * 2014-09-30 2015-01-21 北京金山安全软件有限公司 移动终端中应用程序的清理方法、装置和移动终端
CN105446776A (zh) * 2015-11-20 2016-03-30 北京金山安全软件有限公司 一种应用程序关闭方法、装置及电子设备
CN105468409A (zh) * 2015-11-20 2016-04-06 北京金山安全软件有限公司 一种应用程序关闭方法、装置及电子设备
CN106095055A (zh) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 一种应用程序的关闭方法和装置

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030097651A1 (en) * 2001-09-28 2003-05-22 Peter Markstein Efficient compilation of family of related functions
CN101673216A (zh) * 2008-09-09 2010-03-17 联想(北京)有限公司 应用程序关闭方法和装置
CN104156226A (zh) * 2013-05-15 2014-11-19 索尼公司 混合内存设备的挂起或关机方法
CN104298549A (zh) * 2014-09-30 2015-01-21 北京金山安全软件有限公司 移动终端中应用程序的清理方法、装置和移动终端
CN105446776A (zh) * 2015-11-20 2016-03-30 北京金山安全软件有限公司 一种应用程序关闭方法、装置及电子设备
CN105468409A (zh) * 2015-11-20 2016-04-06 北京金山安全软件有限公司 一种应用程序关闭方法、装置及电子设备
CN106095055A (zh) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 一种应用程序的关闭方法和装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113852975A (zh) * 2021-08-19 2021-12-28 浙江三维利普维网络有限公司 基站的协议栈程序的性能确定方法及装置
CN113852975B (zh) * 2021-08-19 2024-02-02 浙江三维利普维网络有限公司 基站的协议栈程序的性能确定方法及装置

Also Published As

Publication number Publication date
CN106095055B (zh) 2018-07-27
CN106095055A (zh) 2016-11-09

Similar Documents

Publication Publication Date Title
WO2019039892A1 (en) METHOD AND ELECTRONIC MODE SWITCHING DEVICE AND CORRESPONDING INFORMATION CARRIER
WO2017206878A1 (zh) 一种基于唤醒锁的处理方法、装置、存储介质及电子设备
WO2017039142A1 (en) User terminal apparatus, system, and method for controlling the same
WO2014021681A1 (en) Method and apparatus for alarm service using context awareness in portable terminal
WO2015030474A1 (ko) 음성 인식을 위한 전자 장치 및 방법
WO2018076818A1 (zh) 数据的备份方法、装置、电子设备、存储介质及系统
WO2018076866A1 (zh) 数据处理方法、装置、存储介质、电子设备及服务器
WO2017206867A1 (zh) 一种传感器的关闭方法、装置、存储介质及电子设备
WO2017206873A1 (zh) 一种应用程序的关闭方法、装置、存储介质及电子设备
WO2017206870A1 (zh) 一种传感器关闭方法、装置、存储介质及电子设备
WO2017206885A1 (zh) 应用程序的关闭方法、装置、存储介质及电子设备
WO2017206865A1 (zh) 一种应用程序的关闭方法、装置、存储介质及电子设备
WO2018076819A1 (zh) 数据的上传方法、装置、存储介质、电子设备及系统
WO2016032022A1 (ko) 전자 장치에서 배터리 소모를 줄이기 위한 방법
WO2017206862A1 (zh) 一种基于亮屏锁的处理方法、装置、存储介质及电子设备
WO2018166199A1 (zh) 定位精度等级调整方法、装置、存储介质及电子设备
WO2017206890A1 (zh) 一种基于唤醒锁的处理方法、装置、存储介质及电子设备
WO2017206886A1 (zh) 一种唤醒锁释放方法、装置、存储介质及电子设备
WO2017206879A1 (zh) 一种移动终端应用程序的处理方法、装置、存储介质及电子设备
WO2017206892A1 (zh) 一种移动终端的传感器处理方法、装置、存储介质及电子设备
WO2018129960A1 (zh) 闪屏处理方法、装置、存储介质及电子设备
WO2018076830A1 (zh) 数据同步周期的调整方法、装置、电子设备、存储介质及系统
WO2017206874A1 (zh) 一种应用程序的关闭方法、装置、存储介质及电子设备
WO2017206866A1 (zh) 一种应用程序的关闭方法、装置、存储介质及电子设备
WO2019039707A1 (en) METHOD FOR CONFIGURING ACTION OF AN EXTERNAL DEVICE AND ELECTRONIC DEVICE SUPPORTING THE SAME

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

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

Country of ref document: EP

Kind code of ref document: A1